videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp
branchRCL_3
changeset 21 55fa1ec415c6
parent 16 7f2b2a65da29
equal deleted inserted replaced
16:7f2b2a65da29 21:55fa1ec415c6
    13 *
    13 *
    14 * Description:  This class observes the accessory framework.
    14 * Description:  This class observes the accessory framework.
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 8 %
    18 // Version : %version: 9 %
    19 
    19 
    20 //
    20 //
    21 //  INCLUDE FILES
    21 //  INCLUDE FILES
    22 //
    22 //
    23 #include <e32svr.h>
    23 #include <e32svr.h>
    82 //
    82 //
    83 CMPXVideoAccessoryObserver::CMPXVideoAccessoryObserver( CMPXVideoPlaybackController* aController )
    83 CMPXVideoAccessoryObserver::CMPXVideoAccessoryObserver( CMPXVideoPlaybackController* aController )
    84     : CActive( CActive::EPriorityStandard )
    84     : CActive( CActive::EPriorityStandard )
    85     , iController( aController )
    85     , iController( aController )
    86     , iTvOutConnected( EFalse )
    86     , iTvOutConnected( EFalse )
    87     , iTvOutPlaybackAllowed( ETrue )
       
    88 {
    87 {
    89     CActiveScheduler::Add( this );
    88     CActiveScheduler::Add( this );
    90 }
    89 }
    91 
    90 
    92 // -------------------------------------------------------------------------------------------------
    91 // -------------------------------------------------------------------------------------------------
   178     //  Check if the TV-Out status has changed
   177     //  Check if the TV-Out status has changed
   179     //
   178     //
   180     if ( iTvOutConnected != tvOutConnected )
   179     if ( iTvOutConnected != tvOutConnected )
   181     {
   180     {
   182         iTvOutConnected = tvOutConnected;
   181         iTvOutConnected = tvOutConnected;
   183 
       
   184         if ( iTvOutConnected ) 
       
   185         {
       
   186             //
       
   187             //  Check the playablility of the clip
       
   188             //
       
   189             iTvOutPlaybackAllowed = iController->iPlaybackMode->IsTvOutAllowedL();
       
   190         }
       
   191         else
       
   192         {
       
   193             iTvOutPlaybackAllowed = ETrue;
       
   194         }
       
   195 
       
   196         statusChanged   = ETrue;
   182         statusChanged   = ETrue;
   197     }
   183     }
   198 
   184 
   199     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL  iTvOutConnected = %d"), iTvOutConnected);
   185     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL  iTvOutConnected = %d"), iTvOutConnected);
   200 
   186 
   273     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::IsTvOutConnected(%d)"), iTvOutConnected);
   259     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::IsTvOutConnected(%d)"), iTvOutConnected);
   274 
   260 
   275     return iTvOutConnected;
   261     return iTvOutConnected;
   276 }
   262 }
   277 
   263 
   278 // -------------------------------------------------------------------------------------------------
       
   279 //   CMPXVideoAccessoryObserver::IsTvOutPlaybackAllowed
       
   280 // -------------------------------------------------------------------------------------------------
       
   281 //
       
   282 TBool CMPXVideoAccessoryObserver::IsTvOutPlaybackAllowed()
       
   283 {
       
   284     TBool playAllowed = ( ! iTvOutConnected || iTvOutPlaybackAllowed );
       
   285     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::IsTvOutPlaybackAllowed(%d)"), playAllowed);
       
   286 
       
   287     return playAllowed;
       
   288 }
       
   289 
       
   290 //  End of File
   264 //  End of File