summaryrefslogtreecommitdiff
path: root/telepathy-glib/dtmf.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-01-05 17:48:21 -0500
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-01-11 17:53:22 +0100
commit42f024b28c211719194f2d4f6a6d4284003d475e (patch)
tree21d8bd13151c3899c86f622764bc2993c1edfc32 /telepathy-glib/dtmf.c
parentf10122e854dc4afb934fd1ca145b35c99c3b297f (diff)
downloadtelepathy-glib-42f024b28c211719194f2d4f6a6d4284003d475e.tar.gz
Implement DTMF interface on TpBaseMediaContent
Diffstat (limited to 'telepathy-glib/dtmf.c')
-rw-r--r--telepathy-glib/dtmf.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/telepathy-glib/dtmf.c b/telepathy-glib/dtmf.c
index 03b0da1b4..d5accc92a 100644
--- a/telepathy-glib/dtmf.c
+++ b/telepathy-glib/dtmf.c
@@ -20,9 +20,12 @@
#include "config.h"
#include "telepathy-glib/dtmf.h"
+
+#include <telepathy-glib/base-call-internal.h>
#include <telepathy-glib/errors.h>
#include <telepathy-glib/util.h>
+
/**
* SECTION:dtmf
* @title: DTMF dialstring interpreter
@@ -88,8 +91,8 @@ tp_dtmf_event_to_char (TpDTMFEvent event)
#define INVALID_DTMF_EVENT ((TpDTMFEvent) 0xFF)
-static TpDTMFEvent
-tp_dtmf_char_to_event (gchar c)
+TpDTMFEvent
+_tp_dtmf_char_to_event (gchar c)
{
switch (c)
{
@@ -129,16 +132,8 @@ tp_dtmf_char_to_event (gchar c)
}
}
-typedef enum
-{
- DTMF_CHAR_CLASS_MEANINGLESS,
- DTMF_CHAR_CLASS_PAUSE,
- DTMF_CHAR_CLASS_EVENT,
- DTMF_CHAR_CLASS_WAIT_FOR_USER
-} DTMFCharClass;
-
-static DTMFCharClass
-tp_dtmf_char_classify (gchar c)
+DTMFCharClass
+_tp_dtmf_char_classify (gchar c)
{
switch (c)
{
@@ -154,7 +149,7 @@ tp_dtmf_char_classify (gchar c)
return DTMF_CHAR_CLASS_PAUSE;
default:
- if (tp_dtmf_char_to_event (c) != INVALID_DTMF_EVENT)
+ if (_tp_dtmf_char_to_event (c) != INVALID_DTMF_EVENT)
return DTMF_CHAR_CLASS_EVENT;
else
return DTMF_CHAR_CLASS_MEANINGLESS;
@@ -292,7 +287,7 @@ tp_dtmf_player_timer_cb (gpointer data)
return FALSE;
}
- switch (tp_dtmf_char_classify (*self->priv->dialstring_remaining))
+ switch (_tp_dtmf_char_classify (*self->priv->dialstring_remaining))
{
case DTMF_CHAR_CLASS_EVENT:
if (was_playing)
@@ -306,7 +301,7 @@ tp_dtmf_player_timer_cb (gpointer data)
/* We're at the end of a gap or pause, or in our initial state.
* Play the tone straight away. */
tp_dtmf_player_emit_started_tone (self,
- tp_dtmf_char_to_event (*self->priv->dialstring_remaining));
+ _tp_dtmf_char_to_event (*self->priv->dialstring_remaining));
self->priv->timer_id = g_timeout_add (self->priv->tone_ms,
tp_dtmf_player_timer_cb, self);
}
@@ -399,7 +394,7 @@ tp_dtmf_player_play (TpDTMFPlayer *self,
for (i = 0; tones[i] != '\0'; i++)
{
- if (tp_dtmf_char_classify (tones[i]) == DTMF_CHAR_CLASS_MEANINGLESS)
+ if (_tp_dtmf_char_classify (tones[i]) == DTMF_CHAR_CLASS_MEANINGLESS)
{
g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
"Invalid character in DTMF string starting at %s",