/*
/////////////////////////////////////////////////////////////
//															//
//			Management of the Module : Snd					//
//															//			   
// File Name	: ErrSnd.h									//
// Date			: 03/10/96									//
// Author		: First_Name Last_Name						//
//															//
//////////////////////////////////////////////////////////////
//															//
// abbreviation of the module-name. Used in macro is 'Snd'	//
//															//
/////////////////////////////////////////////////////////////
*/
#ifndef __ERRSND_H__
#define __ERRSND_H__
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
#define C_szSndVersion "please cf version.txt"
#define C_szSndFullName "Sound Module for CPA"
#define C_szSndDate __DATE__
 
/* For DLLs who are using this module : */ 
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
 #define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
 #define CPA_EXPORT __declspec(dllexport)
#else
 #define CPA_EXPORT
#endif
 
/*------- special NO_ACP_ERR*/
#ifndef NO_ACP_MEMORY
#include "MMG.h"
#else
#ifndef _MMG_H
#define C_ucErmOpenInfoWindow (0xFF)
#define C_lErmNoDebugData (0xFFFFFFFF)
#define C_ucAllowStopForDebug (0xFF)
#define C_ucModuleNotInitialized (0xff) /* initial value of every module id*/
#define __MULTI_THREAD_ERROR_MANAGEMENT__
#define __DEBUG_ERROR__ 
#define __ERROR_STRINGS__ /* allow to print a explaination texte of the error.*/
#endif /*//__ERROR_STRINGS__*/
#endif /*NO_ACP_MEMORY*/
 
#ifdef NO_ACP_MEMORY
//typedef struct tdstErrorMsg_{
//        unsigned short uwErrorId;
//        char *szErrorText;
//}tdstErrorMsg;
#endif /*NO_ACP_MEMORY*/
 
/*------- end of special NO_ACP_ERR*/
 
/*
#define __FATAL_ERR_SND__
#define __WARNING1_ERR_SND__
#define __WARNING2_ERR_SND__
#define __WARNING3_ERR_SND__
//----------
// Constant	 
//----------
// error of the Snd Module
typedef enum e_uwSndErrNumber_{
	E_uwSndFatalErr,	
#ifdef __FATAL_ERR_SND__
//     -----------------
	E_uwSndMemoryBlockError,	 
	E_uwSndThreadDeadLockError,	 
	E_uwSndThreadReentranceDetectedError,
    E_uwSndInitNotDoneError,
    E_uwSndBadHostConfiguration,
	E_uwSndFatalError4,	
#endif //__FATAL_ERR_SND__
	E_uwSndStartOfWarning,// important constant, it allows to recognize if an error is fatal or not.
#ifdef __WARNING1_ERR_SND__
//     -------------------
	E_uwSndMemoryAllocError,	 
	E_uwSndMemoryReAllocError,	 
	E_uwSndCannotOpenFile,	
	E_uwSndErrorReadingFile,	
	E_uwSndINIFileNotFound,
#endif //__WARNING1_ERR_SND__
#ifdef __WARNING2_ERR_SND__
//     -------------------
	E_uwSndScriptLoadError,	
 
	E_uwSndDLLCannotFindFunction,
	E_uwSndDLLCannotLoadDLL,
	E_uwSndEndOfWarningLevel2,
#endif //__WARNING2_ERR_SND__
#ifdef __WARNING3_ERR_SND__
//     -------------------
	E_uwSndResourceMissing,	
	E_uwSndTooManyEvents,	
	E_uwSndInvalidTypeOfEvent,
	E_uwSndTooManyVoices,
	E_uwSndInvalidTypeOfResource,
	E_uwSndTooManySequences,
	E_uwSndTooManySamples,
	E_uwSndTooManySwitchs,
	E_uwSndTooManySplits,
	E_uwSndInvalidDynParamForResource,
	E_uwSndInvalidStaticParamForResource,
	E_uwSndThreadMultiThreadDetectedError,	 
	E_uwSndSystemError,
    E_uwSndWaveCreateThread,
 
  E_uwSndCDLoadTrack,
  E_uwSndCDStatus,
  E_uwSndCDSet,
  E_uwSndCDPlay,
  E_uwSndCDStop,
  E_uwSndCDNotifyFailure,
  E_uwSndCDNotifyAborted,
  E_uwSndCDNotifySuperseded,
  E_uwSndCDCreateThread,
  E_uwSndCDClose,
  E_uwSndCDFade,
  E_uwSndCDSeek,
  E_uwSndCDNbTracks,
  E_uwSndCDRegisterWndClass,
 
  E_uwSndMIDILoadTrack,
  E_uwSndMIDIUnloadTrack,
  E_uwSndMIDIStatus,
  E_uwSndMIDISet,
  E_uwSndMIDIPlay,
  E_uwSndMIDIStop,                      
  E_uwSndMIDINotifyFailure,
  E_uwSndMIDINotifyAborted,
  E_uwSndMIDINotifySuperseded,
  E_uwSndMIDICreateThread,
  E_uwSndMIDIOpen,
  E_uwSndMIDIClose,
  E_uwSndMIDIFade,
  E_uwSndMIDISeek,
  E_uwSndMIDINbTracks,
  E_uwSndMIDIAllTracksUsed,
 
  E_uwSndMixerNoMixer,
  E_uwSndMixerNoId,
  E_uwSndMixerOpen,
  E_uwSndMixerCapacities,
  E_uwSndMixerDesinit,
  E_uwSndEventNotInABank,
  E_uwSndEventUsesUnloadedBank,
 
	E_uwSndEndOfWarningLevel3,
#endif //__WARNING3_ERR_SND__
	E_uwSndErrNumber
} e_uwSndErrNumber;
*/
/*
//------------------
// Global Variables
//------------------
*/
#undef __ERRSND_EXTERN
#ifndef __DeclareGlobalVariableErrSnd_h__
#define __ERRSND_EXTERN extern /*external declaration*/
#else /*__DeclareGlobalVariableErrSnd_h__*/
#define __ERRSND_EXTERN /*replace by nothing : we have to declare*/
#endif /*__DeclareGlobalVariableErrSnd_h__*/
 
