e_mixer: rename alsa functions e_mixer_system_ to e_mixer_alsa_

SVN revision: 83906
This commit is contained in:
Jérémy Zurcher 2013-02-14 20:27:56 +00:00
parent 301b7915bd
commit 8d86519b5e
5 changed files with 76 additions and 76 deletions

View File

@ -283,7 +283,7 @@ _populate_channels(E_Mixer_App_Dialog_Data *app)
e_mod_mixer_del(app->sys); e_mod_mixer_del(app->sys);
app->sys = e_mod_mixer_new(app->card); app->sys = e_mod_mixer_new(app->card);
if (_mixer_using_default) if (_mixer_using_default)
e_mixer_system_callback_set(app->sys, _cb_system_update, app); e_mixer_alsa_callback_set(app->sys, _cb_system_update, app);
eina_stringshare_del(app->channel_name); eina_stringshare_del(app->channel_name);
app->channel_name = e_mod_mixer_channel_default_name_get(app->sys); app->channel_name = e_mod_mixer_channel_default_name_get(app->sys);

View File

@ -105,7 +105,7 @@ _basic_create_general(E_Config_Dialog *dialog, Evas *evas, E_Config_Dialog_Data
inst = l->data; inst = l->data;
conf = inst->conf; conf = inst->conf;
card_name = e_mixer_system_get_card_name(conf->card); card_name = e_mixer_alsa_get_card_name(conf->card);
snprintf(name, sizeof(name), "%s: %s", card_name, conf->channel_name); snprintf(name, sizeof(name), "%s: %s", card_name, conf->channel_name);
eina_stringshare_del(card_name); eina_stringshare_del(card_name);

View File

@ -886,7 +886,7 @@ e_mixer_update(E_Mixer_Instance *inst)
r = _mixer_sys_setup(inst); r = _mixer_sys_setup(inst);
if (r && _mixer_using_default) if (r && _mixer_using_default)
e_mixer_system_callback_set(inst->sys, _mixer_system_cb_update, inst); e_mixer_alsa_callback_set(inst->sys, _mixer_system_cb_update, inst);
return r; return r;
} }
@ -994,8 +994,8 @@ e_mod_mixer_pulse_ready(Eina_Bool ready)
inst->sys = NULL; inst->sys = NULL;
return; return;
} }
if (_mixer_using_default) e_mixer_system_callback_set(inst->sys, _mixer_system_cb_update, inst); if (_mixer_using_default) e_mixer_alsa_callback_set(inst->sys, _mixer_system_cb_update, inst);
else e_mixer_system_callback_set(inst->sys, NULL, NULL); else e_mixer_alsa_callback_set(inst->sys, NULL, NULL);
if ((inst->mixer_state.left > -1) && (inst->mixer_state.right > -1) && (inst->mixer_state.mute > -1)) if ((inst->mixer_state.left > -1) && (inst->mixer_state.right > -1) && (inst->mixer_state.mute > -1))
e_mod_mixer_volume_set(inst->sys, inst->channel, e_mod_mixer_volume_set(inst->sys, inst->channel,
inst->mixer_state.left, inst->mixer_state.right); inst->mixer_state.left, inst->mixer_state.right);
@ -1073,7 +1073,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
return NULL; return NULL;
} }
if (_mixer_using_default) e_mixer_system_callback_set(inst->sys, _mixer_system_cb_update, inst); if (_mixer_using_default) e_mixer_alsa_callback_set(inst->sys, _mixer_system_cb_update, inst);
inst->ui.gadget = edje_object_add(gc->evas); inst->ui.gadget = edje_object_add(gc->evas);
e_theme_edje_object_set(inst->ui.gadget, "base/theme/modules/mixer", e_theme_edje_object_set(inst->ui.gadget, "base/theme/modules/mixer",
@ -1469,26 +1469,26 @@ _mixer_actions_unregister(E_Mixer_Module_Context *ctxt)
void void
e_mixer_default_setup(void) e_mixer_default_setup(void)
{ {
e_mod_mixer_volume_get = (void *)e_mixer_system_get_volume; e_mod_mixer_volume_get = (void *)e_mixer_alsa_get_volume;
e_mod_mixer_volume_set = (void *)e_mixer_system_set_volume; e_mod_mixer_volume_set = (void *)e_mixer_alsa_set_volume;
e_mod_mixer_mute_get = (void *)e_mixer_system_get_mute; e_mod_mixer_mute_get = (void *)e_mixer_alsa_get_mute;
e_mod_mixer_mute_set = (void *)e_mixer_system_set_mute; e_mod_mixer_mute_set = (void *)e_mixer_alsa_set_mute;
e_mod_mixer_mutable_get = (void *)e_mixer_system_can_mute; e_mod_mixer_mutable_get = (void *)e_mixer_alsa_can_mute;
e_mod_mixer_state_get = (void *)e_mixer_system_get_state; e_mod_mixer_state_get = (void *)e_mixer_alsa_get_state;
e_mod_mixer_capture_get = (void *)e_mixer_system_has_capture; e_mod_mixer_capture_get = (void *)e_mixer_alsa_has_capture;
e_mod_mixer_new = (void *)e_mixer_system_new; e_mod_mixer_new = (void *)e_mixer_alsa_new;
e_mod_mixer_del = (void *)e_mixer_system_del; e_mod_mixer_del = (void *)e_mixer_alsa_del;
e_mod_mixer_channel_default_name_get = (void *)e_mixer_system_get_default_channel_name; e_mod_mixer_channel_default_name_get = (void *)e_mixer_alsa_get_default_channel_name;
e_mod_mixer_channel_get_by_name = (void *)e_mixer_system_get_channel_by_name; e_mod_mixer_channel_get_by_name = (void *)e_mixer_alsa_get_channel_by_name;
e_mod_mixer_channel_name_get = (void *)e_mixer_system_get_channel_name; e_mod_mixer_channel_name_get = (void *)e_mixer_alsa_get_channel_name;
e_mod_mixer_channel_del = (void *)e_mixer_system_channel_del; e_mod_mixer_channel_del = (void *)e_mixer_alsa_channel_del;
e_mod_mixer_channels_free = (void *)e_mixer_system_free_channels; e_mod_mixer_channels_free = (void *)e_mixer_alsa_free_channels;
e_mod_mixer_channels_get = (void *)e_mixer_system_get_channels; e_mod_mixer_channels_get = (void *)e_mixer_alsa_get_channels;
e_mod_mixer_channels_names_get = (void *)e_mixer_system_get_channels_names; e_mod_mixer_channels_names_get = (void *)e_mixer_alsa_get_channels_names;
e_mod_mixer_card_name_get = (void *)e_mixer_system_get_card_name; e_mod_mixer_card_name_get = (void *)e_mixer_alsa_get_card_name;
e_mod_mixer_cards_get = (void *)e_mixer_system_get_cards; e_mod_mixer_cards_get = (void *)e_mixer_alsa_get_cards;
e_mod_mixer_cards_free = (void *)e_mixer_system_free_cards; e_mod_mixer_cards_free = (void *)e_mixer_alsa_free_cards;
e_mod_mixer_card_default_get = (void *)e_mixer_system_get_default_card; e_mod_mixer_card_default_get = (void *)e_mixer_alsa_get_default_card;
_mixer_using_default = EINA_TRUE; _mixer_using_default = EINA_TRUE;
} }

View File

@ -23,36 +23,36 @@ typedef struct _E_Mixer_Channel_Info
E_Mixer_App *app; E_Mixer_App *app;
} E_Mixer_Channel_Info; } E_Mixer_Channel_Info;
Eina_List *e_mixer_system_get_cards(void); Eina_List *e_mixer_alsa_get_cards(void);
void e_mixer_system_free_cards(Eina_List *cards); void e_mixer_alsa_free_cards(Eina_List *cards);
const char *e_mixer_system_get_default_card(void); const char *e_mixer_alsa_get_default_card(void);
const char *e_mixer_system_get_card_name(const char *card); const char *e_mixer_alsa_get_card_name(const char *card);
Eina_Bool e_mixer_pulse_init(void); Eina_Bool e_mixer_pulse_init(void);
E_Mixer_System *e_mixer_system_new(const char *card); E_Mixer_System *e_mixer_alsa_new(const char *card);
void e_mixer_system_del(E_Mixer_System *self); void e_mixer_alsa_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); int e_mixer_alsa_callback_set(E_Mixer_System *self, int (*func)(void *data, E_Mixer_System *self), void *data);
Eina_List *e_mixer_system_get_channels(E_Mixer_System *self); Eina_List *e_mixer_alsa_get_channels(E_Mixer_System *self);
void e_mixer_system_free_channels(Eina_List *channels); void e_mixer_alsa_free_channels(Eina_List *channels);
Eina_List *e_mixer_system_get_channels_names(E_Mixer_System *self); Eina_List *e_mixer_alsa_get_channels_names(E_Mixer_System *self);
void e_mixer_system_free_channels_names(Eina_List *channels_names); void e_mixer_alsa_free_channels_names(Eina_List *channels_names);
const char *e_mixer_system_get_default_channel_name(E_Mixer_System *self); const char *e_mixer_alsa_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); E_Mixer_Channel *e_mixer_alsa_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); const char *e_mixer_alsa_get_channel_name(E_Mixer_System *self, E_Mixer_Channel *channel);
void e_mixer_system_channel_del(E_Mixer_Channel *channel); void e_mixer_alsa_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_alsa_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_alsa_set_state(E_Mixer_System *self, E_Mixer_Channel *channel, const E_Mixer_Channel_State *state);
int e_mixer_system_get_volume(E_Mixer_System *self, E_Mixer_Channel *channel, int *left, int *right); int e_mixer_alsa_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_alsa_set_volume(E_Mixer_System *self, E_Mixer_Channel *channel, int left, int right);
int e_mixer_system_get_mute(E_Mixer_System *self, E_Mixer_Channel *channel, int *mute); int e_mixer_alsa_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_alsa_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_alsa_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_alsa_has_capture(E_Mixer_System *self, E_Mixer_Channel *channel);
int pulse_init(void); int pulse_init(void);
Eina_Bool e_mixer_pulse_ready(void); Eina_Bool e_mixer_pulse_ready(void);

