speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/5] audio, modules - Set libspdaudio's internal log_level variab


From: Luke Yelavich
Subject: [PATCH 5/5] audio, modules - Set libspdaudio's internal log_level variable
Date: Tue, 23 Jun 2009 16:54:40 +1000

From: Luke Yelavich <address@hidden>
To: address@hidden

Since the audio output code is a shared library, it needs to be passed the
log level setting from the parent module making use of the audio output.
---
 ChangeLog                  |    4 ++++
 src/audio/spd_audio.c      |    8 ++++++++
 src/audio/spd_audio.h      |    4 ++++
 src/modules/module_utils.c |    1 +
 4 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bfa4180..7e5e0e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
            speech modules.
          - Add new function do_loglevel, to retrieve and call the above
            mentioned macro to set the log level.
+         - Add a call to spd_audio_set_loglevel to the SET_LOGLEVEL_NUM macro.
 
        * src/modules/module_main.c (main): Add a call to do_loglevel to set
        the log level for the module.
@@ -25,6 +26,9 @@
            before logging a message.
          - Assign all log messages to a log level.
 
+       * src/audio/spd_audio.c: Add a new function spd_audio_set_loglevel to
+       set the internal log_level variable for the libspdaudio library.
+
 2009-06-22  Luke Yelavich <luke.yelavich at canonical.com>
 
        * src/server/output.c: Add output_send_loglevel_setting function
diff --git a/src/audio/spd_audio.c b/src/audio/spd_audio.c
index e684b10..fac2df2 100644
--- a/src/audio/spd_audio.c
+++ b/src/audio/spd_audio.c
@@ -336,3 +336,11 @@ spd_audio_set_volume(AudioID *id, int volume)
     id->volume = volume;
     return 0;
 }
+
+void
+spd_audio_set_loglevel(int level)
+{
+    if (level){
+        log_level = level;
+    }
+}
diff --git a/src/audio/spd_audio.h b/src/audio/spd_audio.h
index 53a1066..a86454d 100644
--- a/src/audio/spd_audio.h
+++ b/src/audio/spd_audio.h
@@ -155,6 +155,8 @@ typedef struct{
 
 AudioID* spd_audio_open(AudioOutputType type, void **pars, char **error);
 
+int log_level;
+
 int spd_audio_play(AudioID *id, AudioTrack track, AudioFormat format);
 
 int spd_audio_stop(AudioID *id);
@@ -163,4 +165,6 @@ int spd_audio_close(AudioID *id);
 
 int spd_audio_set_volume(AudioID *id, int volume);
 
+void spd_audio_set_loglevel(int level);
+
 #endif /* ifndef #__SPD_AUDIO_H */
diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index 184994b..8b5dd7f 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -307,6 +307,7 @@ do_audio(void)
      if(!(cond)){ err = 2; continue; } \
      if (tptr == cur_value){ err = 2; continue; } \
      log_level = number; \
+     spd_audio_set_loglevel(log_level); \
  }
 
 char*
-- 
1.6.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]