__ERRSND_EXTERN CPA_EXPORT  unsigned char g_ucSndModuleId /*number of identification of the Erm module*/
#if defined(__DeclareGlobalVariableErrSnd_h__) && !defined(CPA_WANTS_IMPORT)
= C_ucModuleNotInitialized
#endif /*__DeclareGlobalVariableErrSnd_h__&& CPA_WANTS_IMPORT*/
;
 
#ifdef __ERROR_STRINGS__
 
__ERRSND_EXTERN CPA_EXPORT  char * g_a_szSndInformationModule[]
#if defined(__DeclareGlobalVariableErrSnd_h__) && !defined(CPA_WANTS_IMPORT)
={
#ifndef U64
#include "SNDext\version.txt"
#else
#include "SNX\version.txt"
#endif
    , C_szSndFullName,C_szSndDate}
#endif /*__DeclareGlobalVariableErrSnd_h__ && CPA_WANTS_IMPORT*/
;
 
__ERRSND_EXTERN CPA_EXPORT  char * g_szSndModuleName /* Mandatory syntax 'g_sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(__DeclareGlobalVariableErrSnd_h__) && !defined(CPA_WANTS_IMPORT)
= "Module Snd"
#endif /*__DeclareGlobalVariableErrSnd_h__ && CPA_WANTS_IMPORT*/
;
 
__ERRSND_EXTERN CPA_EXPORT tdstErrorMsg g_a_stSndTabErr[] /* Mandatory syntax 'g_a_st'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(__DeclareGlobalVariableErrSnd_h__) && !defined(CPA_WANTS_IMPORT)
={ 
#ifdef __FATAL_ERR_SND__   
/*	 -------------*/
	E_uwSndMemoryBlockError, "Cannot allocate main memory-block for sound engine",
	E_uwSndThreadDeadLockError, "Possible DeadLock with Sound Engine",
	E_uwSndThreadReentranceDetectedError,"Detected Re-entrance in SoundLibrary",
    E_uwSndInitNotDoneError, "Sound Engine cannot be used before initialization",
    E_uwSndBadHostConfiguration, "Sound Engine cannot be runned on this Machine. Missing component:",
	E_uwSndFatalError4, " text of the error # E_uwSndFatalError4",
#endif /*__FATAL_ERR_SND__*/
#ifdef __WARNING1_ERR_SND__
/*	 ----------------*/
	E_uwSndMemoryAllocError, "Cannot allocate memory for sound data",
	E_uwSndMemoryReAllocError, "Cannot (re)allocate memory for sound data",
	E_uwSndCannotOpenFile, "Cannot open file",
	E_uwSndErrorReadingFile, "Error reading file",
	E_uwSndINIFileNotFound, "INI file for Sound options cannot be found",
