videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp
changeset 28 c48470be1ba7
parent 15 cf5481c2bc0b
equal deleted inserted replaced
24:7d93ee07fb27 28:c48470be1ba7
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2010 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".
    13 *
    13 *
    14 * Description:  Factory method to create playback utility object
    14 * Description:  Factory method to create playback utility object
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 #include <bamdesca.h>
    19 #include"mpxplaybackutilityimpl.h"
    19 #include <s32mem.h>
    20 
    20 #include <e32math.h>
    21 
    21 #include <mpxcmn.h>
    22 // ============================== MEMBER FUNCTIONS ============================
    22 #include <mpxplaybackobserver.h>
    23 
    23 #include <mpxcollectionplaylist.h>
    24 // ----------------------------------------------------------------------------
    24 #include <mpxmedia.h>
    25 // Create the playback utility object
    25 #include <mpxmessagemonitor.h>
    26 // ----------------------------------------------------------------------------
    26 #include <mpxtaskqueue.h>
    27 //
    27 #include <mpxuser.h>
    28 EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TUid& aModeId,
    28 #include <mpxmessagegeneraldefs.h>
    29                                                     MMPXPlaybackObserver* aObs)
    29 #include <mpxcommandgeneraldefs.h>
       
    30 #include <mpxcollectionpath.h>
       
    31 #include <mpxvideoplaybackdefs.h>
       
    32 
       
    33 #include"mpxplaybackutility.h"
       
    34 
       
    35 
       
    36 // ============================== MEMBER FUNCTIONS =================================================
       
    37 	
       
    38 // -------------------------------------------------------------------------------------------------
       
    39 // Creates the playback utility object if not already created
       
    40 // -------------------------------------------------------------------------------------------------
       
    41 //
       
    42 MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/,
       
    43                                                     const TUid& /*aModeId*/ )
       
    44 {
       
    45     return CMPXPlaybackUtility::NewL();
       
    46 }
       
    47 
       
    48 // -------------------------------------------------------------------------------------------------
       
    49 // Two phases constructor
       
    50 // -------------------------------------------------------------------------------------------------
       
    51 //
       
    52 CMPXPlaybackUtility* CMPXPlaybackUtility::NewL()
       
    53 {
       
    54     CMPXPlaybackUtility* p = new(ELeave)CMPXPlaybackUtility();
       
    55     CleanupStack::PushL(p);
       
    56     p->ConstructL();
       
    57     CleanupStack::Pop(p);
       
    58     return p;
       
    59 }
       
    60 
       
    61 // -------------------------------------------------------------------------------------------------
       
    62 // Destructor
       
    63 // -------------------------------------------------------------------------------------------------
       
    64 //
       
    65 CMPXPlaybackUtility::~CMPXPlaybackUtility()
       
    66 {
       
    67 }
       
    68 
       
    69 // -------------------------------------------------------------------------------------------------
       
    70 // C++ constructor
       
    71 // Create a unique name out of thread ID and this pointer: no other instance of
       
    72 // this object will have the same name; used to identify this object for
       
    73 // recieving messages
       
    74 // -------------------------------------------------------------------------------------------------
       
    75 //
       
    76 CMPXPlaybackUtility::CMPXPlaybackUtility()
       
    77 {
       
    78 }
       
    79 
       
    80 // -------------------------------------------------------------------------------------------------
       
    81 // 2nd construtor
       
    82 // -------------------------------------------------------------------------------------------------
       
    83 //
       
    84 void CMPXPlaybackUtility::ConstructL()
       
    85 {
       
    86     iState = EPbStateInitialised;
       
    87 }
       
    88 
       
    89 // -------------------------------------------------------------------------------------------------
       
    90 // Add a observer
       
    91 // -------------------------------------------------------------------------------------------------
       
    92 //
       
    93 void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ )
       
    94 {
       
    95 }
       
    96 
       
    97 // -------------------------------------------------------------------------------------------------
       
    98 // Remove a observer
       
    99 // -------------------------------------------------------------------------------------------------
       
   100 //
       
   101 void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ )
       
   102 {
       
   103 }
       
   104 
       
   105 // -------------------------------------------------------------------------------------------------
       
   106 // Delete this
       
   107 // -------------------------------------------------------------------------------------------------
       
   108 //
       
   109 void CMPXPlaybackUtility::Close()
       
   110 {
       
   111     delete this;
       
   112 }
       
   113 
       
   114 // -------------------------------------------------------------------------------------------------
       
   115 // Issue player commands
       
   116 // -------------------------------------------------------------------------------------------------
       
   117 //
       
   118 void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd )
       
   119 {
       
   120     iCommand = aCmd;
       
   121 }
       
   122 
       
   123 // -------------------------------------------------------------------------------------------------
       
   124 // Issue player commands
       
   125 // -------------------------------------------------------------------------------------------------
       
   126 //
       
   127 void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ )
       
   128 {
       
   129     TInt cmdType = aCmd.ValueTObjectL<TInt>( KMPXCommandGeneralId );
       
   130 
       
   131     if ( cmdType == KMPXCommandIdPlaybackGeneral )
    30     {
   132     {
    31     return CMPXPlaybackUtility::NewL(aModeId,aObs, EMPXCategoryMusic);
   133         iCommand = aCmd.ValueTObjectL<TInt>( KMPXCommandPlaybackGeneralType );
    32     }
   134     }
    33 
   135     else
    34 // ----------------------------------------------------------------------------
       
    35 // Create the playback utility object
       
    36 // ----------------------------------------------------------------------------
       
    37 //
       
    38 
       
    39 EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::NewL(const TMPXCategory aCategory,
       
    40                                                     const TUid& aModeId,
       
    41                                                     MMPXPlaybackObserver* aObs)
       
    42     {
   136     {
    43     return CMPXPlaybackUtility::NewL(aModeId,aObs,aCategory);
   137         iCommand = aCmd.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackCommand );
    44     }
   138     }
    45 	
   139 }
    46 // ----------------------------------------------------------------------------
   140 
    47 // Creates the playback utility object if not already created
   141 // -------------------------------------------------------------------------------------------------
    48 // ----------------------------------------------------------------------------
   142 // Current state of player
    49 //
   143 // -------------------------------------------------------------------------------------------------
    50 EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TUid& aModeId )
   144 //
    51     {
   145 TMPXPlaybackState CMPXPlaybackUtility::StateL() const
    52     return CMPXPlaybackUtility::UtilityL( aModeId, EMPXCategoryMusic );
   146 {
    53     }
   147     return iState;
    54 	
   148 }
    55 // ----------------------------------------------------------------------------
   149 
    56 // Creates the playback utility object if not already created
   150 // -------------------------------------------------------------------------------------------------
    57 // ----------------------------------------------------------------------------
   151 // Determine whether there is a song by the state of the engine: if there is,
    58 //
   152 // its OK to return MMPXMedia, else NULL is returned
    59 
   153 // -------------------------------------------------------------------------------------------------
    60 EXPORT_C MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL(const TMPXCategory aCategory,
   154 //
    61                                                 const TUid& aModeId )
   155 MMPXSource* CMPXPlaybackUtility::Source()
    62     {
   156 {
    63     return CMPXPlaybackUtility::UtilityL( aModeId, aCategory );
   157     return NULL;
    64     }
   158 }
       
   159 
       
   160 // -------------------------------------------------------------------------------------------------
       
   161 // Set playback property, EPropertyChanged event when complete
       
   162 // -------------------------------------------------------------------------------------------------
       
   163 //
       
   164 void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty aProperty, TInt aValue )
       
   165 {
       
   166     iProperty = aProperty;
       
   167     iPropertyValue = aValue;
       
   168 }
       
   169 
       
   170 // -------------------------------------------------------------------------------------------------
       
   171 // Send property request
       
   172 // Result will be called back in HandleProperty
       
   173 // -------------------------------------------------------------------------------------------------
       
   174 //
       
   175 void CMPXPlaybackUtility::PropertyL(
       
   176     MMPXPlaybackCallback& /* aCallback */,
       
   177     TMPXPlaybackProperty /* aProperty */)
       
   178 {
       
   179 }
       
   180 
       
   181 // -------------------------------------------------------------------------------------------------
       
   182 // Path to the collection
       
   183 // -------------------------------------------------------------------------------------------------
       
   184 //
       
   185 CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
       
   186 {
       
   187     CMPXCollectionPlaylist *p = NULL;
       
   188 
       
   189     return p;
       
   190 }
       
   191 
       
   192 // -------------------------------------------------------------------------------------------------
       
   193 // Request for media properties.
       
   194 // -------------------------------------------------------------------------------------------------
       
   195 //
       
   196 void CMPXPlaybackUtility::MediaL(
       
   197     const TArray<TMPXAttribute>& /* aAttrs */,
       
   198     MMPXPlaybackCallback& /* aCallback */,
       
   199     CMPXAttributeSpecs* /* aSpecs */)
       
   200 {
       
   201 }
       
   202 
       
   203 // -------------------------------------------------------------------------------------------------
       
   204 // set primary client
       
   205 // -------------------------------------------------------------------------------------------------
       
   206 //
       
   207 void CMPXPlaybackUtility::SetPrimaryClientL()
       
   208 {
       
   209 }
       
   210 
       
   211 // End of file
       
   212