r2652 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src

njp at sita.openmoko.org njp at sita.openmoko.org
Mon Aug 6 18:33:25 CEST 2007


Author: njp
Date: 2007-08-06 18:33:24 +0200 (Mon, 06 Aug 2007)
New Revision: 2652

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
Log:
2007-08-06  Neil J. Patel  <njp at o-hand.com>

	* src/moko-notify.c: (on_bus_message),
	(moko_notify_start_ringtone):
	Some more looping fixes.

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-08-06 16:03:45 UTC (rev 2651)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-08-06 16:33:24 UTC (rev 2652)
@@ -1,5 +1,11 @@
 2007-08-06  Neil J. Patel  <njp at o-hand.com>
 
+	* src/moko-notify.c: (on_bus_message),
+	(moko_notify_start_ringtone):
+	Some more looping fixes.
+
+2007-08-06  Neil J. Patel  <njp at o-hand.com>
+
 	* src/moko-notify.c: (on_bin_eos), (moko_notify_start_ringtone):
 	Added intial support for looping the ringtone.
 

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c	2007-08-06 16:03:45 UTC (rev 2651)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c	2007-08-06 16:33:24 UTC (rev 2652)
@@ -59,14 +59,17 @@
 
 
 static void
-on_bin_eos (GstElement *element, MokoNotify *notify)
+on_bus_message (GstBus *bus, GstMessage *message, MokoNotify *notify)
 {
   MokoNotifyPrivate *priv;
   
   g_return_if_fail (MOKO_IS_NOTIFY (notify));
   g_return_if_fail (GST_IS_ELEMENT (notify->priv->bin));
   priv = notify->priv;
-  
+
+  if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_EOS)
+    return;
+   
   /* Rewind and play again */
   gst_element_set_state (priv->bin, GST_STATE_PAUSED);
 
@@ -108,9 +111,11 @@
   }
   priv->bin = bin;
 
+  /* Connect to eos signal to repeat the ringtone */
+  gst_bus_add_watch (gst_element_get_bus (bin), 
+                     (GstBusFunc)on_bus_message, (gpointer)notify);
+
   /* Start playing */
-  g_signal_connect (G_OBJECT (bin), "eos",
-                    G_CALLBACK (on_bin_eos), (gpointer)notify);
   gst_element_set_state (bin, GST_STATE_PLAYING);
 
   g_free (pipeline);





More information about the commitlog mailing list