summaryrefslogtreecommitdiff
path: root/navit/speech/espeak/speak.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-11-22 22:34:19 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-11-22 22:34:19 +0000
commit2a6aa9b917249f44e4aa27d88e255f61eb171d6a (patch)
tree0ad46b248e42f96e93b54874aa3b073ad1273aa1 /navit/speech/espeak/speak.c
parent05edfdebd6b83267121b11538abafe39bff266e7 (diff)
downloadnavit-2a6aa9b917249f44e4aa27d88e255f61eb171d6a.tar.gz
Refactor:core:Introduce enum for debug levels, and use it everywhere.|First part of #1269.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5960 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/speech/espeak/speak.c')
-rw-r--r--navit/speech/espeak/speak.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/navit/speech/espeak/speak.c b/navit/speech/espeak/speak.c
index 18edd8cd9..58813590a 100644
--- a/navit/speech/espeak/speak.c
+++ b/navit/speech/espeak/speak.c
@@ -166,11 +166,11 @@ static BOOL initialise(void)
{
if(result == -1)
{
- dbg(0, "Failed to load espeak-data\n");
+ dbg(lvl_error, "Failed to load espeak-data\n");
return FALSE;
}
else
- dbg(0, "Wrong version of espeak-data 0x%x (expects 0x%x) at %s\n",result,version_phdata,path_home);
+ dbg(lvl_error, "Wrong version of espeak-data 0x%x (expects 0x%x) at %s\n",result,version_phdata,path_home);
}
LoadConfig();
SetVoiceStack(NULL);
@@ -214,7 +214,7 @@ static void start_speaking(struct speech_priv* sp_priv)
static LRESULT CALLBACK speech_message_handler( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
- dbg(1, "message_handler called\n");
+ dbg(lvl_warning, "message_handler called\n");
switch (uMsg)
{
@@ -234,7 +234,7 @@ static LRESULT CALLBACK speech_message_handler( HWND hwnd, UINT uMsg, WPARAM wPa
{
WAVEHDR *WaveHeader = (WAVEHDR *)lParam;
struct speech_priv* sp_priv;
- dbg(2, "Wave buffer done\n");
+ dbg(lvl_info, "Wave buffer done\n");
sp_priv = (struct speech_priv*)WaveHeader->dwUser;
sp_priv->free_buffers = g_list_append(sp_priv->free_buffers, WaveHeader);
@@ -282,7 +282,7 @@ static void speech_message_dispatcher( struct speech_priv * sp_priv)
{
if (bRet == -1)
{
- dbg(0, "Error getting message from queue\n");
+ dbg(lvl_error, "Error getting message from queue\n");
break;
}
else
@@ -336,7 +336,7 @@ static DWORD startThread( LPVOID sp_priv)
if (!RegisterClass(&wc))
{
- dbg(0, "Window registration for message queue failed\n");
+ dbg(lvl_error, "Window registration for message queue failed\n");
return 1;
}
@@ -361,7 +361,7 @@ static DWORD startThread( LPVOID sp_priv)
if (hwnd == NULL)
{
- dbg(0, "Window creation failed: %d\n", GetLastError());
+ dbg(lvl_error, "Window creation failed: %d\n", GetLastError());
return 1;
}
@@ -371,7 +371,7 @@ static DWORD startThread( LPVOID sp_priv)
if(!waveout_open(this))
{
- dbg(0, "Can't open wave output\n");
+ dbg(lvl_error, "Can't open wave output\n");
return 1;
}
@@ -387,11 +387,11 @@ static int
espeak_say(struct speech_priv *this, const char *text)
{
char *phrase = g_strdup(text);
- dbg(1, "Speak: '%s'\n", text);
+ dbg(lvl_warning, "Speak: '%s'\n", text);
if (!PostMessage(this->h_queue, msg_say, (WPARAM)this, (LPARAM)phrase))
{
- dbg(0, "PostThreadMessage 'say' failed\n");
+ dbg(lvl_error, "PostThreadMessage 'say' failed\n");
}
return 0;
@@ -440,7 +440,7 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
strcpy(path_home,path->u.str);
else
sprintf(path_home,"%s/espeak-data",getenv("NAVIT_SHAREDIR"));
- dbg(0,"path_home set to %s\n",path_home);
+ dbg(lvl_error,"path_home set to %s\n",path_home);
if ( !initialise() )
{
@@ -467,12 +467,12 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
}
file1=g_strdup_printf("%s/voices/%s",path_home,lang_full);
file2=g_strdup_printf("%s/voices/%s/%s",path_home,lang,lang_full);
- dbg(0,"Testing %s and %s\n",file1,file2);
+ dbg(lvl_error,"Testing %s and %s\n",file1,file2);
if (file_exists(file1) || file_exists(file2))
lang_str=g_strdup(lang_full);
else
lang_str=g_strdup(lang);
- dbg(0,"Language full %s lang %s result %s\n",lang_full,lang,lang_str);
+ dbg(lvl_error,"Language full %s lang %s result %s\n",lang_full,lang,lang_str);
g_free(lang_full);
g_free(lang);
g_free(file1);
@@ -481,12 +481,12 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
}
if(lang_str && SetVoiceByName(lang_str) != EE_OK)
{
- dbg(0, "Error setting language to: '%s',falling back to default\n", lang_str);
+ dbg(lvl_error, "Error setting language to: '%s',falling back to default\n", lang_str);
g_free(lang_str);
lang_str=NULL;
}
if(!lang_str && SetVoiceByName("default") != EE_OK) {
- dbg(0, "Error setting language to default\n");
+ dbg(lvl_error, "Error setting language to default\n");
}