diff options
Diffstat (limited to 'navit/speech')
-rw-r--r-- | navit/speech/android/speech_android.c | 15 | ||||
-rw-r--r-- | navit/speech/cmdline/speech_cmdline.c | 15 | ||||
-rw-r--r-- | navit/speech/dbus/speech_dbus.c | 12 | ||||
-rw-r--r-- | navit/speech/espeak/speak.c | 12 | ||||
-rwxr-xr-x | navit/speech/qt5_espeak/qt5_espeak.cpp | 20 | ||||
-rw-r--r-- | navit/speech/speech_dispatcher/speech_speech_dispatcher.c | 12 |
6 files changed, 29 insertions, 57 deletions
diff --git a/navit/speech/android/speech_android.c b/navit/speech/android/speech_android.c index 2936fa64a..b76c2c3e9 100644 --- a/navit/speech/android/speech_android.c +++ b/navit/speech/android/speech_android.c @@ -33,8 +33,7 @@ struct speech_priv { int flags; }; -static int -speech_android_say(struct speech_priv *this, const char *text) { +static int speech_android_say(struct speech_priv *this, const char *text) { char *str=g_strdup(text); jstring string; int i; @@ -48,8 +47,7 @@ speech_android_say(struct speech_priv *this, const char *text) { return 1; } -static void -speech_android_destroy(struct speech_priv *this) { +static void speech_android_destroy(struct speech_priv *this) { g_free(this); } @@ -58,8 +56,7 @@ static struct speech_methods speech_android_meth = { speech_android_say, }; -static int -speech_android_init(struct speech_priv *ret) { +static int speech_android_init(struct speech_priv *ret) { jmethodID cid; char *class="org/navitproject/navit/NavitSpeech2"; @@ -85,8 +82,7 @@ speech_android_init(struct speech_priv *ret) { return 1; } -static struct speech_priv * -speech_android_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { +static struct speech_priv *speech_android_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { struct speech_priv *this; struct attr *flags; *meth=speech_android_meth; @@ -105,7 +101,6 @@ speech_android_new(struct speech_methods *meth, struct attr **attrs, struct attr } -void -plugin_init(void) { +void plugin_init(void) { plugin_register_category_speech("android", speech_android_new); } diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c index 6d572d170..11537e570 100644 --- a/navit/speech/cmdline/speech_cmdline.c +++ b/navit/speech/cmdline/speech_cmdline.c @@ -57,8 +57,7 @@ static char *urldecode(char *str) { return ret; } -static GList * -speech_cmdline_search(GList *samples, int suffix_len, const char *text, int decode) { +static GList *speech_cmdline_search(GList *samples, int suffix_len, const char *text, int decode) { GList *loop_samples=samples,*result=NULL,*recursion_result; int shortest_result_length=INT_MAX; dbg(lvl_debug,"searching samples for text: '%s'",text); @@ -110,8 +109,7 @@ struct speech_priv { struct spawn_process_info *spi; }; -static int -speechd_say(struct speech_priv *this, const char *text) { +static int speechd_say(struct speech_priv *this, const char *text) { char **cmdv=g_strsplit(this->cmdline," ", -1); int variable_arg_no=-1; GList *argl=NULL; @@ -187,8 +185,7 @@ speechd_say(struct speech_priv *this, const char *text) { } -static void -speechd_destroy(struct speech_priv *this) { +static void speechd_destroy(struct speech_priv *this) { GList *l=this->samples; g_free(this->cmdline); g_free(this->sample_dir); @@ -207,8 +204,7 @@ static struct speech_methods speechd_meth = { speechd_say, }; -static struct speech_priv * -speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { +static struct speech_priv *speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { struct speech_priv *this; struct attr *attr; attr=attr_search(attrs, NULL, attr_data); @@ -246,7 +242,6 @@ speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *paren } -void -plugin_init(void) { +void plugin_init(void) { plugin_register_category_speech("cmdline", speechd_new); } diff --git a/navit/speech/dbus/speech_dbus.c b/navit/speech/dbus/speech_dbus.c index a26a895b3..a3d60620c 100644 --- a/navit/speech/dbus/speech_dbus.c +++ b/navit/speech/dbus/speech_dbus.c @@ -31,8 +31,7 @@ struct speech_priv { struct navit *nav; }; -static int -speech_dbus_say(struct speech_priv *this, const char *text) { +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; @@ -47,8 +46,7 @@ speech_dbus_say(struct speech_priv *this, const char *text) { return 0; } -static void -speech_dbus_destroy(struct speech_priv *this) { +static void speech_dbus_destroy(struct speech_priv *this) { g_free(this); } @@ -57,8 +55,7 @@ static struct speech_methods speech_dbus_meth = { speech_dbus_say, }; -static struct speech_priv * -speech_dbus_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { +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; @@ -69,7 +66,6 @@ speech_dbus_new(struct speech_methods *meth, struct attr **attrs, struct attr *p } -void -plugin_init(void) { +void plugin_init(void) { plugin_register_category_speech("dbus", speech_dbus_new); } diff --git a/navit/speech/espeak/speak.c b/navit/speech/espeak/speak.c index 5076ae7a6..9ac7248b1 100644 --- a/navit/speech/espeak/speak.c +++ b/navit/speech/espeak/speak.c @@ -341,8 +341,7 @@ static DWORD startThread( LPVOID sp_priv) { return 0; } -static int -espeak_say(struct speech_priv *this, const char *text) { +static int espeak_say(struct speech_priv *this, const char *text) { char *phrase = g_strdup(text); dbg(lvl_debug, "Speak: '%s'", text); @@ -364,8 +363,7 @@ static void free_list(gpointer pointer, gpointer this ) { g_free(pointer); } -static void -espeak_destroy(struct speech_priv *this) { +static void espeak_destroy(struct speech_priv *this) { g_list_foreach( this->free_buffers, free_list, (gpointer)this ); g_list_free( this->free_buffers ); @@ -381,8 +379,7 @@ static struct speech_methods espeak_meth = { espeak_say, }; -static struct speech_priv * -espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { +static struct speech_priv *espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) { struct speech_priv *this = NULL; struct attr *path; struct attr *language; @@ -462,7 +459,6 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent return this; } -void -plugin_init(void) { +void plugin_init(void) { plugin_register_category_speech("espeak", espeak_new); } diff --git a/navit/speech/qt5_espeak/qt5_espeak.cpp b/navit/speech/qt5_espeak/qt5_espeak.cpp index 2bcb8fd6c..a0372ff39 100755 --- a/navit/speech/qt5_espeak/qt5_espeak.cpp +++ b/navit/speech/qt5_espeak/qt5_espeak.cpp @@ -71,8 +71,7 @@ int qt5_espeak_SynthCallback(short* wav, int numsamples, espeak_EVENT* events) { } /* set up espeak */ -static bool -qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) { +static bool qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) { struct attr* path; /* prepare espeak library path home */ @@ -109,8 +108,7 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) { } /* set language to espeak */ -static bool -qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs) { +static bool qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs) { struct attr* language; gchar* lang_str = NULL; espeak_ERROR error; @@ -156,8 +154,7 @@ qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs) { } /* init audio system */ -static bool -qt5_espeak_init_audio(struct speech_priv* sr, const char* category) { +static bool qt5_espeak_init_audio(struct speech_priv* sr, const char* category) { try { sr->audio = new Qt5EspeakAudioOut(sr->sample_rate, category); } catch (void* exception) { @@ -171,8 +168,7 @@ qt5_espeak_init_audio(struct speech_priv* sr, const char* category) { * sr - private handle * text - new (utf8) text */ -static int -qt5_espeak_say(struct speech_priv* sr, const char* text) { +static int qt5_espeak_say(struct speech_priv* sr, const char* text) { espeak_ERROR error; dbg(lvl_debug, "Say \"%s\"", text); error = espeak_Synth(text, strlen(text), 0, POS_CHARACTER, 0, @@ -184,8 +180,7 @@ qt5_espeak_say(struct speech_priv* sr, const char* text) { } /* destructor */ -static void -qt5_espeak_destroy(struct speech_priv* sr) { +static void qt5_espeak_destroy(struct speech_priv* sr) { dbg(lvl_debug, "Enter"); if (sr->path_home != NULL) @@ -204,9 +199,8 @@ static struct speech_methods qt5_espeak_meth = { * attr - get decoded attributes from config * parent - get parent attributes from config */ -static struct speech_priv* -qt5_espeak_new(struct speech_methods* meth, struct attr** attrs, - struct attr* parent) { +static struct speech_priv* qt5_espeak_new(struct speech_methods* meth, struct attr** attrs, + struct attr* parent) { struct speech_priv* sr = NULL; dbg(lvl_debug, "Enter"); diff --git a/navit/speech/speech_dispatcher/speech_speech_dispatcher.c b/navit/speech/speech_dispatcher/speech_speech_dispatcher.c index 763bf5ef9..c7b38a26d 100644 --- a/navit/speech/speech_dispatcher/speech_speech_dispatcher.c +++ b/navit/speech/speech_dispatcher/speech_speech_dispatcher.c @@ -35,8 +35,7 @@ struct speech_priv { SPDConnection *conn; }; -static int -speechd_say(struct speech_priv *this, const char *text) { +static int speechd_say(struct speech_priv *this, const char *text) { int err; err = spd_sayf(this->conn, SPD_MESSAGE, text); @@ -45,8 +44,7 @@ speechd_say(struct speech_priv *this, const char *text) { return 0; } -static void -speechd_destroy(struct speech_priv *this) { +static void speechd_destroy(struct speech_priv *this) { spd_close(this->conn); g_free(this); } @@ -56,8 +54,7 @@ static struct speech_methods speechd_meth = { speechd_say, }; -static struct speech_priv * -speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *attr) { +static struct speech_priv *speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *attr) { struct speech_priv *this; SPDConnection *conn; @@ -74,7 +71,6 @@ speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *attr) } -void -plugin_init(void) { +void plugin_init(void) { plugin_register_category_speech("speech_dispatcher", speechd_new); } |