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
ac32f36e
Commit
ac32f36e
authored
Oct 21, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mixer_plugin: pass audio_output pointer to mixer_plugin.init()
This allows the mixer object to access its associated audio output object.
parent
b8ccc885
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
13 deletions
+21
-13
alsa_mixer_plugin.c
src/mixer/alsa_mixer_plugin.c
+1
-1
oss_mixer_plugin.c
src/mixer/oss_mixer_plugin.c
+2
-1
pulse_mixer_plugin.c
src/mixer/pulse_mixer_plugin.c
+1
-1
software_mixer_plugin.c
src/mixer/software_mixer_plugin.c
+2
-1
mixer_control.c
src/mixer_control.c
+3
-2
mixer_control.h
src/mixer_control.h
+2
-1
mixer_plugin.h
src/mixer_plugin.h
+4
-1
output_init.c
src/output_init.c
+5
-4
read_mixer.c
test/read_mixer.c
+1
-1
No files found.
src/mixer/alsa_mixer_plugin.c
View file @
ac32f36e
...
...
@@ -52,7 +52,7 @@ alsa_mixer_quark(void)
}
static
struct
mixer
*
alsa_mixer_init
(
const
struct
config_param
*
param
,
alsa_mixer_init
(
G_GNUC_UNUSED
void
*
ao
,
const
struct
config_param
*
param
,
G_GNUC_UNUSED
GError
**
error_r
)
{
struct
alsa_mixer
*
am
=
g_new
(
struct
alsa_mixer
,
1
);
...
...
src/mixer/oss_mixer_plugin.c
View file @
ac32f36e
...
...
@@ -74,7 +74,8 @@ oss_find_mixer(const char *name)
}
static
struct
mixer
*
oss_mixer_init
(
const
struct
config_param
*
param
,
GError
**
error_r
)
oss_mixer_init
(
G_GNUC_UNUSED
void
*
ao
,
const
struct
config_param
*
param
,
GError
**
error_r
)
{
struct
oss_mixer
*
om
=
g_new
(
struct
oss_mixer
,
1
);
...
...
src/mixer/pulse_mixer_plugin.c
View file @
ac32f36e
...
...
@@ -212,7 +212,7 @@ context_state_cb(pa_context *context, void *userdata)
static
struct
mixer
*
pulse_mixer_init
(
const
struct
config_param
*
param
,
pulse_mixer_init
(
G_GNUC_UNUSED
void
*
ao
,
const
struct
config_param
*
param
,
G_GNUC_UNUSED
GError
**
error_r
)
{
struct
pulse_mixer
*
pm
=
g_new
(
struct
pulse_mixer
,
1
);
...
...
src/mixer/software_mixer_plugin.c
View file @
ac32f36e
...
...
@@ -37,7 +37,8 @@ struct software_mixer {
};
static
struct
mixer
*
software_mixer_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
,
software_mixer_init
(
G_GNUC_UNUSED
void
*
ao
,
G_GNUC_UNUSED
const
struct
config_param
*
param
,
G_GNUC_UNUSED
GError
**
error_r
)
{
struct
software_mixer
*
sm
=
g_new
(
struct
software_mixer
,
1
);
...
...
src/mixer_control.c
View file @
ac32f36e
...
...
@@ -27,14 +27,15 @@
#define G_LOG_DOMAIN "mixer"
struct
mixer
*
mixer_new
(
const
struct
mixer_plugin
*
plugin
,
const
struct
config_param
*
param
,
mixer_new
(
const
struct
mixer_plugin
*
plugin
,
void
*
ao
,
const
struct
config_param
*
param
,
GError
**
error_r
)
{
struct
mixer
*
mixer
;
assert
(
plugin
!=
NULL
);
mixer
=
plugin
->
init
(
param
,
error_r
);
mixer
=
plugin
->
init
(
ao
,
param
,
error_r
);
assert
(
mixer
==
NULL
||
mixer
->
plugin
==
plugin
);
...
...
src/mixer_control.h
View file @
ac32f36e
...
...
@@ -34,7 +34,8 @@ struct mixer_plugin;
struct
config_param
;
struct
mixer
*
mixer_new
(
const
struct
mixer_plugin
*
plugin
,
const
struct
config_param
*
param
,
mixer_new
(
const
struct
mixer_plugin
*
plugin
,
void
*
ao
,
const
struct
config_param
*
param
,
GError
**
error_r
);
void
...
...
src/mixer_plugin.h
View file @
ac32f36e
...
...
@@ -38,11 +38,14 @@ struct mixer_plugin {
/**
* Alocates and configures a mixer device.
*
* @param ao the pointer returned by audio_output_plugin.init
* @param param the configuration section, or NULL if there is
* no configuration
* @param error_r location to store the error occuring, or
* NULL to ignore errors
* @return a mixer object, or NULL on error
*/
struct
mixer
*
(
*
init
)(
const
struct
config_param
*
param
,
struct
mixer
*
(
*
init
)(
void
*
ao
,
const
struct
config_param
*
param
,
GError
**
error_r
);
/**
...
...
src/output_init.c
View file @
ac32f36e
...
...
@@ -89,7 +89,7 @@ audio_output_mixer_type(const struct config_param *param)
}
static
struct
mixer
*
audio_output_load_mixer
(
const
struct
config_param
*
param
,
audio_output_load_mixer
(
void
*
ao
,
const
struct
config_param
*
param
,
const
struct
mixer_plugin
*
plugin
,
struct
filter
*
filter_chain
,
GError
**
error_r
)
...
...
@@ -105,10 +105,10 @@ audio_output_load_mixer(const struct config_param *param,
if
(
plugin
==
NULL
)
return
NULL
;
return
mixer_new
(
plugin
,
param
,
error_r
);
return
mixer_new
(
plugin
,
ao
,
param
,
error_r
);
case
MIXER_TYPE_SOFTWARE
:
mixer
=
mixer_new
(
&
software_mixer_plugin
,
NULL
,
NULL
);
mixer
=
mixer_new
(
&
software_mixer_plugin
,
NULL
,
NULL
,
NULL
);
assert
(
mixer
!=
NULL
);
filter_chain_append
(
filter_chain
,
...
...
@@ -200,7 +200,8 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
if
(
ao
->
data
==
NULL
)
return
false
;
ao
->
mixer
=
audio_output_load_mixer
(
param
,
plugin
->
mixer_plugin
,
ao
->
mixer
=
audio_output_load_mixer
(
ao
->
data
,
param
,
plugin
->
mixer_plugin
,
ao
->
filter
,
&
error
);
if
(
ao
->
mixer
==
NULL
&&
error
!=
NULL
)
{
g_warning
(
"Failed to initialize hardware mixer for '%s': %s"
,
...
...
test/read_mixer.c
View file @
ac32f36e
...
...
@@ -58,7 +58,7 @@ int main(int argc, G_GNUC_UNUSED char **argv)
g_thread_init
(
NULL
);
mixer
=
mixer_new
(
&
alsa_mixer_plugin
,
NULL
,
&
error
);
mixer
=
mixer_new
(
&
alsa_mixer_plugin
,
NULL
,
NULL
,
&
error
);
if
(
mixer
==
NULL
)
{
g_printerr
(
"mixer_new() failed: %s
\n
"
,
error
->
message
);
g_error_free
(
error
);
...
...
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