jeyzu pushed a commit to branch master.
commit a67cc20580bad71a6cd0e9d3e55e4a65a1a3a13e
Author: Jérémy Zurcher <[email protected]>
Date: Sun Feb 24 00:45:12 2013 +0100
mixer: replace e_mod_system.h with e_mod_mixer.hc
provide a neat mixer api, easier to upgrade
---
src/modules/Makefile_mixer.am | 3 +-
src/modules/mixer/e_mod_main.c | 110 ++++-----------------
src/modules/mixer/e_mod_main.h | 49 +--------
src/modules/mixer/e_mod_mixer.c | 77 +++++++++++++++
.../mixer/{e_mod_system.h => e_mod_mixer.h} | 90 +++++++++++++----
src/modules/mixer/sys_alsa.c | 2 +-
src/modules/mixer/sys_dummy.c | 2 +-
src/modules/mixer/sys_pulse.c | 1 +
8 files changed, 175 insertions(+), 159 deletions(-)
diff --git a/src/modules/Makefile_mixer.am b/src/modules/Makefile_mixer.am
index 0152c33..ba74512 100644
--- a/src/modules/Makefile_mixer.am
+++ b/src/modules/Makefile_mixer.am
@@ -11,7 +11,8 @@ mixer_module_la_CFLAGS = $(AM_CFLAGS) @SOUND_CFLAGS@
mixer_module_la_SOURCES = mixer/e_mod_main.c \
mixer/e_mod_main.h \
- mixer/e_mod_system.h \
+ mixer/e_mod_mixer.h \
+ mixer/e_mod_mixer.c \
mixer/app_mixer.c \
mixer/conf_gadget.c \
mixer/conf_module.c \
diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c
index 8fbe563..2b1a7fd 100644
--- a/src/modules/mixer/e_mod_main.c
+++ b/src/modules/mixer/e_mod_main.c
@@ -9,28 +9,6 @@ static char tmpbuf[4096]; /* general purpose buffer, just use
immediately */
static const char _conf_domain[] = "module.mixer";
static const char _name[] = "mixer";
const char _e_mixer_Name[] = N_("Mixer");
-Eina_Bool _mixer_using_default = EINA_FALSE;
-E_Mixer_Volume_Get_Cb e_mod_mixer_volume_get;
-E_Mixer_Volume_Set_Cb e_mod_mixer_volume_set;
-E_Mixer_Mute_Get_Cb e_mod_mixer_mute_get;
-E_Mixer_Mute_Set_Cb e_mod_mixer_mute_set;
-E_Mixer_Capture_Cb e_mod_mixer_mutable_get;
-E_Mixer_State_Get_Cb e_mod_mixer_state_get;
-E_Mixer_Capture_Cb e_mod_mixer_capture_get;
-E_Mixer_Cb e_mod_mixer_new;
-E_Mixer_Cb e_mod_mixer_del;
-E_Mixer_Cb e_mod_mixer_channel_default_name_get;
-E_Mixer_Cb e_mod_mixer_channel_get_by_name;
-E_Mixer_Cb e_mod_mixer_channel_name_get;
-E_Mixer_Cb e_mod_mixer_channel_del;
-E_Mixer_Cb e_mod_mixer_channel_free;
-E_Mixer_Cb e_mod_mixer_channels_free;
-E_Mixer_Cb e_mod_mixer_channels_get;
-E_Mixer_Cb e_mod_mixer_channels_names_get;
-E_Mixer_Cb e_mod_mixer_card_name_get;
-E_Mixer_Cb e_mod_mixer_cards_get;
-E_Mixer_Cb e_mod_mixer_cards_free;
-E_Mixer_Cb e_mod_mixer_card_default_get;
static void _mixer_actions_unregister(E_Mixer_Module_Context *ctxt);
static void _mixer_actions_register(E_Mixer_Module_Context *ctxt);
@@ -901,6 +879,25 @@ _mixer_sys_setup_defaults(E_Mixer_Instance *inst)
return _mixer_sys_setup_default_channel(inst);
}
+static void
+_mixer_pulse_setup(void)
+{
+ E_Mixer_Instance *inst;
+ E_Mixer_Module_Context *ctxt;
+ Eina_List *l;
+
+ e_mixer_pulse_setup();
+
+ if (!mixer_mod) return;
+
+ ctxt = mixer_mod->data;
+ EINA_LIST_FOREACH(ctxt->instances, l, inst)
+ {
+ if (!inst->conf->card)
+ _mixer_gadget_configuration_defaults(inst->conf);
+ }
+}
+
void
e_mod_mixer_pulse_ready(Eina_Bool ready)
{
@@ -924,7 +921,7 @@ e_mod_mixer_pulse_ready(Eina_Bool ready)
inst->sys = NULL;
}
}
- if (ready) e_mixer_pulse_setup();
+ if (ready) _mixer_pulse_setup();
else e_mixer_default_setup();
EINA_LIST_FOREACH(ctxt->instances, l, inst)
@@ -1410,71 +1407,6 @@ _mixer_actions_unregister(E_Mixer_Module_Context *ctxt)
}
}
-void
-e_mixer_default_setup(void)
-{
- e_mod_mixer_volume_get = (void *)e_mixer_system_get_volume;
- e_mod_mixer_volume_set = (void *)e_mixer_system_set_volume;
- e_mod_mixer_mute_get = (void *)e_mixer_system_get_mute;
- e_mod_mixer_mute_set = (void *)e_mixer_system_set_mute;
- e_mod_mixer_mutable_get = (void *)e_mixer_system_can_mute;
- e_mod_mixer_state_get = (void *)e_mixer_system_get_state;
- e_mod_mixer_capture_get = (void *)e_mixer_system_has_capture;
- e_mod_mixer_new = (void *)e_mixer_system_new;
- e_mod_mixer_del = (void *)e_mixer_system_del;
- e_mod_mixer_channel_default_name_get = (void
*)e_mixer_system_get_default_channel_name;
- e_mod_mixer_channel_get_by_name = (void
*)e_mixer_system_get_channel_by_name;
- e_mod_mixer_channel_name_get = (void *)e_mixer_system_get_channel_name;
- e_mod_mixer_channel_del = (void *)e_mixer_system_channel_del;
- e_mod_mixer_channels_free = (void *)e_mixer_system_free_channels;
- e_mod_mixer_channels_get = (void *)e_mixer_system_get_channels;
- e_mod_mixer_channels_names_get = (void *)e_mixer_system_get_channels_names;
- e_mod_mixer_card_name_get = (void *)e_mixer_system_get_card_name;
- e_mod_mixer_cards_get = (void *)e_mixer_system_get_cards;
- e_mod_mixer_cards_free = (void *)e_mixer_system_free_cards;
- e_mod_mixer_card_default_get = (void *)e_mixer_system_get_default_card;
- _mixer_using_default = EINA_TRUE;
-}
-
-void
-e_mixer_pulse_setup(void)
-{
- E_Mixer_Instance *inst;
- E_Mixer_Module_Context *ctxt;
- Eina_List *l;
-
- e_mod_mixer_volume_get = (void *)e_mixer_pulse_get_volume;
- e_mod_mixer_volume_set = (void *)e_mixer_pulse_set_volume;
- e_mod_mixer_mute_get = (void *)e_mixer_pulse_get_mute;
- e_mod_mixer_mute_set = (void *)e_mixer_pulse_set_mute;
- e_mod_mixer_mutable_get = (void *)e_mixer_pulse_can_mute;
- e_mod_mixer_state_get = (void *)e_mixer_pulse_get_state;
- e_mod_mixer_capture_get = (void *)e_mixer_pulse_has_capture;
- e_mod_mixer_new = (void *)e_mixer_pulse_new;
- e_mod_mixer_del = (void *)e_mixer_pulse_del;
- e_mod_mixer_channel_default_name_get = (void
*)e_mixer_pulse_get_default_channel_name;
- e_mod_mixer_channel_get_by_name = (void *)e_mixer_pulse_get_channel_by_name;
- e_mod_mixer_channel_name_get = (void *)e_mixer_pulse_get_channel_name;
- e_mod_mixer_channel_del = (void *)e_mixer_pulse_channel_del;
- e_mod_mixer_channels_free = (void *)e_mixer_pulse_free_channels;
- e_mod_mixer_channels_get = (void *)e_mixer_pulse_get_channels;
- e_mod_mixer_channels_names_get = (void *)e_mixer_pulse_get_channels_names;
- e_mod_mixer_card_name_get = (void *)e_mixer_pulse_get_card_name;
- e_mod_mixer_cards_get = (void *)e_mixer_pulse_get_cards;
- e_mod_mixer_cards_free = (void *)e_mixer_pulse_free_cards;
- e_mod_mixer_card_default_get = (void *)e_mixer_pulse_get_default_card;
- _mixer_using_default = EINA_FALSE;
-
- if (!mixer_mod) return;
-
- ctxt = mixer_mod->data;
- EINA_LIST_FOREACH(ctxt->instances, l, inst)
- {
- if (!inst->conf->card)
- _mixer_gadget_configuration_defaults(inst->conf);
- }
-}
-
EAPI void *
e_modapi_init(E_Module *m)
{
@@ -1487,7 +1419,7 @@ e_modapi_init(E_Module *m)
_mixer_configure_registry_register();
e_gadcon_provider_register(&_gc_class);
if (!e_mixer_pulse_init()) e_mixer_default_setup();
- else e_mixer_pulse_setup();
+ else _mixer_pulse_setup();
mixer_mod = m;
return ctxt;
diff --git a/src/modules/mixer/e_mod_main.h b/src/modules/mixer/e_mod_main.h
index 910b644..a7af108 100644
--- a/src/modules/mixer/e_mod_main.h
+++ b/src/modules/mixer/e_mod_main.h
@@ -2,7 +2,7 @@
#define E_MOD_MAIN_H
#include "e.h"
-#include "e_mod_system.h"
+#include "e_mod_mixer.h"
/* Increment for Major Changes */
#define MOD_CONFIG_FILE_EPOCH 1
@@ -77,14 +77,6 @@ typedef struct E_Mixer_Module_Context
int desktop_notification;
} E_Mixer_Module_Context;
-typedef int (*E_Mixer_Volume_Set_Cb)(E_Mixer_System *, E_Mixer_Channel *, int,
int);
-typedef int (*E_Mixer_Volume_Get_Cb)(E_Mixer_System *, E_Mixer_Channel *, int
*, int *);
-typedef int (*E_Mixer_Mute_Get_Cb)(E_Mixer_System *, E_Mixer_Channel *, int *);
-typedef int (*E_Mixer_Mute_Set_Cb)(E_Mixer_System *, E_Mixer_Channel *, int);
-typedef int (*E_Mixer_State_Get_Cb)(E_Mixer_System *, E_Mixer_Channel *,
E_Mixer_Channel_State *);
-typedef int (*E_Mixer_Capture_Cb)(E_Mixer_System *, E_Mixer_Channel *);
-typedef void *(*E_Mixer_Cb)();
-
EAPI extern E_Module_Api e_modapi;
EAPI void *e_modapi_init(E_Module *m);
EAPI int e_modapi_shutdown(E_Module *m);
@@ -96,48 +88,9 @@ E_Dialog *e_mixer_app_dialog_new(E_Container *con, void
(*func)(E_Dialog *dialog
int e_mixer_app_dialog_select(E_Dialog *dialog, const char *card_name, const
char *channel_name);
int e_mixer_update(E_Mixer_Instance *inst);
-void e_mixer_default_setup(void);
-void e_mixer_pulse_setup(void);
const char *e_mixer_theme_path(void);
void e_mod_mixer_pulse_ready(Eina_Bool);
void e_mod_mixer_pulse_update(void);
-extern Eina_Bool _mixer_using_default;
-extern E_Mixer_Volume_Get_Cb e_mod_mixer_volume_get;
-extern E_Mixer_Volume_Set_Cb e_mod_mixer_volume_set;
-extern E_Mixer_Mute_Get_Cb e_mod_mixer_mute_get;
-extern E_Mixer_Mute_Set_Cb e_mod_mixer_mute_set;
-extern E_Mixer_Capture_Cb e_mod_mixer_mutable_get;
-extern E_Mixer_State_Get_Cb e_mod_mixer_state_get;
-extern E_Mixer_Capture_Cb e_mod_mixer_capture_get;
-extern E_Mixer_Cb e_mod_mixer_new;
-extern E_Mixer_Cb e_mod_mixer_del;
-extern E_Mixer_Cb e_mod_mixer_channel_default_name_get;
-extern E_Mixer_Cb e_mod_mixer_channel_get_by_name;
-extern E_Mixer_Cb e_mod_mixer_channel_name_get;
-extern E_Mixer_Cb e_mod_mixer_channel_del;
-extern E_Mixer_Cb e_mod_mixer_channel_free;
-extern E_Mixer_Cb e_mod_mixer_channels_free;
-extern E_Mixer_Cb e_mod_mixer_channels_get;
-extern E_Mixer_Cb e_mod_mixer_channels_names_get;
-extern E_Mixer_Cb e_mod_mixer_card_name_get;
-extern E_Mixer_Cb e_mod_mixer_cards_get;
-extern E_Mixer_Cb e_mod_mixer_cards_free;
-extern E_Mixer_Cb e_mod_mixer_card_default_get;
-
-/**
- * @addtogroup Optional_Devices
- * @{
- *
- * @defgroup Module_Mixer Audio Mixer (Volume Control)
- *
- * Controls the audio volume and mute status for both playback
- * (output) and record (input) devices.
- *
- * Can work with ALSA (http://www.alsa-project.org/) or PulseAudio
- * (http://www.pulseaudio.org/).
- *
- * @}
- */
#endif
diff --git a/src/modules/mixer/e_mod_mixer.c b/src/modules/mixer/e_mod_mixer.c
new file mode 100644
index 0000000..7c7e5b0
--- /dev/null
+++ b/src/modules/mixer/e_mod_mixer.c
@@ -0,0 +1,77 @@
+#include "e_mod_mixer.h"
+
+Eina_Bool _mixer_using_default = EINA_FALSE;
+E_Mixer_Volume_Get_Cb e_mod_mixer_volume_get;
+E_Mixer_Volume_Set_Cb e_mod_mixer_volume_set;
+E_Mixer_Mute_Get_Cb e_mod_mixer_mute_get;
+E_Mixer_Mute_Set_Cb e_mod_mixer_mute_set;
+E_Mixer_Capture_Cb e_mod_mixer_mutable_get;
+E_Mixer_State_Get_Cb e_mod_mixer_state_get;
+E_Mixer_Capture_Cb e_mod_mixer_capture_get;
+E_Mixer_Cb e_mod_mixer_new;
+E_Mixer_Cb e_mod_mixer_del;
+E_Mixer_Cb e_mod_mixer_channel_default_name_get;
+E_Mixer_Cb e_mod_mixer_channel_get_by_name;
+E_Mixer_Cb e_mod_mixer_channel_name_get;
+E_Mixer_Cb e_mod_mixer_channel_del;
+E_Mixer_Cb e_mod_mixer_channel_free;
+E_Mixer_Cb e_mod_mixer_channels_free;
+E_Mixer_Cb e_mod_mixer_channels_get;
+E_Mixer_Cb e_mod_mixer_channels_names_get;
+E_Mixer_Cb e_mod_mixer_card_name_get;
+E_Mixer_Cb e_mod_mixer_cards_get;
+E_Mixer_Cb e_mod_mixer_cards_free;
+E_Mixer_Cb e_mod_mixer_card_default_get;
+
+void
+e_mixer_default_setup(void)
+{
+ e_mod_mixer_volume_get = (void *)e_mixer_system_get_volume;
+ e_mod_mixer_volume_set = (void *)e_mixer_system_set_volume;
+ e_mod_mixer_mute_get = (void *)e_mixer_system_get_mute;
+ e_mod_mixer_mute_set = (void *)e_mixer_system_set_mute;
+ e_mod_mixer_mutable_get = (void *)e_mixer_system_can_mute;
+ e_mod_mixer_state_get = (void *)e_mixer_system_get_state;
+ e_mod_mixer_capture_get = (void *)e_mixer_system_has_capture;
+ e_mod_mixer_new = (void *)e_mixer_system_new;
+ e_mod_mixer_del = (void *)e_mixer_system_del;
+ e_mod_mixer_channel_default_name_get = (void
*)e_mixer_system_get_default_channel_name;
+ e_mod_mixer_channel_get_by_name = (void
*)e_mixer_system_get_channel_by_name;
+ e_mod_mixer_channel_name_get = (void *)e_mixer_system_get_channel_name;
+ e_mod_mixer_channel_del = (void *)e_mixer_system_channel_del;
+ e_mod_mixer_channels_free = (void *)e_mixer_system_free_channels;
+ e_mod_mixer_channels_get = (void *)e_mixer_system_get_channels;
+ e_mod_mixer_channels_names_get = (void *)e_mixer_system_get_channels_names;
+ e_mod_mixer_card_name_get = (void *)e_mixer_system_get_card_name;
+ e_mod_mixer_cards_get = (void *)e_mixer_system_get_cards;
+ e_mod_mixer_cards_free = (void *)e_mixer_system_free_cards;
+ e_mod_mixer_card_default_get = (void *)e_mixer_system_get_default_card;
+ _mixer_using_default = EINA_TRUE;
+}
+
+void
+e_mixer_pulse_setup()
+{
+ e_mod_mixer_volume_get = (void *)e_mixer_pulse_get_volume;
+ e_mod_mixer_volume_set = (void *)e_mixer_pulse_set_volume;
+ e_mod_mixer_mute_get = (void *)e_mixer_pulse_get_mute;
+ e_mod_mixer_mute_set = (void *)e_mixer_pulse_set_mute;
+ e_mod_mixer_mutable_get = (void *)e_mixer_pulse_can_mute;
+ e_mod_mixer_state_get = (void *)e_mixer_pulse_get_state;
+ e_mod_mixer_capture_get = (void *)e_mixer_pulse_has_capture;
+ e_mod_mixer_new = (void *)e_mixer_pulse_new;
+ e_mod_mixer_del = (void *)e_mixer_pulse_del;
+ e_mod_mixer_channel_default_name_get = (void
*)e_mixer_pulse_get_default_channel_name;
+ e_mod_mixer_channel_get_by_name = (void *)e_mixer_pulse_get_channel_by_name;
+ e_mod_mixer_channel_name_get = (void *)e_mixer_pulse_get_channel_name;
+ e_mod_mixer_channel_del = (void *)e_mixer_pulse_channel_del;
+ e_mod_mixer_channels_free = (void *)e_mixer_pulse_free_channels;
+ e_mod_mixer_channels_get = (void *)e_mixer_pulse_get_channels;
+ e_mod_mixer_channels_names_get = (void *)e_mixer_pulse_get_channels_names;
+ e_mod_mixer_card_name_get = (void *)e_mixer_pulse_get_card_name;
+ e_mod_mixer_cards_get = (void *)e_mixer_pulse_get_cards;
+ e_mod_mixer_cards_free = (void *)e_mixer_pulse_free_cards;
+ e_mod_mixer_card_default_get = (void *)e_mixer_pulse_get_default_card;
+ _mixer_using_default = EINA_FALSE;
+}
+
diff --git a/src/modules/mixer/e_mod_system.h b/src/modules/mixer/e_mod_mixer.h
similarity index 63%
rename from src/modules/mixer/e_mod_system.h
rename to src/modules/mixer/e_mod_mixer.h
index 7a401c4..916cab7 100644
--- a/src/modules/mixer/e_mod_system.h
+++ b/src/modules/mixer/e_mod_mixer.h
@@ -1,68 +1,107 @@
-#ifndef E_MOD_SYSTEM_H
-#define E_MOD_SYSTEM_H
+#ifndef E_MOD_MIXER_H
+#define E_MOD_MIXER_H
#include "e.h"
typedef void E_Mixer_System;
typedef void E_Mixer_Channel;
-struct E_Mixer_Channel_State
+typedef struct _E_Mixer_Channel_State
{
int mute;
int left;
int right;
-};
-typedef struct E_Mixer_Channel_State E_Mixer_Channel_State;
+} E_Mixer_Channel_State;
-Eina_List *e_mixer_system_get_cards(void);
-void e_mixer_system_free_cards(Eina_List *cards);
-const char *e_mixer_system_get_default_card(void);
-const char *e_mixer_system_get_card_name(const char *card);
+typedef int (*E_Mixer_Volume_Set_Cb)(E_Mixer_System *, E_Mixer_Channel *, int,
int);
+typedef int (*E_Mixer_Volume_Get_Cb)(E_Mixer_System *, E_Mixer_Channel *, int
*, int *);
+typedef int (*E_Mixer_Mute_Get_Cb)(E_Mixer_System *, E_Mixer_Channel *, int *);
+typedef int (*E_Mixer_Mute_Set_Cb)(E_Mixer_System *, E_Mixer_Channel *, int);
+typedef int (*E_Mixer_State_Get_Cb)(E_Mixer_System *, E_Mixer_Channel *,
E_Mixer_Channel_State *);
+typedef int (*E_Mixer_Capture_Cb)(E_Mixer_System *, E_Mixer_Channel *);
+typedef void *(*E_Mixer_Cb)();
-Eina_Bool e_mixer_pulse_init(void);
+extern Eina_Bool _mixer_using_default;
+extern E_Mixer_Volume_Get_Cb e_mod_mixer_volume_get;
+extern E_Mixer_Volume_Set_Cb e_mod_mixer_volume_set;
+extern E_Mixer_Mute_Get_Cb e_mod_mixer_mute_get;
+extern E_Mixer_Mute_Set_Cb e_mod_mixer_mute_set;
+extern E_Mixer_Capture_Cb e_mod_mixer_mutable_get;
+extern E_Mixer_State_Get_Cb e_mod_mixer_state_get;
+extern E_Mixer_Capture_Cb e_mod_mixer_capture_get;
+extern E_Mixer_Cb e_mod_mixer_new;
+extern E_Mixer_Cb e_mod_mixer_del;
+extern E_Mixer_Cb e_mod_mixer_channel_default_name_get;
+extern E_Mixer_Cb e_mod_mixer_channel_get_by_name;
+extern E_Mixer_Cb e_mod_mixer_channel_name_get;
+extern E_Mixer_Cb e_mod_mixer_channel_del;
+extern E_Mixer_Cb e_mod_mixer_channel_free;
+extern E_Mixer_Cb e_mod_mixer_channels_free;
+extern E_Mixer_Cb e_mod_mixer_channels_get;
+extern E_Mixer_Cb e_mod_mixer_channels_names_get;
+extern E_Mixer_Cb e_mod_mixer_card_name_get;
+extern E_Mixer_Cb e_mod_mixer_cards_get;
+extern E_Mixer_Cb e_mod_mixer_cards_free;
+extern E_Mixer_Cb e_mod_mixer_card_default_get;
+
+void e_mixer_default_setup(void);
+void e_mixer_pulse_setup();
+
+/* ALSA */
+int e_mixer_system_callback_set(E_Mixer_System *self, int (*func)(void *data,
E_Mixer_System *self), void *data);
E_Mixer_System *e_mixer_system_new(const char *card);
void e_mixer_system_del(E_Mixer_System *self);
-int e_mixer_system_callback_set(E_Mixer_System *self, int (*func)(void *data,
E_Mixer_System *self), void *data);
+Eina_List *e_mixer_system_get_cards(void);
+void e_mixer_system_free_cards(Eina_List *cards);
+const char *e_mixer_system_get_default_card(void);
+const char *e_mixer_system_get_card_name(const char *card);
+const char *e_mixer_system_get_channel_name(E_Mixer_System *self,
E_Mixer_Channel *channel);
Eina_List *e_mixer_system_get_channels(E_Mixer_System *self);
void e_mixer_system_free_channels(Eina_List *channels);
Eina_List *e_mixer_system_get_channels_names(E_Mixer_System *self);
void e_mixer_system_free_channels_names(Eina_List *channels_names);
+
const char *e_mixer_system_get_default_channel_name(E_Mixer_System *self);
E_Mixer_Channel *e_mixer_system_get_channel_by_name(E_Mixer_System *self,
const char *name);
-const char *e_mixer_system_get_channel_name(E_Mixer_System *self,
E_Mixer_Channel *channel);
void e_mixer_system_channel_del(E_Mixer_Channel *channel);
-
-int e_mixer_system_get_state(E_Mixer_System *self, E_Mixer_Channel *channel,
E_Mixer_Channel_State *state);
-int e_mixer_system_set_state(E_Mixer_System *self, E_Mixer_Channel *channel,
const E_Mixer_Channel_State *state);
+int e_mixer_system_has_capture(E_Mixer_System *self, E_Mixer_Channel *channel);
int e_mixer_system_get_volume(E_Mixer_System *self, E_Mixer_Channel *channel,
int *left, int *right);
int e_mixer_system_set_volume(E_Mixer_System *self, E_Mixer_Channel *channel,
int left, int right);
+int e_mixer_system_can_mute(E_Mixer_System *self, E_Mixer_Channel *channel);
int e_mixer_system_get_mute(E_Mixer_System *self, E_Mixer_Channel *channel,
int *mute);
int e_mixer_system_set_mute(E_Mixer_System *self, E_Mixer_Channel *channel,
int mute);
-int e_mixer_system_can_mute(E_Mixer_System *self, E_Mixer_Channel *channel);
-int e_mixer_system_has_capture(E_Mixer_System *self, E_Mixer_Channel *channel);
+int e_mixer_system_get_state(E_Mixer_System *self, E_Mixer_Channel *channel,
E_Mixer_Channel_State *state);
+int e_mixer_system_set_state(E_Mixer_System *self, E_Mixer_Channel *channel,
const E_Mixer_Channel_State *state);
+/* PULSE */
int pulse_init(void);
Eina_Bool e_mixer_pulse_ready(void);
Eina_Bool e_mixer_pulse_init(void);
void e_mixer_pulse_shutdown(void);
+
E_Mixer_System *e_mixer_pulse_new(const char *name);
void e_mixer_pulse_del(E_Mixer_System *self);
+
Eina_List *e_mixer_pulse_get_cards(void);
void e_mixer_pulse_free_cards(Eina_List *cards);
const char *e_mixer_pulse_get_default_card(void);
const char *e_mixer_pulse_get_card_name(const char *card);
+const char *e_mixer_pulse_get_channel_name(E_Mixer_System *self,
E_Mixer_Channel *channel);
+
Eina_List *e_mixer_pulse_get_channels(E_Mixer_System *self);
void e_mixer_pulse_free_channels(Eina_List *channels);
Eina_List *e_mixer_pulse_get_channels_names(E_Mixer_System *self);
void e_mixer_pulse_free_channels_names(Eina_List *channels_names);
+
const char *e_mixer_pulse_get_default_channel_name(E_Mixer_System *self);
E_Mixer_Channel *e_mixer_pulse_get_channel_by_name(E_Mixer_System *self, const
char *name);
void e_mixer_pulse_channel_del(E_Mixer_Channel *channel);
-const char *e_mixer_pulse_get_channel_name(E_Mixer_System *self,
E_Mixer_Channel *channel);
+
+int e_mixer_pulse_has_capture(E_Mixer_System *self, E_Mixer_Channel *channel);
int e_mixer_pulse_get_volume(E_Mixer_System *self, E_Mixer_Channel *channel,
int *left, int *right);
int e_mixer_pulse_set_volume(E_Mixer_System *self, E_Mixer_Channel *channel,
int left, int right);
int e_mixer_pulse_can_mute(E_Mixer_System *self, E_Mixer_Channel *channel);
@@ -70,6 +109,19 @@ int e_mixer_pulse_get_mute(E_Mixer_System *self,
E_Mixer_Channel *channel, int *
int e_mixer_pulse_set_mute(E_Mixer_System *self, E_Mixer_Channel *channel, int
mute);
int e_mixer_pulse_get_state(E_Mixer_System *self, E_Mixer_Channel *channel,
E_Mixer_Channel_State *state);
int e_mixer_pulse_set_state(E_Mixer_System *self, E_Mixer_Channel *channel,
const E_Mixer_Channel_State *state);
-int e_mixer_pulse_has_capture(E_Mixer_System *self, E_Mixer_Channel *channel);
+/**
+ * @addtogroup Optional_Devices
+ * @{
+ *
+ * @defgroup Module_Mixer Audio Mixer (Volume Control)
+ *
+ * Controls the audio volume and mute status for both playback
+ * (output) and record (input) devices.
+ *
+ * Can work with ALSA (http://www.alsa-project.org/) or PulseAudio
+ * (http://www.pulseaudio.org/).
+ *
+ * @}
+ */
#endif /* E_MOD_SYSTEM_H */
diff --git a/src/modules/mixer/sys_alsa.c b/src/modules/mixer/sys_alsa.c
index e47582b..308a847 100644
--- a/src/modules/mixer/sys_alsa.c
+++ b/src/modules/mixer/sys_alsa.c
@@ -1,4 +1,4 @@
-#include "e_mod_system.h"
+#include "e_mod_mixer.h"
#include <alsa/asoundlib.h>
#include <poll.h>
diff --git a/src/modules/mixer/sys_dummy.c b/src/modules/mixer/sys_dummy.c
index fffce07..9d5a069 100644
--- a/src/modules/mixer/sys_dummy.c
+++ b/src/modules/mixer/sys_dummy.c
@@ -1,4 +1,4 @@
-#include "e_mod_system.h"
+#include "e_mod_mixer.h"
static const char *_name = NULL;
diff --git a/src/modules/mixer/sys_pulse.c b/src/modules/mixer/sys_pulse.c
index 38af163..34fbd80 100644
--- a/src/modules/mixer/sys_pulse.c
+++ b/src/modules/mixer/sys_pulse.c
@@ -1,4 +1,5 @@
#include "e_mod_main.h"
+#include "e_mod_mixer.h"
#include "Pulse.h"
#define PULSE_BUS "org.PulseAudio.Core1"
--
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev