From a76ef3e7236480faffee5859c977d044ef7dfed4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 13 Nov 2008 00:19:32 +0100 Subject: [PATCH] Simplify code. Actually, there was third stage of CEpocAudio construction. --- src/audio/symbian/SDL_epocaudio.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/audio/symbian/SDL_epocaudio.cpp b/src/audio/symbian/SDL_epocaudio.cpp index 7c491fd..b0e9fa0 100644 --- a/src/audio/symbian/SDL_epocaudio.cpp +++ b/src/audio/symbian/SDL_epocaudio.cpp @@ -92,7 +92,7 @@ void CSimpleWait::RunL() class CEpocAudio : public CBase, public MStreamObs, public MStreamProvider { public: - CEpocAudio(int aBufferSize, int aFill); + CEpocAudio(int aBufferSize, int aFill, int aRate, int aChannels, TUint32 aType); ~CEpocAudio(); inline static CEpocAudio& Current(SDL_AudioDevice* thisdevice); @@ -102,7 +102,6 @@ class CEpocAudio : public CBase, public MStreamObs, public MStreamProvider void Wait(); void Play(); void ThreadInitL(void* aDevice); - void Open(int iRate, int iChannels, TUint32 aType, int aBytes); TUint8* Buffer(); bool SetPause(bool aPause); @@ -123,8 +122,11 @@ class CEpocAudio : public CBase, public MStreamObs, public MStreamProvider bool iPause; }; -CEpocAudio::CEpocAudio(int aBufferSize, int aFill) - : iBufferSize(aBufferSize) +CEpocAudio::CEpocAudio(int aBufferSize, int aFill, int aRate, int aChannels, TUint32 aType) + : iRate(aRate) + , iChannels(aChannels) + , iType(aType) + , iBufferSize(aBufferSize) , iPause(true) { iBuffer = new TUint8[iBufferSize]; @@ -267,13 +269,6 @@ void CEpocAudio::Wait() } } -void CEpocAudio::Open(int aRate, int aChannels, TUint32 aType, int aBytes) -{ - iRate = aRate; - iChannels = aChannels; - iType = aType; -} - /* Audio driver bootstrap functions */ AudioBootStrap EPOCAudio_bootstrap = { @@ -326,7 +321,6 @@ static int Audio_Available(void) static int EPOC_OpenAudio(SDL_AudioDevice *thisdevice, SDL_AudioSpec *spec) { TUint32 type = KMMFFourCCCodePCM16; - int bytes = 2; switch(spec->format) { @@ -366,12 +360,7 @@ static int EPOC_OpenAudio(SDL_AudioDevice *thisdevice, SDL_AudioSpec *spec) /* Allocate mixing buffer */ const int buflen = spec->size; - thisdevice->hidden = (SDL_PrivateAudioData*)new CEpocAudio(buflen, spec->silence); - - CEpocAudio::Current(thisdevice).Open(spec->freq, spec->channels, type, bytes); - - CEpocAudio::Current(thisdevice).SetPause(true); - + thisdevice->hidden = (SDL_PrivateAudioData*)new CEpocAudio(buflen, spec->silence, spec->freq, spec->channels, type); thisdevice->enabled = 0; // enable only after audio engine has been initialized! return 0; -- 2.11.4.GIT