Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
cf245b61
Commit
cf245b61
authored
Mar 18, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the old device enumeration API.
parent
3a1dce69
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1030 deletions
+67
-1030
examples/simple_enumeration.c
examples/simple_enumeration.c
+11
-24
mini_al.h
mini_al.h
+56
-1006
No files found.
examples/simple_enumeration.c
View file @
cf245b61
...
...
@@ -10,43 +10,30 @@ int main(int argc, char** argv)
mal_context
context
;
if
(
mal_context_init
(
NULL
,
0
,
NULL
,
&
context
)
!=
MAL_SUCCESS
)
{
printf
(
"Failed to initialize context."
);
printf
(
"Failed to initialize context.
\n
"
);
return
-
2
;
}
mal_device_info
infos
[
32
];
mal_uint32
infoCount
;
// Playback devices.
infoCount
=
sizeof
(
infos
)
/
sizeof
(
infos
[
0
]);
mal_result
result
=
mal_enumerate_devices
(
&
context
,
mal_device_type_playback
,
&
infoCount
,
infos
);
mal_device_info
*
pPlaybackDeviceInfos
;
mal_uint32
playbackDeviceCount
;
mal_device_info
*
pCaptureDeviceInfos
;
mal_uint32
captureDeviceCount
;
mal_result
result
=
mal_context_get_devices
(
&
context
,
&
pPlaybackDeviceInfos
,
&
playbackDeviceCount
,
&
pCaptureDeviceInfos
,
&
captureDeviceCount
);
if
(
result
!=
MAL_SUCCESS
)
{
printf
(
"Failed to enumerate playback devices."
);
mal_context_uninit
(
&
context
);
printf
(
"Failed to retrieve device information.
\n
"
);
return
-
3
;
}
printf
(
"Playback Devices
\n
"
);
for
(
mal_uint32
iDevice
=
0
;
iDevice
<
info
Count
;
++
iDevice
)
{
printf
(
" %u: %s
\n
"
,
iDevice
,
i
nfos
[
iDevice
].
name
);
for
(
mal_uint32
iDevice
=
0
;
iDevice
<
playbackDevice
Count
;
++
iDevice
)
{
printf
(
" %u: %s
\n
"
,
iDevice
,
pPlaybackDeviceI
nfos
[
iDevice
].
name
);
}
printf
(
"
\n
"
);
// Capture devices.
infoCount
=
sizeof
(
infos
)
/
sizeof
(
infos
[
0
]);
result
=
mal_enumerate_devices
(
&
context
,
mal_device_type_capture
,
&
infoCount
,
infos
);
if
(
result
!=
MAL_SUCCESS
)
{
printf
(
"Failed to enumerate capture devices."
);
mal_context_uninit
(
&
context
);
return
-
4
;
}
printf
(
"Capture Devices
\n
"
);
for
(
mal_uint32
iDevice
=
0
;
iDevice
<
info
Count
;
++
iDevice
)
{
printf
(
" %u: %s
\n
"
,
iDevice
,
i
nfos
[
iDevice
].
name
);
for
(
mal_uint32
iDevice
=
0
;
iDevice
<
captureDevice
Count
;
++
iDevice
)
{
printf
(
" %u: %s
\n
"
,
iDevice
,
pCaptureDeviceI
nfos
[
iDevice
].
name
);
}
...
...
mini_al.h
View file @
cf245b61
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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