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
b1e95b1f
Commit
b1e95b1f
authored
Jun 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
volume: removed support for legacy mixer configuration
The top-level "mixer_device" and "mixer_control" options have been deprecated by MPD 0.15, and it's safe to remove them in MPD 0.16.
parent
ce072b89
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
89 deletions
+4
-89
NEWS
NEWS
+2
-0
conf.c
src/conf.c
+0
-2
conf.h
src/conf.h
+0
-2
volume.c
src/volume.c
+2
-85
No files found.
NEWS
View file @
b1e95b1f
ver 0.16 (20??/??/??)
ver 0.16 (20??/??/??)
* mixers:
- removed support for legacy mixer configuration
* commands:
* commands:
- added new "status" line with more precise "elapsed time"
- added new "status" line with more precise "elapsed time"
...
...
src/conf.c
View file @
b1e95b1f
...
@@ -192,8 +192,6 @@ void config_global_init(void)
...
@@ -192,8 +192,6 @@ void config_global_init(void)
registerConfigParam
(
CONF_AUDIO_OUTPUT
,
1
,
1
);
registerConfigParam
(
CONF_AUDIO_OUTPUT
,
1
,
1
);
registerConfigParam
(
CONF_AUDIO_OUTPUT_FORMAT
,
0
,
0
);
registerConfigParam
(
CONF_AUDIO_OUTPUT_FORMAT
,
0
,
0
);
registerConfigParam
(
CONF_MIXER_TYPE
,
0
,
0
);
registerConfigParam
(
CONF_MIXER_TYPE
,
0
,
0
);
registerConfigParam
(
CONF_MIXER_DEVICE
,
0
,
0
);
registerConfigParam
(
CONF_MIXER_CONTROL
,
0
,
0
);
registerConfigParam
(
CONF_REPLAYGAIN
,
0
,
0
);
registerConfigParam
(
CONF_REPLAYGAIN
,
0
,
0
);
registerConfigParam
(
CONF_REPLAYGAIN_PREAMP
,
0
,
0
);
registerConfigParam
(
CONF_REPLAYGAIN_PREAMP
,
0
,
0
);
registerConfigParam
(
CONF_REPLAYGAIN_MISSING_PREAMP
,
0
,
0
);
registerConfigParam
(
CONF_REPLAYGAIN_MISSING_PREAMP
,
0
,
0
);
...
...
src/conf.h
View file @
b1e95b1f
...
@@ -44,8 +44,6 @@
...
@@ -44,8 +44,6 @@
#define CONF_AUDIO_OUTPUT "audio_output"
#define CONF_AUDIO_OUTPUT "audio_output"
#define CONF_AUDIO_OUTPUT_FORMAT "audio_output_format"
#define CONF_AUDIO_OUTPUT_FORMAT "audio_output_format"
#define CONF_MIXER_TYPE "mixer_type"
#define CONF_MIXER_TYPE "mixer_type"
#define CONF_MIXER_DEVICE "mixer_device"
#define CONF_MIXER_CONTROL "mixer_control"
#define CONF_REPLAYGAIN "replaygain"
#define CONF_REPLAYGAIN "replaygain"
#define CONF_REPLAYGAIN_PREAMP "replaygain_preamp"
#define CONF_REPLAYGAIN_PREAMP "replaygain_preamp"
#define CONF_REPLAYGAIN_MISSING_PREAMP "replaygain_missing_preamp"
#define CONF_REPLAYGAIN_MISSING_PREAMP "replaygain_missing_preamp"
...
...
src/volume.c
View file @
b1e95b1f
...
@@ -58,82 +58,6 @@ void volume_finish(void)
...
@@ -58,82 +58,6 @@ void volume_finish(void)
g_timer_destroy
(
hardware_volume_timer
);
g_timer_destroy
(
hardware_volume_timer
);
}
}
/**
* Finds the first audio_output configuration section with the
* specified type.
*/
static
struct
config_param
*
find_output_config
(
const
char
*
type
)
{
struct
config_param
*
param
=
NULL
;
while
((
param
=
config_get_next_param
(
CONF_AUDIO_OUTPUT
,
param
))
!=
NULL
)
{
const
char
*
param_type
=
config_get_block_string
(
param
,
"type"
,
NULL
);
if
(
param_type
!=
NULL
&&
strcmp
(
param_type
,
type
)
==
0
)
return
param
;
}
return
NULL
;
}
/**
* Copy a (top-level) legacy mixer configuration parameter to the
* audio_output section.
*/
static
void
mixer_copy_legacy_param
(
const
char
*
type
,
const
char
*
name
)
{
const
struct
config_param
*
param
;
struct
config_param
*
output
;
const
struct
block_param
*
bp
;
/* see if the deprecated configuration exists */
param
=
config_get_param
(
name
);
if
(
param
==
NULL
)
return
;
g_warning
(
"deprecated option '%s' found, moving to '%s' audio output"
,
name
,
type
);
/* determine the configuration section */
output
=
find_output_config
(
type
);
if
(
output
==
NULL
)
{
/* if there is no output configuration at all, create
a new and empty configuration section for the
legacy mixer */
if
(
config_get_next_param
(
CONF_AUDIO_OUTPUT
,
NULL
)
!=
NULL
)
/* there is an audio_output configuration, but
it does not match the mixer_type setting */
g_error
(
"no '%s' audio output found"
,
type
);
output
=
config_new_param
(
NULL
,
param
->
line
);
config_add_block_param
(
output
,
"type"
,
type
,
param
->
line
);
config_add_block_param
(
output
,
"name"
,
type
,
param
->
line
);
config_add_param
(
CONF_AUDIO_OUTPUT
,
output
);
}
bp
=
config_get_block_param
(
output
,
name
);
if
(
bp
!=
NULL
)
g_error
(
"the '%s' audio output already has a '%s' setting"
,
type
,
name
);
/* duplicate the parameter in the configuration section */
config_add_block_param
(
output
,
name
,
param
->
value
,
param
->
line
);
}
static
void
mixer_reconfigure
(
const
char
*
type
)
{
mixer_copy_legacy_param
(
type
,
CONF_MIXER_DEVICE
);
mixer_copy_legacy_param
(
type
,
CONF_MIXER_CONTROL
);
}
void
volume_init
(
void
)
void
volume_init
(
void
)
{
{
const
struct
config_param
*
param
=
config_get_param
(
CONF_MIXER_TYPE
);
const
struct
config_param
*
param
=
config_get_param
(
CONF_MIXER_TYPE
);
...
@@ -148,15 +72,8 @@ void volume_init(void)
...
@@ -148,15 +72,8 @@ void volume_init(void)
}
else
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_HARDWARE
)
==
0
)
{
}
else
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_HARDWARE
)
==
0
)
{
//nothing to do
//nothing to do
}
else
{
}
else
{
//fallback to old config behaviour
g_error
(
"unknown mixer type %s at line %i
\n
"
,
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_OSS
)
==
0
)
{
param
->
value
,
param
->
line
);
mixer_reconfigure
(
param
->
value
);
}
else
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_ALSA
)
==
0
)
{
mixer_reconfigure
(
param
->
value
);
}
else
{
g_error
(
"unknown mixer type %s at line %i
\n
"
,
param
->
value
,
param
->
line
);
}
}
}
}
}
...
...
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