Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Leander Schulten
Lichtsteuerung
Commits
ac46081d
Commit
ac46081d
authored
Oct 05, 2019
by
Leander Schulten
Browse files
AudioManager: The SettingsView will now display the capture lib at startup.
ModelVector: Add support for inserting values.
parent
2ae9449c
Pipeline
#190750
passed with stage
in 4 minutes and 58 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/audio/audiocapturemanager.cpp
View file @
ac46081d
...
...
@@ -155,14 +155,14 @@ bool AudioCaptureManager::startCapturingFromInput(unsigned input) {
return
true
;
}
bool
AudioCaptureManager
::
loadCaptureLibrary
(
QString
name
,
QString
filePathToCaptureLibrary
)
{
bool
AudioCaptureManager
::
loadCaptureLibrary
(
const
QString
&
name
,
const
QString
&
filePathToCaptureLibrary
)
{
auto
func
=
reinterpret_cast
<
CaptureLibEntry
>
(
QLibrary
::
resolve
(
filePathToCaptureLibrary
,
"captureAudio"
));
if
(
func
)
{
// replace if name is already there
auto
res
=
captureLibraries
.
emplace
(
name
,
func
);
if
(
res
.
second
)
{
auto
pos
=
std
::
distance
(
captureLibraries
.
begin
(),
res
.
first
);
captureDeviceNames
.
getVector
().
insert
(
captureDeviceNames
.
cbegin
()
+
pos
,
name
);
captureDeviceNames
.
insert
(
static_cast
<
int
>
(
pos
)
,
name
);
if
(
currentCaptureDevice
>=
pos
)
{
currentCaptureDevice
++
;
emit
currentCaptureDeviceChanged
();
...
...
src/audio/audiocapturemanager.h
View file @
ac46081d
...
...
@@ -103,7 +103,7 @@ public:
* @param filePathToCaptureLibrary The path to the capture lib
* @return true, if the loading was successfull, false otherwise
*/
bool
loadCaptureLibrary
(
QString
name
,
QString
filePathToCaptureLibrary
);
bool
loadCaptureLibrary
(
const
QString
&
name
,
const
QString
&
filePathToCaptureLibrary
);
/**
* @brief startCapturingFromDevice starts the capturing with a capture device with the given name. For the names, see getCaptureDeviceNames()
...
...
src/modelvector.h
View file @
ac46081d
...
...
@@ -164,6 +164,14 @@ public:
* @brief endPushBack Call this function if you have started push_backing with beginPushBack and are finisched
*/
void
endPushBack
(){
endInsertRows
();}
void
beginInsert
(
int
firstIndex
,
int
length
)
{
beginInsertRows
(
QModelIndex
(),
firstIndex
,
firstIndex
+
length
-
1
);
}
void
endInsert
()
{
endInsertRows
();
}
auto
insert
(
int
index
,
const
Type
&
value
)
{
beginInsert
(
index
,
1
);
auto
res
=
model
.
insert
(
cbegin
()
+
index
,
value
);
endInsert
();
return
res
;
}
typename
std
::
vector
<
Type
>::
const_iterator
cbegin
()
const
{
return
model
.
cbegin
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment