Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
93f872e5
Commit
93f872e5
authored
Jul 17, 2019
by
Kateryna Kostiuk
Committed by
Adrien Béraud
Jul 17, 2019
Browse files
audio: get device index by name
Change-Id: I3eb0f0a6ecfec16b9032defd1836f7de37159206
parent
019d948c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/media/audio/coreaudio/osx/corelayer.cpp
View file @
93f872e5
...
...
@@ -47,28 +47,34 @@ CoreLayer::~CoreLayer()
std
::
vector
<
std
::
string
>
CoreLayer
::
getCaptureDeviceList
()
const
{
auto
list
=
getDeviceList
(
true
);
std
::
vector
<
std
::
string
>
ret
;
for
(
const
auto
&
x
:
getDeviceList
(
true
))
ret
.
push_back
(
x
.
name_
);
ret
.
reserve
(
list
.
size
());
for
(
auto
&
x
:
list
)
ret
.
emplace_back
(
std
::
move
(
x
.
name_
));
return
ret
;
}
std
::
vector
<
std
::
string
>
CoreLayer
::
getPlaybackDeviceList
()
const
{
auto
list
=
getDeviceList
(
false
);
std
::
vector
<
std
::
string
>
ret
;
for
(
const
auto
&
x
:
getDeviceList
(
false
))
ret
.
push_back
(
x
.
name_
);
ret
.
reserve
(
list
.
size
());
for
(
auto
&
x
:
list
)
ret
.
emplace_back
(
std
::
move
(
x
.
name_
));
return
ret
;
}
int
CoreLayer
::
getAudioDeviceIndex
(
const
std
::
string
&
name
,
DeviceType
type
)
const
{
int
i
=
0
;
for
(
const
auto
&
device
:
getDeviceList
(
type
==
DeviceType
::
CAPTURE
))
{
if
(
device
.
name_
==
name
)
return
i
;
i
++
;
}
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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