15#define IX_DSP_FILE "D:\\rnd\\prj\\ix\\win95\\dsp\\dsp.cpp"
19void (__cdecl *pIxFree)(
void *) = free;
41 InitializeCriticalSection(&
csMixer);
70 DeleteCriticalSection(&
csMixer);
97 pIxMalloc = (
void *(__cdecl *)(
unsigned int))value;
100 pIxFree = (
void (__cdecl *)(
void *))value;
107 LPSTR module, LPVOID context)
115 result = DirectSoundCreate(guid, &
pDspDevice, 0);
116 if (result == DS_OK) {
120 ? DSSCL_WRITEPRIMARY : DSSCL_EXCLUSIVE);
121 if (result == DS_OK) {
122 ix_log_printf(
"sound driver: %s [%s]\n", description, module);
175 ix_log_printf(
"can't change voice count while voices are in use");
196 ix_log_printf(
"can't change stream count while voices are in use");
199 if (streamCount >= 0)
216 if ((
volume & 0xffff) >= 0) {
218 (
volume & 0xffff) < 0xffff ? (
volume & 0xffff) : 0xffff);
239 for (panPosition = 0; panPosition < 0x40; panPosition++) {
240 panDistance = (short)(0x20 - panPosition);
241 right = (short)(panDistance * volumeStep);
249 right = (short)0x8001;
250 for (panPosition = 0x40; panPosition < 0x80; panPosition++) {
251 panDistance = (short)(0x60 - panPosition);
252 left = (short)(panDistance * volumeStep);
267 return "The function succeeded.";
268 case DSERR_ALLOCATED:
269 return "The function failed because resources (such as a priority level) were already in use by another caller.";
270 case DSERR_ALREADYINITIALIZED:
271 return "This object is already initialized.";
272 case DSERR_BADFORMAT:
273 return "The specified wave format is not supported.";
274 case DSERR_BUFFERLOST:
275 return "The buffer memory has been lost and must be restored.";
276 case DSERR_CONTROLUNAVAIL:
277 return "The control (volume, pan, and so forth) requested by the caller is not available.";
278 case DSERR_INVALIDCALL:
279 return "This function is not valid for the current state of this object";
280 case DSERR_INVALIDPARAM:
281 return "An invalid parameter was passed to the returning function.";
282 case DSERR_NOAGGREGATION:
283 return "This object does not support aggregation.";
285 return "No sound driver is available for use.";
286 case DSERR_OUTOFMEMORY:
287 return "The DirectSound subsystem couldn't allocate sufficient memory to complete the caller's request.";
288 case DSERR_PRIOLEVELNEEDED:
289 return "The caller does not have the priority level required for the function to succeed.";
291 return "The requested COM interface is not available.";
293 return "Unknow dsound error!";
304#pragma function(memcpy)
305void *
ix_dsp_copy(
void *destination,
const void *source,
unsigned int bytes)
307 return memcpy(destination, source, bytes);
void ix_dsp_build_pan_tables(void)
int ix_dsp_get_stream_count(void)
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(__cdecl *pIxFree)(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)
LPDIRECTSOUNDBUFFER pDspPrimaryBuffer
void *__cdecl * pIxMalloc(unsigned int)
BOOL CALLBACK ix_dsp_open_driver(LPGUID guid, LPSTR description, LPSTR module, LPVOID context)
unsigned short nMasterVolume
void ix_dsp_free(void *memory)
unsigned short ix_dsp_get_master_volume(void)
void ix_dsp_set_config_bit1(int enabled)
LPDIRECTSOUNDBUFFER pMixerBuffer
void * ix_dsp_copy(void *destination, const void *source, unsigned int bytes)
unsigned int dwMixerWriteOffset
const char * ix_dsp_result_to_text(int result)
unsigned int dwSoundBufferSize
void * ix_dsp_alloc(unsigned int bytes)
The library's classes and shared declarations.
void ix_log_printf(const char *fmt,...)
DWORD WINAPI ix_mixer_thread_proc(void *parameter)
unsigned short nMasterVolume
friend void ix_dsp_set_master_volume(unsigned short)
friend void ix_dspv_recalc_mix(int)