diff options
author | Chris Robinson <[email protected]> | 2012-04-19 23:00:58 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-04-19 23:00:58 -0700 |
commit | 54185196373d04b49a1e4e778b433ab906a6d5bd (patch) | |
tree | 40c3a5e426dc703e70e4bf39c4e1d96699d35cc3 /Alc | |
parent | b023dbe7b87921a5b4eab0ed759e7b3dd04acf57 (diff) |
Remove some more hungarian notation
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 60 | ||||
-rw-r--r-- | Alc/backends/alsa.c | 50 | ||||
-rw-r--r-- | Alc/backends/dsound.c | 32 | ||||
-rw-r--r-- | Alc/backends/oss.c | 36 | ||||
-rw-r--r-- | Alc/backends/solaris.c | 12 | ||||
-rw-r--r-- | Alc/backends/wave.c | 30 | ||||
-rw-r--r-- | Alc/backends/winmm.c | 94 |
7 files changed, 157 insertions, 157 deletions
@@ -1439,47 +1439,47 @@ static ALCdevice *VerifyDevice(ALCdevice *device) * * Initializes context variables */ -static ALvoid InitContext(ALCcontext *pContext) +static ALvoid InitContext(ALCcontext *Context) { ALint i, j; //Initialise listener - pContext->Listener.Gain = 1.0f; - pContext->Listener.MetersPerUnit = 1.0f; - pContext->Listener.Position[0] = 0.0f; - pContext->Listener.Position[1] = 0.0f; - pContext->Listener.Position[2] = 0.0f; - pContext->Listener.Velocity[0] = 0.0f; - pContext->Listener.Velocity[1] = 0.0f; - pContext->Listener.Velocity[2] = 0.0f; - pContext->Listener.Forward[0] = 0.0f; - pContext->Listener.Forward[1] = 0.0f; - pContext->Listener.Forward[2] = -1.0f; - pContext->Listener.Up[0] = 0.0f; - pContext->Listener.Up[1] = 1.0f; - pContext->Listener.Up[2] = 0.0f; + Context->Listener.Gain = 1.0f; + Context->Listener.MetersPerUnit = 1.0f; + Context->Listener.Position[0] = 0.0f; + Context->Listener.Position[1] = 0.0f; + Context->Listener.Position[2] = 0.0f; + Context->Listener.Velocity[0] = 0.0f; + Context->Listener.Velocity[1] = 0.0f; + Context->Listener.Velocity[2] = 0.0f; + Context->Listener.Forward[0] = 0.0f; + Context->Listener.Forward[1] = 0.0f; + Context->Listener.Forward[2] = -1.0f; + Context->Listener.Up[0] = 0.0f; + Context->Listener.Up[1] = 1.0f; + Context->Listener.Up[2] = 0.0f; for(i = 0;i < 4;i++) { for(j = 0;j < 4;j++) - pContext->Listener.Matrix[i][j] = ((i==j) ? 1.0f : 0.0f); + Context->Listener.Matrix[i][j] = ((i==j) ? 1.0f : 0.0f); } - //Validate pContext - pContext->LastError = AL_NO_ERROR; - pContext->UpdateSources = AL_FALSE; - pContext->ActiveSourceCount = 0; - InitUIntMap(&pContext->SourceMap, pContext->Device->MaxNoOfSources); - InitUIntMap(&pContext->EffectSlotMap, pContext->Device->AuxiliaryEffectSlotMax); + //Validate Context + Context->LastError = AL_NO_ERROR; + Context->UpdateSources = AL_FALSE; + Context->ActiveSourceCount = 0; + InitUIntMap(&Context->SourceMap, Context->Device->MaxNoOfSources); + InitUIntMap(&Context->EffectSlotMap, Context->Device->AuxiliaryEffectSlotMax); //Set globals - pContext->DistanceModel = AL_INVERSE_DISTANCE_CLAMPED; - pContext->SourceDistanceModel = AL_FALSE; - pContext->DopplerFactor = 1.0f; - pContext->DopplerVelocity = 1.0f; - pContext->SpeedOfSound = SPEEDOFSOUNDMETRESPERSEC; - pContext->DeferUpdates = AL_FALSE; - - pContext->ExtensionList = alExtList; + Context->DistanceModel = AL_INVERSE_DISTANCE_CLAMPED; + Context->SourceDistanceModel = AL_FALSE; + Context->DopplerFactor = 1.0f; + Context->DopplerVelocity = 1.0f; + Context->SpeedOfSound = SPEEDOFSOUNDMETRESPERSEC; + Context->DeferUpdates = AL_FALSE; + + Context->ExtensionList = alExtList; } diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 8bd86be0..fa79c808 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -434,8 +434,8 @@ static int verify_state(snd_pcm_t *handle) static ALuint ALSAProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - alsa_data *data = (alsa_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + alsa_data *data = (alsa_data*)Device->ExtraData; const snd_pcm_channel_area_t *areas = NULL; snd_pcm_uframes_t update_size, num_updates; snd_pcm_sframes_t avail, commitres; @@ -445,15 +445,15 @@ static ALuint ALSAProc(ALvoid *ptr) SetRTPriority(); - update_size = pDevice->UpdateSize; - num_updates = pDevice->NumUpdates; + update_size = Device->UpdateSize; + num_updates = Device->NumUpdates; while(!data->killNow) { int state = verify_state(data->pcmHandle); if(state < 0) { ERR("Invalid state detected: %s\n", snd_strerror(state)); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } @@ -502,7 +502,7 @@ static ALuint ALSAProc(ALvoid *ptr) } WritePtr = (char*)areas->addr + (offset * areas->step / 8); - aluMixData(pDevice, WritePtr, frames); + aluMixData(Device, WritePtr, frames); commitres = snd_pcm_mmap_commit(data->pcmHandle, offset, frames); if(commitres < 0 || (commitres-frames) != 0) @@ -521,8 +521,8 @@ static ALuint ALSAProc(ALvoid *ptr) static ALuint ALSANoMMapProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - alsa_data *data = (alsa_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + alsa_data *data = (alsa_data*)Device->ExtraData; snd_pcm_sframes_t avail; char *WritePtr; @@ -534,13 +534,13 @@ static ALuint ALSANoMMapProc(ALvoid *ptr) if(state < 0) { ERR("Invalid state detected: %s\n", snd_strerror(state)); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } WritePtr = data->buffer; avail = data->size / snd_pcm_frames_to_bytes(data->pcmHandle, 1); - aluMixData(pDevice, WritePtr, avail); + aluMixData(Device, WritePtr, avail); while(avail > 0) { @@ -862,7 +862,7 @@ static void alsa_stop_playback(ALCdevice *device) } -static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) +static ALCenum alsa_open_capture(ALCdevice *Device, const ALCchar *deviceName) { const char *driver = NULL; snd_pcm_hw_params_t *hp; @@ -909,7 +909,7 @@ static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) } format = -1; - switch(pDevice->FmtType) + switch(Device->FmtType) { case DevFmtByte: format = SND_PCM_FORMAT_S8; @@ -935,9 +935,9 @@ static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) } funcerr = NULL; - bufferSizeInFrames = maxu(pDevice->UpdateSize*pDevice->NumUpdates, - 100*pDevice->Frequency/1000); - periodSizeInFrames = minu(bufferSizeInFrames, 25*pDevice->Frequency/1000); + bufferSizeInFrames = maxu(Device->UpdateSize*Device->NumUpdates, + 100*Device->Frequency/1000); + periodSizeInFrames = minu(bufferSizeInFrames, 25*Device->Frequency/1000); snd_pcm_hw_params_malloc(&hp); #define CHECK(x) if((funcerr=#x),(err=(x)) < 0) goto error @@ -947,9 +947,9 @@ static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) /* set format (implicitly sets sample bits) */ CHECK(snd_pcm_hw_params_set_format(data->pcmHandle, hp, format)); /* set channels (implicitly sets frame bits) */ - CHECK(snd_pcm_hw_params_set_channels(data->pcmHandle, hp, ChannelsFromDevFmt(pDevice->FmtChans))); + CHECK(snd_pcm_hw_params_set_channels(data->pcmHandle, hp, ChannelsFromDevFmt(Device->FmtChans))); /* set rate (implicitly constrains period/buffer parameters) */ - CHECK(snd_pcm_hw_params_set_rate(data->pcmHandle, hp, pDevice->Frequency, 0)); + CHECK(snd_pcm_hw_params_set_rate(data->pcmHandle, hp, Device->Frequency, 0)); /* set buffer size in frame units (implicitly sets period size/bytes/time and buffer time/bytes) */ if(snd_pcm_hw_params_set_buffer_size_min(data->pcmHandle, hp, &bufferSizeInFrames) < 0) { @@ -969,8 +969,8 @@ static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) if(needring) { - data->ring = CreateRingBuffer(FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType), - pDevice->UpdateSize*pDevice->NumUpdates); + data->ring = CreateRingBuffer(FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType), + Device->UpdateSize*Device->NumUpdates); if(!data->ring) { ERR("ring buffer create failed\n"); @@ -986,9 +986,9 @@ static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) } } - pDevice->DeviceName = strdup(deviceName); + Device->DeviceName = strdup(deviceName); - pDevice->ExtraData = data; + Device->ExtraData = data; return ALC_NO_ERROR; error: @@ -1001,20 +1001,20 @@ error2: snd_pcm_close(data->pcmHandle); free(data); - pDevice->ExtraData = NULL; + Device->ExtraData = NULL; return ALC_INVALID_VALUE; } -static void alsa_close_capture(ALCdevice *pDevice) +static void alsa_close_capture(ALCdevice *Device) { - alsa_data *data = (alsa_data*)pDevice->ExtraData; + alsa_data *data = (alsa_data*)Device->ExtraData; snd_pcm_close(data->pcmHandle); DestroyRingBuffer(data->ring); free(data->buffer); free(data); - pDevice->ExtraData = NULL; + Device->ExtraData = NULL; } static void alsa_start_capture(ALCdevice *Device) diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c index 04e428a2..a24e5559 100644 --- a/Alc/backends/dsound.c +++ b/Alc/backends/dsound.c @@ -224,8 +224,8 @@ static BOOL CALLBACK DSoundEnumCaptureDevices(LPGUID guid, LPCSTR desc, LPCSTR d static ALuint DSoundPlaybackProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - DSoundPlaybackData *pData = (DSoundPlaybackData*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + DSoundPlaybackData *pData = (DSoundPlaybackData*)Device->ExtraData; DSBCAPS DSBCaps; DWORD LastCursor = 0; DWORD PlayCursor; @@ -245,12 +245,12 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) if(FAILED(err)) { ERR("Failed to get buffer caps: 0x%lx\n", err); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); return 1; } - FrameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); - FragSize = pDevice->UpdateSize * FrameSize; + FrameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); + FragSize = Device->UpdateSize * FrameSize; IDirectSoundBuffer_GetCurrentPosition(pData->DSsbuffer, &LastCursor, NULL); while(!pData->killNow) @@ -267,7 +267,7 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) if(FAILED(err)) { ERR("Failed to play buffer: 0x%lx\n", err); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); return 1; } Playing = TRUE; @@ -302,8 +302,8 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) if(SUCCEEDED(err)) { // If we have an active context, mix data directly into output buffer otherwise fill with silence - aluMixData(pDevice, WritePtr1, WriteCnt1/FrameSize); - aluMixData(pDevice, WritePtr2, WriteCnt2/FrameSize); + aluMixData(Device, WritePtr1, WriteCnt1/FrameSize); + aluMixData(Device, WritePtr2, WriteCnt2/FrameSize); // Unlock output buffer only when successfully locked IDirectSoundBuffer_Unlock(pData->DSsbuffer, WritePtr1, WriteCnt1, WritePtr2, WriteCnt2); @@ -311,7 +311,7 @@ static ALuint DSoundPlaybackProc(ALvoid *ptr) else { ERR("Buffer lock error: %#lx\n", err); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); return 1; } @@ -877,26 +877,26 @@ static void DSoundStopCapture(ALCdevice *device) } } -static ALCenum DSoundCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples) +static ALCenum DSoundCaptureSamples(ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples) { - DSoundCaptureData *pData = pDevice->ExtraData; + DSoundCaptureData *pData = Device->ExtraData; ReadRingBuffer(pData->pRing, pBuffer, lSamples); return ALC_NO_ERROR; } -static ALCuint DSoundAvailableSamples(ALCdevice *pDevice) +static ALCuint DSoundAvailableSamples(ALCdevice *Device) { - DSoundCaptureData *pData = pDevice->ExtraData; + DSoundCaptureData *pData = Device->ExtraData; DWORD dwRead, dwCursor, dwBufferBytes, dwNumBytes; void *pvAudio1, *pvAudio2; DWORD dwAudioBytes1, dwAudioBytes2; DWORD FrameSize; HRESULT hr; - if(!pDevice->Connected) + if(!Device->Connected) goto done; - FrameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + FrameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); dwBufferBytes = pData->dwBufferBytes; dwCursor = pData->dwCursor; @@ -925,7 +925,7 @@ static ALCuint DSoundAvailableSamples(ALCdevice *pDevice) if(FAILED(hr)) { ERR("update failed: 0x%08lx\n", hr); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); } done: diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c index 302ba101..4fce1a02 100644 --- a/Alc/backends/oss.c +++ b/Alc/backends/oss.c @@ -79,21 +79,21 @@ static int log2i(ALCuint x) static ALuint OSSProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - oss_data *data = (oss_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + oss_data *data = (oss_data*)Device->ExtraData; ALint frameSize; ssize_t wrote; SetRTPriority(); - frameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + frameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); - while(!data->killNow && pDevice->Connected) + while(!data->killNow && Device->Connected) { ALint len = data->data_size; ALubyte *WritePtr = data->mix_data; - aluMixData(pDevice, WritePtr, len/frameSize); + aluMixData(Device, WritePtr, len/frameSize); while(len > 0 && !data->killNow) { wrote = write(data->fd, WritePtr, len); @@ -102,7 +102,7 @@ static ALuint OSSProc(ALvoid *ptr) if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { ERR("write failed: %s\n", strerror(errno)); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } @@ -120,14 +120,14 @@ static ALuint OSSProc(ALvoid *ptr) static ALuint OSSCaptureProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - oss_data *data = (oss_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + oss_data *data = (oss_data*)Device->ExtraData; int frameSize; int amt; SetRTPriority(); - frameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + frameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); while(!data->killNow) { @@ -135,7 +135,7 @@ static ALuint OSSCaptureProc(ALvoid *ptr) if(amt < 0) { ERR("read failed: %s\n", strerror(errno)); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } if(amt == 0) @@ -450,28 +450,28 @@ static void oss_close_capture(ALCdevice *device) device->ExtraData = NULL; } -static void oss_start_capture(ALCdevice *pDevice) +static void oss_start_capture(ALCdevice *Device) { - oss_data *data = (oss_data*)pDevice->ExtraData; + oss_data *data = (oss_data*)Device->ExtraData; data->doCapture = 1; } -static void oss_stop_capture(ALCdevice *pDevice) +static void oss_stop_capture(ALCdevice *Device) { - oss_data *data = (oss_data*)pDevice->ExtraData; + oss_data *data = (oss_data*)Device->ExtraData; data->doCapture = 0; } -static ALCenum oss_capture_samples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples) +static ALCenum oss_capture_samples(ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples) { - oss_data *data = (oss_data*)pDevice->ExtraData; + oss_data *data = (oss_data*)Device->ExtraData; ReadRingBuffer(data->ring, pBuffer, lSamples); return ALC_NO_ERROR; } -static ALCuint oss_available_samples(ALCdevice *pDevice) +static ALCuint oss_available_samples(ALCdevice *Device) { - oss_data *data = (oss_data*)pDevice->ExtraData; + oss_data *data = (oss_data*)Device->ExtraData; return RingBufferSize(data->ring); } diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c index 2eb5776f..7f456609 100644 --- a/Alc/backends/solaris.c +++ b/Alc/backends/solaris.c @@ -53,21 +53,21 @@ typedef struct { static ALuint SolarisProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - solaris_data *data = (solaris_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + solaris_data *data = (solaris_data*)Device->ExtraData; ALint frameSize; int wrote; SetRTPriority(); - frameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + frameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); - while(!data->killNow && pDevice->Connected) + while(!data->killNow && Device->Connected) { ALint len = data->data_size; ALubyte *WritePtr = data->mix_data; - aluMixData(pDevice, WritePtr, len/frameSize); + aluMixData(Device, WritePtr, len/frameSize); while(len > 0 && !data->killNow) { wrote = write(data->fd, WritePtr, len); @@ -76,7 +76,7 @@ static ALuint SolarisProc(ALvoid *ptr) if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { ERR("write failed: %s\n", strerror(errno)); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c index f4f21ecb..1df07078 100644 --- a/Alc/backends/wave.c +++ b/Alc/backends/wave.c @@ -81,45 +81,45 @@ static void fwrite32le(ALuint val, FILE *f) static ALuint WaveProc(ALvoid *ptr) { - ALCdevice *pDevice = (ALCdevice*)ptr; - wave_data *data = (wave_data*)pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)ptr; + wave_data *data = (wave_data*)Device->ExtraData; ALuint frameSize; ALuint now, start; ALuint64 avail, done; size_t fs; - const ALuint restTime = (ALuint64)pDevice->UpdateSize * 1000 / - pDevice->Frequency / 2; + const ALuint restTime = (ALuint64)Device->UpdateSize * 1000 / + Device->Frequency / 2; - frameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + frameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); done = 0; start = timeGetTime(); - while(!data->killNow && pDevice->Connected) + while(!data->killNow && Device->Connected) { now = timeGetTime(); - avail = (ALuint64)(now-start) * pDevice->Frequency / 1000; + avail = (ALuint64)(now-start) * Device->Frequency / 1000; if(avail < done) { /* Timer wrapped (50 days???). Add the remainder of the cycle to * the available count and reset the number of samples done */ - avail += ((ALuint64)1<<32)*pDevice->Frequency/1000 - done; + avail += ((ALuint64)1<<32)*Device->Frequency/1000 - done; done = 0; } - if(avail-done < pDevice->UpdateSize) + if(avail-done < Device->UpdateSize) { Sleep(restTime); continue; } - while(avail-done >= pDevice->UpdateSize) + while(avail-done >= Device->UpdateSize) { - aluMixData(pDevice, data->buffer, pDevice->UpdateSize); - done += pDevice->UpdateSize; + aluMixData(Device, data->buffer, Device->UpdateSize); + done += Device->UpdateSize; if(!IS_LITTLE_ENDIAN) { - ALuint bytesize = BytesFromDevFmt(pDevice->FmtType); + ALuint bytesize = BytesFromDevFmt(Device->FmtType); ALubyte *bytes = data->buffer; ALuint i; @@ -140,12 +140,12 @@ static ALuint WaveProc(ALvoid *ptr) } } else - fs = fwrite(data->buffer, frameSize, pDevice->UpdateSize, + fs = fwrite(data->buffer, frameSize, Device->UpdateSize, data->f); if(ferror(data->f)) { ERR("Error writing to file\n"); - aluHandleDisconnect(pDevice); + aluHandleDisconnect(Device); break; } } diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c index 21d1b50b..5891e320 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -149,8 +149,8 @@ static void ProbeCaptureDevices(void) */ static void CALLBACK WaveOutProc(HWAVEOUT hDevice,UINT uMsg,DWORD_PTR dwInstance,DWORD_PTR dwParam1,DWORD_PTR dwParam2) { - ALCdevice *pDevice = (ALCdevice*)dwInstance; - WinMMData *pData = pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)dwInstance; + WinMMData *pData = Device->ExtraData; (void)hDevice; (void)dwParam2; @@ -170,13 +170,13 @@ static void CALLBACK WaveOutProc(HWAVEOUT hDevice,UINT uMsg,DWORD_PTR dwInstance */ static DWORD WINAPI PlaybackThreadProc(LPVOID lpParameter) { - ALCdevice *pDevice = (ALCdevice*)lpParameter; - WinMMData *pData = pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)lpParameter; + WinMMData *pData = Device->ExtraData; LPWAVEHDR pWaveHdr; ALuint FrameSize; MSG msg; - FrameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + FrameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); SetRTPriority(); @@ -194,7 +194,7 @@ static DWORD WINAPI PlaybackThreadProc(LPVOID lpParameter) pWaveHdr = ((LPWAVEHDR)msg.lParam); - aluMixData(pDevice, pWaveHdr->lpData, pWaveHdr->dwBufferLength/FrameSize); + aluMixData(Device, pWaveHdr->lpData, pWaveHdr->dwBufferLength/FrameSize); // Send buffer back to play more data waveOutWrite(pData->hWaveHandle.Out, pWaveHdr, sizeof(WAVEHDR)); @@ -218,8 +218,8 @@ static DWORD WINAPI PlaybackThreadProc(LPVOID lpParameter) */ static void CALLBACK WaveInProc(HWAVEIN hDevice,UINT uMsg,DWORD_PTR dwInstance,DWORD_PTR dwParam1,DWORD_PTR dwParam2) { - ALCdevice *pDevice = (ALCdevice*)dwInstance; - WinMMData *pData = pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)dwInstance; + WinMMData *pData = Device->ExtraData; (void)hDevice; (void)dwParam2; @@ -239,13 +239,13 @@ static void CALLBACK WaveInProc(HWAVEIN hDevice,UINT uMsg,DWORD_PTR dwInstance,D */ static DWORD WINAPI CaptureThreadProc(LPVOID lpParameter) { - ALCdevice *pDevice = (ALCdevice*)lpParameter; - WinMMData *pData = pDevice->ExtraData; + ALCdevice *Device = (ALCdevice*)lpParameter; + WinMMData *pData = Device->ExtraData; LPWAVEHDR pWaveHdr; ALuint FrameSize; MSG msg; - FrameSize = FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType); + FrameSize = FrameSizeFromDevFmt(Device->FmtChans, Device->FmtType); while(GetMessage(&msg, NULL, 0, 0)) { @@ -276,7 +276,7 @@ static DWORD WINAPI CaptureThreadProc(LPVOID lpParameter) } -static ALCenum WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceName) +static ALCenum WinMMOpenPlayback(ALCdevice *Device, const ALCchar *deviceName) { WinMMData *pData = NULL; UINT lDeviceID = 0; @@ -302,11 +302,11 @@ static ALCenum WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceName) pData = calloc(1, sizeof(*pData)); if(!pData) return ALC_OUT_OF_MEMORY; - pDevice->ExtraData = pData; + Device->ExtraData = pData; retry_open: memset(&pData->wfexFormat, 0, sizeof(WAVEFORMATEX)); - if(pDevice->FmtType == DevFmtFloat) + if(Device->FmtType == DevFmtFloat) { pData->wfexFormat.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; pData->wfexFormat.wBitsPerSample = 32; @@ -314,24 +314,24 @@ retry_open: else { pData->wfexFormat.wFormatTag = WAVE_FORMAT_PCM; - if(pDevice->FmtType == DevFmtUByte || pDevice->FmtType == DevFmtByte) + if(Device->FmtType == DevFmtUByte || Device->FmtType == DevFmtByte) pData->wfexFormat.wBitsPerSample = 8; else pData->wfexFormat.wBitsPerSample = 16; } - pData->wfexFormat.nChannels = ((pDevice->FmtChans == DevFmtMono) ? 1 : 2); + pData->wfexFormat.nChannels = ((Device->FmtChans == DevFmtMono) ? 1 : 2); pData->wfexFormat.nBlockAlign = pData->wfexFormat.wBitsPerSample * pData->wfexFormat.nChannels / 8; - pData->wfexFormat.nSamplesPerSec = pDevice->Frequency; + pData->wfexFormat.nSamplesPerSec = Device->Frequency; pData->wfexFormat.nAvgBytesPerSec = pData->wfexFormat.nSamplesPerSec * pData->wfexFormat.nBlockAlign; pData->wfexFormat.cbSize = 0; - if((res=waveOutOpen(&pData->hWaveHandle.Out, lDeviceID, &pData->wfexFormat, (DWORD_PTR)&WaveOutProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) + if((res=waveOutOpen(&pData->hWaveHandle.Out, lDeviceID, &pData->wfexFormat, (DWORD_PTR)&WaveOutProc, (DWORD_PTR)Device, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) { - if(pDevice->FmtType == DevFmtFloat) + if(Device->FmtType == DevFmtFloat) { - pDevice->FmtType = DevFmtShort; + Device->FmtType = DevFmtShort; goto retry_open; } ERR("waveOutOpen failed: %u\n", res); @@ -345,7 +345,7 @@ retry_open: goto failure; } - pDevice->DeviceName = strdup(PlaybackDeviceList[lDeviceID]); + Device->DeviceName = strdup(PlaybackDeviceList[lDeviceID]); return ALC_NO_ERROR; failure: @@ -356,7 +356,7 @@ failure: waveOutClose(pData->hWaveHandle.Out); free(pData); - pDevice->ExtraData = NULL; + Device->ExtraData = NULL; return ALC_INVALID_VALUE; } @@ -492,7 +492,7 @@ static void WinMMStopPlayback(ALCdevice *device) } -static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) +static ALCenum WinMMOpenCapture(ALCdevice *Device, const ALCchar *deviceName) { ALbyte *BufferData = NULL; DWORD ulCapturedDataSize; @@ -518,7 +518,7 @@ static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) if(i == NumCaptureDevices) return ALC_INVALID_VALUE; - switch(pDevice->FmtChans) + switch(Device->FmtChans) { case DevFmtMono: case DevFmtStereo: @@ -532,7 +532,7 @@ static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) return ALC_INVALID_ENUM; } - switch(pDevice->FmtType) + switch(Device->FmtType) { case DevFmtUByte: case DevFmtShort: @@ -549,21 +549,21 @@ static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) pData = calloc(1, sizeof(*pData)); if(!pData) return ALC_OUT_OF_MEMORY; - pDevice->ExtraData = pData; + Device->ExtraData = pData; memset(&pData->wfexFormat, 0, sizeof(WAVEFORMATEX)); - pData->wfexFormat.wFormatTag = ((pDevice->FmtType == DevFmtFloat) ? + pData->wfexFormat.wFormatTag = ((Device->FmtType == DevFmtFloat) ? WAVE_FORMAT_IEEE_FLOAT : WAVE_FORMAT_PCM); - pData->wfexFormat.nChannels = ChannelsFromDevFmt(pDevice->FmtChans); - pData->wfexFormat.wBitsPerSample = BytesFromDevFmt(pDevice->FmtType) * 8; + pData->wfexFormat.nChannels = ChannelsFromDevFmt(Device->FmtChans); + pData->wfexFormat.wBitsPerSample = BytesFromDevFmt(Device->FmtType) * 8; pData->wfexFormat.nBlockAlign = pData->wfexFormat.wBitsPerSample * pData->wfexFormat.nChannels / 8; - pData->wfexFormat.nSamplesPerSec = pDevice->Frequency; + pData->wfexFormat.nSamplesPerSec = Device->Frequency; pData->wfexFormat.nAvgBytesPerSec = pData->wfexFormat.nSamplesPerSec * pData->wfexFormat.nBlockAlign; pData->wfexFormat.cbSize = 0; - if((res=waveInOpen(&pData->hWaveHandle.In, lDeviceID, &pData->wfexFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) + if((res=waveInOpen(&pData->hWaveHandle.In, lDeviceID, &pData->wfexFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)Device, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) { ERR("waveInOpen failed: %u\n", res); goto failure; @@ -577,7 +577,7 @@ static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) } // Allocate circular memory buffer for the captured audio - ulCapturedDataSize = pDevice->UpdateSize*pDevice->NumUpdates; + ulCapturedDataSize = Device->UpdateSize*Device->NumUpdates; // Make sure circular buffer is at least 100ms in size if(ulCapturedDataSize < (pData->wfexFormat.nSamplesPerSec / 10)) @@ -611,11 +611,11 @@ static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) InterlockedIncrement(&pData->lWaveBuffersCommitted); } - pData->hWaveThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CaptureThreadProc, (LPVOID)pDevice, 0, &pData->ulWaveThreadID); + pData->hWaveThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CaptureThreadProc, (LPVOID)Device, 0, &pData->ulWaveThreadID); if (pData->hWaveThread == NULL) goto failure; - pDevice->DeviceName = strdup(CaptureDeviceList[lDeviceID]); + Device->DeviceName = strdup(CaptureDeviceList[lDeviceID]); return ALC_NO_ERROR; failure: @@ -639,13 +639,13 @@ failure: waveInClose(pData->hWaveHandle.In); free(pData); - pDevice->ExtraData = NULL; + Device->ExtraData = NULL; return ALC_INVALID_VALUE; } -static void WinMMCloseCapture(ALCdevice *pDevice) +static void WinMMCloseCapture(ALCdevice *Device) { - WinMMData *pData = (WinMMData*)pDevice->ExtraData; + WinMMData *pData = (WinMMData*)Device->ExtraData; void *buffer = NULL; int i; @@ -681,31 +681,31 @@ static void WinMMCloseCapture(ALCdevice *pDevice) pData->hWaveHandle.In = 0; free(pData); - pDevice->ExtraData = NULL; + Device->ExtraData = NULL; } -static void WinMMStartCapture(ALCdevice *pDevice) +static void WinMMStartCapture(ALCdevice *Device) { - WinMMData *pData = (WinMMData*)pDevice->ExtraData; + WinMMData *pData = (WinMMData*)Device->ExtraData; waveInStart(pData->hWaveHandle.In); } -static void WinMMStopCapture(ALCdevice *pDevice) +static void WinMMStopCapture(ALCdevice *Device) { - WinMMData *pData = (WinMMData*)pDevice->ExtraData; + WinMMData *pData = (WinMMData*)Device->ExtraData; waveInStop(pData->hWaveHandle.In); } -static ALCenum WinMMCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples) +static ALCenum WinMMCaptureSamples(ALCdevice *Device, ALCvoid *Buffer, ALCuint Samples) { - WinMMData *pData = (WinMMData*)pDevice->ExtraData; - ReadRingBuffer(pData->pRing, pBuffer, lSamples); + WinMMData *pData = (WinMMData*)Device->ExtraData; + ReadRingBuffer(pData->pRing, Buffer, Samples); return ALC_NO_ERROR; } -static ALCuint WinMMAvailableSamples(ALCdevice *pDevice) +static ALCuint WinMMAvailableSamples(ALCdevice *Device) { - WinMMData *pData = (WinMMData*)pDevice->ExtraData; + WinMMData *pData = (WinMMData*)Device->ExtraData; return RingBufferSize(pData->pRing); } |