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

njp at sita.openmoko.org njp at sita.openmoko.org
Mon Aug 6 19:00:48 CEST 2007


Author: njp
Date: 2007-08-06 19:00:47 +0200 (Mon, 06 Aug 2007)
New Revision: 2654

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_eos), (moko_notify_start_ringtone):
	More loop deugging.

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:39:09 UTC (rev 2653)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-08-06 17:00:47 UTC (rev 2654)
@@ -1,5 +1,10 @@
 2007-08-06  Neil J. Patel  <njp at o-hand.com>
 
+	* src/moko-notify.c: (on_bus_eos), (moko_notify_start_ringtone):
+	More loop deugging.
+
+2007-08-06  Neil J. Patel  <njp at o-hand.com>
+
 	* src/moko-notify.c: (on_bus_message):
 	Connect to the right signals!
 

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:39:09 UTC (rev 2653)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c	2007-08-06 17:00:47 UTC (rev 2654)
@@ -58,32 +58,28 @@
 */
 
 
-static gboolean
-on_bus_message (GstBus *bus, GstMessage *message, MokoNotify *notify)
+static void
+on_bus_eos (GstBus *bus, GstMessage *message, MokoNotify *notify)
 {
   MokoNotifyPrivate *priv;
   
-  g_return_val_if_fail (MOKO_IS_NOTIFY (notify), TRUE);
-  g_return_val_if_fail (GST_IS_ELEMENT (notify->priv->bin), TRUE);
+  g_return_if_fail (MOKO_IS_NOTIFY (notify));
+  g_return_if_fail (GST_IS_ELEMENT (notify->priv->bin));
   priv = notify->priv;
 
   g_print (".");
-
-  if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_EOS)
-    return TRUE;
-   
   /* Rewind and play again */
   gst_element_set_state (priv->bin, GST_STATE_PAUSED);
 
   /* Seek to 0 */
   if (!gst_element_seek_simple (priv->bin, GST_FORMAT_TIME, 0, 0))
     g_error ("Seek error\n");
-    return TRUE;
+  return ;
 
   gst_element_set_state (priv->bin, GST_STATE_PLAYING);
  
   g_print ("Audio finished\n");
-}
+ }
 
 static void
 moko_notify_start_ringtone (MokoNotify *notify)
@@ -113,10 +109,13 @@
   }
   priv->bin = bin;
 
-  /* Connect to eos signal to repeat the ringtone */
+  g_signal_connect (gst_element_get_bus (bin), "message::eos",
+                    G_CALLBACK (on_bus_eos), (gpointer)notify);
+
+  /* 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 */
   gst_element_set_state (bin, GST_STATE_PLAYING);
 





More information about the commitlog mailing list