summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore_audio.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c222
1 files changed, 111 insertions, 111 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index fe2f325..0240903 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -34,7 +34,7 @@ static Eina_Bool _finished_cb(void *data EINA_UNUSED, const Eo_Event *event EINA
34 34
35static Eina_Bool _looped_cb(void *data EINA_UNUSED, const Eo_Event *event) 35static Eina_Bool _looped_cb(void *data EINA_UNUSED, const Eo_Event *event)
36{ 36{
37 eo_do(event->obj, ecore_audio_obj_in_looped_set(EINA_FALSE)); 37 ecore_audio_obj_in_looped_set(event->obj, EINA_FALSE);
38 38
39 return EINA_TRUE; 39 return EINA_TRUE;
40} 40}
@@ -47,10 +47,10 @@ _seek_vol(void *data)
47 Eo *in = data; 47 Eo *in = data;
48 Eo *out = NULL; 48 Eo *out = NULL;
49 49
50 eo_do(in, out = ecore_audio_obj_in_output_get()); 50 out = ecore_audio_obj_in_output_get(in);
51 51
52 eo_do(out, ecore_audio_obj_volume_set(0.4)); 52 ecore_audio_obj_volume_set(out, 0.4);
53 eo_do(in, len = ecore_audio_obj_in_seek(-0.3, SEEK_END)); 53 len = ecore_audio_obj_in_seek(in, -0.3, SEEK_END);
54 fail_if(len < 0); 54 fail_if(len < 0);
55 55
56 return EINA_FALSE; 56 return EINA_FALSE;
@@ -65,8 +65,8 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
65 in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); 65 in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
66 fail_if(!in); 66 fail_if(!in);
67 67
68 eo_do(in, ecore_audio_obj_name_set("modem.wav")); 68 ecore_audio_obj_name_set(in, "modem.wav");
69 eo_do(in, ret = ecore_audio_obj_source_set(TESTS_SRC_DIR"/modem.wav")); 69 ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/modem.wav");
70 fail_if(!ret); 70 fail_if(!ret);
71 71
72 out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL); 72 out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL);
@@ -74,10 +74,10 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
74 74
75 ecore_timer_add(0.3, _seek_vol, in); 75 ecore_timer_add(0.3, _seek_vol, in);
76 76
77 eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL)); 77 eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL);
78 eo_do(out, eo_event_callback_add(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _failed_cb, &pulse_context_failed)); 78 eo_event_callback_add(out, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _failed_cb, &pulse_context_failed);
79 79
80 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 80 ret = ecore_audio_obj_out_input_attach(out, in);
81 fail_if(!ret); 81 fail_if(!ret);
82 82
83 ecore_main_loop_begin(); 83 ecore_main_loop_begin();
@@ -114,17 +114,17 @@ START_TEST(ecore_test_ecore_audio_cleanup)
114 114
115 in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); 115 in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL);
116 fail_if(!in); 116 fail_if(!in);
117 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq)); 117 eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq);
118 eo_do(in, ecore_audio_obj_in_length_set(2)); 118 ecore_audio_obj_in_length_set(in, 2);
119 119
120 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); 120 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
121 fail_if(!out); 121 fail_if(!out);
122 eo_do(out, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG)); 122 ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_OGG);
123 fail_if(!ret); 123 fail_if(!ret);
124 eo_do(out, ret = ecore_audio_obj_source_set(TESTS_BUILD_DIR"/tmp.ogg")); 124 ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.ogg");
125 fail_if(!ret); 125 fail_if(!ret);
126 126
127 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 127 ret = ecore_audio_obj_out_input_attach(out, in);
128 fail_if(!ret); 128 fail_if(!ret);
129 129
130 ecore_idler_add(_idle_del, in); 130 ecore_idler_add(_idle_del, in);
@@ -146,75 +146,75 @@ START_TEST(ecore_test_ecore_audio_obj_tone)
146 in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); 146 in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL);
147 fail_if(!in); 147 fail_if(!in);
148 148
149 eo_do(in, ecore_audio_obj_name_set("tone")); 149 ecore_audio_obj_name_set(in, "tone");
150 150
151 eo_do(in, channel = ecore_audio_obj_in_channels_get()); 151 channel = ecore_audio_obj_in_channels_get(in);
152 fail_if(channel != 1); 152 fail_if(channel != 1);
153 eo_do(in, rate = ecore_audio_obj_in_samplerate_get()); 153 rate = ecore_audio_obj_in_samplerate_get(in);
154 fail_if(rate != 44100); 154 fail_if(rate != 44100);
155 eo_do(in, len = ecore_audio_obj_in_length_get()); 155 len = ecore_audio_obj_in_length_get(in);
156 fail_if(len != 1); 156 fail_if(len != 1);
157 157
158 eo_do(in, ecore_audio_obj_in_length_set(2.5)); 158 ecore_audio_obj_in_length_set(in, 2.5);
159 eo_do(in, len = ecore_audio_obj_in_length_get()); 159 len = ecore_audio_obj_in_length_get(in);
160 fail_if(len != 2.5); 160 fail_if(len != 2.5);
161 161
162 eo_do(in, ecore_audio_obj_in_looped_set(EINA_TRUE)); 162 ecore_audio_obj_in_looped_set(in, EINA_TRUE);
163 163
164 eo_do(in, len = ecore_audio_obj_in_remaining_get()); 164 len = ecore_audio_obj_in_remaining_get(in);
165 fail_if(len != 2.5); 165 fail_if(len != 2.5);
166 166
167 eo_do(in, freq = (intptr_t) eo_key_data_get(ECORE_AUDIO_ATTR_TONE_FREQ)); 167 freq = (intptr_t) eo_key_data_get(in, ECORE_AUDIO_ATTR_TONE_FREQ);
168 fail_if(freq != 1000); 168 fail_if(freq != 1000);
169 169
170 freq = 2000; 170 freq = 2000;
171 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq)); 171 eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq);
172 172
173 eo_do(in, freq = (intptr_t) eo_key_data_get(ECORE_AUDIO_ATTR_TONE_FREQ)); 173 freq = (intptr_t) eo_key_data_get(in, ECORE_AUDIO_ATTR_TONE_FREQ);
174 fail_if(freq != 2000); 174 fail_if(freq != 2000);
175 175
176 eo_do(in, eo_key_data_set("foo", "bar")); 176 eo_key_data_set(in, "foo", "bar");
177 eo_do(in, tmp = eo_key_data_get("foo")); 177 tmp = eo_key_data_get(in, "foo");
178 ck_assert_str_eq(tmp, "bar"); 178 ck_assert_str_eq(tmp, "bar");
179 179
180 eo_do(in, len = ecore_audio_obj_in_seek(5.0, SEEK_SET)); 180 len = ecore_audio_obj_in_seek(in, 5.0, SEEK_SET);
181 fail_if(len != -1); 181 fail_if(len != -1);
182 182
183 eo_do(in, len = ecore_audio_obj_in_seek(1.0, 42)); 183 len = ecore_audio_obj_in_seek(in, 1.0, 42);
184 fail_if(len != -1); 184 fail_if(len != -1);
185 185
186 eo_do(in, len = ecore_audio_obj_in_seek(1.0, SEEK_SET)); 186 len = ecore_audio_obj_in_seek(in, 1.0, SEEK_SET);
187 fail_if(len != 1.0); 187 fail_if(len != 1.0);
188 188
189 eo_do(in, len = ecore_audio_obj_in_remaining_get()); 189 len = ecore_audio_obj_in_remaining_get(in);
190 fail_if(len != 1.5); 190 fail_if(len != 1.5);
191 191
192 eo_do(in, len = ecore_audio_obj_in_seek(1.0, SEEK_CUR)); 192 len = ecore_audio_obj_in_seek(in, 1.0, SEEK_CUR);
193 fail_if(len != 2.0); 193 fail_if(len != 2.0);
194 194
195 eo_do(in, len = ecore_audio_obj_in_remaining_get()); 195 len = ecore_audio_obj_in_remaining_get(in);
196 fail_if(len != 0.5); 196 fail_if(len != 0.5);
197 197
198 eo_do(in, len = ecore_audio_obj_in_seek(-1.0, SEEK_END)); 198 len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END);
199 fail_if(len != 1.5); 199 fail_if(len != 1.5);
200 200
201 eo_do(in, len = ecore_audio_obj_in_remaining_get()); 201 len = ecore_audio_obj_in_remaining_get(in);
202 fail_if(len != 1.0); 202 fail_if(len != 1.0);
203 203
204 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); 204 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
205 fail_if(!out); 205 fail_if(!out);
206 206
207 eo_do(out, ecore_audio_obj_name_set("tmp.wav")); 207 ecore_audio_obj_name_set(out, "tmp.wav");
208 eo_do(out, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_WAV)); 208 ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_WAV);
209 fail_if(!ret); 209 fail_if(!ret);
210 eo_do(out, ret = ecore_audio_obj_source_set(TESTS_BUILD_DIR"/tmp.wav")); 210 ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.wav");
211 fail_if(!ret); 211 fail_if(!ret);
212 212
213 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 213 ret = ecore_audio_obj_out_input_attach(out, in);
214 fail_if(!ret); 214 fail_if(!ret);
215 215
216 eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_LOOPED, _looped_cb, NULL)); 216 eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_LOOPED, _looped_cb, NULL);
217 eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL)); 217 eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL);
218 218
219 ecore_main_loop_begin(); 219 ecore_main_loop_begin();
220 220
@@ -238,73 +238,73 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile)
238 in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); 238 in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
239 fail_if(!in); 239 fail_if(!in);
240 240
241 eo_do(in, fmt = ecore_audio_obj_format_get()); 241 fmt = ecore_audio_obj_format_get(in);
242 fail_if(fmt != ECORE_AUDIO_FORMAT_AUTO); 242 fail_if(fmt != ECORE_AUDIO_FORMAT_AUTO);
243 243
244 eo_do(in, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_FLAC)); 244 ret = ecore_audio_obj_format_set(in, ECORE_AUDIO_FORMAT_FLAC);
245 fail_if(!ret); 245 fail_if(!ret);
246 246
247 eo_do(in, fmt = ecore_audio_obj_format_get()); 247 fmt = ecore_audio_obj_format_get(in);
248 fail_if(fmt != ECORE_AUDIO_FORMAT_FLAC); 248 fail_if(fmt != ECORE_AUDIO_FORMAT_FLAC);
249 249
250 eo_do(in, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_AUTO)); 250 ret = ecore_audio_obj_format_set(in, ECORE_AUDIO_FORMAT_AUTO);
251 fail_if(!ret); 251 fail_if(!ret);
252 252
253 eo_do(in, ecore_audio_obj_name_set("sms.ogg")); 253 ecore_audio_obj_name_set(in, "sms.ogg");
254 eo_do(in, ret = ecore_audio_obj_source_set(TESTS_SRC_DIR"/sms.ogg")); 254 ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/sms.ogg");
255 fail_if(!ret); 255 fail_if(!ret);
256 256
257 eo_do(in, src = ecore_audio_obj_source_get()); 257 src = ecore_audio_obj_source_get(in);
258 ck_assert_str_eq(src, TESTS_SRC_DIR"/sms.ogg"); 258 ck_assert_str_eq(src, TESTS_SRC_DIR"/sms.ogg");
259 259
260 eo_do(in, fmt = ecore_audio_obj_format_get()); 260 fmt = ecore_audio_obj_format_get(in);
261 fail_if(fmt != ECORE_AUDIO_FORMAT_OGG); 261 fail_if(fmt != ECORE_AUDIO_FORMAT_OGG);
262 262
263 eo_do(in, channel = ecore_audio_obj_in_channels_get()); 263 channel = ecore_audio_obj_in_channels_get(in);
264 fail_if(channel != 2); 264 fail_if(channel != 2);
265 eo_do(in, rate = ecore_audio_obj_in_samplerate_get()); 265 rate = ecore_audio_obj_in_samplerate_get(in);
266 fail_if(rate != 44100); 266 fail_if(rate != 44100);
267 eo_do(in, len = ecore_audio_obj_in_length_get()); 267 len = ecore_audio_obj_in_length_get(in);
268 fail_if(len == 0); 268 fail_if(len == 0);
269 eo_do(in, rem = ecore_audio_obj_in_remaining_get()); 269 rem = ecore_audio_obj_in_remaining_get(in);
270 fail_if(len != rem); 270 fail_if(len != rem);
271 271
272 eo_do(in, fmt = ecore_audio_obj_format_get()); 272 fmt = ecore_audio_obj_format_get(in);
273 fail_if(fmt != ECORE_AUDIO_FORMAT_OGG); 273 fail_if(fmt != ECORE_AUDIO_FORMAT_OGG);
274 274
275 eo_do(in, len = ecore_audio_obj_in_seek(0.5, SEEK_SET)); 275 len = ecore_audio_obj_in_seek(in, 0.5, SEEK_SET);
276 fail_if(len != 0.5); 276 fail_if(len != 0.5);
277 277
278 eo_do(in, len = ecore_audio_obj_in_seek(0.5, SEEK_CUR)); 278 len = ecore_audio_obj_in_seek(in, 0.5, SEEK_CUR);
279 fail_if(len != 1.0); 279 fail_if(len != 1.0);
280 280
281 eo_do(in, len = ecore_audio_obj_in_seek(-1.0, SEEK_END)); 281 len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END);
282 fail_if(fabs(rem - 1 - len) > 0.1); 282 fail_if(fabs(rem - 1 - len) > 0.1);
283 283
284 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); 284 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
285 fail_if(!out); 285 fail_if(!out);
286 286
287 eo_do(out, ecore_audio_obj_name_set("tmp.wav")); 287 ecore_audio_obj_name_set(out, "tmp.wav");
288 eo_do(out, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_WAV)); 288 ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_WAV);
289 fail_if(!ret); 289 fail_if(!ret);
290 290
291 eo_do(out, fmt = ecore_audio_obj_format_get()); 291 fmt = ecore_audio_obj_format_get(out);
292 fail_if(fmt != ECORE_AUDIO_FORMAT_WAV); 292 fail_if(fmt != ECORE_AUDIO_FORMAT_WAV);
293 293
294 294
295// eo_do(out, ret = ecore_audio_obj_source_set("/tmp/file/does/not/exist/hopefully.wav")); 295// ret = ecore_audio_obj_source_set(out, "/tmp/file/does/not/exist/hopefully.wav");
296// fail_if(ret); 296// fail_if(ret);
297 297
298 eo_do(out, ret = ecore_audio_obj_source_set(TESTS_BUILD_DIR"/tmp.wav")); 298 ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.wav");
299 fail_if(!ret); 299 fail_if(!ret);
300 300
301 eo_do(out, src = ecore_audio_obj_source_get()); 301 src = ecore_audio_obj_source_get(out);
302 ck_assert_str_eq(src, TESTS_BUILD_DIR"/tmp.wav"); 302 ck_assert_str_eq(src, TESTS_BUILD_DIR"/tmp.wav");
303 303
304 eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); 304 ret = ecore_audio_obj_out_input_attach(out, in);
305 fail_if(!ret); 305 fail_if(!ret);
306 306
307 eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL)); 307 eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL);
308 308
309 ecore_main_loop_begin(); 309 ecore_main_loop_begin();
310 310
@@ -330,47 +330,47 @@ START_TEST(ecore_test_ecore_audio_obj_in_out)
330 fail_if(!in2); 330 fail_if(!in2);
331 fail_if(!out); 331 fail_if(!out);
332 332
333 eo_do(in, out2 = ecore_audio_obj_in_output_get()); 333 out2 = ecore_audio_obj_in_output_get(in);
334 334
335 fail_if(out2); 335 fail_if(out2);
336 336
337 eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); 337 in3 = ecore_audio_obj_out_inputs_get(out);
338 338
339 fail_if(eina_list_count(in3) != 0); 339 fail_if(eina_list_count(in3) != 0);
340 340
341 eo_do(out, attached = ecore_audio_obj_out_input_attach(in)); 341 attached = ecore_audio_obj_out_input_attach(out, in);
342 fail_if(!attached); 342 fail_if(!attached);
343 343
344 eo_do(out, attached = ecore_audio_obj_out_input_attach(in)); 344 attached = ecore_audio_obj_out_input_attach(out, in);
345 fail_if(attached); 345 fail_if(attached);
346 346
347 eo_do(in, out2 = ecore_audio_obj_in_output_get()); 347 out2 = ecore_audio_obj_in_output_get(in);
348 348
349 fail_if(out2 != out); 349 fail_if(out2 != out);
350 350
351 eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); 351 in3 = ecore_audio_obj_out_inputs_get(out);
352 352
353 fail_if(eina_list_count(in3) != 1); 353 fail_if(eina_list_count(in3) != 1);
354 fail_if(eina_list_data_get(in3) != in); 354 fail_if(eina_list_data_get(in3) != in);
355 355
356 eo_do(out, attached = ecore_audio_obj_out_input_attach(in2)); 356 attached = ecore_audio_obj_out_input_attach(out, in2);
357 fail_if(!attached); 357 fail_if(!attached);
358 358
359 eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); 359 in3 = ecore_audio_obj_out_inputs_get(out);
360 360
361 fail_if(eina_list_count(in3) != 2); 361 fail_if(eina_list_count(in3) != 2);
362 fail_if(eina_list_data_get(in3) != in); 362 fail_if(eina_list_data_get(in3) != in);
363 363
364 eo_del(in2); 364 eo_del(in2);
365 365
366 eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); 366 in3 = ecore_audio_obj_out_inputs_get(out);
367 367
368 fail_if(eina_list_count(in3) != 1); 368 fail_if(eina_list_count(in3) != 1);
369 fail_if(eina_list_data_get(in3) != in); 369 fail_if(eina_list_data_get(in3) != in);
370 370
371 eo_del(out); 371 eo_del(out);
372 372
373 eo_do(in, out2 = ecore_audio_obj_in_output_get()); 373 out2 = ecore_audio_obj_in_output_get(in);
374 374
375 fail_if(out2); 375 fail_if(out2);
376 376
@@ -426,10 +426,10 @@ START_TEST(ecore_test_ecore_audio_obj_vio)
426 out = eo_add(ECORE_AUDIO_OUT_CLASS, NULL); 426 out = eo_add(ECORE_AUDIO_OUT_CLASS, NULL);
427 fail_if(!out); 427 fail_if(!out);
428 428
429 eo_do(in, ecore_audio_obj_vio_set(&in_vio, NULL, NULL)); 429 ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL);
430 eo_do(out, ecore_audio_obj_vio_set(&out_vio, NULL, NULL)); 430 ecore_audio_obj_vio_set(out, &out_vio, NULL, NULL);
431 431
432 eo_do(out, ecore_audio_obj_out_input_attach(in)); 432 ecore_audio_obj_out_input_attach(out, in);
433 433
434 ecore_main_loop_begin(); 434 ecore_main_loop_begin();
435 435
@@ -462,71 +462,71 @@ START_TEST(ecore_test_ecore_audio_obj_in)
462 462
463 fail_if(!in); 463 fail_if(!in);
464 464
465 eo_do(in, ecore_audio_obj_vio_set(&vio, &freed, _myfree)); 465 ecore_audio_obj_vio_set(in, &vio, &freed, _myfree);
466 fail_if(freed); 466 fail_if(freed);
467 467
468 eo_do(in, ecore_audio_obj_vio_set(NULL, NULL, NULL)); 468 ecore_audio_obj_vio_set(in, NULL, NULL, NULL);
469 fail_if(!freed); 469 fail_if(!freed);
470 470
471 eo_do(in, speed = ecore_audio_obj_in_speed_get()); 471 speed = ecore_audio_obj_in_speed_get(in);
472 fail_if(speed != 1.0); 472 fail_if(speed != 1.0);
473 473
474 eo_do(in, ecore_audio_obj_in_speed_set(2.5)); 474 ecore_audio_obj_in_speed_set(in, 2.5);
475 475
476 eo_do(in, speed = ecore_audio_obj_in_speed_get()); 476 speed = ecore_audio_obj_in_speed_get(in);
477 fail_if(speed != 2.5); 477 fail_if(speed != 2.5);
478 478
479 eo_do(in, ecore_audio_obj_in_speed_set(0)); 479 ecore_audio_obj_in_speed_set(in, 0);
480 480
481 eo_do(in, speed = ecore_audio_obj_in_speed_get()); 481 speed = ecore_audio_obj_in_speed_get(in);
482 fail_if(speed != 0.2); 482 fail_if(speed != 0.2);
483 483
484 eo_do(in, ecore_audio_obj_in_speed_set(10)); 484 ecore_audio_obj_in_speed_set(in, 10);
485 485
486 eo_do(in, speed = ecore_audio_obj_in_speed_get()); 486 speed = ecore_audio_obj_in_speed_get(in);
487 fail_if(speed != 5.0); 487 fail_if(speed != 5.0);
488 488
489 eo_do(in, samplerate = ecore_audio_obj_in_samplerate_get()); 489 samplerate = ecore_audio_obj_in_samplerate_get(in);
490 fail_if(samplerate != 0); 490 fail_if(samplerate != 0);
491 491
492 eo_do(in, ecore_audio_obj_in_samplerate_set(1234)); 492 ecore_audio_obj_in_samplerate_set(in, 1234);
493 493
494 eo_do(in, samplerate = ecore_audio_obj_in_samplerate_get()); 494 samplerate = ecore_audio_obj_in_samplerate_get(in);
495 fail_if(samplerate != 1234); 495 fail_if(samplerate != 1234);
496 496
497 eo_do(in, channels = ecore_audio_obj_in_channels_get()); 497 channels = ecore_audio_obj_in_channels_get(in);
498 fail_if(channels != 0); 498 fail_if(channels != 0);
499 499
500 eo_do(in, ecore_audio_obj_in_channels_set(2)); 500 ecore_audio_obj_in_channels_set(in, 2);
501 501
502 eo_do(in, channels = ecore_audio_obj_in_channels_get()); 502 channels = ecore_audio_obj_in_channels_get(in);
503 fail_if(channels != 2); 503 fail_if(channels != 2);
504 504
505 eo_do(in, looped = ecore_audio_obj_in_looped_get()); 505 looped = ecore_audio_obj_in_looped_get(in);
506 fail_if(looped); 506 fail_if(looped);
507 507
508 eo_do(in, ecore_audio_obj_in_looped_set(EINA_TRUE)); 508 ecore_audio_obj_in_looped_set(in, EINA_TRUE);
509 509
510 eo_do(in, looped = ecore_audio_obj_in_looped_get()); 510 looped = ecore_audio_obj_in_looped_get(in);
511 fail_if(!looped); 511 fail_if(!looped);
512 512
513 eo_do(in, length = ecore_audio_obj_in_length_get()); 513 length = ecore_audio_obj_in_length_get(in);
514 fail_if(length != 0); 514 fail_if(length != 0);
515 515
516 eo_do(in, length = ecore_audio_obj_in_remaining_get()); 516 length = ecore_audio_obj_in_remaining_get(in);
517 fail_if(length != -1); 517 fail_if(length != -1);
518 518
519 memset(buf, 0xaa, 10); 519 memset(buf, 0xaa, 10);
520 eo_do(in, read = ecore_audio_obj_in_read(buf, 10)); 520 read = ecore_audio_obj_in_read(in, buf, 10);
521 fail_if(read != 0); 521 fail_if(read != 0);
522 522
523 for (i=0; i<10; i++) { 523 for (i=0; i<10; i++) {
524 fail_if(buf[i] != 0xaa); 524 fail_if(buf[i] != 0xaa);
525 } 525 }
526 526
527 eo_do(in, ecore_audio_obj_paused_set(EINA_TRUE)); 527 ecore_audio_obj_paused_set(in, EINA_TRUE);
528 528
529 eo_do(in, read = ecore_audio_obj_in_read(buf, 10)); 529 read = ecore_audio_obj_in_read(in, buf, 10);
530 fail_if(read != 10); 530 fail_if(read != 10);
531 531
532 for (i=0; i<10; i++) { 532 for (i=0; i<10; i++) {
@@ -556,29 +556,29 @@ START_TEST(ecore_test_ecore_audio_obj)
556 556
557 fail_if(!obj); 557 fail_if(!obj);
558 558
559 eo_do(obj, name = ecore_audio_obj_name_get()); 559 name = ecore_audio_obj_name_get(obj);
560 560
561 fail_if(name); 561 fail_if(name);
562 562
563 eo_do(obj, ecore_audio_obj_name_set("In1")); 563 ecore_audio_obj_name_set(obj, "In1");
564 eo_do(obj, name = ecore_audio_obj_name_get()); 564 name = ecore_audio_obj_name_get(obj);
565 565
566 ck_assert_str_eq(name, "In1"); 566 ck_assert_str_eq(name, "In1");
567 567
568 eo_do(obj, ecore_audio_obj_name_get()); 568 ecore_audio_obj_name_get(obj);
569 569
570 eo_do(obj, paused = ecore_audio_obj_paused_get()); 570 paused = ecore_audio_obj_paused_get(obj);
571 fail_if(paused); 571 fail_if(paused);
572 572
573 eo_do(obj, ecore_audio_obj_paused_set(EINA_TRUE)); 573 ecore_audio_obj_paused_set(obj, EINA_TRUE);
574 eo_do(obj, paused = ecore_audio_obj_paused_get()); 574 paused = ecore_audio_obj_paused_get(obj);
575 fail_if(!paused); 575 fail_if(!paused);
576 576
577 eo_do(obj, volume = ecore_audio_obj_volume_get()); 577 volume = ecore_audio_obj_volume_get(obj);
578 fail_if(volume != 1.0); 578 fail_if(volume != 1.0);
579 579
580 eo_do(obj, ecore_audio_obj_volume_set(0.5)); 580 ecore_audio_obj_volume_set(obj, 0.5);
581 eo_do(obj, volume = ecore_audio_obj_volume_get()); 581 volume = ecore_audio_obj_volume_get(obj);
582 fail_if(volume != 0.5); 582 fail_if(volume != 0.5);
583 583
584 eo_del(obj); 584 eo_del(obj);