aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-06-14 13:32:15 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-06-14 13:32:39 +0100
commit1c6aa0c8656f953699680e44005e8ce252855d3b (patch)
treea94cf776688478bc538b4178b3de74ad7d490065
parentecore_audio: Correctly calculate pulse timers (diff)
downloadefl-1c6aa0c8656f953699680e44005e8ce252855d3b.tar.gz
ecore_audio: Support either pulseaudio or alsa in the examples and multisense
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
-rw-r--r--src/examples/ecore/ecore_audio_playback.c16
-rw-r--r--src/lib/edje/edje_multisense.c2
2 files changed, 15 insertions, 3 deletions
diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c
index f34b147904..25f8d23150 100644
--- a/src/examples/ecore/ecore_audio_playback.c
+++ b/src/examples/ecore/ecore_audio_playback.c
@@ -1,6 +1,8 @@
// Compile with:
// gcc -o ecore_audio_playback ecore_audio_playback.c `pkg-config --libs --cflags ecore eina ecore-audio`
+#include <config.h>
+
#include <stdio.h>
#include <string.h>
#include <libgen.h>
@@ -11,9 +13,19 @@
#include <fcntl.h>
#include <Ecore.h>
#include <Ecore_Audio.h>
-#include <ecore_audio_obj_out_pulse.h>
#include <Eina.h>
+#if HAVE_PULSE
+#include <ecore_audio_obj_out_pulse.h>
+#define MY_CLASS ECORE_AUDIO_OBJ_OUT_PULSE_CLASS
+#elif HAVE_ALSA
+#include <ecore_audio_obj_out_alsa.h>
+#define MY_CLASS ECORE_AUDIO_OBJ_OUT_ALSA_CLASS
+#else
+#warning "Need either pulse or alsa for output"
+#define MY_CLASS ECORE_AUDIO_OBJ_OUT_CLASS
+#endif
+
Eo *out = NULL;
double volume = 1;
Eina_List *inputs = NULL;
@@ -308,7 +320,7 @@ main(int argc, const char *argv[])
printf("Start: %s (%0.2fs)\n", name, length);
- out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
+ out = eo_add(MY_CLASS, NULL);
eo_do(out, ecore_audio_obj_out_input_attach(in, &ret));
if (!ret)
printf("Could not attach input %s\n", name);
diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c
index 8bcbbf83c6..16f972bf65 100644
--- a/src/lib/edje/edje_multisense.c
+++ b/src/lib/edje/edje_multisense.c
@@ -13,7 +13,7 @@
#include "ecore_audio_obj_out_alsa.h"
#define MY_CLASS ECORE_AUDIO_OBJ_OUT_ALSA_CLASS
#else
-#error "Multisense needs Pulseaudio suport!"
+#error "Multisense needs Pulseaudio or ALSA suport!"
#endif
#include <sndfile.h>