16#define IX_DSP_FILE "D:\\rnd\\prj\\ix\\win95\\dsp\\dsp.cpp"
34#define IX_MALLOC_HOOK malloc
37void (__cdecl *g_pIxFree)(
void *) = free;
102 g_pIxMalloc = (
void *(__cdecl *)(
unsigned int))value;
105 g_pIxFree = (
void (__cdecl *)(
void *))value;
112 LPSTR module, LPVOID context)
121 if (result == DS_OK) {
125 ? DSSCL_WRITEPRIMARY : DSSCL_EXCLUSIVE);
126 if (result == DS_OK) {
127 ix_log_printf(
"sound driver: %s [%s]\n", description, module);
180 ix_log_printf(
"can't change voice count while voices are in use");
202 ix_log_printf(
"can't change stream count while voices are in use");
205 if (streamCount >= 0)
223 if ((volume & 0xffff) >= 0) {
225 (volume & 0xffff) < 0xffff ? (volume & 0xffff) : 0xffff);
246 for (entry = 0; entry < 0x40; entry++) {
247 offset = (short)(0x20 - entry);
248 right = (short)(offset * step);
252 (short)(leftAmp * -1);
256 right = (short)0x8001;
257 for (entry = 0x40; entry < 0x80; entry++) {
258 offset = (short)(0x60 - entry);
259 leftAmp = (short)(offset * step);
263 (short)(leftAmp * -1);
274 return "The function succeeded.";
275 case DSERR_ALLOCATED:
276 return "The function failed because resources (such as a priority level) were already in use by another caller.";
277 case DSERR_ALREADYINITIALIZED:
278 return "This object is already initialized.";
279 case DSERR_BADFORMAT:
280 return "The specified wave format is not supported.";
281 case DSERR_BUFFERLOST:
282 return "The buffer memory has been lost and must be restored.";
283 case DSERR_CONTROLUNAVAIL:
284 return "The control (volume, pan, and so forth) requested by the caller is not available.";
285 case DSERR_INVALIDCALL:
286 return "This function is not valid for the current state of this object";
287 case DSERR_INVALIDPARAM:
288 return "An invalid parameter was passed to the returning function.";
289 case DSERR_NOAGGREGATION:
290 return "This object does not support aggregation.";
292 return "No sound driver is available for use.";
293 case DSERR_OUTOFMEMORY:
294 return "The DirectSound subsystem couldn't allocate sufficient memory to complete the caller's request.";
295 case DSERR_PRIOLEVELNEEDED:
296 return "The caller does not have the priority level required for the function to succeed.";
298 return "The requested COM interface is not available.";
300 return "Unknow dsound error!";
311#pragma function(memcpy)
312void *
ix_dsp_copy(
void *destination,
const void *source,
unsigned int bytes)
314 return memcpy(destination, source, bytes);
void ix_dsp_build_pan_tables(void)
int ix_dsp_get_stream_count(void)
unsigned short g_nMasterVolume
void ix_dsp_configure(int option, void *value)
int ix_dsp_get_voice_count(void)
void ix_dsp_set_stream_count(int streamCount)
unsigned int ix_dsp_get_tick(void)
void ix_dsp_shutdown(void)
unsigned int ix_dsp_get_flags(void)
void ix_dsp_set_config_bit3(int enabled)
void ix_dsp_set_voice_count(int voiceCount)
unsigned int g_6_dwDsoundTick
void *__cdecl * g_pIxMalloc(unsigned int)
LPDIRECTSOUND g_1_pDirectSound
LPDIRECTSOUNDBUFFER g_1_pPrimarySoundBuffer
BOOL CALLBACK ix_dsp_open_driver(LPGUID guid, LPSTR description, LPSTR module, LPVOID context)
LPDIRECTSOUNDBUFFER g_pMixerBuffer
void ix_dsp_free(void *memory)
unsigned short ix_dsp_get_master_volume(void)
void ix_dsp_set_config_bit1(int enabled)
short g_3_anPanTable[512]
void * ix_dsp_copy(void *destination, const void *source, unsigned int bytes)
void(__cdecl *g_pIxFree)(void *)
void ix_dsp_set_master_volume(unsigned short volume)
unsigned int g_5_dwSoundOptions
const char * ix_dsp_result_to_text(int result)
HANDLE g_2_hMixerRouseEvent
void * ix_dsp_alloc(unsigned int bytes)
unsigned int g_dwMixerScratchSize
unsigned int g_3_dwMixWriteOffset
CRITICAL_SECTION g_7_csMixer
void ix_dspv_recalc_mix(int voice)
Audio classes, DirectSound interfaces and shared ix state.
void ix_log_printf(const char *fmt,...)
DWORD WINAPI ix_mixer_thread_proc(void *parameter)