Drop gst-play-event, as well as gstreamer and pulseaudio dependencies
authorAlex Badea <vamposdecampos@gmail.com>
Sun, 13 Jun 2010 10:15:26 +0000 (13:15 +0300)
committerAlex Badea <vamposdecampos@gmail.com>
Sun, 13 Jun 2010 10:15:26 +0000 (13:15 +0300)
Instead, we can invoke play-sound from osso-af-utils and
set PulseAudio properties via the PULSE_PROP env var.

configure.ac
debian/control
debian/espeaktime-daemon.install
src/Makefile.am
src/espeaktime-now.sh
src/gst-play-event.c [deleted file]

index 95eb48c..57fb79b 100644 (file)
@@ -21,14 +21,6 @@ PKG_CHECK_MODULES(HAL, [hal])
 AC_SUBST(HAL_CFLAGS)
 AC_SUBST(HAL_LIBS)
 
-PKG_CHECK_MODULES(GST, [gstreamer-0.10])
-AC_SUBST(GST_CFLAGS)
-AC_SUBST(GST_LIBS)
-
-PKG_CHECK_MODULES(PA, [pulsecore])
-AC_SUBST(PA_CFLAGS)
-AC_SUBST(PA_LIBS)
-
 AC_OUTPUT([
        Makefile
        src/Makefile
index 9da5c35..c8efdfa 100644 (file)
@@ -3,13 +3,12 @@ Section: user/multimedia
 Priority: extra
 Maintainer: Alex Badea <vamposdecampos@gmail.com>
 Build-Depends: debhelper (>= 5),
- libglib2.0-dev, libdbus-glib-1-dev, libhal-dev, mce-dev (>= 1.8.10),
- pulseaudio-dev, libgstreamer0.10-dev
+ libglib2.0-dev, libdbus-glib-1-dev, libhal-dev, mce-dev (>= 1.8.10)
 Standards-Version: 3.7.2
 
 Package: espeaktime-daemon
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, espeak
+Depends: ${shlibs:Depends}, ${misc:Depends}, espeak, osso-af-utils
 Description: Talking clock based on eSpeak
  This is a simple talking clock daemon.  Activate it by double-pressing
  the power button while the display is locked.
index 816364a..74d5599 100644 (file)
@@ -1,4 +1,3 @@
 usr/bin/espeaktimed
 usr/bin/espeaktime-now.sh
-usr/bin/gst-play-event
 etc/event.d/*
index 0e0d50d..86908a2 100644 (file)
@@ -1,10 +1,6 @@
 bin_SCRIPTS = espeaktime-now.sh
-bin_PROGRAMS = espeaktimed gst-play-event
+bin_PROGRAMS = espeaktimed
 espeaktimed_SOURCES = daemon.c
 espeaktimed_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(MCE_CFLAGS) $(HAL_CFLAGS)
 espeaktimed_LDADD = $(GLIB_LIBS) $(DBUS_LIBS) $(MCE_LIBS) $(HAL_LIBS)
 
-gst_play_event_SOURCES = gst-play-event.c
-gst_play_event_CFLAGS = $(GST_CFLAGS) $(PA_CFLAGS)
-gst_play_event_LDADD = $(GST_LIBS) $(PA_LIBS)
-
index 39db02a..fe3c90a 100755 (executable)
@@ -2,5 +2,8 @@
 
 fname=/tmp/espeaktime-$$.wav
 espeak -w $fname $(date "+%H:%M")
-gst-play-event file://${fname} ringtone-preview
+
+export PULSE_PROP="module-stream-restore.id=x-maemo-applet-profiles event.id=ringtone-preview"
+nice -n -5 play-sound $fname
+
 rm -f $fname
diff --git a/src/gst-play-event.c b/src/gst-play-event.c
deleted file mode 100644 (file)
index 47265c3..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Play media file via gstreamer, optionally setting pulseaudio
- * properties on it.  Inspired by qwerty12's code from:
- * http://talk.maemo.org/showthread.php?t=50266&page=2
- */
-
-#include <gst/gst.h>
-#include <pulse/pulseaudio.h>
-#include <pulse/glib-mainloop.h>
-
-static GMainLoop *loop;
-static GstElement *sound_player, *pulsesink;
-
-static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
-{
-       GMainLoop *loop = data;
-       gchar *debug;
-       GError *error;
-
-       switch (GST_MESSAGE_TYPE(msg)) {
-       case GST_MESSAGE_EOS:
-               g_main_loop_quit(loop);
-               break;
-       case GST_MESSAGE_ERROR:
-               gst_message_parse_error(msg, &error, &debug);
-               g_free (debug);
-
-               g_printerr("Error: %s\n", error->message);
-               g_error_free(error);
-               g_main_loop_quit(loop);
-               break;
-       default:
-               break;
-       }
-
-       return TRUE;
-}
-
-int main(int argc, char *argv[])
-{
-       GstBus *bus;
-       pa_proplist *proplist = NULL;
-
-       if (argc < 2) {
-               g_printerr("Usage: %s <uri> [<event-id>]\n", argv[0]);
-               return 1;
-       }
-
-       gst_init(&argc, &argv);
-       loop = g_main_loop_new(NULL, FALSE);
-
-       if (argc > 2) {
-               proplist = pa_proplist_new();
-               pa_proplist_sets(proplist, PA_PROP_EVENT_ID, argv[2]);
-               pa_proplist_sets(proplist, "module-stream-restore.id", "x-maemo-applet-profiles");
-       }
-
-       sound_player = gst_element_factory_make("playbin2", "eSpeakTime");
-       pulsesink = gst_element_factory_make("pulsesink", NULL);
-       if (proplist)
-               g_object_set(G_OBJECT(pulsesink), "proplist", proplist, NULL);
-
-       bus = gst_pipeline_get_bus(GST_PIPELINE(sound_player));
-       gst_bus_add_watch(bus, bus_call, loop);
-       gst_object_unref(bus);
-
-       g_object_set(sound_player, "audio-sink", pulsesink, "uri", argv[1], NULL);
-       gst_element_set_state(sound_player, GST_STATE_PLAYING);
-
-       g_main_loop_run(loop);
-       return 0;
-}