/*---------------------------------------------------------------
FILE:   priv3dFl.h
ROLE:   private flags for DSound3d

MODIFICATIONS: - J.Vibert - 01/12/98 - extracted from sndxdwav.c
----------------------------------------------------------------*/

// suppress DEFINES (precaution to avoid random bug from visual)
#ifdef USE_DEBUGFILE
#undef USE_DEBUGFILE
#endif

#ifdef DBG_NB_BUF
#undef DBG_NB_BUF
#endif

#ifdef USE_TEST_CODE
#undef USE_TEST_CODE
#endif

#ifdef CREATE_ONLY
#undef CREATE_ONLY
#endif

#ifdef SIMU_CRITICAL_BUFF_NB
#undef SIMU_CRITICAL_BUFF_NB
#endif

#ifdef AVOID_FOCUS_PB
#undef AVOID_FOCUS_PB
#endif

//--------------------------------------------------------------------------
//   DEFINES: comment or uncomment according to your needs
//--------------------------------------------------------------------------
//AVOID_FOCUS_PB=>if a bad window handle is used, allows to (still) hear sounds
//#define AVOID_FOCUS_PB

//USE_DEBUGFILE=>a call to jvdbg(char *) causes the string to be dumped into a file
//#define USE_DEBUGFILE

//DBG_NB_BUF=>include numbers of buffers in debugging file (if debugging file is activated)
#define DBG_NB_BUF

//CREATE_ONLY=>buffers are always created during the play function or simply assigned
//otherwise, the first one is created "normally" during the play, and the next ones are
// duplicated or assigned(or created if the first one was destroyed or if an error occurred)
//[should be tested again]
//#define CREATE_ONLY

//DANGER_BUFF_NB: number of buffers left below which we must be very careful with buffer allocation
#define DANGER_BUFF_NB 8

//SIMU_CRITICAL_BUFF_NB: simulate allocated buffers
//(convenient to test DANGER_BUFF_NB on cards with many buffers)
//#define SIMU_CRITICAL_BUFF_NB
#define SIMU_BUFF_NB      235 //number of simulated allocated buffers (if SIMU_CRITICAL_BUFF_NB)
						      //very careful after SIMU_BUFF_NB+DANGER_BUFF_NB buffers
#define CRITICAL_BUFF_NB DANGER_BUFF_NB


//to activate temporary test code
//#define USE_TEST_CODE


#define DISTANCE_FACTOR 1.f
#define ROLLOFF_FACTOR  1.0f
#define DOPPLER_FACTOR  1.1f

#define FLAG_PLAYING			1
#define FLAG_LOOPING			2
#define FLAG_PAUSED				4
#define FLAG_3D					8
#define FLAG_WAITINGCALLBACK	16
#define FLAG_WAITINGLOOP		32
#define FLAG_VIRTUAL            256 // virtual management of sounds between ForceReleaseBuffer and ForceRestoreBuffer
#define FLAG_SETVIRTVOL         512 // modification of volume while Buffer released=>must be updated later
#define FLAG_SETVIRTFREQ        1024// modification of frequency while Buffer released=>must be updated later

#define C_VIRTUAL_VOL_MASK   0xFF0000 //the volume index is coded with the flags
#define C_VIRTUAL_VOL_SHIFT  0x10

//indicate if the directsound buffers have been created
#define FLAG_BUFFATT            64
#define FLAG_BUFFLOOP           128
#define FLAG_BUFFS              (FLAG_BUFFATT|FLAG_BUFFLOOP)

//indicate if the data have been loaded (the same as the preceding flags now, but used to be !=)
//must be below 256 in current version (byte => mem)
#define FLAG_ALLOCATED          32
#define FLAG_LOADEDATT          64
#define FLAG_LOADEDLOOP         128
#define FLAG_LOADEDBUFFS        (FLAG_LOADEDATT|FLAG_LOADEDLOOP)

/* global flags to indicate some actions to perform on the next ForceRestore */
#define SND_FLAG_FORCEVOL  1
 
/*
  NB_VOICES maximum number of 3D voices description (1 or 2 buffers per voice)
  >Number of virtual voices, to allow more allocations of buffers

  Maximum number of virtual voices chosen by the dll: 31

  F1: about 65 samples
  31 voices can be played on MaxiSound (but 248 buffers can be created)
  =>with 96 voices we should be able to avoid dynamic buffer creation
  with F1 on cards with sufficient amount of buffers (MaxiSound...)

  #define NB_VOICES 100
 */
#define NB_VOICES 64

#ifdef USE_DEBUGFILE
void jvdbg(char *s);
#else
#define jvdbg(a)
#endif
