sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Part of the MVS Agents for TechView sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #ifndef MVSAUDIOPLAYAGENT_H sl@0: #define MVSAUDIOPLAYAGENT_H sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @test sl@0: sl@0: Provides Audio playing functionality for the UI/Client sl@0: sl@0: */ sl@0: class CMVSAudioPlayAgent : public CBase, MMdaAudioPlayerCallback, MMMFAudioResourceNotificationCallback sl@0: { sl@0: public: sl@0: IMPORT_C static CMVSAudioPlayAgent* NewL(MMVSClientObserver& aObserver); sl@0: IMPORT_C ~CMVSAudioPlayAgent(); sl@0: sl@0: //opens an audio clip for playback sl@0: IMPORT_C void OpenFileL(TDesC& aFile); sl@0: //opens DRM protected source sl@0: IMPORT_C void OpenFileL(TMMSource &aSource); //Added for future support sl@0: IMPORT_C void OpenDesL(const TDesC8 &aDescriptor); //Added for future support sl@0: sl@0: IMPORT_C void Play(); sl@0: IMPORT_C void Stop(); sl@0: IMPORT_C TInt Pause(); sl@0: IMPORT_C void Forward(); //Added for future support sl@0: IMPORT_C void Rewind(); //Added for future support sl@0: sl@0: //Setter Methods sl@0: sl@0: IMPORT_C void SetVolume(TInt aVolume, TTimeIntervalMicroSeconds aRamp); sl@0: IMPORT_C void SetPosition(TTimeIntervalMicroSeconds aPosition); sl@0: IMPORT_C void SetRepeats(TInt aNoRepeats, TTimeIntervalMicroSeconds aDelay); sl@0: IMPORT_C TInt SetBalance(TInt aBalance); sl@0: IMPORT_C TInt SetPlayWindow(TTimeIntervalMicroSeconds aStart, TTimeIntervalMicroSeconds aEnd); sl@0: IMPORT_C TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref); sl@0: IMPORT_C TInt ClearPlayWindow(); sl@0: sl@0: //closes the current audio clip sl@0: sl@0: IMPORT_C void Reset(); sl@0: IMPORT_C void SetAutoPauseResume(TBool aEnable); sl@0: sl@0: //Getter Methods sl@0: sl@0: IMPORT_C TTimeIntervalMicroSeconds GetPosition(TTimeIntervalMicroSeconds& aPosition); sl@0: IMPORT_C TInt GetVolume(TInt& aVolume); sl@0: IMPORT_C TInt MaxVolume(); sl@0: IMPORT_C TTimeIntervalMicroSeconds Duration(); sl@0: IMPORT_C TInt GetBalance(TInt& aBalance); sl@0: IMPORT_C void GetMetaArrayL(RPointerArray& aMetaarray); sl@0: IMPORT_C TInt GetBitRate(TUint& aBitRate); sl@0: sl@0: //Returns Implementation Info object of the controller is currently loaded sl@0: sl@0: IMPORT_C const CMMFControllerImplementationInformation& GetControllerInfoL(); sl@0: IMPORT_C TMVSState GetState(); sl@0: private: sl@0: void ConstructL();//create playerutility here sl@0: CMVSAudioPlayAgent(MMVSClientObserver& aObserver); sl@0: sl@0: //from MMdaAudioPlayerCallback sl@0: sl@0: void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &aDuration); sl@0: void MapcPlayComplete(TInt aError); sl@0: sl@0: //from MMMFAudioResourceNotificationCallback sl@0: sl@0: void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); sl@0: private: sl@0: CMdaAudioPlayerUtility* iPlayer; sl@0: MMVSClientObserver& iObserver; sl@0: TMVSState iState; sl@0: RFileLogger iFileLogger; sl@0: }; sl@0: sl@0: #endif MVSAUDIOPLAYAGENT_H