summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:34:33 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:34:33 +0100
commit2d859063677ec2a46b3ae3c49d5fa722ff9f7cf8 (patch)
tree40794735d3ac0c354df6c56f79b1def82538acf1 /src/lib/ecore_audio
parent88835840ea5a9aa75cf563de0042cf92db305dc9 (diff)
ecore_audio: Fix warnings
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio.c1
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj.c33
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c20
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c4
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_tone.c5
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c8
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c17
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c4
8 files changed, 34 insertions, 58 deletions
diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c
index f00fd7323d..4d38c13ada 100644
--- a/src/lib/ecore_audio/ecore_audio.c
+++ b/src/lib/ecore_audio/ecore_audio.c
@@ -24,7 +24,6 @@ Eina_List *ecore_audio_modules;
24EAPI int 24EAPI int
25ecore_audio_init(void) 25ecore_audio_init(void)
26{ 26{
27 Ecore_Audio_Module *mod;
28 27
29 if (++_ecore_audio_init_count != 1) 28 if (++_ecore_audio_init_count != 1)
30 return _ecore_audio_init_count; 29 return _ecore_audio_init_count;
diff --git a/src/lib/ecore_audio/ecore_audio_obj.c b/src/lib/ecore_audio/ecore_audio_obj.c
index 62a784e0f6..83ddbe95e1 100644
--- a/src/lib/ecore_audio/ecore_audio_obj.c
+++ b/src/lib/ecore_audio/ecore_audio_obj.c
@@ -20,16 +20,16 @@ EAPI Eo_Op ECORE_AUDIO_OBJ_BASE_ID = EO_NOOP;
20#define MY_CLASS ECORE_AUDIO_OBJ_CLASS 20#define MY_CLASS ECORE_AUDIO_OBJ_CLASS
21#define MY_CLASS_NAME "ecore_audio_obj" 21#define MY_CLASS_NAME "ecore_audio_obj"
22 22
23static void _name_set(Eo *eo_obj, void *_pd, va_list *list) 23static void _name_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
24{ 24{
25 const Ecore_Audio_Object *obj = _pd; 25 Ecore_Audio_Object *obj = _pd;
26 26
27 const char *name = va_arg(*list, const char *); 27 const char *name = va_arg(*list, const char *);
28 28
29 eina_stringshare_replace(&obj->name, name); 29 eina_stringshare_replace(&obj->name, name);
30} 30}
31 31
32static void _name_get(Eo *eo_obj, void *_pd, va_list *list) 32static void _name_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
33{ 33{
34 const Ecore_Audio_Object *obj = _pd; 34 const Ecore_Audio_Object *obj = _pd;
35 35
@@ -39,7 +39,7 @@ static void _name_get(Eo *eo_obj, void *_pd, va_list *list)
39 *name = obj->name; 39 *name = obj->name;
40} 40}
41 41
42static void _paused_set(Eo *eo_obj, void *_pd, va_list *list) 42static void _paused_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
43{ 43{
44 Ecore_Audio_Object *obj = _pd; 44 Ecore_Audio_Object *obj = _pd;
45 45
@@ -48,7 +48,7 @@ static void _paused_set(Eo *eo_obj, void *_pd, va_list *list)
48 obj->paused = paused; 48 obj->paused = paused;
49} 49}
50 50
51static void _paused_get(Eo *eo_obj, void *_pd, va_list *list) 51static void _paused_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
52{ 52{
53 const Ecore_Audio_Object *obj = _pd; 53 const Ecore_Audio_Object *obj = _pd;
54 54
@@ -58,26 +58,7 @@ static void _paused_get(Eo *eo_obj, void *_pd, va_list *list)
58 *ret = obj->paused; 58 *ret = obj->paused;
59} 59}
60 60
61static void _volume_set(Eo *eo_obj, void *_pd, va_list *list) 61static void _volume_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
62{
63 Ecore_Audio_Object *obj = _pd;
64
65 double volume = va_arg(*list, double);
66
67 obj->volume = volume;
68}
69
70static void _volume_get(Eo *eo_obj, void *_pd, va_list *list)
71{
72 const Ecore_Audio_Object *obj = _pd;
73
74 double *ret = va_arg(*list, double *);
75
76 if (ret)
77 *ret = obj->volume;
78}
79
80static void _format_set(Eo *eo_obj, void *_pd, va_list *list)
81{ 62{
82 Ecore_Audio_Object *obj = _pd; 63 Ecore_Audio_Object *obj = _pd;
83 64
@@ -86,7 +67,7 @@ static void _format_set(Eo *eo_obj, void *_pd, va_list *list)
86 obj->volume = volume; 67 obj->volume = volume;
87} 68}
88 69
89static void _format_get(Eo *eo_obj, void *_pd, va_list *list) 70static void _volume_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
90{ 71{
91 const Ecore_Audio_Object *obj = _pd; 72 const Ecore_Audio_Object *obj = _pd;
92 73
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index 292d06c8e6..72a0a23e8e 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -26,7 +26,7 @@ EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED =
26#define MY_CLASS ECORE_AUDIO_OBJ_IN_CLASS 26#define MY_CLASS ECORE_AUDIO_OBJ_IN_CLASS
27#define MY_CLASS_NAME "ecore_audio_obj_in" 27#define MY_CLASS_NAME "ecore_audio_obj_in"
28 28
29static void _speed_set(Eo *eo_obj, void *_pd, va_list *list) 29static void _speed_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
30{ 30{
31 Ecore_Audio_Input *obj = _pd; 31 Ecore_Audio_Input *obj = _pd;
32 32
@@ -42,7 +42,7 @@ static void _speed_set(Eo *eo_obj, void *_pd, va_list *list)
42 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL)); 42 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL));
43} 43}
44 44
45static void _speed_get(Eo *eo_obj, void *_pd, va_list *list) 45static void _speed_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
46{ 46{
47 const Ecore_Audio_Input *obj = _pd; 47 const Ecore_Audio_Input *obj = _pd;
48 48
@@ -52,7 +52,7 @@ static void _speed_get(Eo *eo_obj, void *_pd, va_list *list)
52 *speed = obj->speed; 52 *speed = obj->speed;
53} 53}
54 54
55static void _samplerate_set(Eo *eo_obj, void *_pd, va_list *list) 55static void _samplerate_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
56{ 56{
57 Ecore_Audio_Input *obj = _pd; 57 Ecore_Audio_Input *obj = _pd;
58 58
@@ -63,7 +63,7 @@ static void _samplerate_set(Eo *eo_obj, void *_pd, va_list *list)
63 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL)); 63 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL));
64} 64}
65 65
66static void _samplerate_get(Eo *eo_obj, void *_pd, va_list *list) 66static void _samplerate_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
67{ 67{
68 const Ecore_Audio_Input *obj = _pd; 68 const Ecore_Audio_Input *obj = _pd;
69 69
@@ -73,7 +73,7 @@ static void _samplerate_get(Eo *eo_obj, void *_pd, va_list *list)
73 *samplerate = obj->samplerate; 73 *samplerate = obj->samplerate;
74} 74}
75 75
76static void _channels_set(Eo *eo_obj, void *_pd, va_list *list) 76static void _channels_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
77{ 77{
78 Ecore_Audio_Input *obj = _pd; 78 Ecore_Audio_Input *obj = _pd;
79 79
@@ -85,7 +85,7 @@ static void _channels_set(Eo *eo_obj, void *_pd, va_list *list)
85 85
86} 86}
87 87
88static void _channels_get(Eo *eo_obj, void *_pd, va_list *list) 88static void _channels_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
89{ 89{
90 const Ecore_Audio_Input *obj = _pd; 90 const Ecore_Audio_Input *obj = _pd;
91 91
@@ -95,7 +95,7 @@ static void _channels_get(Eo *eo_obj, void *_pd, va_list *list)
95 *channels = obj->channels; 95 *channels = obj->channels;
96} 96}
97 97
98static void _looped_set(Eo *eo_obj, void *_pd, va_list *list) 98static void _looped_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
99{ 99{
100 Ecore_Audio_Input *obj = _pd; 100 Ecore_Audio_Input *obj = _pd;
101 101
@@ -104,7 +104,7 @@ static void _looped_set(Eo *eo_obj, void *_pd, va_list *list)
104 obj->looped = looped; 104 obj->looped = looped;
105} 105}
106 106
107static void _looped_get(Eo *eo_obj, void *_pd, va_list *list) 107static void _looped_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
108{ 108{
109 const Ecore_Audio_Input *obj = _pd; 109 const Ecore_Audio_Input *obj = _pd;
110 110
@@ -114,7 +114,7 @@ static void _looped_get(Eo *eo_obj, void *_pd, va_list *list)
114 *ret = obj->looped; 114 *ret = obj->looped;
115} 115}
116 116
117static void _length_get(Eo *eo_obj, void *_pd, va_list *list) 117static void _length_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
118{ 118{
119 const Ecore_Audio_Input *obj = _pd; 119 const Ecore_Audio_Input *obj = _pd;
120 120
@@ -188,7 +188,7 @@ static void _read_internal(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
188 *ret = len_read; 188 *ret = len_read;
189} 189}
190 190
191static void _output_get(Eo *eo_obj, void *_pd, va_list *list) 191static void _output_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
192{ 192{
193 const Ecore_Audio_Input *obj = _pd; 193 const Ecore_Audio_Input *obj = _pd;
194 194
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
index 42df376abd..08ff50955d 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -113,7 +113,7 @@ static void _read(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
113 *ret = read; 113 *ret = read;
114} 114}
115 115
116static void _seek(Eo *eo_obj, void *_pd, va_list *list) 116static void _seek(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
117{ 117{
118 Ecore_Audio_Sndfile *obj = _pd; 118 Ecore_Audio_Sndfile *obj = _pd;
119 sf_count_t count, pos; 119 sf_count_t count, pos;
@@ -289,7 +289,7 @@ static void _vio_set(Eo *eo_obj, void *_pd, va_list *list)
289 ea_obj->format = ECORE_AUDIO_FORMAT_AUTO; 289 ea_obj->format = ECORE_AUDIO_FORMAT_AUTO;
290} 290}
291 291
292static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) 292static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
293{ 293{
294 eo_do_super(eo_obj, MY_CLASS, eo_constructor()); 294 eo_do_super(eo_obj, MY_CLASS, eo_constructor());
295 295
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
index e8969c70bf..f00d5d4830 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
@@ -90,12 +90,9 @@ err:
90 *ret = -1.0; 90 *ret = -1.0;
91} 91}
92 92
93static void _source_set(Eo *eo_obj, void *_pd, va_list *list) 93static void _source_set(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
94{ 94{
95 Ecore_Audio_Tone *obj = _pd;
96
97 Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 95 Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
98 Ecore_Audio_Input *in_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_IN_CLASS);
99 96
100 const char *source = va_arg(*list, const char *); 97 const char *source = va_arg(*list, const char *);
101 98
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c
index 141d26bc17..1e7b2d2473 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out.c
@@ -42,7 +42,7 @@ static void _input_attach(Eo *eo_obj, void *_pd, va_list *list)
42 *ret = EINA_TRUE; 42 *ret = EINA_TRUE;
43} 43}
44 44
45static void _input_detach(Eo *eo_obj, void *_pd, va_list *list) 45static void _input_detach(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
46{ 46{
47 Ecore_Audio_Output *obj = _pd; 47 Ecore_Audio_Output *obj = _pd;
48 Ecore_Audio_Input *in; 48 Ecore_Audio_Input *in;
@@ -61,7 +61,7 @@ static void _input_detach(Eo *eo_obj, void *_pd, va_list *list)
61 61
62} 62}
63 63
64static void _inputs_get(Eo *eo_obj, void *_pd, va_list *list) 64static void _inputs_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
65{ 65{
66 const Ecore_Audio_Output *obj = _pd; 66 const Ecore_Audio_Output *obj = _pd;
67 67
@@ -72,10 +72,8 @@ static void _inputs_get(Eo *eo_obj, void *_pd, va_list *list)
72} 72}
73 73
74 74
75static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) 75static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
76{ 76{
77 const Ecore_Audio_Output *obj = _pd;
78
79 eo_do_super(eo_obj, MY_CLASS, eo_constructor()); 77 eo_do_super(eo_obj, MY_CLASS, eo_constructor());
80 78
81} 79}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index 3e3a1ba490..4402694303 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -83,7 +83,7 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
83 83
84 eo_do(in, ecore_audio_obj_in_read(buf, len, &bread)); 84 eo_do(in, ecore_audio_obj_in_read(buf, len, &bread));
85 pa_stream_write(stream, buf, bread, free, 0, PA_SEEK_RELATIVE); 85 pa_stream_write(stream, buf, bread, free, 0, PA_SEEK_RELATIVE);
86 if (bread < len) 86 if (bread < (int)len)
87 { 87 {
88 pa_operation_unref(pa_stream_trigger(stream, NULL, NULL)); 88 pa_operation_unref(pa_stream_trigger(stream, NULL, NULL));
89 //in->ended = EINA_TRUE; 89 //in->ended = EINA_TRUE;
@@ -91,9 +91,8 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
91 } 91 }
92} 92}
93 93
94static Eina_Bool _update_samplerate_cb(void *data, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 94static Eina_Bool _update_samplerate_cb(void *data EINA_UNUSED, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
95{ 95{
96 Eo *out = data;
97 pa_stream *stream; 96 pa_stream *stream;
98 int samplerate; 97 int samplerate;
99 double speed; 98 double speed;
@@ -101,9 +100,11 @@ static Eina_Bool _update_samplerate_cb(void *data, Eo *eo_obj, const Eo_Event_De
101 eo_do(eo_obj, ecore_audio_obj_in_samplerate_get(&samplerate)); 100 eo_do(eo_obj, ecore_audio_obj_in_samplerate_get(&samplerate));
102 eo_do(eo_obj, ecore_audio_obj_in_speed_get(&speed)); 101 eo_do(eo_obj, ecore_audio_obj_in_speed_get(&speed));
103 102
104 eo_do(eo_obj, eo_base_data_get("pulse_data", &stream)); 103 eo_do(eo_obj, eo_base_data_get("pulse_data", (void **)&stream));
105 104
106 pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL)); 105 pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL));
106
107 return EINA_TRUE;
107} 108}
108 109
109static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in) 110static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
@@ -116,9 +117,9 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
116 Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 117 Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
117 118
118 ss.format = PA_SAMPLE_FLOAT32LE; 119 ss.format = PA_SAMPLE_FLOAT32LE;
119 eo_do(in, ecore_audio_obj_in_samplerate_get(&ss.rate)); 120 eo_do(in, ecore_audio_obj_in_samplerate_get((int *)&ss.rate));
120 eo_do(in, ecore_audio_obj_in_speed_get(&speed)); 121 eo_do(in, ecore_audio_obj_in_speed_get(&speed));
121 eo_do(in, ecore_audio_obj_in_channels_get(&ss.channels)); 122 eo_do(in, ecore_audio_obj_in_channels_get((int *)&ss.channels));
122 eo_do(in, ecore_audio_obj_name_get(&name)); 123 eo_do(in, ecore_audio_obj_name_get(&name));
123 124
124 ss.rate = ss.rate * speed; 125 ss.rate = ss.rate * speed;
@@ -135,11 +136,13 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
135 136
136 eo_do(in, eo_base_data_set("pulse_data", stream, NULL)); 137 eo_do(in, eo_base_data_set("pulse_data", stream, NULL));
137 138
138 //FIXME: Handle paused state
139 139
140 pa_stream_set_write_callback(stream, _write_cb, in); 140 pa_stream_set_write_callback(stream, _write_cb, in);
141 pa_stream_connect_playback(stream, NULL, NULL, PA_STREAM_VARIABLE_RATE, NULL, NULL); 141 pa_stream_connect_playback(stream, NULL, NULL, PA_STREAM_VARIABLE_RATE, NULL, NULL);
142 142
143 if (ea_obj->paused)
144 pa_operation_unref(pa_stream_cork(stream, 1, NULL, NULL));
145
143 return ret; 146 return ret;
144} 147}
145 148
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
index 4a04f2aa5a..99e89d1838 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
@@ -160,10 +160,8 @@ static void _format_get(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
160 *ret = obj->format; 160 *ret = obj->format;
161} 161}
162 162
163static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) 163static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
164{ 164{
165 Ecore_Audio_Sndfile *obj = _pd;
166
167 eo_do_super(eo_obj, MY_CLASS, eo_constructor()); 165 eo_do_super(eo_obj, MY_CLASS, eo_constructor());
168 166
169 eo_do(eo_obj, ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG)); 167 eo_do(eo_obj, ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG));