mpxplugins/viewplugins/views/collectionview/src/mpxcollectionviewlistboxarray.cpp
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Listbox array for collection view container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <StringLoader.h>
       
    21 #include <gulicon.h>
       
    22 #include <AknsSkinInstance.h>
       
    23 #include <AknsUtils.h>
       
    24 #include <AknUtils.h>
       
    25 #include <aknconsts.h>
       
    26 #include <AknIconArray.h>
       
    27 #include <avkon.mbg>
       
    28 #include <f32file.h>
       
    29 #include <data_caging_path_literals.hrh>
       
    30 #include <mpxmedia.h>
       
    31 #include <mpxmediacontainerdefs.h>
       
    32 #include <mpxmediageneraldefs.h>
       
    33 #include <mpxmediaarray.h>
       
    34 #include <mpxlog.h>
       
    35 #include <mpxcollectionview.mbg>
       
    36 #include <mpxcollectionpath.h>  // TMPXItemId
       
    37 #include <mpxplaybackframeworkdefs.h>
       
    38 #include <mpxcollectionview.rsg>
       
    39 #include <mpxuser.h>
       
    40 
       
    41 #include <mpxcommonuihelper.h>
       
    42 #include "mpxcollectionview.hrh"
       
    43 #include "mpxcommoncontainer.hrh"
       
    44 #include "mpxcommonlistboxarrayobserver.h"
       
    45 #include "mpxcollectionviewlistboxarray.h"
       
    46 
       
    47 // CONSTANTS
       
    48 _LIT( KMPXCommonListboxFormatString, "%d\t%S" );
       
    49 _LIT( KMPXTab, "\t" );
       
    50 _LIT( KMPXCollectionViewIconFile, "mpxcollectionview.mbm" );
       
    51 
       
    52 // ============================ MEMBER FUNCTIONS ===============================
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // Two-phased constructor.
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CMPXCollectionViewListBoxArray* CMPXCollectionViewListBoxArray::NewL()
       
    59     {
       
    60     MPX_FUNC( "CMPXCollectionViewListBoxArray::NewL" );
       
    61     CMPXCollectionViewListBoxArray* self =
       
    62         new ( ELeave ) CMPXCollectionViewListBoxArray();
       
    63     CleanupStack::PushL( self );
       
    64     self->ConstructL();
       
    65     CleanupStack::Pop( self );
       
    66     return self;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CMPXCollectionViewListBoxArray::CMPXCollectionViewListBoxArray
       
    71 // C++ default constructor can NOT contain any code, that
       
    72 // might leave.
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 CMPXCollectionViewListBoxArray::CMPXCollectionViewListBoxArray() :
       
    76     CMPXCommonListBoxArrayBase()
       
    77     {
       
    78     }
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // Destructor.
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 CMPXCollectionViewListBoxArray::~CMPXCollectionViewListBoxArray()
       
    85     {
       
    86     MPX_FUNC( "CMPXCollectionViewListBoxArray::~CMPXCollectionViewListBoxArray" );
       
    87     delete iUnknown;
       
    88     delete iMediaOwned;
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // Two-phased constructor.
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 void CMPXCollectionViewListBoxArray::ConstructL()
       
    96     {
       
    97     MPX_FUNC( "CMPXCollectionViewListBoxArray::ConstructL" );
       
    98     iUnknown = StringLoader::LoadL(R_MPX_QTN_MP_UNKNOWN );
       
    99     iMMCDrive = CMPXCommonUiHelper::MMCDriveNumber();
       
   100     }
       
   101 
       
   102 // ---------------------------------------------------------------------------
       
   103 // Sets playback status
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 TInt CMPXCollectionViewListBoxArray::SetPlaybackStatusByIdL(
       
   107     TMPXItemId aId, TMPXPlaybackState aStatus, TInt aIndex )
       
   108     {
       
   109     MPX_FUNC( "CMPXCollectionViewListBoxArray::SetPlaybackStatusByIdL" );
       
   110     // fix crash when click back too quick after play a song
       
   111     // aIndex < 0 means no icon to place, iMedia->Count() == 0 means no song, don't search
       
   112     if ( iMedia == NULL || aIndex < 0 || iMedia->Count() == 0)
       
   113         {
       
   114         return SetPlaybackStatusByIndex( KErrNotFound, aStatus );
       
   115         }
       
   116 
       
   117     TInt index( KErrNotFound );
       
   118     TInt count( iMedia->Count() );
       
   119     // Search start from aIndex, then aIndex-1, aIndex+1, aIndex-2, aIndex+2
       
   120     // until the boundary reach then search for the rest
       
   121     if ( aIndex > count - 1 ) // remove song before the last
       
   122         {
       
   123         aIndex = count - 1;
       
   124         }
       
   125     CMPXMedia* origMedia( iMedia->AtL( aIndex ) );
       
   126     TMPXItemId id( origMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
       
   127     if ( id == aId )
       
   128         {
       
   129         index = aIndex;
       
   130         }
       
   131     else
       
   132         {
       
   133         TInt upBound( ( count - 1 ) - aIndex );
       
   134         TInt loBound( aIndex - 0 );
       
   135         TInt biBound( Min( upBound, loBound ) );
       
   136         for ( TInt i = 1; i <= biBound; i++ )
       
   137             {
       
   138             CMPXMedia* entry( iMedia->AtL( aIndex - i ) );
       
   139             TMPXItemId id( entry->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
       
   140             if ( id == aId )
       
   141                 {
       
   142                 index = aIndex - i;
       
   143                 break;
       
   144                 }
       
   145 
       
   146             entry = iMedia->AtL( aIndex + i );
       
   147             id = entry->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId );
       
   148             if ( id == aId )
       
   149                 {
       
   150                 index = aIndex + i;
       
   151                 break;
       
   152                 }
       
   153             }
       
   154         if ( index == KErrNotFound && upBound != loBound ) // still not found search for the rest
       
   155             {
       
   156             TInt begin( ( loBound > upBound ) ? 0 : aIndex + biBound + 1 );
       
   157             TInt end( ( loBound>upBound ) ? aIndex - biBound : count );
       
   158             for ( TInt i = begin; i < end; i++ )
       
   159                 {
       
   160                 CMPXMedia* entry( iMedia->AtL( i ) );
       
   161                 TMPXItemId id( entry->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) );
       
   162                 if ( id == aId )
       
   163                     {
       
   164                     index = i;
       
   165                     break;
       
   166                     }
       
   167                 }
       
   168             }
       
   169         }
       
   170     return SetPlaybackStatusByIndex( index, aStatus );
       
   171     }
       
   172 
       
   173 // ---------------------------------------------------------------------------
       
   174 // Activates reorder mode
       
   175 // ---------------------------------------------------------------------------
       
   176 //
       
   177 void CMPXCollectionViewListBoxArray::ActivateReorderMode( TBool aEnable )
       
   178     {
       
   179     MPX_FUNC( "CMPXCollectionViewListBoxArray::ActivateReorderMode" );
       
   180     iReorderActivated = aEnable;
       
   181     if ( !iMediaOwned && aEnable )
       
   182         {
       
   183         // make a copy of the current array so that any modification to the array
       
   184         // does not pollute the master copy
       
   185         MPX_TRAPD( error, iMediaOwned = CMPXMediaArray::NewL() );
       
   186         if ( error == KErrNone )
       
   187             {
       
   188             TInt count( iMedia->Count() );
       
   189             TRAP_IGNORE(
       
   190                 for ( TInt i = 0; i < count; i++ )
       
   191                     {
       
   192                     CMPXMedia* entry( iMedia->AtL( i ) );
       
   193                     iMediaOwned->AppendL( *entry );
       
   194                     } );
       
   195             // no need to delete iMedia, we don't own it
       
   196             // iMedia might get reset before we have a chance to delete it
       
   197             // keep a copy of the pointer so that we can delete
       
   198             iMedia = iMediaOwned;
       
   199             }
       
   200         }
       
   201     }
       
   202 
       
   203 // ---------------------------------------------------------------------------
       
   204 // Set reorder mode
       
   205 // ---------------------------------------------------------------------------
       
   206 //
       
   207 void CMPXCollectionViewListBoxArray::SetReorderGrabbedMode(
       
   208     TBool aEnable, TInt aIndex )
       
   209     {
       
   210     MPX_FUNC( "CMPXCollectionViewListBoxArray::SetReorderGrabbedMode" );
       
   211     iReorder = aEnable;
       
   212     iOriginalIndex = aIndex;
       
   213     iMovedIndex = aIndex;
       
   214     if ( aEnable && aIndex == iIndex )
       
   215         {
       
   216         // if the item currently being moved is now playing
       
   217         // manually move the icon after it's complete, and before the result
       
   218         // is saved to db
       
   219         iMoveNowPlaying = ETrue;
       
   220         }
       
   221     else
       
   222         {
       
   223         iMoveNowPlaying = EFalse;
       
   224         }
       
   225     }
       
   226 
       
   227 // ---------------------------------------------------------------------------
       
   228 // Move current reorder index
       
   229 // ---------------------------------------------------------------------------
       
   230 //
       
   231 void CMPXCollectionViewListBoxArray::MoveReorderIndex( TInt aDirection )
       
   232     {
       
   233     MPX_FUNC( "CMPXCollectionViewListBoxArray::MoveReorderIndex" );
       
   234     if ( iReorder )
       
   235         {
       
   236         if ( ( aDirection == 1 ) && ( iMovedIndex < MdcaCount() - 1 ) )
       
   237             {
       
   238             iMovedIndex++;
       
   239             }
       
   240         else if ( ( aDirection == -1 ) && ( iMovedIndex > 0 ) )
       
   241             {
       
   242             iMovedIndex--;
       
   243             }
       
   244         }
       
   245     }
       
   246 
       
   247 // ---------------------------------------------------------------------------
       
   248 // Set current reorder index
       
   249 // ---------------------------------------------------------------------------
       
   250 //
       
   251 void CMPXCollectionViewListBoxArray::SetReorderIndex( TInt aIndex )
       
   252     {
       
   253     MPX_FUNC( "CMPXCollectionViewListBoxArray::SetReorderIndex" );
       
   254     iMovedIndex = aIndex;
       
   255     }
       
   256 
       
   257 // ---------------------------------------------------------------------------
       
   258 // Confirm reorder
       
   259 // ---------------------------------------------------------------------------
       
   260 //
       
   261 void CMPXCollectionViewListBoxArray::ConfirmReorderL()
       
   262     {
       
   263     MPX_FUNC( "CMPXCollectionViewListBoxArray::ConfirmReorderL" );
       
   264     CMPXMedia* origMedia( iMedia->AtL( iOriginalIndex ) );
       
   265     CMPXMedia* entry( CMPXMedia::NewL( *origMedia ) );
       
   266     iMedia->Remove( iOriginalIndex );
       
   267     iMedia->Insert( entry, iMovedIndex ); // iMedia takes ownership
       
   268     if ( iMoveNowPlaying )
       
   269         {
       
   270         iIndex = iMovedIndex;
       
   271         iMoveNowPlaying = EFalse;
       
   272         }
       
   273     iOriginalIndex = KErrNotFound;
       
   274     iMovedIndex = KErrNotFound;
       
   275     }
       
   276 
       
   277 // ---------------------------------------------------------------------------
       
   278 // Cancel reorder
       
   279 // ---------------------------------------------------------------------------
       
   280 //
       
   281 void CMPXCollectionViewListBoxArray::CancelReorder()
       
   282     {
       
   283     MPX_FUNC( "CMPXCollectionViewListBoxArray::CancelReorder" );
       
   284     iOriginalIndex = KErrNotFound;
       
   285     iMovedIndex = KErrNotFound;
       
   286     }
       
   287 
       
   288 // ---------------------------------------------------------------------------
       
   289 // Gets original index of currently selected item
       
   290 // ---------------------------------------------------------------------------
       
   291 //
       
   292 TInt CMPXCollectionViewListBoxArray::GetOriginalIndex() const
       
   293     {
       
   294     MPX_FUNC( "CMPXCollectionViewListBoxArray::GetOriginalIndex" );
       
   295     return iOriginalIndex;
       
   296     }
       
   297 
       
   298 // ---------------------------------------------------------------------------
       
   299 // Gets the index for the song that's currently playing
       
   300 // ---------------------------------------------------------------------------
       
   301 //
       
   302 TInt CMPXCollectionViewListBoxArray::GetPlaybackIndex() const
       
   303     {
       
   304     MPX_FUNC( "CMPXCollectionViewListBoxArray::GetPlaybackIndex" );
       
   305     return iIndex;
       
   306     }
       
   307 
       
   308 // -----------------------------------------------------------------------------
       
   309 // Indicates if Unknown entry exists in this view
       
   310 // -----------------------------------------------------------------------------
       
   311 //
       
   312 TBool CMPXCollectionViewListBoxArray::IsCategoryUnknownExist() const
       
   313     {
       
   314     return iIsUnknownExist;
       
   315     }
       
   316 
       
   317 // -----------------------------------------------------------------------------
       
   318 // Checks if the current item is a broken link
       
   319 // -----------------------------------------------------------------------------
       
   320 //
       
   321 TBool CMPXCollectionViewListBoxArray::IsItemBrokenLinkL( TInt aIndex ) const
       
   322     {
       
   323     TBool ret( EFalse );
       
   324     if ( iMedia )
       
   325         {
       
   326         CMPXMedia* entry( iMedia->AtL( aIndex ) );
       
   327         TUint flags( 0 );
       
   328         if( entry->IsSupported( KMPXMediaGeneralFlags ) )
       
   329             {
       
   330             flags = entry->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
       
   331             ret = ( ( flags ) & ( KMPXMediaGeneralFlagsIsInvalid ) );
       
   332             }
       
   333         }
       
   334     return ret;
       
   335     }
       
   336 
       
   337 // -----------------------------------------------------------------------------
       
   338 // Checks if the current item is corrupted
       
   339 // -----------------------------------------------------------------------------
       
   340 //
       
   341 TBool CMPXCollectionViewListBoxArray::IsItemCorruptedL( TInt aIndex ) const
       
   342     {
       
   343     TBool ret( EFalse );
       
   344     if ( iMedia )
       
   345         {
       
   346         CMPXMedia* entry( iMedia->AtL( aIndex ) );
       
   347         TUint flags( 0 );
       
   348         if( entry->IsSupported( KMPXMediaGeneralFlags ) )
       
   349             {
       
   350             flags = entry->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
       
   351             ret = ( ( flags ) & ( KMPXMediaGeneralFlagsIsCorrupted ) );
       
   352             }
       
   353         }
       
   354     return ret;
       
   355     }
       
   356 
       
   357 // -----------------------------------------------------------------------------
       
   358 // CMPXCollectionViewListBoxArray::IndicationIconIndices
       
   359 // Get array of indicator icon indices at the specified view index
       
   360 // Only used when using Hitchcock container.
       
   361 // -----------------------------------------------------------------------------
       
   362 //
       
   363 RArray<TInt> CMPXCollectionViewListBoxArray::IndicatorIconIndicesL(
       
   364     TInt aIndex )
       
   365     {
       
   366     RArray<TInt> iconIndices;
       
   367 
       
   368     TInt index( GetArrayIndexForListBoxIndex( aIndex ) );
       
   369     CMPXMedia* entry( iMedia->AtL( index ) );
       
   370 
       
   371     TMPXGeneralType type( EMPXNoType );
       
   372     if ( entry->IsSupported( KMPXMediaGeneralType ) )
       
   373         {
       
   374         type = entry->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType );
       
   375         }
       
   376     TMPXGeneralCategory category( EMPXNoCategory );
       
   377     if ( entry->IsSupported( KMPXMediaGeneralCategory ) )
       
   378         {
       
   379         category = entry->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory );
       
   380         }
       
   381     TUint flags(0);
       
   382     if ( entry->IsSupported( KMPXMediaGeneralFlags ) )
       
   383         {
       
   384         flags = entry->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
       
   385         }
       
   386 
       
   387     // reorder icon
       
   388     if ( ( iReorder ) && ( aIndex == iMovedIndex ) )
       
   389         {
       
   390         iconIndices.Append( GetReorderIcon() );
       
   391         }
       
   392     else if ( !iReorderActivated )
       
   393         {
       
   394         // playback status icon
       
   395         if ( iIndex == index )
       
   396             {
       
   397             switch ( iPbState )
       
   398                 {
       
   399                 case EPbStatePlaying:
       
   400                     {
       
   401                     iconIndices.Append( EMPXClvIconPlay );
       
   402                     break;
       
   403                     }
       
   404                 case EPbStatePaused:
       
   405                     {
       
   406                     iconIndices.Append( EMPXClvIconPause );
       
   407                     break;
       
   408                     }
       
   409                 default:
       
   410                     {
       
   411                     // other playback states, not handled
       
   412                     break;
       
   413                     }
       
   414                 }
       
   415             }
       
   416         }
       
   417 
       
   418     if ( category == EMPXSong && type == EMPXItem )
       
   419         {
       
   420         if ( flags & KMPXMediaGeneralFlagsIsInvalid )
       
   421             {
       
   422             iconIndices.Append( EMPXClvIconBrokenTrack );
       
   423             }
       
   424         else if ( flags & KMPXMediaGeneralFlagsIsCorrupted )
       
   425             {
       
   426             iconIndices.Append( EMPXClvIconCorruptTrack );
       
   427             }
       
   428         else if ( flags & KMPXMediaGeneralFlagsIsDrmLicenceInvalid )
       
   429             {
       
   430             iconIndices.Append( EMPXClvIconDrmExpired );
       
   431             }
       
   432         }
       
   433     else if ( category == EMPXPlaylist )
       
   434         {
       
   435         if ( flags & KMPXMediaGeneralFlagsIsInvalid )
       
   436             {
       
   437             iconIndices.Append( EMPXClvIconBrokenPlaylist );
       
   438             }
       
   439         }
       
   440 
       
   441     TInt driveNum = ( ( flags ) & ( KMPXMediaGeneralFlagsDriveInfo ) );
       
   442     if ( driveNum == iMMCDrive )
       
   443         {
       
   444         // The MMC icon is displayed in the first Indicator slot
       
   445         iconIndices.Append( EMPXClvIconMMC );
       
   446         }
       
   447 
       
   448     return iconIndices;
       
   449     }
       
   450 
       
   451 // -----------------------------------------------------------------------------
       
   452 // CMPXCollectionViewListBoxArray::MdcaPoint
       
   453 // indexes into a descriptor array.
       
   454 // -----------------------------------------------------------------------------
       
   455 //
       
   456 TPtrC CMPXCollectionViewListBoxArray::MdcaPoint( TInt aIndex ) const
       
   457     {
       
   458     //MPX_FUNC( "CMPXCollectionViewListBoxArray::MdcaPoint" );
       
   459     //MPX_DEBUG2( "CMPXCollectionViewListBoxArray::MdcaPoint media count %d", iMedia->Count() );
       
   460     TPtrC item( KNullDesC );
       
   461     TRAP_IGNORE( item.Set( GetMdcaPointL( aIndex ) ) );
       
   462     return item;
       
   463     }
       
   464 
       
   465 // -----------------------------------------------------------------------------
       
   466 // CMPXCollectionViewListBoxArray::CreateIconArrayL
       
   467 // creates icon array.
       
   468 // -----------------------------------------------------------------------------
       
   469 //
       
   470 CAknIconArray* CMPXCollectionViewListBoxArray::CreateIconArrayL()
       
   471     {
       
   472     MPX_FUNC( "CMPXCollectionViewListBoxArray::CreateIconArrayL" );
       
   473     TParse mbmFileName;
       
   474     mbmFileName.Set( KMPXCollectionViewIconFile,
       
   475                      &KDC_APP_RESOURCE_DIR, NULL );
       
   476     TFileName iconFile( mbmFileName.FullName() );
       
   477     User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
       
   478 
       
   479 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
       
   480     // Prepare icon array for listbox
       
   481     CAknIconArray* iconArray = new ( ELeave ) CAknIconArray( 26 ); // magic: array granularity
       
   482 #else
       
   483     // Prepare icon array for listbox
       
   484     CAknIconArray* iconArray = new ( ELeave ) CAknIconArray( 25 ); // magic: array granularity
       
   485 #endif
       
   486 
       
   487     // Update the enums when this list is updated
       
   488     AppendColorIconToArrayL( iconArray,
       
   489         KAknsIIDQgnIndiMarkedAdd,
       
   490         KAknsIIDNone,
       
   491         EAknsMinorNone,
       
   492         KAvkonBitmapFile,
       
   493         EMbmAvkonQgn_indi_marked_add,
       
   494         EMbmAvkonQgn_indi_marked_add_mask);
       
   495    AppendColorIconToArrayL( iconArray,
       
   496         KAknsIIDQgnPropEmpty,
       
   497         KAknsIIDNone,
       
   498         EAknsMinorNone,
       
   499         KAvkonBitmapFile,
       
   500         EMbmAvkonQgn_prop_empty,
       
   501         EMbmAvkonQgn_prop_empty_mask);    
       
   502     AppendColorIconToArrayL( iconArray,
       
   503         KAknsIIDQgnPropMupSongs,
       
   504         KAknsIIDNone,
       
   505         EAknsMinorNone,
       
   506         iconFile,
       
   507         EMbmMpxcollectionviewQgn_prop_mup_songs,
       
   508         EMbmMpxcollectionviewQgn_prop_mup_songs_mask );
       
   509     AppendColorIconToArrayL( iconArray,
       
   510         KAknsIIDQgnPropMupArtist,
       
   511         KAknsIIDNone,
       
   512         EAknsMinorNone,
       
   513         iconFile,
       
   514         EMbmMpxcollectionviewQgn_prop_mup_artist,
       
   515         EMbmMpxcollectionviewQgn_prop_mup_artist_mask );
       
   516     AppendColorIconToArrayL( iconArray,
       
   517         KAknsIIDQgnPropMupAlbum,
       
   518         KAknsIIDNone,
       
   519         EAknsMinorNone,
       
   520         iconFile,
       
   521         EMbmMpxcollectionviewQgn_prop_mup_album,
       
   522         EMbmMpxcollectionviewQgn_prop_mup_album_mask );
       
   523     AppendColorIconToArrayL( iconArray,
       
   524         KAknsIIDQgnPropMupPlaylist,
       
   525         KAknsIIDNone,
       
   526         EAknsMinorNone,
       
   527         iconFile,
       
   528         EMbmMpxcollectionviewQgn_prop_mup_playlist,
       
   529         EMbmMpxcollectionviewQgn_prop_mup_playlist_mask);
       
   530     AppendColorIconToArrayL( iconArray,
       
   531         KAknsIIDQgnPropMupPlaylist,
       
   532         KAknsIIDNone,
       
   533         EAknsMinorNone,
       
   534         iconFile,
       
   535         EMbmMpxcollectionviewQgn_graf_mup_lst_userplayl,
       
   536         EMbmMpxcollectionviewQgn_graf_mup_lst_userplayl_mask );
       
   537     AppendColorIconToArrayL( iconArray,
       
   538         KAknsIIDQgnPropMupPlaylistAuto,
       
   539         KAknsIIDNone,
       
   540         EAknsMinorNone,
       
   541         iconFile,
       
   542         EMbmMpxcollectionviewQgn_prop_mup_playlist_auto,
       
   543         EMbmMpxcollectionviewQgn_prop_mup_playlist_auto_mask );
       
   544     AppendColorIconToArrayL( iconArray,
       
   545         KAknsIIDQgnPropMupGenre,
       
   546         KAknsIIDNone,
       
   547         EAknsMinorNone,
       
   548         iconFile,
       
   549         EMbmMpxcollectionviewQgn_prop_mup_genre,
       
   550         EMbmMpxcollectionviewQgn_prop_mup_genre_mask );
       
   551     AppendColorIconToArrayL( iconArray,
       
   552         KAknsIIDQgnPropMupComposer,
       
   553         KAknsIIDNone,
       
   554         EAknsMinorNone,
       
   555         iconFile,
       
   556         EMbmMpxcollectionviewQgn_prop_mup_composer,
       
   557         EMbmMpxcollectionviewQgn_prop_mup_composer_mask );
       
   558     AppendColorIconToArrayL( iconArray,
       
   559         KAknsIIDQgnMenuFolderApps,
       
   560         KAknsIIDNone,
       
   561         EAknsMinorNone,
       
   562         iconFile,
       
   563         EMbmMpxcollectionviewQgn_menu_folder_apps,
       
   564         EMbmMpxcollectionviewQgn_menu_folder_apps_mask );
       
   565     AppendColorIconToArrayL( iconArray,
       
   566         KAknsIIDQgnPropMupAudio,
       
   567         KAknsIIDNone,
       
   568         EAknsMinorNone,
       
   569         iconFile,
       
   570         EMbmMpxcollectionviewQgn_prop_mup_audio,
       
   571         EMbmMpxcollectionviewQgn_prop_mup_audio_mask );
       
   572     AppendColorIconToArrayL( iconArray,
       
   573         KAknsIIDNone,
       
   574         KAknsIIDNone,
       
   575         EAknsMinorNone,
       
   576         iconFile,
       
   577         EMbmMpxcollectionviewQgn_graf_mup_lst_corrupttrack,
       
   578         EMbmMpxcollectionviewQgn_graf_mup_lst_corrupttrack_mask );
       
   579     AppendColorIconToArrayL( iconArray,
       
   580         KAknsIIDNone,
       
   581         KAknsIIDNone,
       
   582         EAknsMinorNone,
       
   583         iconFile,
       
   584         EMbmMpxcollectionviewQgn_graf_mup_lst_brokentrack,
       
   585         EMbmMpxcollectionviewQgn_graf_mup_lst_brokentrack_mask );
       
   586     AppendColorIconToArrayL( iconArray,
       
   587         KAknsIIDNone,
       
   588         KAknsIIDNone,
       
   589         EAknsMinorNone,
       
   590         iconFile,
       
   591         EMbmMpxcollectionviewQgn_graf_mup_lst_brokenplayl,
       
   592         EMbmMpxcollectionviewQgn_graf_mup_lst_brokenplayl_mask );
       
   593     AppendColorIconToArrayL( iconArray,
       
   594         KAknsIIDNone,
       
   595         KAknsIIDNone,
       
   596         EAknsMinorNone,
       
   597         iconFile,
       
   598         EMbmMpxcollectionviewQgn_graf_mup_lst_drm_exp,
       
   599         EMbmMpxcollectionviewQgn_graf_mup_lst_drm_exp_mask );
       
   600     AppendColorIconToArrayL( iconArray,
       
   601         KAknsIIDQgnPropUnknown,
       
   602         KAknsIIDNone,
       
   603         EAknsMinorNone,
       
   604         iconFile,
       
   605         EMbmMpxcollectionviewQgn_prop_unknown,
       
   606         EMbmMpxcollectionviewQgn_prop_unknown_mask );
       
   607     AppendColorIconToArrayL( iconArray,
       
   608         KAknsIIDQgnIndiMmcAdd,
       
   609         KAknsIIDQsnIconColors,
       
   610         EAknsCIQsnIconColorsCG26,
       
   611         iconFile,
       
   612         EMbmMpxcollectionviewQgn_indi_mmc_add,
       
   613         EMbmMpxcollectionviewQgn_indi_mmc_add_mask );
       
   614     AppendColorIconToArrayL( iconArray,
       
   615         KAknsIIDQgnIndiMupPlay,
       
   616         KAknsIIDQsnIconColors,
       
   617         EAknsCIQsnIconColorsCG26,
       
   618         iconFile,
       
   619         EMbmMpxcollectionviewQgn_graf_mup_npv_icon_play,
       
   620         EMbmMpxcollectionviewQgn_graf_mup_npv_icon_play_mask );
       
   621     AppendColorIconToArrayL( iconArray,
       
   622         KAknsIIDQgnIndiMupPause,
       
   623         KAknsIIDQsnIconColors,
       
   624         EAknsCIQsnIconColorsCG26,
       
   625         iconFile,
       
   626         EMbmMpxcollectionviewQgn_graf_mup_npv_icon_pause,
       
   627         EMbmMpxcollectionviewQgn_graf_mup_npv_icon_pause_mask );
       
   628     AppendColorIconToArrayL( iconArray,
       
   629         KAknsIIDQgnIndiMupForwAdd,
       
   630         KAknsIIDQsnIconColors,
       
   631         EAknsCIQsnIconColorsCG26,
       
   632         iconFile,
       
   633         EMbmMpxcollectionviewQgn_indi_mup_forw_add,
       
   634         EMbmMpxcollectionviewQgn_indi_mup_forw_add_mask );
       
   635     AppendColorIconToArrayL( iconArray,
       
   636         KAknsIIDQgnIndiMupRewAdd,
       
   637         KAknsIIDQsnIconColors,
       
   638         EAknsCIQsnIconColorsCG26,
       
   639         iconFile,
       
   640         EMbmMpxcollectionviewQgn_indi_mup_rew_add,
       
   641         EMbmMpxcollectionviewQgn_indi_mup_rew_add_mask );
       
   642     AppendColorIconToArrayL( iconArray,
       
   643         KAknsIIDQgnIndiMmcAdd,
       
   644         KAknsIIDQsnIconColors,
       
   645         EAknsCIQsnIconColorsCG26,
       
   646         iconFile,
       
   647         EMbmMpxcollectionviewQgn_graf_mup_adtl_reorder_down,
       
   648         EMbmMpxcollectionviewQgn_graf_mup_adtl_reorder_down_mask );
       
   649     AppendColorIconToArrayL( iconArray,
       
   650         KAknsIIDQgnIndiMmcAdd,
       
   651         KAknsIIDQsnIconColors,
       
   652         EAknsCIQsnIconColorsCG26,
       
   653         iconFile,
       
   654         EMbmMpxcollectionviewQgn_graf_mup_adtl_reorder_up,
       
   655         EMbmMpxcollectionviewQgn_graf_mup_adtl_reorder_up_mask );
       
   656     AppendColorIconToArrayL( iconArray,
       
   657         KAknsIIDQgnIndiMmcAdd,
       
   658         KAknsIIDQsnIconColors,
       
   659         EAknsCIQsnIconColorsCG26,
       
   660         iconFile,
       
   661         EMbmMpxcollectionviewQgn_graf_mup_adtl_reorder_updown,
       
   662         EMbmMpxcollectionviewQgn_graf_mup_adtl_reorder_updown_mask );
       
   663 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
       
   664     AppendColorIconToArrayL( iconArray,
       
   665         KAknsIIDQgnGrafMupDlstPodcast,
       
   666         KAknsIIDNone,
       
   667         EAknsMinorNone,
       
   668         iconFile,
       
   669         EMbmMpxcollectionviewQgn_graf_mup_dlst_podcast,
       
   670         EMbmMpxcollectionviewQgn_graf_mup_dlst_podcast_mask );
       
   671 #endif
       
   672     return iconArray;
       
   673     }
       
   674 
       
   675 // -----------------------------------------------------------------------------
       
   676 // CMPXCollectionViewListBoxArray::AppendMediaL
       
   677 // Appends media array to the current array
       
   678 // -----------------------------------------------------------------------------
       
   679 //
       
   680 void CMPXCollectionViewListBoxArray::AppendMediaL( const CMPXMedia& aMedia )
       
   681     {
       
   682     MPX_FUNC( "CMPXCollectionViewListBoxArray::AppendMediaL" );
       
   683     if ( iMediaOwned )
       
   684         {
       
   685         delete iMediaOwned;
       
   686         iMediaOwned = NULL;
       
   687         }
       
   688     CMPXCommonListBoxArrayBase::AppendMediaL( aMedia );
       
   689     iIsUnknownExist = EFalse;
       
   690 
       
   691     if ( iMedia )
       
   692         {
       
   693         TInt entriesCount( iMedia->Count() );
       
   694         if ( entriesCount > 0 )
       
   695             {
       
   696             // check if the last entry is "unknown" entry
       
   697             // if the last entry has a length of 0, then it's
       
   698             // "unknown" category and needs to be localized
       
   699             CMPXMedia* origMedia( iMedia->AtL( entriesCount - 1 ) );
       
   700             if ( origMedia->ValueText(
       
   701                 KMPXMediaGeneralTitle ).Length() == 0 )
       
   702                 {
       
   703                 iIsUnknownExist = ETrue;
       
   704                 }
       
   705             }
       
   706         }
       
   707     if ( iContainerMedia )
       
   708         {
       
   709         if ( iContainerMedia->IsSupported( KMPXMediaGeneralTitle ) )
       
   710             {
       
   711             if ( iContainerMedia->ValueText(
       
   712                 KMPXMediaGeneralTitle ).Length() == 0 )
       
   713                 {
       
   714                 TMPXGeneralCategory containerCategory(
       
   715                     iContainerMedia->ValueTObjectL<TMPXGeneralCategory>(
       
   716                         KMPXMediaGeneralCategory ) );
       
   717                 HBufC* text( NULL );
       
   718                 switch ( containerCategory )
       
   719                     {
       
   720                     case EMPXArtist:
       
   721                         {
       
   722                         text = StringLoader::LoadLC(
       
   723                             R_MPX_QTN_NMP_UNKNOWN_ARTIST );
       
   724                         break;
       
   725                         }
       
   726                     case EMPXAlbum:
       
   727                         {
       
   728                         text = StringLoader::LoadLC(
       
   729                             R_MPX_QTN_MUS_TITLE_UNKNOWN_ALBUM );
       
   730                         break;
       
   731                         }
       
   732                     case EMPXGenre:
       
   733                         {
       
   734                         text = StringLoader::LoadLC(
       
   735                             R_MPX_QTN_MUS_TITLE_UNKNOWN_GENRE );
       
   736                         break;
       
   737                         }
       
   738                     case EMPXComposer:
       
   739                         {
       
   740                         text = StringLoader::LoadLC(
       
   741                             R_MPX_QTN_MUS_TITLE_UNKNOWN_COMPOSER );
       
   742                         break;
       
   743                         }
       
   744                     default:
       
   745                         {
       
   746                         text = StringLoader::LoadLC(
       
   747                             R_MPX_QTN_MP_UNKNOWN );
       
   748                         break;
       
   749                         }
       
   750                     }
       
   751                 iContainerMedia->SetTextValueL(
       
   752                     KMPXMediaGeneralTitle, *text );
       
   753                 CleanupStack::PopAndDestroy( text );
       
   754                 }
       
   755             }
       
   756         }
       
   757     }
       
   758 
       
   759 // -----------------------------------------------------------------------------
       
   760 // Append icon to array
       
   761 // -----------------------------------------------------------------------------
       
   762 //
       
   763 void CMPXCollectionViewListBoxArray::AppendColorIconToArrayL(
       
   764     CAknIconArray* aArray,
       
   765     const TAknsItemID& aID,
       
   766     const TAknsItemID& aColorId,
       
   767     TInt aColorIndex,
       
   768     const TDesC& aMbmFile,
       
   769     TInt aBitmapId,
       
   770     TInt aMaskId )
       
   771     {
       
   772     MAknsSkinInstance* skin( AknsUtils::SkinInstance() );
       
   773 
       
   774     CFbsBitmap* bitmap( NULL );
       
   775     CFbsBitmap* mask( NULL );
       
   776 
       
   777     if ( aColorId == KAknsIIDNone )
       
   778         {
       
   779         // do not use theme color, use the default color from the file
       
   780         AknsUtils::CreateIconLC( skin, aID,
       
   781             bitmap, mask, aMbmFile, aBitmapId, aMaskId );
       
   782         }
       
   783     else
       
   784         {
       
   785         // use theme color
       
   786         AknsUtils::CreateColorIconLC( skin, aID, aColorId, aColorIndex,
       
   787             bitmap, mask, aMbmFile, aBitmapId, aMaskId, KRgbBlack );
       
   788         }
       
   789 
       
   790     CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
       
   791     icon->SetBitmapsOwnedExternally( EFalse );
       
   792 
       
   793     // icon now owns the bitmaps, no need to keep on cleanup stack.
       
   794     CleanupStack::Pop( 2 ); // mask, bitmap
       
   795 
       
   796     CleanupStack::PushL( icon );
       
   797     aArray->AppendL( icon );
       
   798     // aArray now owns the icon, no need to delete.
       
   799     CleanupStack::Pop( icon );
       
   800     }
       
   801 
       
   802 // -----------------------------------------------------------------------------
       
   803 // Maps list box index to array index in reorder mode
       
   804 // -----------------------------------------------------------------------------
       
   805 //
       
   806 TInt CMPXCollectionViewListBoxArray::GetArrayIndexForListBoxIndex(
       
   807     TInt aIndex ) const
       
   808     {
       
   809     TInt index( aIndex );
       
   810 
       
   811     if ( ( iReorder ) && ( iOriginalIndex != iMovedIndex ) )
       
   812         {
       
   813         if ( iMovedIndex > iOriginalIndex )
       
   814             {
       
   815             // moved down
       
   816             if ( aIndex < iOriginalIndex )
       
   817                 {
       
   818                 // do nothing
       
   819                 }
       
   820             else if ( aIndex > iMovedIndex )
       
   821                 {
       
   822                 // do nothing
       
   823                 }
       
   824             else if ( aIndex < iMovedIndex )
       
   825                 {
       
   826                 // between original index and moved index
       
   827                 index = aIndex + 1;
       
   828                 }
       
   829             else if ( aIndex == iMovedIndex )
       
   830                 {
       
   831                 index = iOriginalIndex;
       
   832                 }
       
   833             }
       
   834         else
       
   835             {
       
   836             // moved up
       
   837             if ( aIndex > iOriginalIndex )
       
   838                 {
       
   839                 // do nothing
       
   840                 }
       
   841             else if ( aIndex < iMovedIndex )
       
   842                 {
       
   843                 // do nothing
       
   844                 }
       
   845             else if ( aIndex > iMovedIndex )
       
   846                 {
       
   847                 // between original index and moved index
       
   848                 index = aIndex - 1;
       
   849                 }
       
   850             else if ( aIndex == iMovedIndex )
       
   851                 {
       
   852                 index = iOriginalIndex;
       
   853                 }
       
   854             }
       
   855         }
       
   856 
       
   857     return index;
       
   858     }
       
   859 
       
   860 // -----------------------------------------------------------------------------
       
   861 // Get reorder icon
       
   862 // -----------------------------------------------------------------------------
       
   863 //
       
   864 TBool CMPXCollectionViewListBoxArray::GetReorderIcon() const
       
   865     {
       
   866     TInt icon( EMPXClvIconNone );
       
   867 
       
   868     // Determine the icon to display
       
   869     if ( iReorder )
       
   870         {
       
   871         if ( iMovedIndex == 0 )
       
   872             {
       
   873             icon = EMPXClvIconReorderDown;
       
   874             }
       
   875         else if ( MdcaCount() - 1 == iMovedIndex )
       
   876             {
       
   877             icon = EMPXClvIconReorderUp;
       
   878             }
       
   879         else
       
   880             {
       
   881             icon = EMPXClvIconReorderUpDown;
       
   882             }
       
   883         }
       
   884     return icon;
       
   885     }
       
   886 
       
   887 // -----------------------------------------------------------------------------
       
   888 // CMPXCollectionViewListBoxArray::GetMdcaPointL
       
   889 // indexes into a descriptor array.
       
   890 // -----------------------------------------------------------------------------
       
   891 //
       
   892 TPtrC CMPXCollectionViewListBoxArray::GetMdcaPointL( TInt aIndex ) const
       
   893     {
       
   894     TInt index( GetArrayIndexForListBoxIndex( aIndex ) );
       
   895     TPtrC item( KNullDesC );
       
   896     CMPXMedia* entry( iMedia->AtL( index ) );
       
   897     if( entry->IsSupported( KMPXMediaGeneralTitle ) )
       
   898         {
       
   899         TPtrC title( entry->ValueText( KMPXMediaGeneralTitle ) );
       
   900         if ( IsCategoryUnknownExist() && aIndex== MdcaCount() - 1 && title.Length()==0 )
       
   901             {
       
   902             title.Set( *iUnknown );
       
   903             }
       
   904 
       
   905         TMPXGeneralType type( EMPXNoType );
       
   906         if( entry->IsSupported( KMPXMediaGeneralType ) )
       
   907             {
       
   908             type = entry->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType );
       
   909             }
       
   910         TMPXGeneralCategory category( EMPXNoCategory );
       
   911         if( entry->IsSupported( KMPXMediaGeneralCategory ) )
       
   912             {
       
   913             category = entry->ValueTObjectL<TMPXGeneralCategory>(
       
   914                         KMPXMediaGeneralCategory );
       
   915             }
       
   916         TUint flags(0);
       
   917         if( entry->IsSupported( KMPXMediaGeneralFlags ) )
       
   918             {
       
   919             flags = entry->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
       
   920             }
       
   921         //MPX_DEBUG3( "CMPXCollectionViewListBoxArray::MdcaPoint (%d) Name: %S", aIndex, &title );
       
   922         //MPX_DEBUG4( "CMPXCollectionViewListBoxArray::MdcaPoint (%d) Type: %d, Category: %d", aIndex, type, category );
       
   923         TInt iconID( EMPXClvIconNone );
       
   924         switch( category )
       
   925             {
       
   926             case EMPXSong:
       
   927                 {
       
   928                 if ( type == EMPXGroup )
       
   929                     {
       
   930                     iconID = EMPXClvIconSongs;
       
   931                     }
       
   932                 else
       
   933                     {
       
   934                     TUint flags(0);
       
   935                     if( entry->IsSupported( KMPXMediaGeneralFlags ) )
       
   936                         {
       
   937                         flags = entry->ValueTObjectL<TUint>( KMPXMediaGeneralFlags );
       
   938                         }
       
   939                     if ( flags & KMPXMediaGeneralFlagsIsInvalid )
       
   940                         {
       
   941                         iconID = EMPXClvIconBrokenTrack;
       
   942                         }
       
   943                     else if ( flags & KMPXMediaGeneralFlagsIsCorrupted )
       
   944                         {
       
   945                         iconID = EMPXClvIconCorruptTrack;
       
   946                         }
       
   947                     else if ( flags & KMPXMediaGeneralFlagsIsDrmLicenceInvalid )
       
   948                         {
       
   949                         iconID = EMPXClvIconDrmExpired;
       
   950                         }
       
   951                     else
       
   952                         {
       
   953                         iconID = EMPXClvIconAudio;
       
   954                         }
       
   955                     }
       
   956                 break;
       
   957                 }
       
   958             case EMPXArtist:
       
   959                 {
       
   960                 iconID = EMPXClvIconArtist;
       
   961                 break;
       
   962                 }
       
   963             case EMPXAlbum:
       
   964                 {
       
   965                 iconID = EMPXClvIconAlbum;
       
   966                 if ( entry->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) ==
       
   967                     iContainerMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) )
       
   968                     {
       
   969                     // if id == containerid, "all" under artist/album
       
   970                     iconID = EMPXClvIconSongs;
       
   971                     }
       
   972                 break;
       
   973                 }
       
   974             case EMPXPlaylist:
       
   975                 {
       
   976                 if ( flags & KMPXMediaGeneralFlagsIsInvalid )
       
   977                     {
       
   978                     iconID = EMPXClvIconBrokenPlaylist;
       
   979                     }
       
   980                 else
       
   981                     {
       
   982                     if ( type == EMPXGroup )
       
   983                         {
       
   984                         iconID = EMPXClvIconPlaylist;
       
   985                         }
       
   986                     else
       
   987                         {
       
   988                         iconID = EMPXClvIconUserPlaylist;
       
   989                         }
       
   990                     if ( type == EMPXItem )
       
   991                         {
       
   992                         if ( entry->IsSupported(
       
   993                             KMPXMediaGeneralNonPermissibleActions ) )
       
   994                             {
       
   995                             // check for auto playlist and display a different icon
       
   996                             TMPXGeneralNonPermissibleActions attr(
       
   997                                 entry->ValueTObjectL<TMPXGeneralNonPermissibleActions>(
       
   998                                     KMPXMediaGeneralNonPermissibleActions ) );
       
   999                             if ( attr & EMPXWrite )
       
  1000                                 {
       
  1001                                 iconID = EMPXClvIconPlaylistAuto;
       
  1002                                 }
       
  1003                             }
       
  1004                         }
       
  1005                     }
       
  1006                 break;
       
  1007                 }
       
  1008             case EMPXGenre:
       
  1009                 {
       
  1010                 iconID = EMPXClvIconGenre;
       
  1011                 break;
       
  1012                 }
       
  1013             case EMPXComposer:
       
  1014                 {
       
  1015                 iconID = EMPXClvIconComposer;
       
  1016                 break;
       
  1017                 }
       
  1018 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
       
  1019             case EMPXPodcast:
       
  1020                 {
       
  1021                 iconID = EMPXClvIconPodcasts;
       
  1022                 break;
       
  1023                 }
       
  1024 #endif
       
  1025             case EMPXFile:
       
  1026                 {
       
  1027                 // a group of files is a folder
       
  1028                 iconID = EMPXClvIconFolder;
       
  1029                 break;
       
  1030                 }
       
  1031 
       
  1032             default:
       
  1033                 {
       
  1034                 // unknown folder icon
       
  1035                 iconID = EMPXClvIconUnknowFile;
       
  1036                 break;
       
  1037                 }
       
  1038             }
       
  1039         TPtr ptr = iItem->Des();
       
  1040         ptr.Zero();
       
  1041 
       
  1042         ptr.Format( KMPXCommonListboxFormatString, iconID, &title );
       
  1043 
       
  1044         iconID = EMPXClvIconNone;
       
  1045         // reorder icon
       
  1046         if ( ( iReorder ) && ( aIndex == iMovedIndex ) )
       
  1047             {
       
  1048             iconID = GetReorderIcon();
       
  1049             }
       
  1050         else if ( !iReorderActivated )
       
  1051             {
       
  1052             // playback status icon
       
  1053             if ( iIndex == index )
       
  1054                 {
       
  1055                 switch ( iPbState )
       
  1056                     {
       
  1057                     case EPbStatePlaying:
       
  1058                         {
       
  1059                         iconID = EMPXClvIconPlay;
       
  1060                         break;
       
  1061                         }
       
  1062                     case EPbStatePaused:
       
  1063                         {
       
  1064                         iconID = EMPXClvIconPause;
       
  1065                         break;
       
  1066                         }
       
  1067                     case EPbStateSeekingForward:
       
  1068                         {
       
  1069                         iconID = EMPXClvIconForward;
       
  1070                         break;
       
  1071                         }
       
  1072                     case EPbStateSeekingBackward:
       
  1073                         {
       
  1074                         iconID = EMPXClvIconRewind;
       
  1075                         break;
       
  1076                         }
       
  1077                     default:
       
  1078                         {
       
  1079                         // other playback states, not handled
       
  1080                         break;
       
  1081                         }
       
  1082                     }
       
  1083                 }
       
  1084             }
       
  1085         else
       
  1086             {
       
  1087             // Do nothing
       
  1088             }
       
  1089 
       
  1090         if ( iconID != EMPXClvIconNone )
       
  1091             {
       
  1092             ptr.Append( KMPXTab );
       
  1093             ptr.AppendNum( iconID );
       
  1094             }
       
  1095 
       
  1096         // mmc icon
       
  1097         TInt driveNum = ( ( flags ) & ( KMPXMediaGeneralFlagsDriveInfo ) );
       
  1098         if ( driveNum == iMMCDrive )
       
  1099             {
       
  1100             ptr.Append( KMPXTab );
       
  1101             ptr.AppendNum( EMPXClvIconMMC );
       
  1102             }
       
  1103 
       
  1104         item.Set( *iItem );
       
  1105         }
       
  1106     return item;
       
  1107     }
       
  1108 
       
  1109 // ---------------------------------------------------------------------------
       
  1110 // Sets playback status
       
  1111 // ---------------------------------------------------------------------------
       
  1112 //
       
  1113 TInt CMPXCollectionViewListBoxArray::SetPlaybackStatusByIndex(
       
  1114     TInt aIndex, TMPXPlaybackState aStatus )
       
  1115     {
       
  1116     MPX_FUNC( "CMPXCollectionViewListBoxArray::SetPlaybackStatusByIndex" );
       
  1117     TInt ret( iIndex );
       
  1118     iIndex = aIndex;
       
  1119 
       
  1120     // Not to display seeking icons for seeking mode
       
  1121     if ( aStatus != EPbStateSeekingForward &&
       
  1122         aStatus != EPbStateSeekingBackward )
       
  1123         {
       
  1124         iPbState = aStatus;
       
  1125         }
       
  1126     return ret;
       
  1127     }
       
  1128 
       
  1129 //  End of File