summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_audio.c
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-29 19:38:40 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-29 19:57:16 +0100
commited011b10cc9ff87b19a7c17c43f4ce22c57c135a (patch)
treecfad27d25dac0c47ef01bcd4eb12c3e4d38d846b /src/tests/ecore/ecore_test_ecore_audio.c
parentbafa8f0ae627706d639d8506316fc3824c387ef4 (diff)
ecore_audio: Test pulseaudio output if it is enabled
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index ec52973..75c5bb0 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -2,6 +2,8 @@
2#include <config.h> 2#include <config.h>
3#endif 3#endif
4 4
5#include <math.h>
6
5#include <Ecore_Audio.h> 7#include <Ecore_Audio.h>
6#include <Ecore_File.h> 8#include <Ecore_File.h>
7 9
@@ -317,6 +319,50 @@ static Eina_Bool _looped_cb(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Desc
317 return EINA_TRUE; 319 return EINA_TRUE;
318} 320}
319 321
322#ifdef HAVE_PULSE
323static Eina_Bool
324_seek_vol(void *data)
325{
326 double len;
327 Eo *in = data;
328
329 eo_do(in, ecore_audio_obj_volume_set(0.4));
330 eo_do(in, ecore_audio_obj_in_seek(-0.3, SEEK_END, &len));
331 fail_if(len < 0);
332
333 return EINA_FALSE;
334}
335
336START_TEST(ecore_test_ecore_audio_obj_pulse)
337{
338 Eo *in, *out;
339 Eina_Bool ret;
340
341 in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
342 fail_if(!in);
343
344 eo_do(in, ecore_audio_obj_name_set("modem.wav"));
345 eo_do(in, ecore_audio_obj_source_set(TESTS_SRC_DIR"/modem.wav", &ret));
346 fail_if(!ret);
347
348 out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
349 fail_if(!out);
350
351 ecore_timer_add(0.3, _seek_vol, in);
352
353 eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _finished_cb, NULL));
354
355 eo_do(out, ecore_audio_obj_out_input_attach(in, &ret));
356 fail_if(!ret);
357
358 ecore_main_loop_begin();
359
360 eo_del(out);
361 eo_del(in);
362}
363END_TEST
364#endif
365
320START_TEST(ecore_test_ecore_audio_obj_tone) 366START_TEST(ecore_test_ecore_audio_obj_tone)
321{ 367{
322 Eo *in, *out; 368 Eo *in, *out;
@@ -747,7 +793,7 @@ ecore_test_ecore_audio(TCase *tc)
747#ifdef HAVE_SNDFILE 793#ifdef HAVE_SNDFILE
748 tcase_add_test(tc, ecore_test_ecore_audio_obj_sndfile); 794 tcase_add_test(tc, ecore_test_ecore_audio_obj_sndfile);
749#endif 795#endif
750#ifdef HAVE_PUSE 796#ifdef HAVE_PULSE
751 tcase_add_test(tc, ecore_test_ecore_audio_obj_pulse); 797 tcase_add_test(tc, ecore_test_ecore_audio_obj_pulse);
752#endif 798#endif
753 799