2008-07-31 20:08:16 -07:00
|
|
|
#include "e_mod_system.h"
|
|
|
|
|
2009-03-11 08:13:42 -07:00
|
|
|
static const char *_name = NULL;
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_mixer_dummy_set(void)
|
|
|
|
{
|
2009-04-17 13:16:56 -07:00
|
|
|
if (!_name) _name = eina_stringshare_add("No ALSA mixer found!");
|
2009-03-11 08:13:42 -07:00
|
|
|
}
|
2008-07-31 20:08:16 -07:00
|
|
|
|
|
|
|
E_Mixer_System *
|
|
|
|
e_mixer_system_new(const char *name)
|
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
|
|
|
if (name == _name || strcmp(name, _name) == 0)
|
2009-04-17 13:13:17 -07:00
|
|
|
return (E_Mixer_System *)-1;
|
2008-07-31 20:08:16 -07:00
|
|
|
else
|
2009-04-17 13:13:17 -07:00
|
|
|
return NULL;
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_del(E_Mixer_System *self __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_callback_set(E_Mixer_System *self __UNUSED__, int (*func)(void *data, E_Mixer_System *self) __UNUSED__, void *data __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *
|
2008-07-31 20:08:16 -07:00
|
|
|
e_mixer_system_get_cards(void)
|
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
return eina_list_append(NULL, _name);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-10-22 04:49:33 -07:00
|
|
|
e_mixer_system_free_cards(Eina_List *cards)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
eina_list_free(cards);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
2009-03-11 08:13:42 -07:00
|
|
|
const char *
|
2008-07-31 20:08:16 -07:00
|
|
|
e_mixer_system_get_default_card(void)
|
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
|
|
|
return eina_stringshare_ref(_name);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
2009-03-11 08:13:42 -07:00
|
|
|
const char *
|
2008-07-31 20:08:16 -07:00
|
|
|
e_mixer_system_get_card_name(const char *card)
|
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
|
|
|
if (card == _name || strcmp(card, _name) == 0)
|
2009-04-17 13:13:17 -07:00
|
|
|
return eina_stringshare_ref(_name);
|
2008-07-31 20:08:16 -07:00
|
|
|
else
|
2009-04-17 13:13:17 -07:00
|
|
|
return NULL;
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_channels(E_Mixer_System *self __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
return eina_list_append(NULL, (void *)-2);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-10-22 04:49:33 -07:00
|
|
|
e_mixer_system_free_channels(Eina_List *channels)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
eina_list_free(channels);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_channels_names(E_Mixer_System *self __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
return eina_list_append(NULL, _name);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-10-22 04:49:33 -07:00
|
|
|
e_mixer_system_free_channels_names(Eina_List *channels_names)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
eina_list_free(channels_names);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
2009-03-11 08:13:42 -07:00
|
|
|
const char *
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_default_channel_name(E_Mixer_System *self __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
|
|
|
return eina_stringshare_ref(_name);
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
E_Mixer_Channel *
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_channel_by_name(E_Mixer_System *self __UNUSED__, const char *name)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
2009-03-11 08:13:42 -07:00
|
|
|
_e_mixer_dummy_set();
|
|
|
|
|
|
|
|
if (name == _name || strcmp(name, _name) == 0)
|
2009-04-17 13:13:17 -07:00
|
|
|
return (E_Mixer_Channel *)-2;
|
2008-07-31 20:08:16 -07:00
|
|
|
else
|
2009-04-17 13:13:17 -07:00
|
|
|
return NULL;
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_channel_del(E_Mixer_Channel *channel __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-03-11 08:13:42 -07:00
|
|
|
const char *
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_channel_name(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
if (channel == (E_Mixer_Channel *)-2)
|
2009-04-17 13:13:17 -07:00
|
|
|
return eina_stringshare_ref(_name);
|
2008-07-31 20:08:16 -07:00
|
|
|
else
|
2009-04-17 13:13:17 -07:00
|
|
|
return NULL;
|
2008-07-31 20:08:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_volume(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__, int *left, int *right)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
if (left)
|
2009-04-17 13:13:17 -07:00
|
|
|
*left = 0;
|
2008-07-31 20:08:16 -07:00
|
|
|
if (right)
|
2009-04-17 13:13:17 -07:00
|
|
|
*right = 0;
|
2008-07-31 20:08:16 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_set_volume(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__, int left __UNUSED__, int right __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_can_mute(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_mute(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__, int *mute)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
if (mute)
|
2009-04-17 13:13:17 -07:00
|
|
|
*mute = 1;
|
2008-07-31 20:08:16 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_set_mute(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__, int mute __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_get_state(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__, E_Mixer_Channel_State *state)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
const E_Mixer_Channel_State def = {1, 0, 0};
|
|
|
|
|
|
|
|
if (state)
|
2009-04-17 13:13:17 -07:00
|
|
|
*state = def;
|
2008-07-31 20:08:16 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_set_state(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__, const E_Mixer_Channel_State *state __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-08 03:23:49 -07:00
|
|
|
e_mixer_system_has_capture(E_Mixer_System *self __UNUSED__, E_Mixer_Channel *channel __UNUSED__)
|
2008-07-31 20:08:16 -07:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|