View File

@ -143,7 +143,7 @@ _mixer_callback_replace(E_Mixer_System *self __UNUSED__,
} }
E_Mixer_System * E_Mixer_System *
e_mixer_system_new(const char *name) e_mixer_alsa_new(const char *name)
{ {
snd_mixer_t *handle; snd_mixer_t *handle;
int err; int err;
@ -177,7 +177,7 @@ error_open:
} }
void void
e_mixer_system_del(E_Mixer_System *self) e_mixer_alsa_del(E_Mixer_System *self)
{ {
struct e_mixer_callback_desc *desc; struct e_mixer_callback_desc *desc;
@ -192,7 +192,7 @@ e_mixer_system_del(E_Mixer_System *self)
} }
int int
e_mixer_system_callback_set(E_Mixer_System *self, e_mixer_alsa_callback_set(E_Mixer_System *self,
int (*func)(void *data, E_Mixer_System *self), int (*func)(void *data, E_Mixer_System *self),
void *data) void *data)
{ {
@ -218,7 +218,7 @@ e_mixer_system_callback_set(E_Mixer_System *self,
} }
Eina_List * Eina_List *
e_mixer_system_get_cards(void) e_mixer_alsa_get_cards(void)
{ {
int err, card_num; int err, card_num;
Eina_List *cards; Eina_List *cards;
@ -246,7 +246,7 @@ e_mixer_system_get_cards(void)
} }
void void
e_mixer_system_free_cards(Eina_List *cards) e_mixer_alsa_free_cards(Eina_List *cards)
{ {
const char *card; const char *card;
@ -255,7 +255,7 @@ e_mixer_system_free_cards(Eina_List *cards)
} }
const char * const char *
e_mixer_system_get_default_card(void) e_mixer_alsa_get_default_card(void)
{ {
static const char buf[] = "hw:0"; static const char buf[] = "hw:0";
snd_ctl_t *control; snd_ctl_t *control;
@ -267,7 +267,7 @@ e_mixer_system_get_default_card(void)
} }
const char * const char *
e_mixer_system_get_card_name(const char *card) e_mixer_alsa_get_card_name(const char *card)
{ {
snd_ctl_card_info_t *hw_info; snd_ctl_card_info_t *hw_info;
const char *name; const char *name;
@ -304,7 +304,7 @@ e_mixer_system_get_card_name(const char *card)
} }
Eina_List * Eina_List *
e_mixer_system_get_channels(E_Mixer_System *self) e_mixer_alsa_get_channels(E_Mixer_System *self)
{ {
Eina_List *channels; Eina_List *channels;
snd_mixer_elem_t *elem; snd_mixer_elem_t *elem;
@ -328,13 +328,13 @@ e_mixer_system_get_channels(E_Mixer_System *self)
} }
void void
e_mixer_system_free_channels(Eina_List *channels) e_mixer_alsa_free_channels(Eina_List *channels)
{ {
eina_list_free(channels); eina_list_free(channels);
} }
Eina_List * Eina_List *
e_mixer_system_get_channels_names(E_Mixer_System *self) e_mixer_alsa_get_channels_names(E_Mixer_System *self)
{ {
Eina_List *channels; Eina_List *channels;
snd_mixer_elem_t *elem; snd_mixer_elem_t *elem;
@ -364,7 +364,7 @@ e_mixer_system_get_channels_names(E_Mixer_System *self)
} }
void void
e_mixer_system_free_channels_names(Eina_List *channels_names) e_mixer_alsa_free_channels_names(Eina_List *channels_names)
{ {
const char *channel; const char *channel;
@ -373,7 +373,7 @@ e_mixer_system_free_channels_names(Eina_List *channels_names)
} }
const char * const char *
e_mixer_system_get_default_channel_name(E_Mixer_System *self) e_mixer_alsa_get_default_channel_name(E_Mixer_System *self)
{ {
snd_mixer_elem_t *elem; snd_mixer_elem_t *elem;
snd_mixer_selem_id_t *sid; snd_mixer_selem_id_t *sid;
@ -401,7 +401,7 @@ e_mixer_system_get_default_channel_name(E_Mixer_System *self)
} }
E_Mixer_Channel * E_Mixer_Channel *
e_mixer_system_get_channel_by_name(E_Mixer_System *self, e_mixer_alsa_get_channel_by_name(E_Mixer_System *self,
const char *name) const char *name)
{ {
snd_mixer_elem_t *elem; snd_mixer_elem_t *elem;
@ -430,12 +430,12 @@ e_mixer_system_get_channel_by_name(E_Mixer_System *self,
} }
void void
e_mixer_system_channel_del(E_Mixer_Channel *channel __UNUSED__) e_mixer_alsa_channel_del(E_Mixer_Channel *channel __UNUSED__)
{ {
} }
const char * const char *
e_mixer_system_get_channel_name(E_Mixer_System *self, e_mixer_alsa_get_channel_name(E_Mixer_System *self,
E_Mixer_Channel *channel) E_Mixer_Channel *channel)
{ {
snd_mixer_selem_id_t *sid; snd_mixer_selem_id_t *sid;
@ -452,7 +452,7 @@ e_mixer_system_get_channel_name(E_Mixer_System *self,
} }
int int
e_mixer_system_get_volume(E_Mixer_System *self, e_mixer_alsa_get_volume(E_Mixer_System *self,
E_Mixer_Channel *channel, E_Mixer_Channel *channel,
int *left, int *left,
int *right) int *right)
@ -489,7 +489,7 @@ e_mixer_system_get_volume(E_Mixer_System *self,
} }
int int
e_mixer_system_set_volume(E_Mixer_System *self, e_mixer_alsa_set_volume(E_Mixer_System *self,
E_Mixer_Channel *channel, E_Mixer_Channel *channel,
int left, int left,
int right) int right)
@ -541,7 +541,7 @@ e_mixer_system_set_volume(E_Mixer_System *self,
} }
int int
e_mixer_system_can_mute(E_Mixer_System *self, e_mixer_alsa_can_mute(E_Mixer_System *self,
E_Mixer_Channel *channel) E_Mixer_Channel *channel)
{ {
if ((!self) || (!channel)) if ((!self) || (!channel))
@ -553,7 +553,7 @@ e_mixer_system_can_mute(E_Mixer_System *self,
} }
int int
e_mixer_system_get_mute(E_Mixer_System *self, e_mixer_alsa_get_mute(E_Mixer_System *self,
E_Mixer_Channel *channel, E_Mixer_Channel *channel,
int *mute) int *mute)
{ {
@ -579,7 +579,7 @@ e_mixer_system_get_mute(E_Mixer_System *self,
} }
int int
e_mixer_system_set_mute(E_Mixer_System *self, e_mixer_alsa_set_mute(E_Mixer_System *self,
E_Mixer_Channel *channel, E_Mixer_Channel *channel,
int mute) int mute)
{ {
@ -595,7 +595,7 @@ e_mixer_system_set_mute(E_Mixer_System *self,
} }
int int
e_mixer_system_get_state(E_Mixer_System *self, e_mixer_alsa_get_state(E_Mixer_System *self,
E_Mixer_Channel *channel, E_Mixer_Channel *channel,
E_Mixer_Channel_State *state) E_Mixer_Channel_State *state)
{ {
@ -604,13 +604,13 @@ e_mixer_system_get_state(E_Mixer_System *self,
if (!state) if (!state)
return 0; return 0;
r = e_mixer_system_get_mute(self, channel, &state->mute); r = e_mixer_alsa_get_mute(self, channel, &state->mute);
r &= e_mixer_system_get_volume(self, channel, &state->left, &state->right); r &= e_mixer_alsa_get_volume(self, channel, &state->left, &state->right);
return r; return r;
} }
int int
e_mixer_system_set_state(E_Mixer_System *self, e_mixer_alsa_set_state(E_Mixer_System *self,
E_Mixer_Channel *channel, E_Mixer_Channel *channel,
const E_Mixer_Channel_State *state) const E_Mixer_Channel_State *state)
{ {
@ -619,13 +619,13 @@ e_mixer_system_set_state(E_Mixer_System *self,
if (!state) if (!state)
return 0; return 0;
r = e_mixer_system_set_mute(self, channel, state->mute); r = e_mixer_alsa_set_mute(self, channel, state->mute);
r &= e_mixer_system_set_volume(self, channel, state->left, state->right); r &= e_mixer_alsa_set_volume(self, channel, state->left, state->right);
return r; return r;
} }
int int
e_mixer_system_has_capture(E_Mixer_System *self, e_mixer_alsa_has_capture(E_Mixer_System *self,
E_Mixer_Channel *channel) E_Mixer_Channel *channel)
{ {
if ((!self) || (!channel)) if ((!self) || (!channel))