speech-dispatcher: Generic Macros and Functions

 
 5.2.7.3 Generic Macros and Functions
 ....................................
 
  -- Module Utils macro: UPDATE_PARAMETER (param, setter)
      Tests if the integer or enum parameter specified in 'param' (e.g.
      rate, pitch, cap_let_recogn, ...)  changed since the last time when
      the 'setter' function was called.
 
      If it changed, it calls the function 'setter' with the new value.
      (The new value is stored in the msg_settings structure that is
      created by module_utils.h, which you normally don't have to care
      about.)
 
      The function 'setter' should be defined as:
           void setter_name(type value);
 
      Please look at the 'SET' command in the communication protocol for
      the list of all available parameters.  ⇒Communication Protocol
      for Output Modules.
 
      An example from Festival output module:
      static void
      festival_set_rate(signed int rate)
      {
          assert(rate >= -100 && rate <= +100);
          festivalSetRate(festival_info, rate);
      }
      [...]
      int
      module_speak(char *data, size_t bytes, EMessageType msgtype)
      {
          [...]
          UPDATE_PARAMETER(rate, festival_set_rate);
          UPDATE_PARAMETER(pitch, festival_set_pitch);
          [...]
      }
 
  -- Module Utils macro: UPDATE_STRING_PARAMETER (param, setter)
      The same as 'UPDATE_PARAMETER' except that it works for parameters
      with a string value.