diff options
| author | Pierre Grandin <grandinp@gmail.com> | 2019-06-04 10:14:17 -0600 |
|---|---|---|
| committer | Pierre Grandin <grandinp@gmail.com> | 2019-06-04 10:14:17 -0600 |
| commit | 92a5169423e470e4d1a5f4237cb2112266998d28 (patch) | |
| tree | bee5f13203e0a0d99c8f6962c82deef9fe772b6e /navit/speech/dbus/speech_dbus.c | |
| parent | 5304cda121782db8e1e5e4685ae10780cce36394 (diff) | |
| parent | da3e1e0c186dfd6c6566f798811a27d001a7fb1d (diff) | |
| download | navit-audio.tar.gz | |
Merge branch 'trunk' into audioaudio
Diffstat (limited to 'navit/speech/dbus/speech_dbus.c')
| -rw-r--r-- | navit/speech/dbus/speech_dbus.c | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/navit/speech/dbus/speech_dbus.c b/navit/speech/dbus/speech_dbus.c index 0fdfb71ab..a3d60620c 100644 --- a/navit/speech/dbus/speech_dbus.c +++ b/navit/speech/dbus/speech_dbus.c @@ -28,50 +28,44 @@ #include "speech.h" struct speech_priv { - struct navit *nav; + struct navit *nav; }; -static int -speech_dbus_say(struct speech_priv *this, const char *text) -{ - struct attr attr1,attr2,cb,*attr_list[3]; - int valid=0; - attr1.type=attr_type; - attr1.u.str="speech"; - attr2.type=attr_data; - attr2.u.str=(char *)text; - attr_list[0]=&attr1; - attr_list[1]=&attr2; - attr_list[2]=NULL; - if (navit_get_attr(this->nav, attr_callback_list, &cb, NULL)) - callback_list_call_attr_4(cb.u.callback_list, attr_command, "dbus_send_signal", attr_list, NULL, &valid); - return 0; +static int speech_dbus_say(struct speech_priv *this, const char *text) { + struct attr attr1,attr2,cb,*attr_list[3]; + int valid=0; + attr1.type=attr_type; + attr1.u.str="speech"; + attr2.type=attr_data; + attr2.u.str=(char *)text; + attr_list[0]=&attr1; + attr_list[1]=&attr2; + attr_list[2]=NULL; + if (navit_get_attr(this->nav, attr_callback_list, &cb, NULL)) + callback_list_call_attr_4(cb.u.callback_list, attr_command, "dbus_send_signal", attr_list, NULL, &valid); + return 0; } -static void -speech_dbus_destroy(struct speech_priv *this) { - g_free(this); +static void speech_dbus_destroy(struct speech_priv *this) { + g_free(this); } static struct speech_methods speech_dbus_meth = { - speech_dbus_destroy, - speech_dbus_say, + speech_dbus_destroy, + speech_dbus_say, }; -static struct speech_priv * -speech_dbus_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { - struct speech_priv *this; - if (!parent || parent->type != attr_navit) - return NULL; - this=g_new(struct speech_priv,1); - this->nav=parent->u.navit; - *meth=speech_dbus_meth; - return this; +static struct speech_priv *speech_dbus_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { + struct speech_priv *this; + if (!parent || parent->type != attr_navit) + return NULL; + this=g_new(struct speech_priv,1); + this->nav=parent->u.navit; + *meth=speech_dbus_meth; + return this; } -void -plugin_init(void) -{ - plugin_register_category_speech("dbus", speech_dbus_new); +void plugin_init(void) { + plugin_register_category_speech("dbus", speech_dbus_new); } |
