diff options
author | Steve Kondik <shade@chemlab.org> | 2012-11-18 15:47:18 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2012-11-18 15:47:18 -0800 |
commit | a546c7006355a7bd1df4267ee53d0bfa2c017c8c (patch) | |
tree | 01be0bf6c0d6968e1468ec9661fd52110f9b05a7 /distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h | |
parent | baf3d7830396202df5cc47bd7bcee109c319cdb3 (diff) | |
parent | 0f809250987b64f491bd3b4b73c0f0d33036a786 (diff) | |
download | external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.zip external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.gz external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.bz2 |
Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/external/qemu into mr1-staging
Change-Id: I8a4a71ac65b08e6e17f26c942f67a15b85211115
Diffstat (limited to 'distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h')
-rw-r--r-- | distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h b/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h new file mode 100644 index 0000000..8c6e74f --- /dev/null +++ b/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h @@ -0,0 +1,89 @@ +#ifndef STREAMPLAYER_H +#define STREAMPLAYER_H + +#include<MdaAudioOutputStream.h> + +const TInt KSilenceBuffer = 256; + +class MStreamObs + { + public: + enum + { + EInit, + EPlay, + EWrite, + EClose, + }; + virtual void Complete(TInt aState, TInt aError) = 0; + }; + +class MStreamProvider + { + public: + virtual TPtrC8 Data() = 0; + }; + +NONSHARABLE_CLASS(CStreamPlayer) : public CBase, public MMdaAudioOutputStreamCallback + { + public: + CStreamPlayer(MStreamProvider& aProvider, MStreamObs& aObs); + ~CStreamPlayer(); + void ConstructL(); + + static TInt ClosestSupportedRate(TInt aRate); + + TInt OpenStream(TInt aRate, TInt aChannels, TUint32 aType = KMMFFourCCCodePCM16); + + void SetVolume(TInt aNew); + TInt Volume() const; + TInt MaxVolume() const; + + void Stop(); + void Start(); + void Open(); + void Close(); + + TBool Playing() const; + TBool Closed() const; + + private: + + void MaoscOpenComplete(TInt aError) ; + void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); + void MaoscPlayComplete(TInt aError); + + private: + void Request(); + void SetCapsL(); + + private: + MStreamProvider& iProvider; + MStreamObs& iObs; + TInt iVolume; + + CMdaAudioOutputStream* iStream; + + TInt iRate; + TInt iChannels; + TUint32 iType; + + enum + { + ENone = 0, + EInited = 0x1, + EStarted = 0x2, + EStopped = 0x4, + EVolumeChange = 0x8, + EDied = 0x10 + }; + + TInt iState; + TBuf8<KSilenceBuffer> iSilence; + TPtrC8 iPtr; + + }; + + +#endif + |