javauis/mmapi_qt/baseline/inc/cmmammfplayerbase.h
changeset 23 98ccebc37403
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  This class is used for playing sounds
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CMMAMMFPLAYERBASE_H
       
    19 #define CMMAMMFPLAYERBASE_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <mmf/common/mmfstandardcustomcommands.h>
       
    23 #include "cmmaplayer.h"
       
    24 
       
    25 class CMMAMMFResolver;
       
    26 //  CLASS DECLARATION
       
    27 /**
       
    28 *   This is base class for players those use MMF
       
    29 *
       
    30 *
       
    31 */
       
    32 
       
    33 class CMMAMMFPlayerBase : public CMMAPlayer,
       
    34         public MMMFControllerEventMonitorObserver
       
    35 {
       
    36 protected:
       
    37     //   C++ constructor
       
    38     CMMAMMFPlayerBase(CMMAMMFResolver* aResolver);
       
    39     void ConstructL();
       
    40 
       
    41     ~CMMAMMFPlayerBase();
       
    42 public: // new methods
       
    43     /**
       
    44      * Getter for RMMFController
       
    45      */
       
    46     IMPORT_C RMMFController& Controller();
       
    47 
       
    48     /**
       
    49      * Check whether this player is playing from a file locator
       
    50      * @return ETrue if is a file player, EFalse otherwise
       
    51      */
       
    52     TBool IsFilePlayer();
       
    53 
       
    54 public: // from CMMAPlayer
       
    55     void StartL();
       
    56     void StopL(TBool aPostEvent);
       
    57     void DeallocateL();
       
    58     IMPORT_C void GetDuration(TInt64* aDuration);
       
    59     void SetMediaTimeL(TInt64* aTime);
       
    60     void GetMediaTime(TInt64* aMediaTime);
       
    61     void CloseL();
       
    62 
       
    63 protected: // New methods
       
    64 
       
    65     /**
       
    66      * Loops through iControllerInfos and tries to open those
       
    67      * @param aSourceUid Data source uid
       
    68      * @param aSourceData Data for source
       
    69      * @param aSinkUid Data sink uid
       
    70      * @param aSinkData Data for sink.
       
    71      * @param aPrioritySettings Controller's priority.
       
    72      * @return KErrNone if controller was opened
       
    73      */
       
    74     IMPORT_C virtual TInt DoOpen(TUid aSourceUid,
       
    75                                  const TDesC8& aSourceData,
       
    76                                  TUid aSinkUid,
       
    77                                  const TDesC8& aSinkData,
       
    78                                  TMMFPrioritySettings aPrioritySettings);
       
    79 
       
    80 public: // from MMMFControllerEventMonitorObserver
       
    81     void HandleEvent(const class TMMFEvent& aEvent);
       
    82 
       
    83 protected:
       
    84 
       
    85     /**
       
    86      * Controller infos, owned
       
    87      */
       
    88     RMMFControllerImplInfoArray* iControllerInfos;
       
    89 
       
    90     /**
       
    91      * Used to control mmf plugin.
       
    92      */
       
    93     RMMFController iController;
       
    94 
       
    95     /**
       
    96      * Owned member.
       
    97      * Event monitor is used to monitor iController for events.
       
    98      * If an event occurs, this class will be notified via the
       
    99      * MMMFControllerEventMonitorObserver interface
       
   100      */
       
   101     CMMFControllerEventMonitor* iEventMonitor;
       
   102 
       
   103     /**
       
   104      * Filename used for playing directly from file, owned
       
   105      */
       
   106     HBufC* iFileName;
       
   107 
       
   108     /**
       
   109     * Cached media time
       
   110     */
       
   111     TInt64 iMediaTime;
       
   112 
       
   113     /**
       
   114     * The time that will be sent with CMMAPlayerEvent::EStarted
       
   115     * (may be different from iMediaTime).
       
   116     */
       
   117     TInt64 iStartedEventTime;
       
   118 };
       
   119 
       
   120 #endif // CMMAMMFPLAYERBASE_H