os/mm/devsoundextensions/drmaudioplayer/DRMPlayServer/inc/DRMPlaySession.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsoundextensions/drmaudioplayer/DRMPlayServer/inc/DRMPlaySession.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,149 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:   DRM Play Session
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __CDRMPLAYSESSION_H
    1.23 +#define __CDRMPLAYSESSION_H
    1.24 +
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +#include <e32cons.h>
    1.28 +#include <f32file.h>
    1.29 +#include "DRMPlayServer.h"
    1.30 +#include "DRMCustomCommandAsyncAO.h"
    1.31 +#include <mdaaudiosampleplayer.h>
    1.32 +#include <s32mem.h>
    1.33 +#include <mmfcontrollerframeworkbase.h>
    1.34 +
    1.35 +
    1.36 +class CDRMCustomCommandAsyncAO;
    1.37 +class CDRMPlayServer;
    1.38 +#ifdef RD_TSP_CLIENT_MAPPER
    1.39 +class CTspClientMapper;
    1.40 +#endif // #ifdef RD_TSP_CLIENT_MAPPER
    1.41 +
    1.42 +class CDRMPlayServerSession : public CSession2, 
    1.43 +                              public MMdaAudioPlayerCallback,
    1.44 +							  public MAudioLoadingObserver
    1.45 +	{
    1.46 +	friend class CDRMPlayServer;
    1.47 +public:
    1.48 +	// construct/destruct
    1.49 +	CDRMPlayServerSession(CDRMPlayServer* aServer);
    1.50 +    static CDRMPlayServerSession* NewL(CDRMPlayServer* aServer, const RMessage2& aMessage );
    1.51 +	~CDRMPlayServerSession();
    1.52 +	//service request
    1.53 +	virtual void ServiceL(const RMessage2 &aMessage);
    1.54 +	TInt DispatchMessageL(const RMessage2 &aMessage);
    1.55 +
    1.56 +	//services available 
    1.57 +	void NewFilePlayerL(const RMessage2 aMessage);
    1.58 +	void NewDesPlayerL(const RMessage2 aMessage);
    1.59 +	void NewDesPlayerReadOnlyL(const RMessage2 aMessage);
    1.60 +	void NewPlayerL(const RMessage2 aMessage);	
    1.61 +	void OpenFileL(const RMessage2 &aMessage);
    1.62 +	void OpenFileByHandleL(const RMessage2 &aMessage);
    1.63 +	void OpenFileBySourceL(const RMessage2 &aMessage);
    1.64 +	void OpenDesL(const RMessage2 &aMessage);
    1.65 +	void OpenUrlL(const RMessage2 &aMessage);
    1.66 +	void Play();
    1.67 +	void Stop();
    1.68 +	void SetVolume(const RMessage2 &aMessage);
    1.69 +	void SetRepeats(const RMessage2 &aMessage);
    1.70 +	void SetVolumeRamp(const RMessage2 &aMessage);
    1.71 +	void Duration(const RMessage2&aMessage); 
    1.72 +	TInt MaxVolume();
    1.73 +
    1.74 +	// API Additions since version 7.0	
    1.75 +	TInt Pause();
    1.76 +	void Close();
    1.77 +	TInt GetPosition(const RMessage2 &aMessage);
    1.78 +	void SetPosition(const RMessage2 &aMessage);
    1.79 +
    1.80 +	TInt SetPriority(const RMessage2 &aMessage);
    1.81 +	TInt GetVolume(const RMessage2 &aMessage);
    1.82 +	TInt GetNumberOfMetaDataEntries(const RMessage2 &aMessage);
    1.83 +	void GetMetaDataEntryL(const RMessage2 &aMessage);
    1.84 +	TInt SetPlayWindow(const RMessage2 &aMessage);
    1.85 +	TInt ClearPlayWindow();
    1.86 +	TInt SetBalance(const RMessage2 &aMessage);
    1.87 +	TInt GetBalance(const RMessage2 &aMessage);
    1.88 +	TInt GetBitRate(const RMessage2 &aMessage);
    1.89 +	
    1.90 +	void RegisterForAudioLoadingNotification(const RMessage2 &aMessage);
    1.91 +	void GetAudioLoadingProgressL(const RMessage2 &aMessage);
    1.92 +	void ControllerImplementationInformationL(const RMessage2 &aMessage);
    1.93 +
    1.94 +	void CustomCommandSyncL(const RMessage2 &aMessage);
    1.95 +    void CustomCommandAsyncStep1L(const RMessage2 &aMessage);
    1.96 +    void CustomCommandAsyncStep2L(const RMessage2 &aMessage);
    1.97 +    
    1.98 +    void SetPriorityPreference(const RMessage2 &aMessage);
    1.99 +    void AsyncCustomCommandCompleted( CDRMCustomCommandAsyncAO* aObject );
   1.100 +
   1.101 +
   1.102 +
   1.103 +protected:
   1.104 +	// panic the client
   1.105 +	void PanicClient(const RMessage2 &aMessage, TInt aPanic) const;
   1.106 +
   1.107 +private:
   1.108 +    void ConstructL( const RMessage2& aMessage );
   1.109 +
   1.110 +	//MMdaAudioPlayerCallback
   1.111 +    void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
   1.112 +    void MapcPlayComplete(TInt aError);
   1.113 +
   1.114 +    //MAudioLoadingObserver
   1.115 +	void MaloLoadingStarted();
   1.116 +	void MaloLoadingComplete();
   1.117 +
   1.118 +    //Returns False if Destination CustomCommand needs to be blocked
   1.119 +	TBool IsValidCustomCommandDestination(TUid aDestinationUid, TDesC8& aParam);
   1.120 +	TBool CheckCustomInterfaceBuilderImplL(TDesC8& aParam);
   1.121 +
   1.122 +private:
   1.123 +	enum{EIdle,EPlaying,EStopped};
   1.124 +
   1.125 +	CDRMPlayServer *iServer;
   1.126 +	CMdaAudioPlayerUtility* iPlayUtil;
   1.127 +	RMessage2 iMessage;
   1.128 +	RMessage2* iMessage2;
   1.129 +	CBufFlat* iMetaDataBuffer;
   1.130 +	//CAsyncCallback* iAsyncCallback;
   1.131 +	TErrorDurationStructPckgBuf iErrDurPckg;
   1.132 +	TAsyncCallbackStatePckgBuf  iCallbackState;
   1.133 +    TInt iAsyncComplete;
   1.134 +	TInt iCount;
   1.135 +	TInt iState;
   1.136 +	TInt iPriority;
   1.137 +	TMdaPriorityPreference iPref;
   1.138 +	TBool iFileHandleUsed;
   1.139 +	RFile iFileHandle;
   1.140 +#ifdef RD_TSP_CLIENT_MAPPER
   1.141 +    // Handle to TSP Client Mapper for Rem Con Framework
   1.142 +    CTspClientMapper*   iTSPClientMapper;
   1.143 +    // Process id of client to DRM Session
   1.144 +    TProcessId          iClientProcessId;
   1.145 +#endif // RD_TSP_CLIENT_MAPPER
   1.146 +	RPointerArray<CDRMCustomCommandAsyncAO> iActiveAsyncCustomCommands;
   1.147 +	CDRMCustomCommandAsyncAO* iCDRMCustomCommandAsyncAO2Phase;
   1.148 +	};
   1.149 +
   1.150 +#endif
   1.151 +
   1.152 +// End of file