upnpavcontroller/upnpavcontrollerclient/src/upnpavrenderingsessionimpl.cpp
branchnew development branch with rendering state machine and other goodies
changeset 38 5360b7ddc251
parent 0 7f85d04be362
equal deleted inserted replaced
32:3785f754ee62 38:5360b7ddc251
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 
    19 
    20 
    20 
    21 
    21 
    22 
    22 
    23 // INCLUDES
    23 // INCLUDES
    24 // upnp stack api
    24 // dlnasrv / mediaserver api
    25 #include <upnpitem.h>
    25 #include <upnpitem.h>
    26 #include <upnpobjectlist.h>
    26 #include <upnpobjectlist.h>
    27 
    27 
    28 // upnpframework / avcontroller api
    28 // dlnasrv / avcontroller api
    29 #include "upnpavdevice.h"
    29 #include "upnpavdevice.h"
    30 #include "upnpavcontrollerglobals.h"
    30 #include "upnpavcontrollerglobals.h"
    31 #include "upnpavrenderingsessionobserver.h"
    31 #include "upnpavrenderingsessionobserver.h"
    32 
    32 
    33 // avcontroller internal
    33 // avcontroller internal
   155     {
   155     {
   156     return *iDevice;
   156     return *iDevice;
   157     }
   157     }
   158 
   158 
   159 // --------------------------------------------------------------------------
   159 // --------------------------------------------------------------------------
   160 // CUPnPAVRenderingSessionImpl::ReserveLocalMSServicesL
       
   161 // See upnpavrenderingsessionimpl.h
       
   162 // --------------------------------------------------------------------------
       
   163 void CUPnPAVRenderingSessionImpl::ReserveLocalMSServicesL()
       
   164     {  
       
   165     ResetL();
       
   166     
       
   167     iCommandActive->ReserveLocalMSServicesL();       
       
   168     }
       
   169 
       
   170 // --------------------------------------------------------------------------
       
   171 // CUPnPAVRenderingSessionImpl::CancelReserveLocalMSServicesL
       
   172 // See upnpavrenderingsessionimpl.h
       
   173 // --------------------------------------------------------------------------
       
   174 void CUPnPAVRenderingSessionImpl::CancelReserveLocalMSServicesL()
       
   175     {
       
   176     ResetL();
       
   177     
       
   178     iCommandActive->CancelReserveLocalMSServicesL();  
       
   179     }
       
   180 
       
   181 // --------------------------------------------------------------------------
       
   182 // CUPnPAVRenderingSessionImpl::ReleaseLocalMSServicesL
       
   183 // See upnpavrenderingsessionimpl.h
       
   184 // --------------------------------------------------------------------------
       
   185 void CUPnPAVRenderingSessionImpl::ReleaseLocalMSServicesL()
       
   186     {  
       
   187     ResetL();
       
   188     
       
   189     iCommandActive->ReleaseLocalMSServicesL();
       
   190     }
       
   191 
       
   192 // --------------------------------------------------------------------------
       
   193 // CUPnPAVRenderingSessionImpl::SetURIL
   160 // CUPnPAVRenderingSessionImpl::SetURIL
   194 // See upnpavrenderingsessionimpl.h
   161 // See upnpavrenderingsessionimpl.h
   195 // --------------------------------------------------------------------------
   162 // --------------------------------------------------------------------------
   196 void CUPnPAVRenderingSessionImpl::SetURIL( const TDesC8& aURI,
   163 void CUPnPAVRenderingSessionImpl::SetURIL( const TDesC8& aURI,
   197     const CUpnpItem& aItem )
   164     const CUpnpItem& aItem )
   297 // --------------------------------------------------------------------------
   264 // --------------------------------------------------------------------------
   298 void CUPnPAVRenderingSessionImpl::GetPositionInfoL()
   265 void CUPnPAVRenderingSessionImpl::GetPositionInfoL()
   299     {
   266     {
   300     ResetL();
   267     ResetL();
   301     
   268     
   302     iSettingActive->GetPositionInfoL();               
   269     iCommandActive->GetPositionInfoL();               
       
   270     }
       
   271 
       
   272 // --------------------------------------------------------------------------
       
   273 // CUPnPAVRenderingSessionImpl::SeekRelTimeL
       
   274 // See upnpavrenderingsessionimpl.h
       
   275 // --------------------------------------------------------------------------
       
   276 void CUPnPAVRenderingSessionImpl::SeekRelTimeL( const TTime& aDesiredTime ) 
       
   277     {
       
   278     ResetL();
       
   279     
       
   280     iCommandActive->SeekRelTimeL( aDesiredTime );
       
   281     }
       
   282 
       
   283 // --------------------------------------------------------------------------
       
   284 // CUPnPAVRenderingActive::GetRendererStateL
       
   285 // See upnpavrenderingactive.h
       
   286 // --------------------------------------------------------------------------
       
   287 TUPnPAVInteractOperation CUPnPAVRenderingSessionImpl::GetRendererStateL()
       
   288     {
       
   289     __LOG( "CUPnPAVRenderingSessionImpl::GetRendererStateL" );
       
   290     
       
   291     ResetL();
       
   292     
       
   293     TUnsolicitedEventE event;
       
   294     TPckg<TUnsolicitedEventE> pckg( event );
       
   295     User::LeaveIfError( iServer.GetRendererState( (TInt)this, pckg ) );
       
   296     
       
   297     TUPnPAVInteractOperation op( EUPnPAVStopUser );
       
   298     switch( event )
       
   299         {
       
   300         case EPlay:
       
   301             {
       
   302             op = EUPnPAVPlayUser;
       
   303             }
       
   304             break;       
       
   305         case EStop:
       
   306             {
       
   307             op = EUPnPAVStopUser;
       
   308             }
       
   309             break;       
       
   310         case EPause:
       
   311             {
       
   312             op = EUPnPAVPauseUser;
       
   313             }
       
   314             break;    
       
   315         default:
       
   316             {
       
   317             __PANIC( __FILE__, __LINE__ );
       
   318             }
       
   319         }
       
   320     
       
   321     return op;
   303     }
   322     }
   304 
   323 
   305 // --------------------------------------------------------------------------
   324 // --------------------------------------------------------------------------
   306 // CUPnPAVRenderingSessionImpl::UPnPDeviceDiscovered
   325 // CUPnPAVRenderingSessionImpl::UPnPDeviceDiscovered
   307 // See upnpavrenderingsessionimpl.h
   326 // See upnpavrenderingsessionimpl.h
   384                 {
   403                 {
   385                 iObserver->MuteResult( aError, (TBool)aEvent.iValue,
   404                 iObserver->MuteResult( aError, (TBool)aEvent.iValue,
   386                     EFalse );
   405                     EFalse );
   387                 break;
   406                 break;
   388                 }
   407                 }
       
   408             case ETransition:
       
   409                 {
       
   410                 iObserver->InteractOperationComplete( aEvent.iValue,
       
   411                     EUPnPAVTransition );                
       
   412                 break;
       
   413                 }
   389             default:
   414             default:
   390                 {
   415                 {
   391                 __PANICD( __FILE__, __LINE__ );
   416                 __PANICD( __FILE__, __LINE__ );
   392                 break;
   417                 break;
   393                 }    
   418                 }