blob: 67a3f28f60a093a1ec23de6f043b00e4ba2d1c9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
#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_get;
E_Mixer_Cb e_mod_mixer_channel_names_get;
E_Mixer_Cb e_mod_mixer_card_name_get;
E_Mixer_Cb e_mod_mixer_card_names_get;
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_get = (void *)e_mixer_system_get_channels;
e_mod_mixer_channel_names_get = (void *)e_mixer_system_get_channel_names;
e_mod_mixer_card_name_get = (void *)e_mixer_system_get_card_name;
e_mod_mixer_card_names_get = (void *)e_mixer_system_get_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_get = (void *)e_mixer_pulse_get_channels;
e_mod_mixer_channel_names_get = (void *)e_mixer_pulse_get_channel_names;
e_mod_mixer_card_name_get = (void *)e_mixer_pulse_get_card_name;
e_mod_mixer_card_names_get = (void *)e_mixer_pulse_get_cards;
e_mod_mixer_card_default_get = (void *)e_mixer_pulse_get_default_card;
_mixer_using_default = EINA_FALSE;
}
static int
_channel_info_cmp(const void *data_a, const void *data_b)
{
const E_Mixer_Channel_Info *a = data_a, *b = data_b;
if (a->has_capture < b->has_capture)
return -1;
else if (a->has_capture > b->has_capture)
return 1;
return strcmp(a->name, b->name);
}
Eina_List *
e_mod_mixer_channel_infos_get(E_Mixer_System *sys)
{
return eina_list_sort(e_mod_mixer_channels_get(sys), -1, _channel_info_cmp);
}
void
e_mod_mixer_channel_infos_free(Eina_List *list)
{
E_Mixer_Channel_Info *info;
EINA_LIST_FREE(list, info)
{
eina_stringshare_del(info->name);
free(info);
}
}
void
e_mod_mixer_channel_names_free(Eina_List *list)
{
const char *str;
EINA_LIST_FREE(list, str)
eina_stringshare_del(str);
}
void
e_mod_mixer_card_names_free(Eina_List *list)
{
const char *str;
EINA_LIST_FREE(list, str)
eina_stringshare_del(str);
}
|