Send commitlog mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r2644 - in
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2: .
src ([EMAIL PROTECTED])
2. r2645 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
3. r2646 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
4. r2647 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
5. r2648 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
6. r2649 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . data
src ([EMAIL PROTECTED])
--- Begin Message ---
Author: zecke
Date: 2007-08-06 12:59:30 +0200 (Mon, 06 Aug 2007)
New Revision: 2644
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c
Log:
2007-08-06 Holger Hans Peter Freyther <[EMAIL PROTECTED]>
Blind compile fix for GNU libc.
* src/feed-data.c:
Modified: trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
2007-08-06 10:51:19 UTC (rev 2643)
+++ trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/ChangeLog
2007-08-06 10:59:30 UTC (rev 2644)
@@ -1,5 +1,11 @@
2007-08-06 Holger Hans Peter Freyther <[EMAIL PROTECTED]>
+ Blind compile fix for GNU libc.
+
+ * src/feed-data.c:
+
+2007-08-06 Holger Hans Peter Freyther <[EMAIL PROTECTED]>
+
Remove old feed posts from the model only once the new posts
were fetched and parsed.
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c
2007-08-06 10:51:19 UTC (rev 2643)
+++
trunk/src/target/OM-2007.2/applications/openmoko-feedreader2/src/feed-data.c
2007-08-06 10:59:30 UTC (rev 2644)
@@ -24,6 +24,8 @@
* Current Version: $Rev$ ($Date$) [$Author$]
*/
+#define _GNU_SOURCE
+
#include "feed-data.h"
#include "feed-configuration.h"
#include "rfcdate.h"
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-06 14:46:07 +0200 (Mon, 06 Aug 2007)
New Revision: 2645
Added:
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.h
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/configure.ac
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/Makefile.am
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer-main.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
Log:
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
* configure.ac:
* src/Makefile.am:
* src/dialer-main.c: (main):
* src/moko-contacts.c: (moko_contacts_lookup):
* src/moko-dialer.c: (moko_dialer_rejected),
(on_talking_accept_call), (on_incoming_call), (on_incoming_clip),
(register_network_cb), (moko_dialer_init):
* src/moko-notify.c: (moko_notify_start_vibrate),
(moko_notify_stop_vibrate), (moko_notify_start),
(moko_notify_stop), (moko_notify_dispose), (moko_notify_finalize),
(moko_notify_class_init), (moko_notify_init), (moko_notify_new):
* src/moko-notify.h:
Added a MokoNotify object, which will deal with user notification of
incoming calls.
Implemented a simple vibration notifcation for incoming calls.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 12:46:07 UTC (rev 2645)
@@ -1,3 +1,21 @@
+2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+
+ * configure.ac:
+ * src/Makefile.am:
+ * src/dialer-main.c: (main):
+ * src/moko-contacts.c: (moko_contacts_lookup):
+ * src/moko-dialer.c: (moko_dialer_rejected),
+ (on_talking_accept_call), (on_incoming_call), (on_incoming_clip),
+ (register_network_cb), (moko_dialer_init):
+ * src/moko-notify.c: (moko_notify_start_vibrate),
+ (moko_notify_stop_vibrate), (moko_notify_start),
+ (moko_notify_stop), (moko_notify_dispose), (moko_notify_finalize),
+ (moko_notify_class_init), (moko_notify_init), (moko_notify_new):
+ * src/moko-notify.h:
+ Added a MokoNotify object, which will deal with user notification of
+ incoming calls.
+ Implemented a simple vibration notifcation for incoming calls.
+
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-contacts.c: (moko_contacts_lookup):
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/configure.ac
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/configure.ac
2007-08-06 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/configure.ac
2007-08-06 12:46:07 UTC (rev 2645)
@@ -17,7 +17,8 @@
libebook-1.2
libmokojournal2
libmokogsmd2
- libmokoui2)
+ libmokoui2
+ gstreamer-0.10)
old_cflags=$CFLAGS
CFLAGS=$DIALER_CFLAGS
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/Makefile.am
2007-08-06 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/Makefile.am
2007-08-06 12:46:07 UTC (rev 2645)
@@ -22,6 +22,8 @@
moko-history.h \
moko-keypad.c \
moko-keypad.h \
+ moko-notify.c \
+ moko-notify.h \
moko-talking.c \
moko-talking.h
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer-main.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer-main.c
2007-08-06 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer-main.c
2007-08-06 12:46:07 UTC (rev 2645)
@@ -16,6 +16,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
+#include <gst/gst.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>
@@ -106,6 +107,7 @@
/* Initialize Threading & GTK+ */
gtk_init (&argc, &argv);
+ gst_init (&argc, &argv);
moko_stock_register ();
/* Try and setup our DBus service */
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-06 10:59:30 UTC (rev 2644)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-06 12:46:07 UTC (rev 2645)
@@ -89,7 +89,7 @@
entry = g_hash_table_lookup (priv->prefixes, number);
- if (entry && !GDK_IS_PIXBUF (entry->contact->photo))
+ if (!GDK_IS_PIXBUF (entry->contact->photo))
moko_contacts_get_photo (contacts, entry->contact);
return entry;
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-06 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-06 12:46:07 UTC (rev 2645)
@@ -32,9 +32,10 @@
#include "moko-dialer.h"
#include "moko-contacts.h"
+#include "moko-history.h"
#include "moko-keypad.h"
+#include "moko-notify.h"
#include "moko-talking.h"
-#include "moko-history.h"
G_DEFINE_TYPE (MokoDialer, moko_dialer, G_TYPE_OBJECT)
@@ -60,6 +61,7 @@
MokoGsmdConnection *connection;
MokoJournal *journal;
MokoContacts *contacts;
+ MokoNotify *notify;
/* The shared MokoJournalEntry which is constantly created */
MokoJournalEntry *entry;
@@ -206,6 +208,9 @@
priv->status = DIALER_STATUS_NORMAL;
+ /* Stop the notification */
+ moko_notify_stop (priv->notify);
+
if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (priv->notebook)) == 3)
gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), 0);
@@ -282,6 +287,9 @@
priv->status = DIALER_STATUS_TALKING;
+ /* Stop the notification */
+ moko_notify_stop (priv->notify);
+
/* Finalise and add the journal entry */
if (priv->entry)
{
@@ -420,6 +428,9 @@
gtk_window_present (GTK_WINDOW (priv->window));
+ /* Start the notification */
+ moko_notify_start (priv->notify);
+
g_signal_emit (G_OBJECT (dialer), dialer_signals[INCOMING_CALL], 0, NULL);
}
@@ -440,7 +451,6 @@
&& (strcmp (number, last) == 0)
&& ((GDK_CURRENT_TIME - timestamp) < 1500))
{
- timestamp = GDK_CURRENT_TIME;
return;
}
if (last)
@@ -557,7 +567,7 @@
*/
if (priv->registered)
{
- g_print ("Netwok Registered\n");
+ g_print ("Network Registered\n");
return FALSE;
}
else
@@ -704,6 +714,9 @@
/* Load the contacts store */
priv->contacts = moko_contacts_get_default ();
+ /* Load the notification object */
+ priv->notify = moko_notify_new ();
+
/* Create the window */
priv->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (priv->window), "delete-event",
Added:
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 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
2007-08-06 12:46:07 UTC (rev 2645)
@@ -0,0 +1,176 @@
+/*
+ * moko-notify; a Notification object. This deals with notifying the user
+ * of an incoming call.
+ *
+ * Authored by OpenedHand Ltd <[EMAIL PROTECTED]>
+ *
+ * Copyright (C) 2006-2007 OpenMoko Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation; version 2 of the license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser Public License for more details.
+ *
+ * Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "moko-notify.h"
+
+#include <gst/gst.h>
+
+G_DEFINE_TYPE (MokoNotify, moko_notify, G_TYPE_OBJECT)
+
+#define MOKO_NOTIFY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE(obj, \
+ MOKO_TYPE_NOTIFY, MokoNotifyPrivate))
+
+#define DEFAULT_RINGTONE "/default_ringtone.ogg"
+#define SYS_BRIGHTNESS "/sys/class/backlight/gta01-bl/brightness"
+#define SYS_VIBRATE "/sys/class/leds/gta01:vibrator"
+
+struct _MokoNotifyPrivate
+{
+ gint i;
+};
+/*
+enum
+{
+ NOTHING,
+
+ LAST_SIGNAL
+};
+
+static guint notify_signals[LAST_SIGNAL] = {0, };
+*/
+
+static void
+moko_notify_start_vibrate (void)
+{
+ gint fd;
+ gchar buf[100];
+ gint len;
+
+ /* Set the trigger state */
+ fd = g_open (SYS_VIBRATE"/trigger", O_WRONLY, 0);
+ if (fd == -1)
+ {
+ g_warning ("Unable to open vibration device");
+ return;
+ }
+ len = g_sprintf (buf, "%s", "timer");
+ write (fd, buf, len);
+ close (fd);
+
+ /* Set the 'on' delay */
+ fd = g_open (SYS_VIBRATE"/delay_on", O_WRONLY, 0);
+ if (fd == -1)
+ {
+ g_warning ("Unable to open timer 'delay_on'");
+ return;
+ }
+ len = g_sprintf (buf, "%d", 500);
+ write (fd, buf, len);
+ close (fd);
+
+ /* Set the 'off' delay, this also starts the vibration */
+ fd = g_open (SYS_VIBRATE"/delay_off", O_WRONLY, 0);
+ if (fd == -1)
+ {
+ g_warning ("Unable to open timer 'delay_off'");
+ return;
+ }
+ len = g_sprintf (buf, "%d", 1000);
+ write (fd, buf, len);
+ close (fd);
+}
+
+static void
+moko_notify_stop_vibrate (void)
+{
+ gint fd;
+ gchar buf[100];
+ gint len;
+
+ /* Set the trigger state to none*/
+ fd = g_open (SYS_VIBRATE"/trigger", O_WRONLY, 0);
+ if (fd == -1)
+ {
+ g_warning ("Unable to open vibration device");
+ return;
+ }
+ len = g_sprintf (buf, "%s", "none");
+ write (fd, buf, len);
+ close (fd);
+}
+
+/* We need to do a few things here:
+ * 1. If the backlight is dimmed down, undim it
+ * 2. Start playing the ringtone
+ * 3. Start the vibration alert
+ */
+void
+moko_notify_start (MokoNotify *notify)
+{
+ moko_notify_start_vibrate ();
+}
+
+/* Stop the ringtone and the vibration alert */
+void
+moko_notify_stop (MokoNotify *notify)
+{
+ moko_notify_stop_vibrate ();
+}
+
+/* GObject functions */
+static void
+moko_notify_dispose (GObject *object)
+{
+ G_OBJECT_CLASS (moko_notify_parent_class)->dispose (object);
+}
+
+static void
+moko_notify_finalize (GObject *notify)
+{
+ G_OBJECT_CLASS (moko_notify_parent_class)->finalize (notify);
+}
+
+static void
+moko_notify_class_init (MokoNotifyClass *klass)
+{
+ GObjectClass *obj_class = G_OBJECT_CLASS (klass);
+
+ obj_class->finalize = moko_notify_finalize;
+ obj_class->dispose = moko_notify_dispose;
+
+ g_type_class_add_private (obj_class, sizeof (MokoNotifyPrivate));
+}
+
+static void
+moko_notify_init (MokoNotify *notify)
+{
+ MokoNotifyPrivate *priv;
+
+ priv = notify->priv = MOKO_NOTIFY_GET_PRIVATE (notify);
+}
+
+MokoNotify*
+moko_notify_new (void)
+{
+ MokoNotify *notify = NULL;
+
+ notify = g_object_new (MOKO_TYPE_NOTIFY, NULL);
+
+ return notify;
+}
Added:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.h
2007-08-06 10:59:30 UTC (rev 2644)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.h
2007-08-06 12:46:07 UTC (rev 2645)
@@ -0,0 +1,77 @@
+/*
+ * moko-notify; a Notification object. This deals with notifying the user
+ * of an incoming call.
+ *
+ * Authored by OpenedHand Ltd <[EMAIL PROTECTED]>
+ *
+ * Copyright (C) 2006-2007 OpenMoko Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation; version 2 of the license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser Public License for more details.
+ *
+ * Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#ifndef _HAVE_MOKO_NOTIFY_H
+#define _HAVE_MOKO_NOTIFY_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define MOKO_TYPE_NOTIFY (moko_notify_get_type ())
+
+#define MOKO_NOTIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ MOKO_TYPE_NOTIFY, MokoNotify))
+
+#define MOKO_NOTIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ MOKO_TYPE_NOTIFY, MokoNotifyClass))
+
+#define MOKO_IS_NOTIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ MOKO_TYPE_NOTIFY))
+
+#define MOKO_IS_NOTIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ MOKO_TYPE_NOTIFY))
+
+#define MOKO_NOTIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ MOKO_TYPE_NOTIFY, MokoNotifyClass))
+
+typedef struct _MokoNotify MokoNotify;
+typedef struct _MokoNotifyClass MokoNotifyClass;
+typedef struct _MokoNotifyPrivate MokoNotifyPrivate;
+
+struct _MokoNotify
+{
+ GObject parent;
+
+ /*< private >*/
+ MokoNotifyPrivate *priv;
+};
+
+struct _MokoNotifyClass
+{
+ /*< private >*/
+ GObjectClass parent_class;
+};
+
+GType moko_notify_get_type (void) G_GNUC_CONST;
+
+MokoNotify*
+moko_notify_new (void);
+
+void
+moko_notify_start (MokoNotify *notify);
+
+void
+moko_notify_stop (MokoNotify *notify);
+
+G_END_DECLS
+
+#endif /* _HAVE_MOKO_NOTIFY_H */
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-06 15:01:32 +0200 (Mon, 06 Aug 2007)
New Revision: 2646
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
Log:
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-contacts.c: (moko_contacts_lookup):
Check entry is valid before performing operations on it.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 12:46:07 UTC (rev 2645)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 13:01:32 UTC (rev 2646)
@@ -1,5 +1,10 @@
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+ * src/moko-contacts.c: (moko_contacts_lookup):
+ Check entry is valid before performing operations on it.
+
+2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+
* configure.ac:
* src/Makefile.am:
* src/dialer-main.c: (main):
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-06 12:46:07 UTC (rev 2645)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-06 13:01:32 UTC (rev 2646)
@@ -37,7 +37,7 @@
{
EBook *book;
- GList *contacts;
+ List *contacts;
GList *entries;
GHashTable *prefixes;
};
@@ -89,7 +89,7 @@
entry = g_hash_table_lookup (priv->prefixes, number);
- if (!GDK_IS_PIXBUF (entry->contact->photo))
+ if (entry && !GDK_IS_PIXBUF (entry->contact->photo))
moko_contacts_get_photo (contacts, entry->contact);
return entry;
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-06 15:36:25 +0200 (Mon, 06 Aug 2007)
New Revision: 2647
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
Log:
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-contacts.c:
Fix typo.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 13:01:32 UTC (rev 2646)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 13:36:25 UTC (rev 2647)
@@ -1,5 +1,10 @@
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+ * src/moko-contacts.c:
+ Fix typo.
+
+2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+
* src/moko-contacts.c: (moko_contacts_lookup):
Check entry is valid before performing operations on it.
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-06 13:01:32 UTC (rev 2646)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-06 13:36:25 UTC (rev 2647)
@@ -37,7 +37,7 @@
{
EBook *book;
- List *contacts;
+ GList *contacts;
GList *entries;
GHashTable *prefixes;
};
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-06 15:42:02 +0200 (Mon, 06 Aug 2007)
New Revision: 2648
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
Log:
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-dialer.c: (on_call_progress_changed):
* src/moko-notify.c: (moko_notify_start), (moko_notify_stop),
(moko_notify_init):
Added state support for notify object.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 13:36:25 UTC (rev 2647)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 13:42:02 UTC (rev 2648)
@@ -1,5 +1,12 @@
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+ * src/moko-dialer.c: (on_call_progress_changed):
+ * src/moko-notify.c: (moko_notify_start), (moko_notify_stop),
+ (moko_notify_init):
+ Added state support for notify object.
+
+2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+
* src/moko-contacts.c:
Fix typo.
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-06 13:36:25 UTC (rev 2647)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-06 13:42:02 UTC (rev 2648)
@@ -511,6 +511,7 @@
priv->time = NULL;
}
moko_journal_write_to_storage (priv->journal);
+ moko_notify_stop (priv->notify);
g_print ("mokogsmd disconnect\n");
break;
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 13:36:25 UTC (rev 2647)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
2007-08-06 13:42:02 UTC (rev 2648)
@@ -42,7 +42,7 @@
struct _MokoNotifyPrivate
{
- gint i;
+ gboolean started;
};
/*
enum
@@ -123,6 +123,15 @@
void
moko_notify_start (MokoNotify *notify)
{
+ MokoNotifyPrivate *priv;
+
+ g_return_if_fail (MOKO_IS_NOTIFY (notify));
+ priv = notify->priv;
+
+ if (priv->started)
+ return;
+ priv->started = TRUE;
+
moko_notify_start_vibrate ();
}
@@ -130,6 +139,15 @@
void
moko_notify_stop (MokoNotify *notify)
{
+ MokoNotifyPrivate *priv;
+
+ g_return_if_fail (MOKO_IS_NOTIFY (notify));
+ priv = notify->priv;
+
+ if (!priv->started)
+ return;
+ priv->started = FALSE;
+
moko_notify_stop_vibrate ();
}
@@ -163,6 +181,8 @@
MokoNotifyPrivate *priv;
priv = notify->priv = MOKO_NOTIFY_GET_PRIVATE (notify);
+
+ priv->started = FALSE;
}
MokoNotify*
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-06 16:41:01 +0200 (Mon, 06 Aug 2007)
New Revision: 2649
Added:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/default_ringtone.ogg
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/Makefile.am
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
Log:
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
* data/Makefile.am:
Added a default ringtone (until sound themes are finished).
* src/moko-notify.c: (on_filesrc_eos),
(moko_notify_start_ringtone), (moko_notify_stop_ringtone),
(moko_notify_start), (moko_notify_stop):
Added some basic support for playing the default ringtone when there is
an
incoming call.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 13:42:02 UTC (rev 2648)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-06 14:41:01 UTC (rev 2649)
@@ -1,5 +1,16 @@
2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+ * data/Makefile.am:
+ Added a default ringtone (until sound themes are finished).
+
+ * src/moko-notify.c: (on_filesrc_eos),
+ (moko_notify_start_ringtone), (moko_notify_stop_ringtone),
+ (moko_notify_start), (moko_notify_stop):
+ Added some basic support for playing the default ringtone when there is
an
+ incoming call.
+
+2007-08-06 Neil J. Patel <[EMAIL PROTECTED]>
+
* src/moko-dialer.c: (on_call_progress_changed):
* src/moko-notify.c: (moko_notify_start), (moko_notify_stop),
(moko_notify_init):
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/Makefile.am
2007-08-06 13:42:02 UTC (rev 2648)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/Makefile.am
2007-08-06 14:41:01 UTC (rev 2649)
@@ -34,7 +34,8 @@
talking_3.png\
exit.png\
connecting.png\
- incall.png
+ incall.png\
+ default_ringtone.ogg
#
# desktop integration: .desktop file
#
Added:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/default_ringtone.ogg
===================================================================
(Binary files differ)
Property changes on:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/data/default_ringtone.ogg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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 13:42:02 UTC (rev 2648)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
2007-08-06 14:41:01 UTC (rev 2649)
@@ -42,7 +42,9 @@
struct _MokoNotifyPrivate
{
- gboolean started;
+ gboolean started;
+
+ GstElement *bin;
};
/*
enum
@@ -55,7 +57,96 @@
static guint notify_signals[LAST_SIGNAL] = {0, };
*/
+
static void
+on_filesrc_eos (GstElement *element, MokoNotify *notify)
+{
+ /* Rewind and play again */
+ g_print ("Audio finished\n");
+}
+
+static void
+moko_notify_start_ringtone (MokoNotify *notify)
+{
+ MokoNotifyPrivate *priv;
+ GstElement *bin, *filesrc, *decoder, *aconvert, *aresample, *asink;
+
+ g_return_if_fail (MOKO_IS_NOTIFY (notify));
+ priv = notify->priv;
+
+ /* Create a bin to hold elements */
+ bin = gst_pipeline_new ("pipeline");
+ g_assert (bin);
+
+ /* Disk reader */
+ filesrc = gst_element_factory_make ("filesrc", "source");
+ g_assert (filesrc);
+ g_object_set (G_OBJECT (filesrc),
+ "location", PKGDATADIR DEFAULT_RINGTONE,
+ NULL);
+ g_signal_connect (G_OBJECT (filesrc), "eos",
+ G_CALLBACK (on_filesrc_eos), (gpointer)notify);
+
+ /* Decoder */
+ decoder = gst_element_factory_make ("decodebin", "decode");
+ if (!decoder)
+ {
+ g_warning ("Could not load 'decodebin'");
+ return;
+ }
+
+ /* Audio convert */
+ aconvert = gst_element_factory_make ("audioconvert", NULL);
+ if (!aconvert)
+ {
+ g_warning ("Could not load 'audioconvert'");
+ return;
+ }
+
+ /* Audio resample */
+ aresample = gst_element_factory_make ("audioresample", NULL);
+ if (!aresample)
+ {
+ g_warning ("Could not load 'audioresample'");
+ return;
+ }
+
+ /* Audio sink */
+ asink = gst_element_factory_make ("alsasink", "play_audio");
+ if (!asink)
+ {
+ g_warning ("Could not load 'alsasink'");
+ return;
+ }
+
+ /* Add objects to the bin */
+ gst_bin_add_many (GST_BIN (bin), filesrc, decoder,
+ aconvert, aresample, asink, NULL);
+
+ /* Link the elements */
+ gst_element_link_many (filesrc, decoder, aconvert, aresample, asink, NULL);
+
+ priv->bin = bin;
+
+ /* Start playing */
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+}
+
+static void
+moko_notify_stop_ringtone (MokoNotify *notify)
+{
+ MokoNotifyPrivate *priv;
+
+ g_return_if_fail (MOKO_IS_NOTIFY (notify));
+ priv = notify->priv;
+
+ if (GST_IS_ELEMENT (priv->bin))
+ {
+ gst_element_set_state (priv->bin, GST_STATE_NULL);
+ }
+}
+
+static void
moko_notify_start_vibrate (void)
{
gint fd;
@@ -132,7 +223,8 @@
return;
priv->started = TRUE;
- moko_notify_start_vibrate ();
+ moko_notify_start_vibrate ();
+ moko_notify_start_ringtone (notify);
}
/* Stop the ringtone and the vibration alert */
@@ -149,6 +241,7 @@
priv->started = FALSE;
moko_notify_stop_vibrate ();
+ moko_notify_stop_ringtone (notify);
}
/* GObject functions */
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog