1 /*******************************************************************
\r
3 * File: Audio_mediaserver.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 <Mda\Common\Audio.h>
\r
19 #include <MdaAudioOutputStream.h>
\r
21 //#include "audio.h"
\r
22 #include "polledas.h"
\r
24 const TInt KSoundBuffers = 4;
\r
27 class TGameAudioEventListener : public MMdaAudioOutputStreamCallback
\r
29 public: // implements MMdaAudioOutputStreamCallback
\r
30 void MaoscOpenComplete(TInt aError);
\r
31 void MaoscBufferCopied(TInt aError, const TDesC8& );
\r
32 void MaoscPlayComplete(TInt aError);
\r
35 // TBool iHasCopied;
\r
41 class CGameAudioMS // : public IGameAudio // IGameAudio MUST be specified first!
\r
43 public: // implements IGameAudio
\r
44 TInt16 *NextFrameL(TInt aPcmFrames);
\r
47 void ChangeVolume(TInt aUp);
\r
51 CGameAudioMS(TInt aRate, TBool aStereo, TInt aWritesPerSec);
\r
52 static CGameAudioMS* NewL(TInt aRate, TBool aStereo, TInt aWritesPerSec);
\r
56 void UnderflowedL();
\r
60 void WaitForOpenToCompleteL();
\r
65 CMdaAudioOutputStream *iMdaAudioOutputStream;
\r
66 TMdaAudioDataSettings iMdaAudioDataSettings;
\r
68 TGameAudioEventListener iListener;
\r
70 CPolledActiveScheduler *iScheduler;
\r
72 HBufC8* iSoundBuffers[KSoundBuffers];
\r
74 TInt iBufferedFrames;
\r
75 TInt16* iCurrentPosition;
\r
76 TInt iCurrentBuffer;
\r
77 TInt iCurrentBufferSize;
\r
79 CMdaServer* iServer;
\r
85 #endif /* __AUDIO_MEDIASERVER_H */
\r