#endif /*__WARNING1_ERR_SND__*/
#ifdef __WARNING2_ERR_SND__
/*	 ----------------*/
	E_uwSndScriptLoadError, "error while loading from script ",
	E_uwSndDLLCannotFindFunction, "Cannot dynamically resolve function ",
	E_uwSndDLLCannotLoadDLL, "Cannot load DLL ",
#endif /*__WARNING2_ERR_SND__*/
#ifdef __WARNING3_ERR_SND__
/*	 ----------------*/
	E_uwSndResourceMissing, " Missing Windows-Resource for Sound Library",	
	E_uwSndTooManyEvents, " Too many Events for SOUND3D ",
	E_uwSndInvalidTypeOfEvent , " Invalid type of Sound Event ",
	E_uwSndTooManyVoices, " Too many Voices for SNDPLAY ",
	E_uwSndInvalidTypeOfResource , " Invalid type of Sound Resource ",
	E_uwSndTooManySequences, " Too many Voices for SNDSEQ",
	E_uwSndTooManySamples, " Too many Voices for SNDXD ",
	E_uwSndTooManySwitchs, " Too many Voices for SNDSwitch",
	E_uwSndTooManySplits, " Too many Voices for SNDSplits",
	E_uwSndInvalidDynParamForResource , " Invalid dynamic parameters for resource ",
	E_uwSndInvalidStaticParamForResource , " Invalid static parameters for resource ",
	E_uwSndThreadMultiThreadDetectedError,"Multi-threading not allowed with SoundLibrary",
	E_uwSndSystemError,"Problem with your sound card",
    E_uwSndWaveCreateThread,"Cannot create Wave thread",
 
  E_uwSndCDLoadTrack,"CD : Loading resource error",
  E_uwSndCDStatus,"CD : Status command error",
  E_uwSndCDSet,"CD : Set command error",
  E_uwSndCDPlay,"CD : Play command error",
  E_uwSndCDStop,"CD : Stop command error",
  E_uwSndCDNotifyFailure,"CD : Notify Failure",
  E_uwSndCDNotifyAborted,"CD : Notify aborted",
  E_uwSndCDNotifySuperseded,"CD : Notify superseded",
  E_uwSndCDCreateThread,"CD : Creating thread failed",
  E_uwSndCDClose,"CD : Close command error",
  E_uwSndCDFade,"CD : Fade error",
  E_uwSndCDSeek,"CD : Seek command error",
  E_uwSndCDNbTracks,"CD : Bad Cd error",
  E_uwSndCDRegisterWndClass,"CD : Register wnd class failed",
 
  E_uwSndMIDILoadTrack,"MIDI : Loading resource error",
  E_uwSndMIDIUnloadTrack,"MIDI : Unloading resource error",
  E_uwSndMIDIStatus,"MIDI : Status command error",
  E_uwSndMIDISet,"MIDI : Set command error",
  E_uwSndMIDIPlay,"MIDI : Play command error",
  E_uwSndMIDIStop,"MIDI : Stop command error",
  E_uwSndMIDINotifyFailure,"MIDI : Notify Failure",
  E_uwSndMIDINotifyAborted,"MIDI : Notify aborted",
  E_uwSndMIDINotifySuperseded,"MIDI : Notify superseded",
  E_uwSndMIDICreateThread,"MIDI : CreateThread failed",
  E_uwSndMIDIOpen,"MIDI : Open command error",
  E_uwSndMIDIClose,"MIDI : Close command error",
  E_uwSndMIDIFade,"MIDI : Fade error",
  E_uwSndMIDISeek,"MIDI : Seek command error",
  E_uwSndMIDINbTracks,"MIDI : Bad MIDI error",
  E_uwSndMIDIAllTracksUsed,"MIDI : All tracks used",
 
  E_uwSndMixerNoMixer,"Mixer : No mixer available",
  E_uwSndMixerNoId,"Mixer : No mixer Id available",
  E_uwSndMixerOpen,"Mixer : Open command",
  E_uwSndMixerCapacities,"Mixer : Getcaps command",
  E_uwSndMixerDesinit,"Mixer : close command",
  E_uwSndEventNotInABank,"Sound Event is in no sound bank",
  E_uwSndEventUsesUnloadedBank,"Bank containing sound event is not loaded",
 
#endif /*__WARNING3_ERR_SND__*/
	0xFFFF, "\0"/*fin*/
}
#endif /*__DeclareGlobalVariableErrSnd_h__ && CPA_WANTS_IMPORT*/
;
 
#endif /*__ERROR_STRINGS__*/
 
#ifdef __cplusplus
};
#endif /* __cplusplus */
 
 
#endif /*__ERRSND_H__*/
 
