Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f2bd2c31
Commit
f2bd2c31
authored
Dec 02, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MixerType: convert to strictly-typed enum
parent
21c42819
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
MixerType.cxx
src/mixer/MixerType.cxx
+4
-4
MixerType.hxx
src/mixer/MixerType.hxx
+8
-8
Init.cxx
src/output/Init.cxx
+5
-5
No files found.
src/mixer/MixerType.cxx
View file @
f2bd2c31
...
...
@@ -29,11 +29,11 @@ mixer_type_parse(const char *input)
assert
(
input
!=
NULL
);
if
(
strcmp
(
input
,
"none"
)
==
0
||
strcmp
(
input
,
"disabled"
)
==
0
)
return
M
IXER_TYPE_
NONE
;
return
M
ixerType
::
NONE
;
else
if
(
strcmp
(
input
,
"hardware"
)
==
0
)
return
M
IXER_TYPE_
HARDWARE
;
return
M
ixerType
::
HARDWARE
;
else
if
(
strcmp
(
input
,
"software"
)
==
0
)
return
M
IXER_TYPE_
SOFTWARE
;
return
M
ixerType
::
SOFTWARE
;
else
return
M
IXER_TYPE_
UNKNOWN
;
return
M
ixerType
::
UNKNOWN
;
}
src/mixer/MixerType.hxx
View file @
f2bd2c31
...
...
@@ -20,26 +20,26 @@
#ifndef MPD_MIXER_TYPE_HXX
#define MPD_MIXER_TYPE_HXX
enum
MixerType
{
enum
class
MixerType
{
/** parser error */
MIXER_TYPE_
UNKNOWN
,
UNKNOWN
,
/** mixer disabled */
MIXER_TYPE_
NONE
,
NONE
,
/** software mixer with pcm_volume() */
MIXER_TYPE_
SOFTWARE
,
SOFTWARE
,
/** hardware mixer (output's plugin) */
MIXER_TYPE_
HARDWARE
,
HARDWARE
,
};
/**
* Parses a #MixerType setting from the configuration file.
*
* @param input the configured string value; must not be NULL
*
@return a #MixerType value; MIXER_TYPE_UNKNOWN means #input could
*
not be
parsed
* @param input the configured string value; must not be NULL
@return
*
a #MixerType value; #MixerType::UNKNOWN means #input could not be
* parsed
*/
MixerType
mixer_type_parse
(
const
char
*
input
);
...
...
src/output/Init.cxx
View file @
f2bd2c31
...
...
@@ -103,7 +103,7 @@ audio_output_mixer_type(const config_param ¶m)
/* try the local "mixer_enabled" setting next (deprecated) */
if
(
!
param
.
GetBlockValue
(
"mixer_enabled"
,
true
))
return
M
IXER_TYPE_
NONE
;
return
M
ixerType
::
NONE
;
/* fall back to the global "mixer_type" setting (also
deprecated) */
...
...
@@ -122,18 +122,18 @@ audio_output_load_mixer(EventLoop &event_loop, AudioOutput &ao,
Mixer
*
mixer
;
switch
(
audio_output_mixer_type
(
param
))
{
case
M
IXER_TYPE_
NONE
:
case
M
IXER_TYPE_
UNKNOWN
:
case
M
ixerType
:
:
NONE
:
case
M
ixerType
:
:
UNKNOWN
:
return
nullptr
;
case
M
IXER_TYPE_
HARDWARE
:
case
M
ixerType
:
:
HARDWARE
:
if
(
plugin
==
nullptr
)
return
nullptr
;
return
mixer_new
(
event_loop
,
*
plugin
,
ao
,
listener
,
param
,
error
);
case
M
IXER_TYPE_
SOFTWARE
:
case
M
ixerType
:
:
SOFTWARE
:
mixer
=
mixer_new
(
event_loop
,
software_mixer_plugin
,
ao
,
listener
,
config_param
(),
...
...
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