mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgplaylisthelper.cpp
branchRCL_3
changeset 13 c8156a91d13c
parent 11 943ff5625028
child 24 26a1709b9fec
equal deleted inserted replaced
12:171e07ac910f 13:c8156a91d13c
   170     {
   170     {
   171     MPX_DEBUG1("CMPXCollectionViewHgPlaylistHelper::InitPlaylistL");
   171     MPX_DEBUG1("CMPXCollectionViewHgPlaylistHelper::InitPlaylistL");
   172 
   172 
   173     if (!iIsInitializing)
   173     if (!iIsInitializing)
   174         {
   174         {
       
   175 		if (aEnableShuffle)
       
   176 			{
       
   177 			TTime time;
       
   178 			time.UniversalTime();
       
   179 			TInt64 seed = time.Int64();
       
   180 			TInt randIndex = Math::Rand(seed) % aPath.Count();
       
   181 			aPath.Set(randIndex);
       
   182 			}
       
   183 
   175         CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL( aPath );
   184         CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL( aPath );
   176         CleanupStack::PushL( playlist );
   185         CleanupStack::PushL( playlist );
   177         
   186 
   178         if (aEnableShuffle)
   187         playlist->SetShuffleEnabledL( aEnableShuffle );
   179             {
   188         iPlaybackUtility->SetL( EPbPropertyRandomMode, aEnableShuffle );
   180             TTime time;
       
   181             time.UniversalTime();
       
   182             TInt64 seed = time.Int64();
       
   183             TInt randIndex = Math::Rand(seed) % aPath.Count();
       
   184             aPath.Set(randIndex);
       
   185             playlist->SetShuffleEnabledL( aEnableShuffle );
       
   186             iPlaybackUtility->SetL( EPbPropertyRandomMode, aEnableShuffle );
       
   187             }
       
   188 
       
   189         iPlaybackUtility->InitL( *playlist, ETrue );
   189         iPlaybackUtility->InitL( *playlist, ETrue );
   190         CleanupStack::PopAndDestroy( playlist );
   190         CleanupStack::PopAndDestroy( playlist );
   191 
   191 
   192 		//iPlaybackUtility->SetL( EPbPropertyRandomMode, aEnableShuffle );
   192 		//iPlaybackUtility->SetL( EPbPropertyRandomMode, aEnableShuffle );
   193 		//iCollectionUtility->Collection().OpenL(aPath);
   193 		//iCollectionUtility->Collection().OpenL(aPath);