diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-30 17:29:00 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-30 17:29:00 +0800 |
commit | 8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b (patch) | |
tree | d6387df87b988b83dedc16ffb5ef73e5d0d30de9 | |
parent | 0dca19234c147a94609c6659660e83135e765b9c (diff) | |
download | gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.tar gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.tar.gz gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.tar.bz2 gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.tar.lz gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.tar.xz gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.tar.zst gsoc2013-empathy-8172bca03c6f85d7dcc0ff39f1a81ccfd719b08b.zip |
add EmpathySoundManager stub object (#636067)
-rw-r--r-- | libempathy-gtk/empathy-sound-manager.c | 34 | ||||
-rw-r--r-- | libempathy-gtk/empathy-sound-manager.h | 26 |
2 files changed, 60 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-sound-manager.c b/libempathy-gtk/empathy-sound-manager.c index 459016db1..8d51f7391 100644 --- a/libempathy-gtk/empathy-sound-manager.c +++ b/libempathy-gtk/empathy-sound-manager.c @@ -68,6 +68,40 @@ static EmpathySoundEntry sound_entries[LAST_EMPATHY_SOUND] = { N_("Voice call ended"), NULL }, }; +G_DEFINE_TYPE (EmpathySoundManager, empathy_sound_manager, G_TYPE_OBJECT) + +struct _EmpathySoundManagerPrivate +{ + gpointer unused; +}; + +static void +empathy_sound_manager_class_init (EmpathySoundManagerClass *cls) +{ + g_type_class_add_private (cls, sizeof (EmpathySoundManagerPrivate)); +} + +static void +empathy_sound_manager_init (EmpathySoundManager *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + EMPATHY_TYPE_SOUND_MANAGER, EmpathySoundManagerPrivate); +} + +EmpathySoundManager * +empathy_sound_manager_dup_singleton (void) +{ + static EmpathySoundManager *manager = NULL; + + if (manager != NULL) + return g_object_ref (manager); + + manager = g_object_new (EMPATHY_TYPE_SOUND_MANAGER, NULL); + + g_object_add_weak_pointer (G_OBJECT (manager), (gpointer *) &manager); + return manager; +} + /* An hash table containing currently repeating sounds. The format is the * following: * Key: An EmpathySound diff --git a/libempathy-gtk/empathy-sound-manager.h b/libempathy-gtk/empathy-sound-manager.h index 95160b342..ca112e2d9 100644 --- a/libempathy-gtk/empathy-sound-manager.h +++ b/libempathy-gtk/empathy-sound-manager.h @@ -42,6 +42,32 @@ typedef enum { LAST_EMPATHY_SOUND, } EmpathySound; +#define EMPATHY_TYPE_SOUND_MANAGER (empathy_sound_manager_get_type ()) +#define EMPATHY_SOUND_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_SOUND_MANAGER, EmpathySoundManager)) +#define EMPATHY_SOUND_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_SOUND_MANAGER, EmpathySoundManagerClass)) +#define EMPATHY_IS_SOUND_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_SOUND_MANAGER)) +#define EMPATHY_IS_SOUND_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_SOUND_MANAGER)) +#define EMPATHY_SOUND_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_SOUND_MANAGER, EmpathySoundManagerClass)) + +typedef struct _EmpathySoundManager EmpathySoundManager; +typedef struct _EmpathySoundManagerClass EmpathySoundManagerClass; +typedef struct _EmpathySoundManagerPrivate EmpathySoundManagerPrivate; + +struct _EmpathySoundManager +{ + GObject parent; + EmpathySoundManagerPrivate *priv; +}; + +struct _EmpathySoundManagerClass +{ + GObjectClass parent_class; +}; + +GType empathy_sound_manager_get_type (void) G_GNUC_CONST; + +EmpathySoundManager * empathy_sound_manager_dup_singleton (void); + gboolean empathy_sound_play (GtkWidget *widget, EmpathySound sound_id); void empathy_sound_stop (EmpathySound sound_id); |