tsrc/fusionmpxplayer_test/FusionMpxPlayerTestExeUi/src/FusionMpxPlayerTesterDescFunctions.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2009 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 the License "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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32base.h>
       
    19 
       
    20 #include "FusionMpxPlayerTester.h"
       
    21 
       
    22 #include <mpxplaybackutility.h>
       
    23 #include <mpxplaybackmessage.h>
       
    24 #include <mpxmessagegeneraldefs.h>
       
    25 #include <mpxcommandgeneraldefs.h>
       
    26 #include <mpxplaybackframeworkdefs.h>
       
    27 #include <mpxviewutility.h>
       
    28 
       
    29 #include "mpxmediavideodefs.h"
       
    30 #include <mpxvideoplaybackdefs.h>
       
    31 
       
    32 // -------------------------------------------------------------------------------------------------
       
    33 // CFusionMpxPlayerTester::GetGeneralPlaybackMessageDes
       
    34 // -------------------------------------------------------------------------------------------------
       
    35 //
       
    36 void CFusionMpxPlayerTester::GetGeneralPlaybackCommandDes( TMPXPlaybackCommand aCmd, TDes& aDes )
       
    37     {
       
    38     switch( aCmd )
       
    39         {
       
    40         case EPbCmdPlay: // 0 Play which ever track is currently stopped, paused etc.
       
    41             {
       
    42             aDes.Copy( _L("EPbCmdPlay" ) );
       
    43             }
       
    44             break;
       
    45         case EPbCmdPlayWithFadeIn: // 1 uses KPbFadeInDuration
       
    46             {
       
    47             aDes.Copy( _L("EPbCmdPlayWithFadeIn" ) );
       
    48             }
       
    49             break;
       
    50         case EPbCmdPause:    // 2
       
    51             {
       
    52             aDes.Copy( _L("EPbCmdPause" ) );
       
    53             }
       
    54             break;
       
    55         case EPbCmdStop:     // 3
       
    56             {
       
    57             aDes.Copy( _L("EPbCmdStop" ) );
       
    58             }
       
    59             break;
       
    60         case EPbCmdNext:     // 4 No effect if no next track
       
    61             {
       
    62             aDes.Copy( _L("EPbCmdNext" ) );
       
    63             }
       
    64             break;
       
    65         case EPbCmdPrevious: // 5 No effect if no previous track;
       
    66                         //   if pos>KPbReplayThreshold, replays current track
       
    67             {
       
    68             aDes.Copy( _L("EPbCmdPrevious" ) );
       
    69             }
       
    70             break;
       
    71         case EPbCmdReplay:   // 6 Restart current track at beginning
       
    72             {
       
    73             aDes.Copy( _L("EPbCmdReplay" ) );
       
    74             }
       
    75             break;
       
    76         case EPbCmdStartSeekForward:  // 7
       
    77             {
       
    78             aDes.Copy( _L("EPbCmdStartSeekForward" ) );
       
    79             }
       
    80             break;
       
    81         case EPbCmdStartSeekBackward: // 8
       
    82             {
       
    83             aDes.Copy( _L("EPbCmdStartSeekBackward" ) );
       
    84             }
       
    85             break;
       
    86         case EPbCmdStopSeeking:       // 9
       
    87             {
       
    88             aDes.Copy( _L("EPbCmdStopSeeking" ) );
       
    89             }
       
    90             break;
       
    91         case EPbCmdIncreaseVolume:    // 10
       
    92             {
       
    93             aDes.Copy( _L("EPbCmdIncreaseVolume" ) );
       
    94             }
       
    95             break;
       
    96         case EPbCmdDecreaseVolume:    // 11
       
    97             {
       
    98             aDes.Copy( _L("EPbCmdDecreaseVolume" ) );
       
    99             }
       
   100             break;
       
   101         case EPbCmdMuteVolume:        // 12
       
   102             {
       
   103             aDes.Copy( _L("EPbCmdMuteVolume" ) );
       
   104             }
       
   105             break;
       
   106         case EPbCmdUnMuteVolume:      // 13
       
   107             {
       
   108             aDes.Copy( _L("EPbCmdUnMuteVolume" ) );
       
   109             }
       
   110             break;
       
   111         case EPbCmdClose:             // 14
       
   112             {
       
   113             aDes.Copy( _L("EPbCmdClose" ) );
       
   114             }
       
   115             break;
       
   116         case EPbApplyEffect:          // 15 Apply an effect to the current playback,
       
   117                                  //    aData used to identify effect
       
   118             {
       
   119             aDes.Copy( _L("EPbApplyEffect" ) );
       
   120             }
       
   121             break;
       
   122         case EPbCmdPreservePosition:  // 16 Preserve playback position
       
   123             {
       
   124             aDes.Copy( _L("EPbCmdPreservePosition" ) );
       
   125             }
       
   126             break;
       
   127         case EPbCmdPreserveState:     // 17 Preserve playback state
       
   128             {
       
   129             aDes.Copy( _L("EPbCmdPreserveState" ) );
       
   130             }
       
   131             break;
       
   132         case EPbCmdCloseItem:         // 18 Request to close the file handle
       
   133             {
       
   134             aDes.Copy( _L("EPbCmdCloseItem" ) );
       
   135             }
       
   136             break;
       
   137         case EPbCmdPlayPause:         // 19 Play/Pause toggle command
       
   138             {
       
   139             aDes.Copy( _L("EPbCmdPlayPause" ) );
       
   140             }
       
   141             break;
       
   142         case EPbCmdCancelInit:         // 20
       
   143             {
       
   144             aDes.Copy( _L("EPbCmdCancelInit" ) );
       
   145             }
       
   146             break;
       
   147         case EPbCmdResetPreserveState: // 21
       
   148             {
       
   149             aDes.Copy( _L("EPbCmdResetPreserveState" ) );
       
   150             }
       
   151             break;
       
   152         case EPbCmdUnloadNonActivePlugin: // 22 KMPXCommandPlaybackGeneralData is TUid.iUid
       
   153             {
       
   154             aDes.Copy( _L("EPbCmdUnloadNonActivePlugin" ) );
       
   155             }
       
   156             break;
       
   157         case EPbCmdClearKeyBuffer:        // 23 Clear all media key commands
       
   158             {
       
   159             aDes.Copy( _L("EPbCmdClearKeyBuffer" ) );
       
   160             }
       
   161             break;
       
   162         case EPbCmdDisableEffect:
       
   163             {
       
   164             aDes.Copy( _L("EPbCmdDisableEffect" ) );
       
   165             }
       
   166             break;
       
   167         case EPbCmdSetVolume:             // 25 Set volume to the value specified by aData
       
   168             {
       
   169             aDes.Copy( _L("EPbCmdSetVolume" ) );
       
   170             }
       
   171             break;
       
   172         case EPbCmdEnd:                    // Mark for the end of command        
       
   173             {
       
   174             aDes.Copy( _L("EPbCmdEnd" ) );
       
   175             }
       
   176             break;
       
   177         }
       
   178     }
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // CFusionMpxPlayerTester::GetGeneralPlaybackMessageDes
       
   182 // -----------------------------------------------------------------------------
       
   183 //
       
   184 void CFusionMpxPlayerTester::GetGeneralPlaybackEventDes( TInt aEvent, TDes& aDes )
       
   185     {
       
   186     switch ( aEvent )
       
   187         {
       
   188         case TMPXPlaybackMessage::ENoEvent:
       
   189             {
       
   190             aDes.Copy( _L("ENoEvent" ) );
       
   191             break;
       
   192             }
       
   193         case TMPXPlaybackMessage::EError: // EError must be 1. iData is error originating from player: iType=event type
       
   194             {
       
   195             aDes.Copy( _L("EError" ) );
       
   196             break;
       
   197             }
       
   198         case TMPXPlaybackMessage::ECommandReceived: // iType=TMPXPlaybackCommand
       
   199             {
       
   200             aDes.Copy( _L("ECommandReceived" ) );
       
   201             break;
       
   202             }
       
   203         case TMPXPlaybackMessage::ECommandComplete: // iType=TMPXPlaybackCommand
       
   204             {
       
   205             aDes.Copy( _L("ECommandComplete" ) );
       
   206             break;
       
   207             }
       
   208         case TMPXPlaybackMessage::EPropertyChanged: // iType=TMPXPlaybackProperty; iData=new value
       
   209             {
       
   210             aDes.Copy( _L("EPropertyChanged" ) );
       
   211             break;
       
   212             }
       
   213         case TMPXPlaybackMessage::EStateChanged: // iType=TMPXPlaybackState
       
   214             {
       
   215             aDes.Copy( _L("EStateChanged" ) );
       
   216             break;
       
   217             }
       
   218         case TMPXPlaybackMessage::ESongCorrupt:
       
   219             {
       
   220             aDes.Copy( _L("ESongCorrupt" ) );
       
   221             break;
       
   222             }
       
   223         case TMPXPlaybackMessage::ESongContainerChanged: // Need to call MMPXMedia::CollectionPathL() to get new path
       
   224             {
       
   225             aDes.Copy( _L("ESongContainerChanged" ) );
       
   226             break;
       
   227             }
       
   228         case TMPXPlaybackMessage::EInitializeComplete: // iData = ETrue if init was to start playback: else EFalse.
       
   229             {
       
   230             aDes.Copy( _L("EInitializeComplete" ) );                
       
   231             break;
       
   232             }
       
   233         case TMPXPlaybackMessage::ESongChanged: // iData=new index; need to query to get new properties (e.g. duration: title etc.)
       
   234             {
       
   235             aDes.Copy( _L("ESongChanged" ) );
       
   236             break;
       
   237             }
       
   238         case TMPXPlaybackMessage::EPlayerChanged: // Need to call MMPXPlaybackUtility::CurrentPlayer() to get new features
       
   239             {
       
   240             aDes.Copy( _L("EPlayerChanged" ) );
       
   241             break;
       
   242             }
       
   243         case TMPXPlaybackMessage::EActivePlayerChanged: // iData=active/inactive (ETrue/EFalse) ); iType (ETrue:rebind to  ActivePlayerMode)
       
   244             {
       
   245             aDes.Copy( _L("EActivePlayerChanged" ) );                
       
   246             break;
       
   247             }
       
   248         case TMPXPlaybackMessage::ESubPlayersChanged: // Need to query to get new list of sub players
       
   249             {
       
   250             aDes.Copy( _L("ESubPlayersChanged" ) );
       
   251             break;
       
   252             }
       
   253         case TMPXPlaybackMessage::EPlayerSelectionChanged: // Need to query MMPXPlayerManager::GetSelectionL()
       
   254             {
       
   255             aDes.Copy( _L("EPlayerSelectionChanged" ) );
       
   256             break;
       
   257             }
       
   258         case TMPXPlaybackMessage::EDownloadStarted: // iData=total expected bytes
       
   259             {
       
   260             aDes.Copy( _L("EDownloadStarted" ) );                
       
   261             break;
       
   262             }
       
   263         case TMPXPlaybackMessage::EDownloadUpdated: // iData=total bytes so far
       
   264             {
       
   265             aDes.Copy( _L("EDownloadUpdated" ) );                
       
   266             break;
       
   267             }
       
   268         case TMPXPlaybackMessage::EDownloadComplete: // iData=total bytes downloaded
       
   269             {
       
   270             aDes.Copy( _L("EDownloadComplete" ) );                
       
   271             break;
       
   272             }
       
   273         case TMPXPlaybackMessage::EDownloadPositionChanged: // iData=total bytes so far
       
   274             {
       
   275             aDes.Copy( _L("EDownloadPositionChanged" ) );                
       
   276             break;
       
   277             }
       
   278         case TMPXPlaybackMessage::EDownloadStateChanged: // iData=TMPXPlaybackPdDownloadState
       
   279             {
       
   280             aDes.Copy( _L("EDownloadStateChanged" ) );                
       
   281             break;
       
   282             }
       
   283         case TMPXPlaybackMessage::EDownloadCmdPauseDownload: // iData=transaction ID
       
   284             {
       
   285             aDes.Copy( _L("EDownloadCmdPauseDownload" ) );                
       
   286             break;
       
   287             }
       
   288         case TMPXPlaybackMessage::EDownloadCmdResumeDownload: // iData=transaction ID
       
   289             {
       
   290             aDes.Copy( _L("EDownloadCmdResumeDownload" ) );                
       
   291             break;
       
   292             }
       
   293         case TMPXPlaybackMessage::EDownloadCmdCancelDownload: // iData=transaction ID
       
   294             {
       
   295             aDes.Copy( _L("EDownloadCmdCancelDownload" ) );                
       
   296             break;
       
   297             }
       
   298         case TMPXPlaybackMessage::EAccessoryChanged: // iType=TAccessoryMode
       
   299             {
       
   300             aDes.Copy( _L("EAccessoryChanged" ) );
       
   301             break;
       
   302             }
       
   303         case TMPXPlaybackMessage::EMediaChanged: // When the song/playlist hasn't: but data may become available
       
   304             {
       
   305             aDes.Copy( _L("EMediaChanged" ) );
       
   306             break;
       
   307             }
       
   308         case TMPXPlaybackMessage::ESkipping: //skipping event: iData=+1: skipping forward: -1: skipping backward
       
   309             {
       
   310             aDes.Copy( _L("ESkipping" ) );                
       
   311             break;
       
   312             }
       
   313         case TMPXPlaybackMessage::ESkipEnd: //skipping end
       
   314             {
       
   315             aDes.Copy( _L("ESkipEnd" ) );
       
   316             break;
       
   317             }
       
   318         case TMPXPlaybackMessage::EPlayerUnavailable:
       
   319             {
       
   320             aDes.Copy( _L("EPlayerUnavailable" ) );
       
   321             break;
       
   322             }
       
   323         case TMPXPlaybackMessage::EPlaylistUpdated: // playlist updated
       
   324             {
       
   325             aDes.Copy( _L("EPlaylistUpdated" ) );
       
   326             break;
       
   327             }
       
   328         case TMPXPlaybackMessage::EReachedEndOfPlaylist: // playback or skipping forward has reached end of playlist
       
   329             {
       
   330             aDes.Copy( _L("EReachedEndOfPlaylist" ) );
       
   331             break;
       
   332             }
       
   333 
       
   334         default:
       
   335             {
       
   336             break;
       
   337             }
       
   338         }
       
   339     }
       
   340 
       
   341 
       
   342 // -----------------------------------------------------------------------------
       
   343 // CFusionMpxPlayerTester::GetVideoPlaybackCommandDes
       
   344 // -----------------------------------------------------------------------------
       
   345 //
       
   346 void CFusionMpxPlayerTester::GetVideoPlaybackCommandDes( TMPXVideoPlaybackCommand aCmd, TDes& aDes )
       
   347     {
       
   348     switch ( aCmd )
       
   349         {
       
   350         case EPbCmdInitView:
       
   351             {
       
   352             aDes.Copy( _L("EPbCmdInitView") );
       
   353             }
       
   354             break;
       
   355         case EPbCmdAbortDSA:
       
   356             {
       
   357             aDes.Copy( _L("EPbCmdAbortDSA") );
       
   358             }
       
   359             break;
       
   360         case EPbCmdRestartDSA:
       
   361             {
       
   362             aDes.Copy( _L("EPbCmdRestartDSA") );
       
   363             }
       
   364             break;
       
   365         case EPbCmdSetDisplayWindow:
       
   366             {
       
   367             aDes.Copy( _L("EPbCmdSetDisplayWindow") );
       
   368             }
       
   369             break;
       
   370         case EPbCmdStartVideoSeekingForward:
       
   371             {
       
   372             aDes.Copy( _L("EPbCmdStartVideoSeekingForward") );
       
   373             }
       
   374             break;
       
   375         case EPbCmdStartVideoSeekingBackward:
       
   376             {
       
   377             aDes.Copy( _L("EPbCmdStartVideoSeekingBackward") );
       
   378             }
       
   379             break;
       
   380         case EPbCmdStopVideoSeeking:
       
   381             {
       
   382             aDes.Copy( _L("EPbCmdStopVideoSeeking") );
       
   383             }
       
   384             break;
       
   385         case EPbCmdHandleForeground:
       
   386             {
       
   387             aDes.Copy( _L("EPbCmdHandleForeground") );
       
   388             }
       
   389             break;
       
   390         case EPbCmdHandleBackground:
       
   391             {
       
   392             aDes.Copy( _L("EPbCmdHandleBackground") );
       
   393             }
       
   394             break;
       
   395         case EPbCmdNaturalAspectRatio:
       
   396             {
       
   397             aDes.Copy( _L("EPbCmdNaturalAspectRatio") );
       
   398             }
       
   399             break;
       
   400         case EPbCmdZoomAspectRatio:
       
   401             {
       
   402             aDes.Copy( _L("EPbCmdZoomAspectRatio") );
       
   403             }
       
   404             break;
       
   405         case EPbCmdStretchAspectRatio:
       
   406             {
       
   407             aDes.Copy( _L("EPbCmdStretchAspectRatio") );
       
   408             }
       
   409             break;
       
   410         case EPbCmdSetDefaultAspectRatio:
       
   411             {
       
   412             aDes.Copy( _L("EPbCmdSetDefaultAspectRatio") );
       
   413             }
       
   414             break;
       
   415         case EPbCmdTvOutEvent:
       
   416             {
       
   417             aDes.Copy( _L("EPbCmdTvOutEvent") );
       
   418             }
       
   419             break;
       
   420         case EPbCmdPluginError:
       
   421             {
       
   422             aDes.Copy( _L("EPbCmdPluginError") );
       
   423             }
       
   424             break;
       
   425         default:
       
   426             break;
       
   427         }
       
   428     }
       
   429 
       
   430 // -----------------------------------------------------------------------------
       
   431 // CFusionMpxPlayerTester::GetStateDes
       
   432 // -----------------------------------------------------------------------------
       
   433 //
       
   434 void CFusionMpxPlayerTester::GetStateDes( TMPXPlaybackState aState, TDes& aDes )
       
   435     {
       
   436     switch ( aState )
       
   437         {
       
   438         case EPbStateNotInitialised:
       
   439             {            
       
   440             aDes.Copy( _L("EPbStateNotInitialised") );            
       
   441             }
       
   442             break;            
       
   443         case EPbStateInitialising:   
       
   444             {
       
   445             aDes.Copy( _L("EPbStateInitialising") );
       
   446             }
       
   447             break;
       
   448         case EPbStatePlaying:        
       
   449             {
       
   450             aDes.Copy( _L("EPbStatePlaying") );
       
   451             }
       
   452             break;
       
   453         case EPbStatePaused:         
       
   454             {
       
   455             aDes.Copy( _L("EPbStatePaused") );
       
   456             }
       
   457             break;
       
   458         case EPbStateStopped:        
       
   459             {
       
   460             aDes.Copy( _L("EPbStateStopped") );
       
   461             }
       
   462             break;
       
   463         case EPbStateSeekingForward: 
       
   464             {
       
   465             aDes.Copy( _L("EPbStateSeekingForward") );
       
   466             }
       
   467             break;
       
   468         case EPbStateSeekingBackward:
       
   469             {
       
   470             aDes.Copy( _L("EPbStateSeekingBackward") );
       
   471             }
       
   472             break;
       
   473         case EPbStateShuttingDown:   
       
   474             {
       
   475             aDes.Copy( _L("EPbStateShuttingDown") );
       
   476             }
       
   477             break;
       
   478         case EPbStateBuffering:      
       
   479             {
       
   480             aDes.Copy( _L("EPbStateBuffering") );
       
   481             }
       
   482             break;
       
   483         case EPbStateDownloading:    
       
   484             {
       
   485             aDes.Copy( _L("EPbStateDownloading") );
       
   486             }
       
   487             break;
       
   488         case EPbStateInitialised:        
       
   489             {
       
   490             aDes.Copy( _L("EPbStateInitialised") );
       
   491             }
       
   492             break;
       
   493         case EPbStatePluginSeeking:   
       
   494             {
       
   495             aDes.Copy( _L("EPbStatePluginSeeking") );
       
   496             }
       
   497             break;
       
   498         }    
       
   499     }
       
   500 
       
   501 // -----------------------------------------------------------------------------
       
   502 // CFusionMpxPlayerTester::GetPropertyDes
       
   503 // -----------------------------------------------------------------------------
       
   504 //
       
   505 void CFusionMpxPlayerTester::GetPropertyDes( TMPXPlaybackProperty aProperty, TDes& aDes )
       
   506     {
       
   507     switch( aProperty )
       
   508         {
       
   509         case EPbPropertyVolume:    // 0 volume level values 0-KPbPlaybackVolumeLevelMax
       
   510             {
       
   511             aDes.Copy( _L("EPbPropertyVolume") );
       
   512             }
       
   513             break;
       
   514         case EPbPropertyMaxVolume: // 1 read only, KPbPlaybackVolumeLevelMax
       
   515             {
       
   516             aDes.Copy( _L("EPbPropertyMaxVolume") );
       
   517             }
       
   518             break;
       
   519         case EPbPropertyVolumeRamp:// 2
       
   520             {
       
   521             aDes.Copy( _L("EPbPropertyVolumeRamp") );
       
   522             }
       
   523             break;
       
   524         case EPbPropertyMute:      // 3 values 0(normal), 1(muted)
       
   525             {
       
   526             aDes.Copy( _L("EPbPropertyMute") );
       
   527             }
       
   528             break;
       
   529         case EPbPropertyBalance:   // 4 values -100(left) - 0 - +100(right)
       
   530             {
       
   531             aDes.Copy( _L("EPbPropertyBalance") );
       
   532             }
       
   533             break;
       
   534         case EPbPropertyEmbeddedMode:// 5
       
   535             {
       
   536             aDes.Copy( _L("EPbPropertyEmbeddedMode") );
       
   537             }
       
   538             break;
       
   539         case EPbPropertyCrossFade:   // 6
       
   540             {
       
   541             aDes.Copy( _L("EPbPropertyCrossFade") );
       
   542             }
       
   543             break;
       
   544         case EPbPropertyRandomMode:  // 7
       
   545             {
       
   546             aDes.Copy( _L("EPbPropertyRandomMode") );
       
   547             }
       
   548             break;
       
   549         case EPbPropertyRepeatMode:  // 8
       
   550             {
       
   551             aDes.Copy( _L("EPbPropertyRepeatMode") );
       
   552             }
       
   553             break;
       
   554         case EPbPropertyAccessPoint: // 9
       
   555             {
       
   556             aDes.Copy( _L("EPbPropertyAccessPoint") );
       
   557             }
       
   558             break;
       
   559         case EPbPropertyPosition:    // 10 depends on the plugin, it's safer to pause
       
   560                                 // the playing item before setting position
       
   561             {
       
   562             aDes.Copy( _L("EPbPropertyPosition") );
       
   563             }
       
   564             break;
       
   565         case EPbPropertyDuration:    // 11 read only, millisecond
       
   566             {
       
   567             aDes.Copy( _L("EPbPropertyDuration") );
       
   568             }
       
   569             break;
       
   570         case EPbPropertySongValid:   // 12
       
   571             {
       
   572             aDes.Copy( _L("EPbPropertySongValid") );
       
   573             }
       
   574             break;
       
   575         case EPbPropertyRemote:      // 13
       
   576             {
       
   577             aDes.Copy( _L("EPbPropertyRemote") );
       
   578             }
       
   579             break;
       
   580         case EPbPropertySupportedFeatures:// 14 read only
       
   581             {
       
   582             aDes.Copy( _L("EPbPropertySupportedFeatures") );
       
   583             }
       
   584             break;
       
   585         case EPbPropertyNum:               // 15 Last
       
   586             {
       
   587             aDes.Copy( _L("EPbPropertyNum") );
       
   588             }
       
   589             break;
       
   590         }
       
   591     }