Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
dsp.cpp File Reference

DirectSound initialization, device configuration and buffers. More...

#include "ix.h"
#include <dsound.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define IX_DSP_FILE   "D:\\rnd\\prj\\ix\\win95\\dsp\\dsp.cpp"
#define IX_MALLOC_HOOK   malloc

Functions

void *__cdecl * g_pIxMalloc (unsigned int)
 void (__cdecl *g_pIxFree)(void *)
int ix_dsp_init (void)
void ix_dsp_shutdown (void)
void ix_dsp_configure (int option, void *value)
BOOL CALLBACK ix_dsp_open_driver (LPGUID guid, LPSTR description, LPSTR module, LPVOID context)
unsigned int ix_dsp_get_tick (void)
unsigned int ix_dsp_get_flags (void)
void ix_dsp_set_config_bit1 (int enabled)
void ix_dsp_set_config_bit3 (int enabled)
int ix_dsp_get_voice_count (void)
void ix_dsp_set_voice_count (int voiceCount)
int ix_dsp_get_stream_count (void)
void ix_dsp_set_stream_count (int streamCount)
unsigned short ix_dsp_get_master_volume (void)
void ix_dsp_set_master_volume (unsigned short volume)
void ix_dsp_build_pan_tables (void)
const char * ix_dsp_result_to_text (int result)
void * ix_dsp_alloc (unsigned int bytes)
void * ix_dsp_copy (void *destination, const void *source, unsigned int bytes)
void ix_dsp_free (void *memory)

Variables

HANDLE g_hMixerTask
HWND g_4_hDspWnd
HANDLE g_2_hMixerRouseEvent
unsigned int g_3_dwMixWriteOffset
LPDIRECTSOUND g_1_pDirectSound
unsigned int g_dwMixerScratchSize
unsigned int g_5_dwSoundOptions
DWORD g_1_dwMixWorkerId
LPDIRECTSOUNDBUFFER g_pMixerBuffer
unsigned int g_6_dwDsoundTick
LPDIRECTSOUNDBUFFER g_1_pPrimarySoundBuffer
short g_3_anPanTable [512]
int g_nVoicesReserved
unsigned short g_nMasterVolume = 0xffff

Detailed Description

DirectSound initialization, device configuration and buffers.

Definition in file dsp.cpp.

Macro Definition Documentation

◆ IX_DSP_FILE

#define IX_DSP_FILE   "D:\\rnd\\prj\\ix\\win95\\dsp\\dsp.cpp"

Definition at line 16 of file dsp.cpp.

Referenced by ix_dsp_init(), ix_dsp_set_stream_count(), and ix_dsp_set_voice_count().

◆ IX_MALLOC_HOOK

#define IX_MALLOC_HOOK   malloc

Definition at line 34 of file dsp.cpp.

Referenced by g_pIxMalloc().

Function Documentation

◆ g_pIxMalloc()

◆ ix_dsp_alloc()

void * ix_dsp_alloc ( unsigned int bytes)

◆ ix_dsp_build_pan_tables()

void ix_dsp_build_pan_tables ( void )

Definition at line 236 of file dsp.cpp.

References g_3_anPanTable, and ix_dsp_build_pan_tables().

Referenced by ix_dsp_build_pan_tables(), and ix_dsp_init().

◆ ix_dsp_configure()

◆ ix_dsp_copy()

void * ix_dsp_copy ( void * destination,
const void * source,
unsigned int bytes )

◆ ix_dsp_free()

void ix_dsp_free ( void * memory)

Definition at line 318 of file dsp.cpp.

References ix_dsp_free().

Referenced by ix_dsp_free(), and IxSample::ix_sample_destruct().

◆ ix_dsp_get_flags()

unsigned int ix_dsp_get_flags ( void )

Definition at line 145 of file dsp.cpp.

References g_5_dwSoundOptions, and ix_dsp_get_flags().

Referenced by ix_dsp_get_flags().

◆ ix_dsp_get_master_volume()

unsigned short ix_dsp_get_master_volume ( void )

Definition at line 213 of file dsp.cpp.

References g_nMasterVolume, and ix_dsp_get_master_volume().

Referenced by ix_dsp_get_master_volume(), and ix_system_get_master_volume().

◆ ix_dsp_get_stream_count()

int ix_dsp_get_stream_count ( void )

Definition at line 191 of file dsp.cpp.

