1 /*******************************************************************
\r
3 * File: Audio_motorola.h
\r
5 * Author: Peter van Sebille (peter@yipton.net)
\r
7 * Modified/adapted for picodriveN by notaz, 2006
\r
9 * (c) Copyright 2006, notaz
\r
10 * (c) Copyright 2001, Peter van Sebille
\r
11 * All Rights Reserved
\r
13 *******************************************************************/
\r
15 #ifndef __AUDIO_MEDIASERVER_H
\r
16 #define __AUDIO_MEDIASERVER_H
\r
18 #include <cmaudiofb.h>
\r
21 #include "polledas.h"
\r
23 const TInt KSoundBuffers = 8;
\r
24 const TInt KMaxUnderflows = 20; // max underflows/API errors we are going allow in a row (to prevent lockups)
\r
27 class TGameAudioEventListener : public MMAudioFBObserver, public MMAudioACObserver
\r
30 // Implementation of MMAudioFBObserver
\r
31 void OnEvent(TMAudioFBCallbackState aState, TInt aError);
\r
32 void OnEvent(TMAudioFBCallbackState aState, TInt aError, TDes8* aBuffer);
\r
33 // Implementation of MMAudioACObserver
\r
34 void OnEvent(TMAudioACCallbackState aState, TInt aError);
\r
38 // TBool iHasCopied;
\r
44 class CGameAudioMot : public IGameAudio // IGameAudio MUST be specified first!
\r
46 public: // implements IGameAudio
\r
47 TInt16 *NextFrameL();
\r
48 TInt16 *DupeFrameL(TInt &aUnderflowed);
\r
51 void ChangeVolume(TInt aUp);
\r
55 CGameAudioMot(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames);
\r
57 EXPORT_C static CGameAudioMot* NewL(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames);
\r
61 void UnderflowedL();
\r
64 void WaitForOpenToCompleteL();
\r
69 CMAudioFB *iAudioOutputStream;
\r
70 CMAudioAC *iAudioControl;
\r
71 TMAudioFBBufSettings iSettings;
\r
73 TGameAudioEventListener iListener;
\r
75 CPolledActiveScheduler *iScheduler;
\r
77 HBufC8* iSoundBuffers[KSoundBuffers+1];
\r
78 TPtr8* iSoundBufferPtrs[KSoundBuffers+1];
\r
80 TInt iBufferedFrames;
\r
81 TInt16* iCurrentPosition;
\r
82 TInt iCurrentBuffer;
\r
88 //TInt64 iTime; // removed because can't test
\r
91 #endif /* __AUDIO_MEDIASERVER_H */
\r