mediasettings/gsvideoplugin/src/GSVideoPlugin.cpp
branchRCL_3
changeset 57 befca0ec475f
equal deleted inserted replaced
56:839377eedc2b 57:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2005 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:   GSVideoPlugin.cpp*
       
    15 */
       
    16 
       
    17 
       
    18 // Version : %version: 10 %
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDES
       
    23 #include "MPSettingsModelForROP.h"
       
    24 #include "GSVideoPlugin.h"
       
    25 #include "MPSettingsConstants.h"
       
    26 #include "MPSettingsMainView.h"
       
    27 #include "MPSettingsPluginView.h"
       
    28 #include "MPSettingsAdvancedBwView.h"
       
    29 #include "MPSettingsMainContainer.h" 
       
    30 #include "MPSettingsStreamingContainer.h" 
       
    31 #include "mediasettings.hrh"
       
    32 #include "gstabhelper.h"
       
    33 #include "GSMediaPlayerVideoView.h"
       
    34 #include "GSMediaPlayerStreamingView.h"
       
    35 #include "mpxlog.h"
       
    36 
       
    37 #include <coeaui.h>
       
    38 #include <hlplch.h>             // For HlpLauncher
       
    39 #include <aknview.h>
       
    40 #include <aknViewAppUi.h>
       
    41 #include <featmgr.h>
       
    42 #include <StringLoader.h>     //for StringLoader
       
    43 #include <gsprivatepluginproviderids.h>
       
    44 #include <gsmainview.h>
       
    45 #include <mediasettings.mbg>
       
    46 #include <MediaSettings.rsg>
       
    47 #include <eiktxlbm.h>
       
    48 #include <eikmenup.h> 
       
    49 
       
    50 #include <centralrepository.h>
       
    51 #include "MediaPlayerPrivateCRKeys.h"
       
    52 #include "MediaPlayerVariant.hrh" 
       
    53 
       
    54 // CONSTANTS
       
    55 const TInt KGSRopSettViewIdArrayGranularity = 2;
       
    56 const TInt KGSRopSettTopItemIndex = 0;
       
    57 
       
    58 // ========================= MEMBER FUNCTIONS ================================
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // CGSVideoPlugin::CGSVideoPlugin()
       
    62 // Constructor
       
    63 //
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 CGSVideoPlugin::CGSVideoPlugin() 
       
    67     : iResources( *iCoeEnv ), iConstructAsGsPlugin(ETrue)
       
    68     {
       
    69     MPX_FUNC("#MS# CGSVideoPlugin::CGSVideoPlugin()");
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // CGSVideoPlugin::~CGSVideoPlugin()
       
    74 //  
       
    75 // Destructor
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 CGSVideoPlugin::~CGSVideoPlugin()
       
    79     {
       
    80     MPX_FUNC("#MS# CGSVideoPlugin::~CGSVideoPlugin()");
       
    81     FeatureManager::UnInitializeLib();
       
    82     iImplInfoArray.ResetAndDestroy();   
       
    83     
       
    84     iResources.Close();
       
    85     
       
    86     if ( iViewIds )
       
    87         {
       
    88         delete iViewIds;
       
    89         }
       
    90     
       
    91     if ( iModel )
       
    92         {
       
    93         delete iModel;
       
    94         iModel = NULL;
       
    95         }
       
    96 
       
    97     if ( iViewArray ) 
       
    98         {
       
    99         iViewArray->Reset();
       
   100         delete iViewArray;
       
   101         }
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // CGSVideoPlugin::ConstructL(const TRect& aRect)
       
   106 // Symbian OS two-phased constructor
       
   107 //
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 void CGSVideoPlugin::ConstructL()
       
   111     {
       
   112     MPX_FUNC("#MS# CGSVideoPlugin::ConstructL()");
       
   113     FeatureManager::InitializeLibL();
       
   114 
       
   115     iVideoViewAvailable = VideoContrastIsSupportedL();
       
   116     if ( iVideoViewAvailable )
       
   117         {
       
   118         iViewArray = new (ELeave) CArrayPtrFlat<MGSTabbedView>( KGSRopSettViewIdArrayGranularity ); 
       
   119         }
       
   120     TFileName fileName;
       
   121     LocateFilePathL( fileName, EFalse );    
       
   122     OpenLocalizedResourceFileL( fileName, iResources );
       
   123     
       
   124     TInt ctorResource = ( iVideoViewAvailable ? R_GS_MEDIASETTING_VIEW :
       
   125                                                 R_GS_MPSETT_STREAMING_VIEW );
       
   126     
       
   127     BaseConstructL( ctorResource );
       
   128     }
       
   129    
       
   130 // ---------------------------------------------------------------------------
       
   131 // CGSVideoPlugin::NewL()
       
   132 // Static constructor
       
   133 //  
       
   134 // ---------------------------------------------------------------------------
       
   135 //
       
   136 CGSVideoPlugin* CGSVideoPlugin::NewL( /* TAny* aInitParams */)
       
   137     {
       
   138     MPX_FUNC("#MS# CGSVideoPlugin::NewL()");
       
   139     CGSVideoPlugin* self = new( ELeave ) CGSVideoPlugin();
       
   140     CleanupStack::PushL(self);
       
   141     self->ConstructL();
       
   142     CleanupStack::Pop(self);
       
   143     return self; 
       
   144     }
       
   145 
       
   146 // ---------------------------------------------------------------------------
       
   147 // CGSVideoPlugin::Id
       
   148 // 
       
   149 // Returns own view ID.
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 TUid CGSVideoPlugin::Id() const
       
   153     {
       
   154     MPX_FUNC("#MS# CGSVideoPlugin::Id()");
       
   155     return KGSVideoPluginUid;
       
   156     }
       
   157 
       
   158 // ---------------------------------------------------------------------------
       
   159 // CGSVideoPlugin::HandleClientRectChange
       
   160 // 
       
   161 // Handle changes to rect().
       
   162 // ---------------------------------------------------------------------------
       
   163 //
       
   164 void CGSVideoPlugin::HandleClientRectChange()
       
   165     {
       
   166     MPX_FUNC("#MS# CGSVideoPlugin::HandleClientRectChange()");
       
   167     if ( iContainer )
       
   168         {
       
   169         iContainer->SetRect( ClientRect() );
       
   170         }
       
   171     }
       
   172 
       
   173 // ---------------------------------------------------------------------------
       
   174 // CGSVideoPlugin::DoActivateL
       
   175 // 
       
   176 // First method called by the Avkon framwork to invoke a view.
       
   177 // ---------------------------------------------------------------------------
       
   178 //
       
   179 void CGSVideoPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
       
   180                                 TUid /* aCustomMessageId */,
       
   181                                 const TDesC8& /* aCustomMessage */)
       
   182     {
       
   183     MPX_FUNC("#MS# CGSVideoPlugin::DoActivateL()");
       
   184     iPrevViewId = aPrevViewId;
       
   185     if( iContainer )
       
   186         {
       
   187         AppUi()->RemoveFromViewStack( *this, iContainer );
       
   188 
       
   189         delete iContainer;
       
   190         iContainer = NULL;
       
   191         }
       
   192 
       
   193     if (!iViewIds)
       
   194         {
       
   195         CreateLocalViewsL();        
       
   196         }
       
   197     CreateContainerL();
       
   198     AppUi()->AddToViewStackL( *this, iContainer );
       
   199     if ( iVideoViewAvailable )
       
   200         {
       
   201         iContainer->ListBox()->SetListBoxObserver( this ) ;
       
   202         }
       
   203     ResetSelectedItemIndex();
       
   204     }
       
   205 
       
   206 // ---------------------------------------------------------------------------
       
   207 // CGSVideoPlugin::DoDeactivate
       
   208 // 
       
   209 // Called by the Avkon view framework when closing.
       
   210 // ---------------------------------------------------------------------------
       
   211 //
       
   212 void CGSVideoPlugin::DoDeactivate()
       
   213     {
       
   214     MPX_FUNC("#MS# CGSVideoPlugin::DoDeactivate()");
       
   215     if ( iContainer )
       
   216         {
       
   217         AppUi()->RemoveFromViewStack( *this, iContainer );
       
   218         delete iContainer;
       
   219         iContainer = NULL;
       
   220         }
       
   221     }
       
   222 
       
   223 // ---------------------------------------------------------------------------
       
   224 // CGSVideoPlugin::HandleCommandL
       
   225 // 
       
   226 // Handle user menu actions in this view.
       
   227 // ---------------------------------------------------------------------------
       
   228 //
       
   229 void CGSVideoPlugin::HandleCommandL( TInt aCommand )
       
   230     {
       
   231     MPX_FUNC("#MS# CGSVideoPlugin::HandleCommandL()");
       
   232     switch ( aCommand )
       
   233         {
       
   234         case EMPSettCmdOpen:
       
   235             break;          
       
   236         case EAknSoftkeyBack:
       
   237             SetCurrentItem(EGSMediaSettingsVideoIndex);
       
   238             AppUi()->ActivateLocalViewL( KGSAppsPluginUid );
       
   239             break;
       
   240         case EMPSettCmdAdvancedSett:
       
   241             AppUi()->ActivateLocalViewL( KMPSettAdvancedBwViewId );
       
   242             break;                    
       
   243         case EMPSettCmdHelp:
       
   244             {
       
   245             if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   246                 {
       
   247                 HlpLauncher::LaunchHelpApplicationL(
       
   248                     iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
       
   249                 }
       
   250             break;
       
   251             }
       
   252         default:
       
   253             AppUi()->HandleCommandL( aCommand );
       
   254             break;
       
   255         }
       
   256     }
       
   257 
       
   258 // ---------------------------------------------------------------------------
       
   259 // CGSVideoPlugin::GetCaption
       
   260 // 
       
   261 // Return application/view caption.
       
   262 // ---------------------------------------------------------------------------
       
   263 //
       
   264 void CGSVideoPlugin::GetCaptionL( TDes& aCaption ) const
       
   265     {
       
   266     MPX_FUNC("#MS# CGSVideoPlugin::GetCaptionL()");
       
   267     // the resource file is already opened.
       
   268     HBufC* result = StringLoader::LoadL( R_GS_MEDIASETTING_VIEW_CAPTION );
       
   269     
       
   270     aCaption.Copy( *result );
       
   271     delete result;
       
   272     }
       
   273   
       
   274 // ---------------------------------------------------------------------------
       
   275 // CGSVideoPlugin::PluginProviderCategory
       
   276 // 
       
   277 // A means to identify the location of this plug-in in the framework.
       
   278 // ---------------------------------------------------------------------------
       
   279 //
       
   280 TInt CGSVideoPlugin::PluginProviderCategory() const
       
   281     {
       
   282     MPX_FUNC("#MS# CGSVideoPlugin::PluginProviderCategory()");
       
   283     //To identify internal plug-ins.
       
   284     return KGSPluginProviderInternal;
       
   285     }
       
   286   
       
   287 // ========================= From CGSBaseView ==================
       
   288 
       
   289 
       
   290 // ---------------------------------------------------------------------------
       
   291 // CGSVideoPlugin::NewContainerL
       
   292 // 
       
   293 // Creates new iContainer.
       
   294 // ---------------------------------------------------------------------------
       
   295 //
       
   296 void CGSVideoPlugin::NewContainerL()
       
   297     {
       
   298     MPX_FUNC("#MS# CGSVideoPlugin::NewContainerL()");
       
   299     if ( iVideoViewAvailable )
       
   300         {
       
   301         iContainer = new( ELeave ) CMPSettingsMainContainer;
       
   302         }
       
   303     else    
       
   304         {
       
   305         iContainer = new( ELeave ) CMPSettingsStreamingContainer( iModel );
       
   306         }
       
   307     }
       
   308     
       
   309 // ---------------------------------------------------------------------------
       
   310 // CGSVideoPlugin::HandleListBoxSelectionL
       
   311 // 
       
   312 // Handle any user actions while in the list view.
       
   313 // ---------------------------------------------------------------------------
       
   314 void CGSVideoPlugin::HandleListBoxSelectionL() 
       
   315     {
       
   316     MPX_FUNC("#MS# CGSVideoPlugin::HandleListBoxSelectionL()");
       
   317     iCurrentItem = iContainer->ListBox()->CurrentItemIndex();
       
   318     iTopItemIndex = iContainer->ListBox()->TopItemIndex();
       
   319     
       
   320     CGSMediaPlayerVideoView* videoView = NULL;
       
   321     CGSMediaPlayerStreamingView* streamingView = NULL;
       
   322 
       
   323     TInt count = iViewIds->Count();
       
   324 
       
   325     for (TInt i = 0; i < count; i++)
       
   326         {
       
   327         if (i == 0) //first item of the list is Video view
       
   328             {
       
   329             videoView = static_cast<CGSMediaPlayerVideoView*>(AppUi()->View(iViewIds->At(i)));
       
   330             videoView->SetCurrentItem(KGSRopSettTopItemIndex);        
       
   331             }
       
   332         else if (i == 1) //second item of the list is Streaming view
       
   333             {
       
   334             streamingView = static_cast<CGSMediaPlayerStreamingView*>(AppUi()->View(iViewIds->At(i)));
       
   335             streamingView->SetCurrentItem(KGSRopSettTopItemIndex);        
       
   336             }
       
   337         }
       
   338          
       
   339     AppUi()->ActivateLocalViewL(iViewIds->At(iCurrentItem));
       
   340     }
       
   341 
       
   342 // ---------------------------------------------------------------------------
       
   343 // CGSVideoPlugin::Container
       
   344 // 
       
   345 // Return handle to container class.
       
   346 // ---------------------------------------------------------------------------
       
   347 //
       
   348 CMPSettingsMainContainer* CGSVideoPlugin::Container()
       
   349     {
       
   350     MPX_FUNC("#MS# CGSVideoPlugin::Container()");
       
   351     return static_cast<CMPSettingsMainContainer*>( iContainer );
       
   352     }
       
   353 
       
   354 // ---------------------------------------------------------------------------
       
   355 // CGSVideoPlugin::CreateContainerL()
       
   356 // 
       
   357 // 
       
   358 // ---------------------------------------------------------------------------
       
   359 //
       
   360 void CGSVideoPlugin::CreateContainerL()
       
   361     {
       
   362     MPX_FUNC("#MS# CGSVideoPlugin::CreateContainerL()");
       
   363     NewContainerL();
       
   364     __ASSERT_DEBUG( 
       
   365         iContainer, User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
       
   366     iContainer->SetMopParent( this );
       
   367 
       
   368     TRAPD( error, iContainer->ConstructL( ClientRect() ) );
       
   369 
       
   370     if ( error )
       
   371         {
       
   372         delete iContainer;
       
   373         iContainer = NULL;
       
   374         User::Leave( error );
       
   375         }
       
   376     }
       
   377 
       
   378 // ---------------------------------------------------------------------------
       
   379 // CGSVideoPlugin::CreateLocalViews()
       
   380 // 
       
   381 // 
       
   382 // ---------------------------------------------------------------------------
       
   383 //
       
   384 void CGSVideoPlugin::CreateLocalViewsL()
       
   385     {
       
   386     MPX_FUNC("#MS# CGSVideoPlugin::CreateLocalViewsL()");
       
   387     // model creation
       
   388     iModel = CMPSettingsModelForROP::NewL();
       
   389 
       
   390     // Create vector which contains view id's for all setting folders. 
       
   391     iViewIds = new(ELeave) CArrayFixFlat<TUid>( KGSRopSettViewIdArrayGranularity );
       
   392     if ( iVideoViewAvailable )
       
   393         {
       
   394         iViewIds->AppendL( KMPSettVideoViewId );
       
   395         }
       
   396     iViewIds->AppendL( KMPSettStreamingViewId );
       
   397   
       
   398     CAknView* view;  
       
   399 
       
   400     if ( iVideoViewAvailable )
       
   401         {
       
   402         view = CMPSettingsMainView::NewLC(iViewIds,iModel,iConstructAsGsPlugin); 
       
   403         AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
       
   404         CleanupStack::Pop();    // view
       
   405 
       
   406         // iMainView is not owned, i.e. it is not deleted in the destructor ->
       
   407         // main view cannot be directly creted to iMainView, as it's against the coding
       
   408         // conventions to place class' pointers to cleanup stack => static_cast.
       
   409         iMainView = static_cast<CMPSettingsMainView*>(view);
       
   410         
       
   411         view = CGSMediaPlayerVideoView::NewLC(iModel,iViewArray);
       
   412         AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
       
   413         CleanupStack::Pop();    // view
       
   414         }
       
   415         
       
   416     view = CGSMediaPlayerStreamingView::NewLC(iModel,iViewArray);
       
   417     AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
       
   418     CleanupStack::Pop();    // view 
       
   419 
       
   420     view = CMPSettingsAdvancedBwView::NewLC(iModel,iConstructAsGsPlugin);
       
   421     AppUi()->AddViewL(view);      // transfer ownership to CAknViewAppUi
       
   422     CleanupStack::Pop();    // view 
       
   423     
       
   424     // Construct plug-in views (if any exists)
       
   425     CMPSettingsPluginView::ListImplementationsL(iImplInfoArray);
       
   426     TInt count = iImplInfoArray.Count();
       
   427 
       
   428     if (count > 0)
       
   429         {
       
   430         CMPSettingsPluginView* pluginView = NULL;
       
   431 
       
   432         for (TInt ii(0); ii < count; ++ii)
       
   433             {
       
   434             TUid uid = iImplInfoArray[ii]->ImplementationUid();
       
   435             pluginView = CMPSettingsPluginView::NewL(uid);
       
   436             CleanupStack::PushL(pluginView);
       
   437             AppUi()->AddViewL(pluginView);
       
   438             CleanupStack::Pop();    // pluginView
       
   439 
       
   440             if (pluginView->OpenedFromMainView())
       
   441                 {
       
   442                 iViewIds->AppendL(pluginView->Id());
       
   443                 }
       
   444             }
       
   445         // Sort UID array to rising order
       
   446         TKeyArrayFix sortKey(0, ECmpTUint);
       
   447         User::LeaveIfError(iViewIds->Sort(sortKey));
       
   448         }
       
   449     }
       
   450 
       
   451 // ---------------------------------------------------------------------------
       
   452 // CGSVideoPlugin::CreateIconL
       
   453 // 
       
   454 // Return the icon, if has one.
       
   455 // ---------------------------------------------------------------------------
       
   456 //
       
   457 CGulIcon* CGSVideoPlugin::CreateIconL( const TUid aIconType )
       
   458     {
       
   459     MPX_FUNC("#MS# CGSVideoPlugin::CreateIconL()");
       
   460     //EMbm<Mbm_file_name><Bitmap_name>
       
   461     CGulIcon* icon;
       
   462     
       
   463     TFileName fileName;
       
   464     LocateFilePathL( fileName );    
       
   465     
       
   466     if( aIconType == KGSIconTypeLbxItem )
       
   467         {
       
   468         icon = AknsUtils::CreateGulIconL(
       
   469         AknsUtils::SkinInstance(), 
       
   470         KAknsIIDDefault, 
       
   471         fileName,
       
   472         EMbmMediasettingsQgn_menu_video,
       
   473         EMbmMediasettingsQgn_menu_video_mask );
       
   474         }
       
   475     else
       
   476         {
       
   477         icon = CGSPluginInterface::CreateIconL( aIconType );
       
   478         }
       
   479 
       
   480     return icon;
       
   481     }
       
   482   
       
   483 // ---------------------------------------------------------------------------
       
   484 // CGSVideoPlugin::TabbedViews()
       
   485 // Returns pointer to tabbed views of application.
       
   486 // ---------------------------------------------------------------------------
       
   487 //
       
   488 CArrayPtrFlat<MGSTabbedView>* CGSVideoPlugin::TabbedViews()
       
   489     {
       
   490     MPX_FUNC("#MS# CGSVideoPlugin::TabbedViews()");
       
   491     return iViewArray;
       
   492     }
       
   493     
       
   494 // -----------------------------------------------------------------------------
       
   495 // CGSVideoPlugin::ResetSelectedItemIndex()
       
   496 //
       
   497 //
       
   498 // -----------------------------------------------------------------------------
       
   499 //
       
   500 void CGSVideoPlugin::ResetSelectedItemIndex()
       
   501     {
       
   502     MPX_FUNC("#MS# CGSVideoPlugin::ResetSelectedItemIndex()");
       
   503     if( iContainer )
       
   504         {
       
   505         iContainer->SetSelectedItem( iCurrentItem );
       
   506         }
       
   507     }
       
   508 
       
   509 // ---------------------------------------------------------------------------
       
   510 // CGSVideoPlugin::SetCurrentItem
       
   511 //
       
   512 //
       
   513 // ---------------------------------------------------------------------------
       
   514 void CGSVideoPlugin::SetCurrentItem( TInt aIndex )
       
   515     {
       
   516     MPX_FUNC("#MS# CGSVideoPlugin::SetCurrentItem()");
       
   517     iCurrentItem = aIndex;
       
   518     }
       
   519 
       
   520 // ---------------------------------------------------------------------------
       
   521 // CGSVideoPlugin::DynInitMenuPaneL
       
   522 // Before showing a options menu
       
   523 // ---------------------------------------------------------------------------
       
   524 void CGSVideoPlugin::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
       
   525     {
       
   526     MPX_FUNC("#MS# CGSVideoPlugin::DynInitMenuPaneL()");
       
   527     if ( aResourceId == R_MPSETT_APP_MENU )
       
   528         {
       
   529         // Help should be displayed only if the feature is supported according
       
   530         // to Feature Manager
       
   531         if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
       
   532             {
       
   533             aMenuPane->SetItemDimmed(EMPSettCmdHelp, ETrue);
       
   534             }
       
   535         }
       
   536     }
       
   537 
       
   538 // -----------------------------------------------------------------------------
       
   539 // CGSVideoPlugin::LocateFilePathL
       
   540 // -----------------------------------------------------------------------------
       
   541 //
       
   542 void CGSVideoPlugin::LocateFilePathL( TFileName& aFileName, TBool aBitmapFile )
       
   543     {
       
   544     _LIT( KGSResourceFileName, "mediasettings.rsc" );
       
   545     _LIT( KGSIconFileName, "mediasettings.mif");
       
   546     
       
   547     TParse parse;
       
   548     TFileName temp;
       
   549                 
       
   550     if ( aBitmapFile )  // Mbm file
       
   551         {
       
   552         temp.Append(KGSIconFileName);
       
   553         }
       
   554     else                // Rsc file
       
   555         {
       
   556         temp.Append(KGSResourceFileName);
       
   557         }
       
   558         
       
   559     parse.Set( temp, &KDC_APP_RESOURCE_DIR, NULL );
       
   560     TPtrC iconFile = parse.FullName();
       
   561         
       
   562     // This is done to ensure upgraded file is used first. 
       
   563     // If no upgraded file is found, default file in Z: drive will be used.
       
   564     TFindFile find( CCoeEnv::Static()->FsSession() );
       
   565     TInt err = find.FindByDir( iconFile, KNullDesC );
       
   566         
       
   567     if ( err )
       
   568         {
       
   569         if ( aBitmapFile )
       
   570             {
       
   571             aFileName.Append( KGSVideoPluginIconFileName );    
       
   572             }
       
   573         else
       
   574             {
       
   575             aFileName.Append( KGSVideoPluginResourceFileName );     
       
   576             }
       
   577         }
       
   578     else
       
   579         {
       
   580         if ( aBitmapFile ) 
       
   581             {
       
   582             // this Mbm file has the whole path including the drive
       
   583             aFileName.Append( find.File() );    
       
   584             }
       
   585         else               
       
   586             {
       
   587             // General Settings base class would only take in this format <drive>:<rsc_file_name>
       
   588             // So, the file name is returned in that particular format
       
   589             TFileName tempFile;
       
   590             tempFile.Append( find.File() );    // this rsc file has the whole path including the drive
       
   591             aFileName.Append( tempFile[0] );   // append drive letter
       
   592             aFileName.Append( tempFile[1] );   // append delimiter
       
   593             aFileName.Append( KGSResourceFileName ); // append rsc_file_name
       
   594             }
       
   595         }
       
   596         MPX_DEBUG3(_L("#MS# CGSVideoPlugin::LocateFilePathL(%d,%S)"),aBitmapFile,&aFileName);
       
   597     }   
       
   598 
       
   599 // -----------------------------------------------------------------------------
       
   600 // CGSVideoPlugin::VideoContrastIsSupportedL
       
   601 // -----------------------------------------------------------------------------
       
   602 //
       
   603 TBool CGSVideoPlugin::VideoContrastIsSupportedL()
       
   604     {
       
   605     TInt flags;
       
   606     CRepository* repository = CRepository::NewL( KCRUidMediaPlayerFeatures );
       
   607     repository->Get( KMPLocalVariation, flags );
       
   608     delete repository;
       
   609 
       
   610     return ( flags & KMediaPlayerVideoContrast );
       
   611     }
       
   612 
       
   613 //End of File