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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
#include "e_mod_system.h"
#include <stdlib.h>
#include <string.h>
static const char *_name = NULL;
static void
_e_mixer_dummy_set(void)
{
if (!_name) _name = eina_stringshare_add("No ALSA mixer found!");
}
E_Mixer_System *
e_mixer_system_new(const char *name)
{
_e_mixer_dummy_set();
if (name == _name || strcmp(name, _name) == 0)
return (E_Mixer_System *)-1;
else
return NULL;
}
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)
{
return 0;
}
Eina_List *
e_mixer_system_get_cards(void)
{
_e_mixer_dummy_set();
return eina_list_append(NULL, _name);
}
void
e_mixer_system_free_cards(Eina_List *cards)
{
eina_list_free(cards);
}
const char *
e_mixer_system_get_default_card(void)
{
_e_mixer_dummy_set();
return eina_stringshare_ref(_name);
}
const char *
e_mixer_system_get_card_name(const char *card)
{
_e_mixer_dummy_set();
if (card == _name || strcmp(card, _name) == 0)
return eina_stringshare_ref(_name);
else
return NULL;
}
Eina_List *
e_mixer_system_get_channels(E_Mixer_System *self)
{
return eina_list_append(NULL, (void *)-2);
}
void
e_mixer_system_free_channels(Eina_List *channels)
{
eina_list_free(channels);
}
Eina_List *
e_mixer_system_get_channels_names(E_Mixer_System *self)
{
_e_mixer_dummy_set();
return eina_list_append(NULL, _name);
}
void
e_mixer_system_free_channels_names(Eina_List *channels_names)
{
eina_list_free(channels_names);
}
const char *
e_mixer_system_get_default_channel_name(E_Mixer_System *self)
{
_e_mixer_dummy_set();
return eina_stringshare_ref(_name);
}
E_Mixer_Channel *
e_mixer_system_get_channel_by_name(E_Mixer_System *self, const char *name)
{
_e_mixer_dummy_set();
if (name == _name || strcmp(name, _name) == 0)
return (E_Mixer_Channel *)-2;
else
return NULL;
}
void
e_mixer_system_channel_del(E_Mixer_Channel *channel)
{
}
const char *
e_mixer_system_get_channel_name(E_Mixer_System *self, E_Mixer_Channel *channel)
{
if (channel == (E_Mixer_Channel *)-2)
return eina_stringshare_ref(_name);
else
return NULL;
}
int
e_mixer_system_get_volume(E_Mixer_System *self, E_Mixer_Channel *channel, int *left, int *right)
{
if (left)
*left = 0;
if (right)
*right = 0;
return 1;
}
int
e_mixer_system_set_volume(E_Mixer_System *self, E_Mixer_Channel *channel, int left, int right)
{
return 0;
}
int
e_mixer_system_can_mute(E_Mixer_System *self, E_Mixer_Channel *channel)
{
return 1;
}
int
e_mixer_system_get_mute(E_Mixer_System *self, E_Mixer_Channel *channel, int *mute)
{
if (mute)
*mute = 1;
return 1;
}
int
e_mixer_system_set_mute(E_Mixer_System *self, E_Mixer_Channel *channel, int mute)
{
return 0;
}
int
e_mixer_system_get_state(E_Mixer_System *self, E_Mixer_Channel *channel, E_Mixer_Channel_State *state)
{
const E_Mixer_Channel_State def = {1, 0, 0};
if (state)
*state = def;
return 1;
}
int
e_mixer_system_set_state(E_Mixer_System *self, E_Mixer_Channel *channel, const E_Mixer_Channel_State *state)
{
return 0;
}
int
e_mixer_system_has_capture(E_Mixer_System *self, E_Mixer_Channel *channel)
{
return 0;
}
|