4 #include <mdaaudiooutputstream.h>
6 const int KSilenceBuffer
= 1024;
7 const int KMaxVolume
= 256;
19 virtual void Complete(int aState
, int aError
) = 0;
25 virtual TPtrC8
Data() = 0;
28 class CStreamPlayer
: public CBase
, public MMdaAudioOutputStreamCallback
31 CStreamPlayer(MStreamProvider
& aProvider
, MStreamObs
& aObs
);
34 static int ClosestSupportedRate(int aRate
);
36 int OpenStream(int aRate
, int aChannels
, TUint32 aType
= KMMFFourCCCodePCM16
);
38 void SetVolume(int aNew
);
39 int Volume() const { return iVolume
; }
46 bool Playing() const { return (iState
& EInited
) && (iState
& EStarted
); }
47 bool Closed() const { return !(iState
& EInited
) && !(iState
& EDied
); }
50 void MaoscOpenComplete(int aError
);
51 void MaoscBufferCopied(int aError
, const TDesC8
& aBuffer
);
52 void MaoscPlayComplete(int aError
);
56 MStreamProvider
& iProvider
;
60 CMdaAudioOutputStream
* iStream
;
77 TBuf8
<KSilenceBuffer
> iSilence
;