upnpavcontroller/upnpavcontrollerclient/inc/upnpavrenderingsessionimpl.h
changeset 0 7f85d04be362
child 38 5360b7ddc251
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:      implements a session against a renderer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_UPNPAVRENDERINGSESSIONIMPL_H
       
    24 #define C_UPNPAVRENDERINGSESSIONIMPL_H
       
    25 
       
    26 // INCLUDE FILES
       
    27 #include <e32std.h>
       
    28 #include <e32base.h>
       
    29 
       
    30 #include "upnpavrenderingsession.h"
       
    31 #include "upnpavdeviceobserver.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CUpnpAVDevice;
       
    35 class RUPnPAVControllerClient;
       
    36 class CUPnPAVEventActive;
       
    37 class CUPnPAVDeviceActive;
       
    38 class CUPnPAVRenderingActive;
       
    39 class CUpnpItem;
       
    40 class TUnsolicitedEventC;
       
    41 
       
    42 /**
       
    43  *  AV Controller rendering session implementation.
       
    44  *
       
    45  *  This class implements the rendering session. Includes operations
       
    46  *  to set and to set next uri, play, stop and pause the playback,
       
    47  *  to set the volume and mute and to get the position information
       
    48  *
       
    49  *  @lib upnpavcontrollerclient.lib
       
    50  *  @since S60 v3.1
       
    51  */
       
    52 class CUPnPAVRenderingSessionImpl : public CBase,
       
    53                                     public MUPnPAVRenderingSession,
       
    54                                     public MUPnPAVDeviceObserver
       
    55                                     
       
    56     {
       
    57 
       
    58 public:
       
    59 
       
    60     /**
       
    61      * Static constructor
       
    62      *
       
    63      * @param aServer handle to AV Controller server
       
    64      * @param aDevice target device
       
    65      * @return a new browsing session implementation instance
       
    66      */    
       
    67     static CUPnPAVRenderingSessionImpl* NewL(
       
    68         RUPnPAVControllerClient& aServer,
       
    69         const CUpnpAVDevice& aDevice );
       
    70  
       
    71     /**
       
    72      * Destructor
       
    73      */        
       
    74     virtual ~CUPnPAVRenderingSessionImpl();
       
    75     
       
    76 private:
       
    77 
       
    78     /**
       
    79      * 2nd phase construct
       
    80      */    
       
    81     CUPnPAVRenderingSessionImpl( RUPnPAVControllerClient& aServer );
       
    82     
       
    83     /**
       
    84      * 2nd phase construct
       
    85      */        
       
    86     void ConstructL();
       
    87 
       
    88 protected: // From MUPnPAVRenderingSession
       
    89 
       
    90     /**
       
    91      * See upnpavrenderingsession.h
       
    92      */
       
    93     void SetObserver( MUPnPAVRenderingSessionObserver& aObserver );
       
    94 
       
    95     /**
       
    96      * See upnpavrenderingsession.h
       
    97      */
       
    98     void RemoveObserver();
       
    99 
       
   100     /**
       
   101      * See upnpavrenderingsession.h
       
   102      */
       
   103     MUPnPAVRenderingSessionObserver* Observer() const;
       
   104     
       
   105     /**
       
   106      * See upnpavrenderingsession.h
       
   107      */
       
   108     const CUpnpAVDevice& Device() const;
       
   109     
       
   110     /**
       
   111      * See upnpavrenderingsession.h
       
   112      */
       
   113     void ReserveLocalMSServicesL(); 
       
   114 
       
   115     /**
       
   116      * See upnpavrenderingsession.h
       
   117      */
       
   118     void CancelReserveLocalMSServicesL(); 
       
   119 
       
   120     /**
       
   121      * See upnpavrenderingsession.h
       
   122      */
       
   123     void ReleaseLocalMSServicesL(); 
       
   124 
       
   125     /**
       
   126      * See upnpavrenderingsession.h
       
   127      */
       
   128     void SetURIL( const TDesC8& aURI, const CUpnpItem& aItem );
       
   129 
       
   130     /**
       
   131      * See upnpavrenderingsession.h
       
   132      */
       
   133     void SetNextURIL( const TDesC8& aURI, const CUpnpItem& aItem );
       
   134 
       
   135     /**
       
   136      * See upnpavrenderingsession.h
       
   137      */
       
   138     void PlayL();
       
   139 
       
   140     /**
       
   141      * See upnpavrenderingsession.h
       
   142      */
       
   143     void StopL();
       
   144 
       
   145     /**
       
   146      * See upnpavrenderingsession.h
       
   147      */
       
   148     void PauseL();
       
   149 
       
   150     /**
       
   151      * See upnpavrenderingsession.h
       
   152      */
       
   153     void SetVolumeL( TInt aVolumeLevel );
       
   154 
       
   155     /**
       
   156      * See upnpavrenderingsession.h
       
   157      */
       
   158     void GetVolumeL();
       
   159 
       
   160     /**
       
   161      * See upnpavrenderingsession.h
       
   162      */
       
   163     void SetMuteL( TBool aMute );
       
   164 
       
   165     /**
       
   166      * See upnpavrenderingsession.h
       
   167      */
       
   168     void GetMuteL();
       
   169 
       
   170     /**
       
   171      * See upnpavrenderingsession.h
       
   172      */
       
   173     void GetPositionInfoL();
       
   174 
       
   175 public: // From MUPnPAVDeviceObserver
       
   176 
       
   177     /**
       
   178      * See upnpavdeviceobserver.h
       
   179      */
       
   180     void UPnPDeviceDiscovered( const CUpnpAVDevice& aDevice );
       
   181 
       
   182     /**
       
   183      * See upnpavdeviceobserver.h
       
   184      */
       
   185     void UPnPDeviceDisappeared( const CUpnpAVDevice& aDevice );
       
   186 
       
   187     /**
       
   188      * See upnpavdeviceobserver.h
       
   189      */
       
   190     void WLANConnectionLost();
       
   191 
       
   192 public: // Public methods
       
   193 
       
   194     /**
       
   195      * A method to receive an unsolicited event
       
   196      * @param aError error code
       
   197      * @param aEvent event
       
   198      */     
       
   199     void EventReceived( TInt aError,
       
   200         TUnsolicitedEventC aEvent );
       
   201        
       
   202 private: // Private methods
       
   203 
       
   204     void ResetL();
       
   205 
       
   206 private:
       
   207 
       
   208     RUPnPAVControllerClient&            iServer; // not owned
       
   209     
       
   210     MUPnPAVRenderingSessionObserver*    iObserver; // not owned
       
   211     
       
   212     CUPnPAVDeviceActive*                iDeviceActive; // owned
       
   213     
       
   214     CUPnPAVEventActive*                 iEventActive; // owned
       
   215     
       
   216     CUPnPAVRenderingActive*             iCommandActive; // owned
       
   217     
       
   218     CUPnPAVRenderingActive*             iSettingActive; // owned    
       
   219     
       
   220     CUpnpAVDevice*                      iDevice; // owned
       
   221 
       
   222     // Buffer to pass data to server
       
   223     HBufC8*                             iBuffer; // owned            
       
   224     TPtr8                               iBufferPtr;         
       
   225  
       
   226     TBool                               iAlive;
       
   227         
       
   228     TBool                               iMediaServerResourceReserved;
       
   229     
       
   230     };
       
   231 
       
   232 
       
   233 #endif // C_UPNPAVRENDERINGSESSIONIMPL_H