
/* *********************************************************************
 * *                                                                   *
 * * Header file for  audio server                                     *
 * *                                                                   *
 * *********************************************************************
 * File: /libs/include/audio_lib.h
 *
 *                     COPYRIGHT (c) 1997, 2000  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 *
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */

#ifndef _AUDIO_LIB_H_
#define _AUDIO_LIB_H_


/***********************************************************
** These define are used in the audio.C and audioLib.C
** They are sent down a message que from audioLib.C to 
** audio.C to tell the audio server what to do
**********************************************************/

#define SAYSERV_FILE_FORMAT  "say_server_file_format_9_2_98"
#define AUDIO_OPEN                 1
#define AUDIO_CLOSE                2
#define AUDIO_SAY_TEXT_LOCAL       3
#define AUDIO_SAY_PORT_HOST_REMOTE 4
#define AUDIO_SAY_TEXT_REMOTE      5
#define AUDIO_PLAY_ALARM           6
#define AUDIO_PLAY_MSG             7
#define AUDIO_XBELL                8

#ifdef __cplusplus
/********************************************************************
** This class will only ever have 1 instance.  It will be used in
** the program audiox. audiox combined sayx and alarm setup (which 
** was in iris)
*******************************************************************/
class AudioParams
{
  private :
  public :
     AudioParams(void);

     void  save();
     void  load();

     void  setPlayAlarmName(char *alarm_filename_a);
     char  *getPlayAlarmName(void);

     void  setPlayMsgName(char *msg_filename_a);
     char  *getPlayMsgName(void);

     void  setSayIsLocal(UINT4 is_local_a);
     UINT4 getSayIsLocal(void);

     void  setSayRemoteHostname(char *hostname_a);
     char  *getSayRemoteHostname(void);

     void  setSayRemotePortNum(UINT4 portnum_a);
     UINT4 getSayRemotePortNum(void);

     void  setEnableSay(UINT4 enable_a);
     UINT4 getEnableSay(void);

     void  setAlarmCont(UINT4 continous_a);
     UINT4 getAlarmCont(void);

     void  setAlarmTime(UINT4 time_a);
     UINT4 getAlarmTime(void);

     void  setEnableSndCard(UINT2 enable_a);
     UINT2 getEnableSndCard(void);

     void  setEnableAlarmBell(UINT1 enable_a);
     UINT1 getEnableAlarmBell(void);

     void  setEnableMsgBell(UINT1 enable_a);
     UINT1 getEnableMsgBell(void);

     void  setSndCardVol(UINT1 vol_a);
     UINT1 getSndCardVol(void);
};


/********************************************************************
** This class will be used ever time a C++ function will want
** sound or speech 
*******************************************************************/
class Audio : private AudioParams
{
  private :
     UINT2 lConfigMode;
     UINT4 iPid;
     UINT4 iMsgQId;                                                      
  public :
     Audio(void);
     MESSAGE openForAudiox(void);  /* Only unsed with auidox*/
     MESSAGE open(void);
     MESSAGE close(void);
     MESSAGE sayText(const char *txt_a);
     MESSAGE playMsg(void);
     MESSAGE playAlarm(void);
     MESSAGE playAlarmCont(void);
     MESSAGE stopAlarmCont(void);
};
#endif


/***************************************************************
** These functions will only be called by C functions to access
** the C++ audio lib function 
***************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

MESSAGE audio_open(void);
MESSAGE audio_close(void);
MESSAGE audio_sayText(const char *txt_a);
MESSAGE audio_playMsg(void);
MESSAGE audio_playAlarm(void);
MESSAGE audio_playAlarmCont(void);
MESSAGE audio_stopAlarmCont(void);

#ifdef __cplusplus
}
#endif

#endif /*  _SAYSERV_LIB_H_ */