References g_3_nStreamCount, and ix_dsp_get_stream_count().

Referenced by ix_dsp_get_stream_count().

◆ ix_dsp_get_tick()

unsigned int ix_dsp_get_tick ( void )

◆ ix_dsp_get_voice_count()

int ix_dsp_get_voice_count ( void )

◆ ix_dsp_init()

◆ ix_dsp_open_driver()

BOOL CALLBACK ix_dsp_open_driver ( LPGUID guid,
LPSTR description,
LPSTR module,
LPVOID context )

◆ ix_dsp_result_to_text()

const char * ix_dsp_result_to_text ( int result)

Definition at line 270 of file dsp.cpp.

References ix_dsp_result_to_text().

Referenced by ix_dsp_result_to_text(), ix_mixer_service(), and ix_mixer_thread_proc().

◆ ix_dsp_set_config_bit1()

void ix_dsp_set_config_bit1 ( int enabled)

Definition at line 151 of file dsp.cpp.

References g_5_dwSoundOptions, and ix_dsp_set_config_bit1().

Referenced by ix_dsp_set_config_bit1().

◆ ix_dsp_set_config_bit3()

void ix_dsp_set_config_bit3 ( int enabled)

Definition at line 160 of file dsp.cpp.

References g_5_dwSoundOptions, and ix_dsp_set_config_bit3().

Referenced by ix_dsp_set_config_bit3().

◆ ix_dsp_set_master_volume()

void ix_dsp_set_master_volume ( unsigned short volume)

◆ ix_dsp_set_stream_count()

void ix_dsp_set_stream_count ( int streamCount)

◆ ix_dsp_set_voice_count()

void ix_dsp_set_voice_count ( int voiceCount)

◆ ix_dsp_shutdown()

◆ void()

Variable Documentation

◆ g_1_dwMixWorkerId

DWORD g_1_dwMixWorkerId

Definition at line 25 of file dsp.cpp.

Referenced by ix_dsp_init().

◆ g_1_pDirectSound

LPDIRECTSOUND g_1_pDirectSound

◆ g_1_pPrimarySoundBuffer

LPDIRECTSOUNDBUFFER g_1_pPrimarySoundBuffer

Definition at line 28 of file dsp.cpp.

Referenced by ix_mixer_thread_proc().

◆ g_2_hMixerRouseEvent

HANDLE g_2_hMixerRouseEvent

Definition at line 20 of file dsp.cpp.

Referenced by ix_dsp_configure(), ix_dsp_init(), ix_dsp_shutdown(), and ix_mixer_thread_proc().

◆ g_3_anPanTable

short g_3_anPanTable[512]

Definition at line 29 of file dsp.cpp.

Referenced by ix_dsp_build_pan_tables(), ix_dspv_recalc_mix(), and void().

◆ g_3_dwMixWriteOffset

unsigned int g_3_dwMixWriteOffset

Definition at line 21 of file dsp.cpp.

Referenced by ix_dsp_init(), and ix_mixer_service().

◆ g_4_hDspWnd

HWND g_4_hDspWnd

Definition at line 19 of file dsp.cpp.

Referenced by ix_dsp_configure(), and ix_dsp_open_driver().

◆ g_5_dwSoundOptions

◆ g_6_dwDsoundTick

unsigned int g_6_dwDsoundTick

Definition at line 27 of file dsp.cpp.

Referenced by ix_dsp_get_tick(), and ix_mixer_service().

◆ g_dwMixerScratchSize

unsigned int g_dwMixerScratchSize

Definition at line 23 of file dsp.cpp.

Referenced by ix_mixer_service(), and ix_mixer_thread_proc().

◆ g_hMixerTask

HANDLE g_hMixerTask

Definition at line 18 of file dsp.cpp.

Referenced by ix_dsp_init(), and ix_dsp_shutdown().

◆ g_nMasterVolume

unsigned short g_nMasterVolume = 0xffff

◆ g_nVoicesReserved

int g_nVoicesReserved
extern

Definition at line 249 of file dspv.cpp.

Referenced by ix_dsp_set_stream_count(), and ix_dsp_set_voice_count().

◆ g_pMixerBuffer

LPDIRECTSOUNDBUFFER g_pMixerBuffer

Definition at line 26 of file dsp.cpp.

Referenced by ix_mixer_service(), and ix_mixer_thread_proc().