summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c22
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_tone.c6
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c10
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_core_audio.c20
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c46
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c16
8 files changed, 62 insertions, 62 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_obj.c b/src/lib/ecore_audio/ecore_audio_obj.c
index 3607cd9..bef68c8 100644
--- a/src/lib/ecore_audio/ecore_audio_obj.c
+++ b/src/lib/ecore_audio/ecore_audio_obj.c
@@ -58,7 +58,7 @@ EOLIAN static Eo *
58_ecore_audio_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Object *obj) 58_ecore_audio_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Object *obj)
59{ 59{
60 obj->volume = 1.0; 60 obj->volume = 1.0;
61 return eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 61 return eo_constructor(eo_super(eo_obj, MY_CLASS));
62} 62}
63 63
64#include "ecore_audio.eo.c" 64#include "ecore_audio.eo.c"
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index a6afa18..c69bd2f 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -27,7 +27,7 @@ _ecore_audio_in_speed_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, double
27 27
28 obj->speed = speed; 28 obj->speed = speed;
29 29
30 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL)); 30 eo_event_callback_call(eo_obj, ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL);
31} 31}
32 32
33EOLIAN static double 33EOLIAN static double
@@ -41,7 +41,7 @@ _ecore_audio_in_samplerate_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, i
41{ 41{
42 obj->samplerate = samplerate; 42 obj->samplerate = samplerate;
43 43
44 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL)); 44 eo_event_callback_call(eo_obj, ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL);
45} 45}
46 46
47EOLIAN static int 47EOLIAN static int
@@ -89,7 +89,7 @@ _ecore_audio_in_remaining_get(Eo *eo_obj, Ecore_Audio_Input *obj)
89 if (!obj->seekable) return -1; 89 if (!obj->seekable) return -1;
90 else { 90 else {
91 double ret = 0.0; 91 double ret = 0.0;
92 eo_do(eo_obj, ret = ecore_audio_obj_in_seek(0, SEEK_CUR)); 92 ret = ecore_audio_obj_in_seek(eo_obj, 0, SEEK_CUR);
93 return obj->length - ret; 93 return obj->length - ret;
94 } 94 }
95} 95}
@@ -104,14 +104,14 @@ _ecore_audio_in_read(Eo *eo_obj, Ecore_Audio_Input *obj, void *buf, size_t len)
104 memset(buf, 0, len); 104 memset(buf, 0, len);
105 len_read = len; 105 len_read = len;
106 } else { 106 } else {
107 eo_do(eo_obj, len_read = ecore_audio_obj_in_read_internal(buf, len)); 107 len_read = ecore_audio_obj_in_read_internal(eo_obj, buf, len);
108 if (len_read == 0) { 108 if (len_read == 0) {
109 if (!obj->looped || !obj->seekable) { 109 if (!obj->looped || !obj->seekable) {
110 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_STOPPED, NULL)); 110 eo_event_callback_call(eo_obj, ECORE_AUDIO_IN_EVENT_IN_STOPPED, NULL);
111 } else { 111 } else {
112 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_SET)); 112 ecore_audio_obj_in_seek(eo_obj, 0, SEEK_SET);
113 eo_do(eo_obj, len_read = ecore_audio_obj_in_read_internal(buf, len)); 113 len_read = ecore_audio_obj_in_read_internal(eo_obj, buf, len);
114 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_LOOPED, NULL)); 114 eo_event_callback_call(eo_obj, ECORE_AUDIO_IN_EVENT_IN_LOOPED, NULL);
115 } 115 }
116 } 116 }
117 117
@@ -173,7 +173,7 @@ _ecore_audio_in_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Input *obj, Ecore_Au
173EOLIAN static Eo * 173EOLIAN static Eo *
174_ecore_audio_in_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Input *obj) 174_ecore_audio_in_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Input *obj)
175{ 175{
176 eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 176 eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
177 177
178 obj->speed = 1.0; 178 obj->speed = 1.0;
179 179
@@ -184,9 +184,9 @@ EOLIAN static void
184_ecore_audio_in_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Input *obj) 184_ecore_audio_in_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Input *obj)
185{ 185{
186 if(obj->output) 186 if(obj->output)
187 eo_do(obj->output, ecore_audio_obj_out_input_detach(eo_obj)); 187 ecore_audio_obj_out_input_detach(obj->output, eo_obj);
188 188
189 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 189 eo_destructor(eo_super(eo_obj, MY_CLASS));
190} 190}
191 191
192#include "ecore_audio_in.eo.c" 192#include "ecore_audio_in.eo.c"
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 599ae27..cefe28b 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -205,7 +205,7 @@ _ecore_audio_in_sndfile_eo_base_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Da
205 if (ea_obj->vio) 205 if (ea_obj->vio)
206 _free_vio(ea_obj); 206 _free_vio(ea_obj);
207 207
208 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 208 eo_destructor(eo_super(eo_obj, MY_CLASS));
209} 209}
210 210
211#include "ecore_audio_in_sndfile.eo.c" 211#include "ecore_audio_in_sndfile.eo.c"
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 2b097f6..ff35a98 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
@@ -90,7 +90,7 @@ _ecore_audio_in_tone_eo_base_key_data_set(Eo *eo_obj, Ecore_Audio_In_Tone_Data *
90 if (!strcmp(key, ECORE_AUDIO_ATTR_TONE_FREQ)) { 90 if (!strcmp(key, ECORE_AUDIO_ATTR_TONE_FREQ)) {
91 obj->freq = *(int *)val; 91 obj->freq = *(int *)val;
92 } else { 92 } else {
93 eo_do_super(eo_obj, MY_CLASS, eo_key_data_set(key, val)); 93 eo_key_data_set(eo_super(eo_obj, MY_CLASS), key, val);
94 } 94 }
95 95
96} 96}
@@ -102,7 +102,7 @@ _ecore_audio_in_tone_eo_base_key_data_get(Eo *eo_obj, Ecore_Audio_In_Tone_Data *
102 return (void *) (intptr_t) obj->freq; 102 return (void *) (intptr_t) obj->freq;
103 } else { 103 } else {
104 void *ret = NULL; 104 void *ret = NULL;
105 eo_do_super(eo_obj, MY_CLASS, ret = eo_key_data_get(key)); 105 ret = eo_key_data_get(eo_super(eo_obj, MY_CLASS), key);
106 return ret; 106 return ret;
107 } 107 }
108} 108}
@@ -112,7 +112,7 @@ _ecore_audio_in_tone_eo_base_constructor(Eo *eo_obj, Ecore_Audio_In_Tone_Data *o
112{ 112{
113 Ecore_Audio_Input *in_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_IN_CLASS); 113 Ecore_Audio_Input *in_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_IN_CLASS);
114 114
115 eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 115 eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
116 116
117 in_obj->channels = 1; 117 in_obj->channels = 1;
118 in_obj->samplerate = 44100; 118 in_obj->samplerate = 44100;
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c
index 0414d66..c34245f 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out.c
@@ -34,7 +34,7 @@ static Eina_Bool _write_cb(void *data)
34 /* FIXME: Multiple inputs */ 34 /* FIXME: Multiple inputs */
35 in = eina_list_data_get(out_obj->inputs); 35 in = eina_list_data_get(out_obj->inputs);
36 36
37 eo_do(in, bread = ecore_audio_obj_in_read(buf, 4*1024)); 37 bread = ecore_audio_obj_in_read(in, buf, 4*1024);
38 38
39 if (bread == 0) { 39 if (bread == 0) {
40 ea_obj->paused = EINA_TRUE; 40 ea_obj->paused = EINA_TRUE;
@@ -61,7 +61,7 @@ _ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Output *obj, Eo *input)
61 if (in->output == eo_obj) 61 if (in->output == eo_obj)
62 return EINA_FALSE; 62 return EINA_FALSE;
63 63
64 if (in->output) eo_do(in->output, ecore_audio_obj_out_input_detach(input)); 64 if (in->output) ecore_audio_obj_out_input_detach(in->output, input);
65 in->output = eo_obj; 65 in->output = eo_obj;
66 66
67 /* TODO: Send event */ 67 /* TODO: Send event */
@@ -132,7 +132,7 @@ _ecore_audio_out_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Output *_pd EINA_UN
132EOLIAN static Eo * 132EOLIAN static Eo *
133_ecore_audio_out_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Output *obj) 133_ecore_audio_out_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Output *obj)
134{ 134{
135 eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 135 eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
136 136
137 obj->need_writer = EINA_TRUE; 137 obj->need_writer = EINA_TRUE;
138 138
@@ -146,10 +146,10 @@ _ecore_audio_out_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Output *obj)
146 Eo *in; 146 Eo *in;
147 147
148 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) { 148 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) {
149 eo_do(eo_obj, ecore_audio_obj_out_input_detach(in)); 149 ecore_audio_obj_out_input_detach(eo_obj, in);
150 } 150 }
151 151
152 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 152 eo_destructor(eo_super(eo_obj, MY_CLASS));
153} 153}
154 154
155#include "ecore_audio_out.eo.c" 155#include "ecore_audio_out.eo.c"
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_core_audio.c b/src/lib/ecore_audio/ecore_audio_obj_out_core_audio.c
index 1d2ead4..aa0d76b 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_core_audio.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_core_audio.c
@@ -185,7 +185,7 @@ _audio_io_proc_cb(AudioObjectID obj_id EINA_UNUSED,
185 185
186 if (helper->fake_stereo) 186 if (helper->fake_stereo)
187 { 187 {
188 eo_do(helper->input, bread = ecore_audio_obj_in_read(buf, size * 2)); 188 bread = ecore_audio_obj_in_read(helper->input, buf, size * 2);
189 189
190 for (k = bread - 1; k >= 0; --k) 190 for (k = bread - 1; k >= 0; --k)
191 { 191 {
@@ -196,7 +196,7 @@ _audio_io_proc_cb(AudioObjectID obj_id EINA_UNUSED,
196 } 196 }
197 else 197 else
198 { 198 {
199 eo_do(helper->input, bread = ecore_audio_obj_in_read(buf, size * 4)); 199 bread = ecore_audio_obj_in_read(helper->input, buf, size * 4);
200 bread /= 4; 200 bread /= 4;
201 } 201 }
202 202
@@ -219,7 +219,7 @@ EOLIAN static void
219_ecore_audio_out_core_audio_ecore_audio_volume_set(Eo *obj, Ecore_Audio_Out_Core_Audio_Data *sd EINA_UNUSED, double volume) 219_ecore_audio_out_core_audio_ecore_audio_volume_set(Eo *obj, Ecore_Audio_Out_Core_Audio_Data *sd EINA_UNUSED, double volume)
220{ 220{
221 // TODO Change volume of playing inputs 221 // TODO Change volume of playing inputs
222 eo_do_super(obj, MY_CLASS, ecore_audio_obj_volume_set(volume)); 222 ecore_audio_obj_volume_set(eo_super(obj, MY_CLASS), volume);
223} 223}
224 224
225EOLIAN static Eina_Bool 225EOLIAN static Eina_Bool
@@ -230,7 +230,7 @@ _ecore_audio_out_core_audio_ecore_audio_out_input_attach(Eo *obj, Ecore_Audio_Ou
230 OSStatus err; 230 OSStatus err;
231 Eina_Bool chk; 231 Eina_Bool chk;
232 232
233 eo_do_super(obj, MY_CLASS, chk = ecore_audio_obj_out_input_attach(input)); 233 chk = ecore_audio_obj_out_input_attach(eo_super(obj, MY_CLASS), input);
234 if (EINA_UNLIKELY(!chk)) 234 if (EINA_UNLIKELY(!chk))
235 { 235 {
236 ERR("Failed to attach input (eo_do_super)"); 236 ERR("Failed to attach input (eo_do_super)");
@@ -266,10 +266,10 @@ _ecore_audio_out_core_audio_ecore_audio_out_input_attach(Eo *obj, Ecore_Audio_Ou
266 } 266 }
267 267
268 /* Forward samplerate to CoreAudio */ 268 /* Forward samplerate to CoreAudio */
269 eo_do(input, helper->format.mSampleRate = ecore_audio_obj_in_samplerate_get()); 269 helper->format.mSampleRate = ecore_audio_obj_in_samplerate_get(input);
270 270
271 /* Set channels. If only 1 channel, emulate stereo */ 271 /* Set channels. If only 1 channel, emulate stereo */
272 eo_do(input, channels = ecore_audio_obj_in_channels_get()); 272 channels = ecore_audio_obj_in_channels_get(input);
273 if (channels == 1) 273 if (channels == 1)
274 { 274 {
275 DBG("Fake stereo enabled for input %p", input); 275 DBG("Fake stereo enabled for input %p", input);
@@ -303,7 +303,7 @@ _ecore_audio_out_core_audio_ecore_audio_out_input_attach(Eo *obj, Ecore_Audio_Ou
303 } 303 }
304 304
305 /* Keep track of data for deallocation */ 305 /* Keep track of data for deallocation */
306 eo_do(input, eo_key_data_set("coreaudio_data", helper)); 306 eo_key_data_set(input, "coreaudio_data", helper);
307 307
308 /* Start playing */ 308 /* Start playing */
309 helper->is_playing = EINA_TRUE; 309 helper->is_playing = EINA_TRUE;
@@ -322,7 +322,7 @@ free_proc_id:
322free_helper: 322free_helper:
323 free(helper); 323 free(helper);
324detach: 324detach:
325 eo_do_super(obj, MY_CLASS, ecore_audio_obj_out_input_detach(input)); 325 ecore_audio_obj_out_input_detach(eo_super(obj, MY_CLASS), input);
326return_failure: 326return_failure:
327 return EINA_FALSE; 327 return EINA_FALSE;
328} 328}
@@ -335,10 +335,10 @@ _ecore_audio_out_core_audio_ecore_audio_out_input_detach(Eo *obj, Ecore_Audio_Ou
335 335
336 DBG("Detach"); 336 DBG("Detach");
337 /* Free helper */ 337 /* Free helper */
338 eo_do(input, data = eo_key_data_get("coreaudio_data")); 338 data = eo_key_data_get(input, "coreaudio_data");
339 _core_audio_helper_free(data); 339 _core_audio_helper_free(data);
340 340
341 eo_do_super(obj, MY_CLASS, ret = ecore_audio_obj_out_input_detach(input)); 341 ret = ecore_audio_obj_out_input_detach(eo_super(obj, MY_CLASS), input);
342 342
343 return ret; 343 return ret;
344} 344}
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 2c869fd..95aa0c0 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -61,10 +61,10 @@ _ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_
61 61
62 pa_cvolume_set(&pa_volume, 2, volume * PA_VOLUME_NORM); 62 pa_cvolume_set(&pa_volume, 2, volume * PA_VOLUME_NORM);
63 63
64 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_volume_set(volume)); 64 ecore_audio_obj_volume_set(eo_super(eo_obj, MY_CLASS), volume);
65 65
66 EINA_LIST_FOREACH(out_obj->inputs, input, in) { 66 EINA_LIST_FOREACH(out_obj->inputs, input, in) {
67 eo_do(in, stream = eo_key_data_get("pulse_data")); 67 stream = eo_key_data_get(in, "pulse_data");
68 idx = pa_stream_get_index(stream); 68 idx = pa_stream_get_index(stream);
69 pa_operation_unref(pa_context_set_sink_input_volume(class_vars.context, idx, &pa_volume, NULL, NULL)); 69 pa_operation_unref(pa_context_set_sink_input_volume(class_vars.context, idx, &pa_volume, NULL, NULL));
70 } 70 }
@@ -81,7 +81,7 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
81 81
82 pa_stream_begin_write(stream, &buf, &wlen); 82 pa_stream_begin_write(stream, &buf, &wlen);
83 83
84 eo_do(in, bread = ecore_audio_obj_in_read(buf, wlen)); 84 bread = ecore_audio_obj_in_read(in, buf, wlen);
85 85
86 pa_stream_write(stream, buf, bread, NULL, 0, PA_SEEK_RELATIVE); 86 pa_stream_write(stream, buf, bread, NULL, 0, PA_SEEK_RELATIVE);
87 if (bread < (int)len) 87 if (bread < (int)len)
@@ -96,10 +96,10 @@ static Eina_Bool _update_samplerate_cb(void *data EINA_UNUSED, const Eo_Event *e
96 int samplerate = 0; 96 int samplerate = 0;
97 double speed = 0; 97 double speed = 0;
98 98
99 eo_do(event->obj, samplerate = ecore_audio_obj_in_samplerate_get()); 99 samplerate = ecore_audio_obj_in_samplerate_get(event->obj);
100 eo_do(event->obj, speed = ecore_audio_obj_in_speed_get()); 100 speed = ecore_audio_obj_in_speed_get(event->obj);
101 101
102 eo_do(event->obj, stream = eo_key_data_get("pulse_data")); 102 stream = eo_key_data_get(event->obj, "pulse_data");
103 103
104 pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL)); 104 pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL));
105 105
@@ -115,28 +115,28 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
115 Eina_Bool ret = EINA_FALSE; 115 Eina_Bool ret = EINA_FALSE;
116 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); 116 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
117 117
118 eo_do_super(eo_obj, MY_CLASS, ret = ecore_audio_obj_out_input_attach(in)); 118 ret = ecore_audio_obj_out_input_attach(eo_super(eo_obj, MY_CLASS), in);
119 if (!ret) 119 if (!ret)
120 return EINA_FALSE; 120 return EINA_FALSE;
121 121
122 ss.format = PA_SAMPLE_FLOAT32LE; 122 ss.format = PA_SAMPLE_FLOAT32LE;
123 eo_do(in, ss.rate = ecore_audio_obj_in_samplerate_get()); 123 ss.rate = ecore_audio_obj_in_samplerate_get(in);
124 eo_do(in, speed = ecore_audio_obj_in_speed_get()); 124 speed = ecore_audio_obj_in_speed_get(in);
125 eo_do(in, ss.channels = ecore_audio_obj_in_channels_get()); 125 ss.channels = ecore_audio_obj_in_channels_get(in);
126 eo_do(in, name = ecore_audio_obj_name_get()); 126 name = ecore_audio_obj_name_get(in);
127 127
128 ss.rate = ss.rate * speed; 128 ss.rate = ss.rate * speed;
129 129
130 stream = pa_stream_new(class_vars.context, name, &ss, NULL); 130 stream = pa_stream_new(class_vars.context, name, &ss, NULL);
131 if (!stream) { 131 if (!stream) {
132 ERR("Could not create stream"); 132 ERR("Could not create stream");
133 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in)); 133 ecore_audio_obj_out_input_detach(eo_super(eo_obj, MY_CLASS), in);
134 return EINA_FALSE; 134 return EINA_FALSE;
135 } 135 }
136 136
137 eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, _update_samplerate_cb, eo_obj)); 137 eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, _update_samplerate_cb, eo_obj);
138 138
139 eo_do(in, eo_key_data_set("pulse_data", stream)); 139 eo_key_data_set(in, "pulse_data", stream);
140 140
141 141
142 pa_stream_set_write_callback(stream, _write_cb, in); 142 pa_stream_set_write_callback(stream, _write_cb, in);
@@ -151,7 +151,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
151static Eina_Bool _delayed_attach_cb(void *data, const Eo_Event *event) 151static Eina_Bool _delayed_attach_cb(void *data, const Eo_Event *event)
152{ 152{
153 Eo *in = data; 153 Eo *in = data;
154 eo_do(event->obj, eo_event_callback_del(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in)); 154 eo_event_callback_del(event->obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in);
155 155
156 _input_attach_internal(event->obj, in); 156 _input_attach_internal(event->obj, in);
157 157
@@ -165,7 +165,7 @@ _ecore_audio_out_pulse_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Out_
165 165
166 if (class_vars.state != PA_CONTEXT_READY) { 166 if (class_vars.state != PA_CONTEXT_READY) {
167 DBG("Delaying input_attach because PA context is not ready."); 167 DBG("Delaying input_attach because PA context is not ready.");
168 eo_do(eo_obj, eo_event_callback_add(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in)); 168 eo_event_callback_add(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in);
169 } else { 169 } else {
170 retval = _input_attach_internal(eo_obj, in); 170 retval = _input_attach_internal(eo_obj, in);
171 } 171 }
@@ -186,11 +186,11 @@ _ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_
186 Eina_Bool ret2 = EINA_FALSE; 186 Eina_Bool ret2 = EINA_FALSE;
187 pa_operation *op; 187 pa_operation *op;
188 188
189 eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_detach(in)); 189 ret2 = ecore_audio_obj_out_input_detach(eo_super(eo_obj, MY_CLASS), in);
190 if (!ret2) 190 if (!ret2)
191 return EINA_FALSE; 191 return EINA_FALSE;
192 192
193 eo_do(in, stream = eo_key_data_get("pulse_data")); 193 stream = eo_key_data_get(in, "pulse_data");
194 194
195 pa_stream_set_write_callback(stream, NULL, NULL); 195 pa_stream_set_write_callback(stream, NULL, NULL);
196 op = pa_stream_drain(stream, _drain_cb, NULL); 196 op = pa_stream_drain(stream, _drain_cb, NULL);
@@ -221,12 +221,12 @@ static void _state_cb(pa_context *context, void *data EINA_UNUSED)
221 if (state == PA_CONTEXT_READY) { 221 if (state == PA_CONTEXT_READY) {
222 DBG("PA context ready."); 222 DBG("PA context ready.");
223 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 223 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
224 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, NULL)); 224 eo_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, NULL);
225 } 225 }
226 } else if ((state == PA_CONTEXT_FAILED) || (state == PA_CONTEXT_TERMINATED)) { 226 } else if ((state == PA_CONTEXT_FAILED) || (state == PA_CONTEXT_TERMINATED)) {
227 DBG("PA context fail."); 227 DBG("PA context fail.");
228 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 228 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
229 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL)); 229 eo_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL);
230 } 230 }
231 } else { 231 } else {
232 DBG("Connection state %i", state); 232 DBG("Connection state %i", state);
@@ -252,7 +252,7 @@ static void _state_job(void *data EINA_UNUSED)
252 } 252 }
253 // the callback here can delete things in the list.. 253 // the callback here can delete things in the list..
254 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 254 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
255 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL)); 255 eo_event_callback_call(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL);
256 } 256 }
257 // now unref everything safely 257 // now unref everything safely
258 EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) { 258 EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) {
@@ -269,7 +269,7 @@ _ecore_audio_out_pulse_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Dat
269 char **argv; 269 char **argv;
270 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS); 270 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS);
271 271
272 eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 272 eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
273 273
274 out_obj->need_writer = EINA_FALSE; 274 out_obj->need_writer = EINA_FALSE;
275 275
@@ -296,7 +296,7 @@ EOLIAN static void
296_ecore_audio_out_pulse_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED) 296_ecore_audio_out_pulse_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED)
297{ 297{
298 class_vars.outputs = eina_list_remove(class_vars.outputs, eo_obj); 298 class_vars.outputs = eina_list_remove(class_vars.outputs, eo_obj);
299 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 299 eo_destructor(eo_super(eo_obj, MY_CLASS));
300} 300}
301 301
302#include "ecore_audio_out_pulse.eo.c" 302#include "ecore_audio_out_pulse.eo.c"
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 d986b67..e24cfeb 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
@@ -43,7 +43,7 @@ static Eina_Bool _write_cb(void *data)
43 /* TODO: Support mixing of multiple inputs */ 43 /* TODO: Support mixing of multiple inputs */
44 in = eina_list_data_get(out_obj->inputs); 44 in = eina_list_data_get(out_obj->inputs);
45 45
46 eo_do(in, bread = ecore_audio_obj_in_read(buf, 4*1024)); 46 bread = ecore_audio_obj_in_read(in, buf, 4*1024);
47 47
48 if (bread == 0) { 48 if (bread == 0) {
49 sf_write_sync(obj->handle); 49 sf_write_sync(obj->handle);
@@ -66,19 +66,19 @@ _ecore_audio_out_sndfile_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Ou
66 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS); 66 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS);
67 Eina_Bool ret2 = EINA_FALSE; 67 Eina_Bool ret2 = EINA_FALSE;
68 68
69 eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_attach(in)); 69 ret2 = ecore_audio_obj_out_input_attach(eo_super(eo_obj, MY_CLASS), in);
70 if (!ret2) 70 if (!ret2)
71 return EINA_FALSE; 71 return EINA_FALSE;
72 72
73 eo_do(in, obj->sfinfo.samplerate = ecore_audio_obj_in_samplerate_get()); 73 obj->sfinfo.samplerate = ecore_audio_obj_in_samplerate_get(in);
74 eo_do(in, obj->sfinfo.channels = ecore_audio_obj_in_channels_get()); 74 obj->sfinfo.channels = ecore_audio_obj_in_channels_get(in);
75 75
76 obj->handle = sf_open(ea_obj->source, SFM_WRITE, &obj->sfinfo); 76 obj->handle = sf_open(ea_obj->source, SFM_WRITE, &obj->sfinfo);
77 77
78 if (!obj->handle) { 78 if (!obj->handle) {
79 eina_stringshare_del(ea_obj->source); 79 eina_stringshare_del(ea_obj->source);
80 ea_obj->source = NULL; 80 ea_obj->source = NULL;
81 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in)); 81 ecore_audio_obj_out_input_detach(eo_super(eo_obj, MY_CLASS), in);
82 return EINA_FALSE; 82 return EINA_FALSE;
83 } 83 }
84 84
@@ -163,9 +163,9 @@ _ecore_audio_out_sndfile_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Out_Sndfile
163{ 163{
164 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS); 164 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS);
165 165
166 eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); 166 eo_obj = eo_constructor(eo_super(eo_obj, MY_CLASS));
167 167
168 eo_do(eo_obj, ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG)); 168 ecore_audio_obj_format_set(eo_obj, ECORE_AUDIO_FORMAT_OGG);
169 169
170 // FIXME: Use writer from output 170 // FIXME: Use writer from output
171 out_obj->need_writer = EINA_FALSE; 171 out_obj->need_writer = EINA_FALSE;
@@ -182,7 +182,7 @@ _ecore_audio_out_sndfile_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Out_Sndfile_
182 if (out_obj->write_idler) 182 if (out_obj->write_idler)
183 ecore_idler_del(out_obj->write_idler); 183 ecore_idler_del(out_obj->write_idler);
184 184
185 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 185 eo_destructor(eo_super(eo_obj, MY_CLASS));
186} 186}
187 187
188#include "ecore_audio_out_sndfile.eo.c" 188#include "ecore_audio_out_sndfile.eo.c"