Unit DWaveMix |
Classes |
TfChannels - Renamed from WaveMix.
TWaveMix -
TWaveMixChannelsProperty -
Functions |
InitLibrary - get the system directory don't bother checking path, because will fail when I do cmp anyway
MixerPlay - This is the main mixing function, it gets called often and so is a good candidate for assembly optimization.
MyWaveOutGetPosition -
MyWaveOutReset - bugbug: if stereo gets screwed up may need to force dwBaseTime to be block aligned
Register - *********************************
TWaveMix
WaveMixActivate - error msg already displayed in AllocWaveBlocks */
WaveMixCloseChannel - don't remix if that channel didn't have data on it.
WaveMixCloseSession -
WaveMixConfigureInit - * if we are running on NT don't want to use our technique of flooding the wave output to
** try to figure out the DMA size since the way NT protects the hardware makes this inaccurate
WaveMixFlushChannel - * if we are not already playing we should pause before submitting data or we
** may not be able to do it fast enough and will cause a hicup
WaveMixFreeWave - * flush the channel and let WaveMixFlushChannel do all the
** error checking for us
WaveMixInit - function prototypes
adjust the wave format if the sampling rate is no longer set to the default */
WaveMixOpenChannel - return same errors as waveOutOpen, waveOutWrite, and waveOutClose */
WaveMixOpenWave - SamplesPerSec align the data, e.
WaveMixPlay - if the playqueue is empty we want to reset our global waveoutposition back to 0 so we don't have to worry about the waveout position wrapping back to zero and messing up all sounds still playing (this would take 13.
Types |
CHANNELNODE
fnRemix
fnSampleAdjust
GLOBALS
HPINT
PCHANNELNODE
PDWord
PGLOBALS
PLAYQUEUE
PMixConfig
PMixPlayParams
PMixWave
PPCMWaveFormat
PPLAYQUEUE
PSAMPLE
PSAMPLE16
PWaveFormat
PXWAVEHDR
TMixConfig
TMixPlayParams
TMixWave
TPCMWaveFormat
TWaveFormat
TWaveMixChannels
XWAVEHDR
Constants |
BITSPERBYTE
BITSPERSAMPLE
BYTESPERSAMPLE
COUNTNODES
DEBUGOUTPUT
DEFAULT_GOODWAVPOS
DEFAULT_NTWAVEBLOCKLEN
DEFAULT_REMIXALGORITHM
DEFAULT_SAMPLESPERSEC
DEFAULT_WAVEBLOCKLEN
DEFAULT_WAVEBLOCKS
gpFormat
gszAppName
gszDefault
gszIniFile
gszMemError
MAGICNO
MAJORVERSION
MAXCHANNELS
MAXFILENAME
MAXQUEUEDWAVES
MAXWAVEBLOCKLEN
MAXWAVEBLOCKS
MINORVERSION
MINWAVEBLOCKLEN
MINWAVEBLOCKS
MONO
NUMHDRS
SAMPLESPERSEC
SILENCE
WAVEBUFSIZE
WF_WINNT
WMIX_ALL
WMIX_CHANNELS
WMIX_CLEARQUEUE
WMIX_CONFIG_CHANNELS
WMIX_CONFIG_SAMPLINGRATE
WMIX_FILE
WMIX_HIGHPRIORITY
WMIX_MEMORY
WMIX_NOREMIX
WMIX_OPENALL
WMIX_OPENCOUNT
WMIX_OPENSINGLE
WMiX_QUEUEWAVE
WMIX_RESOURCE
WMIX_SAMPLINGRATE
WMIX_USELRUCHANNEL
WMIX_WAIT
_MAX_PATH
Variables |
Functions |
adjust the wave format if the sampling rate is no longer set to the default */
Types |
CHANNELNODE = record
next : PCHANNELNODE;
PlayParams : TMIXPLAYPARAMS;
lpMixWave : PMIXWAVE;
dwNumSamples : DWord;
dwStartPos : DWord;
dwEndPos : DWord;
lpPos : PSAMPLE;
lpEnd : PSAMPLE;
end;
fnRemix = procedure (dwRemixSamplePos: DWord; pCD: PCHANNELNODE)this is pointer to last sample of actual wave data
fnSampleAdjust = function (dwSamplePos: DWord; dwAdjustAmt: DWord): DWord
GLOBALS = record
wMagic1 : Word;
hWndApp : HWND;
fShow : Boolean;
hWaveOut : HWAVEOUT;
fActive : Boolean;
wDeviceID : UINT;
szDevicePName : array [0..MAXPNAMELEN] of char;
aChannel : array [0..MAXCHANNELS-1] of PCHANNELNODE;
iChannels : Integer;
MRUChannel : array [0..MAXCHANNELS-1] of DWord;
dwMRU : DWord;
pcm : TPCMWAVEFORMAT;
dwWaveBlockLen : DWord;
iNumWaveBlocks : Integer;
dwCurrentSample : DWord;
dwBaseTime : DWord;
fGoodGetPos : Boolean;
dwWaveOutPos : DWord;
pfnRemix : fnRemix;
pfnSampleAdjust : fnSampleAdjust;
pWaitList : PCHANNELNODE;
wMagic2 : Word;
end;
HPINT = ^Word
PCHANNELNODE = ^CHANNELNODE
PDWord = ^DWord
PGLOBALS = ^GLOBALS
PLAYQUEUE = record
first : PXWAVEHDR;
last : PXWAVEHDR;
end;
PMixConfig = ^TMixConfig11, 22, or 44 kHz
PMixPlayParams = ^TMixPlayParams# of times to loop ($FFFF = indefinite
PMixWave = ^TMixWave
PPCMWaveFormat = ^TPCMWaveFormat
PPLAYQUEUE = ^PLAYQUEUE
PSAMPLE = PCHAR
PSAMPLE16 = ^Smallint
PWaveFormat = ^TWaveFormat
PXWAVEHDR = ^XWAVEHDR
TMixConfig = recordblock size of data
wSize : word;
dwFlags : longint;
wChannels : word;
wSamplingRate : word;
end;
TMixPlayParams = record
Size : Word;
hMixSession : THandle;
iChannel : Integer;
lpMixWave : PMixWave;
hWndNotify : HWND;
dwFlags : Longint;
wLoops : Word;
end;
TMixWave = record
pcm : TPCMWAVEFORMAT;
wh : TWAVEHDR;
szWaveFilename : array [0..MAXFILENAME] of char;
end;
TPCMWaveFormat = record
wf : TWaveFormat;
wBitsPerSample : Word;
end;
TWaveFormat = record
wFormatTag : Word;
nChannels : Word;
nSamplesPerSec : DWord;
nAvgBytesPerSec : DWord;
nBlockAlign : Word;
end;
TWaveMixChannels = Byte**************************************** ***** TWaveMix Component *****************
XWAVEHDR = record
wh : TWAVEHDR;
fAvailable : Boolean;
dwWavePos : DWord;
g : PGLOBALS;
QNext : PXWAVEHDR;
end;
Constants |
Variables |