mtpdataproviders/mtpplaybackcontroldp/mtpplaybackinterface/inc/mmtpplaybackinterface.h
branchRCL_3
changeset 20 4a793f564d72
parent 19 0aa8cc770c8a
child 21 74aa6861c87d
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef MMTPPLAYBACKINTERFACE_H
       
    22 #define MMTPPLAYBACKINTERFACE_H
       
    23 
       
    24 const TInt KPlaybackErrNone = 0;
       
    25 const TInt KPlaybackErrDeviceBusy = (-8000);
       
    26 const TInt KPlaybackErrDeviceUnavailable = (-8001);
       
    27 const TInt KPlaybackErrParamInvalid = (-8002);
       
    28 const TInt KPlaybackErrContextInvalid = (-8003);
       
    29 
       
    30 /** Playback status */
       
    31 enum TMTPPlaybackState
       
    32     {
       
    33     /** Playing */
       
    34     EPlayStatePlaying,
       
    35     /** Pause */
       
    36     EPlayStatePaused,
       
    37     /** Forward seeking */
       
    38     EPlayStateForwardSeeking,
       
    39     /** Backward seeking */
       
    40     EPlayStateBackwardSeeking,
       
    41     /** error state */
       
    42     EPlayStateError
       
    43     };
       
    44 
       
    45 /** Playback events */
       
    46 enum TMTPPlaybackEvent
       
    47     {
       
    48     EPlaybackEventNone,
       
    49     /** playback volume update */
       
    50     EPlaybackEventVolumeUpdate,
       
    51     /** playback object update */
       
    52     EPlaybackEventObjectUpdate,
       
    53     /** playback object index update */
       
    54     EPlaybackEventObjectIndexUpdate,
       
    55     /** player state update */
       
    56     EPlaybackEventStateUpdate,
       
    57     /** Last Event */
       
    58     EPlaybackEventEnd
       
    59     };
       
    60 
       
    61 /** Playback command */
       
    62 enum TMTPPlaybackCommand
       
    63     {
       
    64     EPlaybackCmdNone,
       
    65     EPlaybackCmdInitObject,
       
    66     EPlaybackCmdInitIndex,
       
    67     EPlaybackCmdPlay,
       
    68     EPlaybackCmdPause,
       
    69     EPlaybackCmdStop,
       
    70     EPlaybackCmdSkip,
       
    71     EPlaybackCmdSeekForward,
       
    72     EPlaybackCmdSeekBackward,
       
    73     EPlaybackCmdGetVolume,
       
    74     EPlaybackCmdGetVolumeSet,
       
    75     EPlaybackCmdSetVolume,
       
    76     EPlaybackCmdGetPosition,
       
    77     EPlaybackCmdSetPosition,
       
    78     EPlaybackCmdGetDuration,
       
    79     EPlaybackCmdGetState,
       
    80     EPlaybackCmdGetObject,
       
    81     EPlaybackCmdGetIndex,
       
    82     EPlaybackCmdEnd
       
    83     };
       
    84 
       
    85 class CMTPPlaybackCommand;
       
    86 class CMTPPlaybackEvent;
       
    87 
       
    88 class MMTPPlaybackObserver
       
    89     {
       
    90 public: 
       
    91     /**
       
    92      * Called when playback object is updated or 
       
    93      * playback object's position is updated 
       
    94      * in the active player instance.
       
    95      */
       
    96     virtual void HandlePlaybackEventL(CMTPPlaybackEvent* aEvent, TInt aErr = KPlaybackErrNone) = 0;
       
    97     };
       
    98 
       
    99 class MMTPPlaybackCallback
       
   100     {
       
   101 public:
       
   102     /**
       
   103      * Called when playback command is completed
       
   104      * 
       
   105      * @param aErr Complete error
       
   106      * @param aCmd Complete command
       
   107      */
       
   108     virtual void HandlePlaybackCommandCompleteL(CMTPPlaybackCommand* aCmd, TInt aErr = KPlaybackErrNone) = 0;
       
   109     };
       
   110 
       
   111 class MMTPPlaybackControl
       
   112     {
       
   113 public:
       
   114     /** 
       
   115     *  Create an Instance of MMTPPlaybackControl's implementation.
       
   116     */
       
   117     static MMTPPlaybackControl* NewL(MMTPPlaybackObserver& aObserver);
       
   118     
       
   119     /**
       
   120     *  Frees resource, and destroy the object itself.
       
   121     */
       
   122     virtual void Close()=0;
       
   123     
       
   124     /** 
       
   125     *  Issue player commands, with optional data.
       
   126     *  @param aCmd the command
       
   127     *  @param aCallback Call back function
       
   128     */
       
   129     virtual void CommandL(CMTPPlaybackCommand& aCmd, MMTPPlaybackCallback* aCallback = NULL) = 0;
       
   130     };
       
   131 
       
   132 #endif // MMTPPLAYBACKINTERFACE_H
       
   133 // End of File