53 #include <mpxcollectionpath.h> |
53 #include <mpxcollectionpath.h> |
54 #include <mpxplaybackutility.h> |
54 #include <mpxplaybackutility.h> |
55 #include <mpxcollectionviewhg.rsg> |
55 #include <mpxcollectionviewhg.rsg> |
56 #include <mpxcollectionviewhg.mbg> |
56 #include <mpxcollectionviewhg.mbg> |
57 #include <mpxappui.hrh> |
57 #include <mpxappui.hrh> |
|
58 #include <mpxmusicplayerviewplugin.hrh> |
58 |
59 |
59 #include <ganes/HgDoubleGraphicListFlat.h> |
60 #include <ganes/HgDoubleGraphicListFlat.h> |
60 #include <ganes/HgSingleGraphicList.h> |
61 #include <ganes/HgSingleGraphicList.h> |
61 #include <ganes/HgSingleTextListWithIcon.h> |
62 #include <ganes/HgSingleTextListWithIcon.h> |
62 #include <ganes/HgVgItem.h> |
63 #include <ganes/HgVgItem.h> |
63 #include <ganes/HgItem.h> |
64 #include <ganes/HgItem.h> |
64 #include <ganes/HgScrollerWithTitle.h> |
65 #include <ganes/HgScrollerWithTitle.h> |
65 #include <ganes/HgVgMediaWall.h> |
66 #include <ganes/HgVgMediaWall.h> |
66 |
67 |
67 #include <layoutmetadata.cdl.h> |
68 #include <layoutmetadata.cdl.h> |
|
69 #include <akntranseffect.h> // For transition effects |
|
70 #include <gfxtranseffect\gfxtranseffect.h> // For transition effects |
68 |
71 |
69 #include "mpxcommoncontainer.hrh" |
72 #include "mpxcommoncontainer.hrh" |
70 #include "mpxcollectionviewhg.hrh" |
73 #include "mpxcollectionviewhg.hrh" |
71 #include "mpxcollectionviewhglistboxarray.h" |
74 #include "mpxcollectionviewhglistboxarray.h" |
72 #include "mpxcollectionviewhg.hlp.hrh" |
75 #include "mpxcollectionviewhg.hlp.hrh" |
73 #include "mpxcollectionviewhgcontainer.h" |
76 #include "mpxcollectionviewhgcontainer.h" |
74 #include "mpxcollectionviewhgplaylisthelper.h" |
77 #include "mpxcollectionviewhgplaylisthelper.h" |
75 #include "mpxcollectionviewhgtnloader.h" |
78 #include "mpxcollectionviewhgtnloader.h" |
76 #include "mpxcbahandler.h" |
79 #include "mpxcbahandler.h" |
|
80 #include "mpxselectedalbumhandler.h" |
|
81 #include "mpxpopuplist.h" |
77 |
82 |
78 // CONSTANTS |
83 // CONSTANTS |
79 _LIT( KMPXCollectionViewRscPath, "mpxcollectionviewhg.rsc" ); |
84 _LIT( KMPXCollectionViewRscPath, "mpxcollectionviewhg.rsc" ); |
80 _LIT( KMPXCollectionViewIconFile, "mpxcollectionviewhg.mbm" ); |
85 _LIT( KMPXCollectionViewIconFile, "mpxcollectionviewhg.mbm" ); |
81 const TInt KMPXListSelectionCount = 5; |
86 const TInt KMPXListSelectionCount = 5; |
109 _LIT( KAlbum, " album" ); |
116 _LIT( KAlbum, " album" ); |
110 _LIT( KAlbums, " albums" ); |
117 _LIT( KAlbums, " albums" ); |
111 _LIT( KSongDash, " song - " ); |
118 _LIT( KSongDash, " song - " ); |
112 _LIT( KSongsDash, " songs - " ); |
119 _LIT( KSongsDash, " songs - " ); |
113 |
120 |
114 _LIT( KMPXDriveC, "c:" ); |
|
115 _LIT( KMPXSelectedAlbumItemFileName, "mpxalbumitem.dat"); |
|
116 |
|
117 // ======== MEMBER FUNCTIONS ======== |
121 // ======== MEMBER FUNCTIONS ======== |
118 |
122 |
119 // --------------------------------------------------------------------------- |
123 // --------------------------------------------------------------------------- |
120 // Two-phased constructor. |
124 // Two-phased constructor. |
121 // --------------------------------------------------------------------------- |
125 // --------------------------------------------------------------------------- |
122 // |
126 // |
123 CMPXCollectionViewHgContainer* CMPXCollectionViewHgContainer::NewL( |
127 CMPXCollectionViewHgContainer* CMPXCollectionViewHgContainer::NewL( |
124 MEikCommandObserver* aView, |
128 MEikCommandObserver* aView, |
125 MEikListBoxObserver* aObserver, |
129 MEikListBoxObserver* aObserver, |
|
130 MMPXSelectedAlbumHandler* aSelectedAlbumHandler, |
126 TBool aIsEmbedded) |
131 TBool aIsEmbedded) |
127 { |
132 { |
128 MPX_FUNC( "CMPXCollectionViewHgContainer::NewL" ); |
133 MPX_FUNC( "CMPXCollectionViewHgContainer::NewL" ); |
129 CMPXCollectionViewHgContainer* self = |
134 CMPXCollectionViewHgContainer* self = |
130 new ( ELeave ) CMPXCollectionViewHgContainer(aView, aObserver, aIsEmbedded); |
135 new ( ELeave ) CMPXCollectionViewHgContainer( |
|
136 aView, aObserver, aSelectedAlbumHandler, aIsEmbedded); |
131 CleanupStack::PushL( self ); |
137 CleanupStack::PushL( self ); |
132 self->ConstructL(); |
138 self->ConstructL(); |
133 CleanupStack::Pop( self ); |
139 CleanupStack::Pop( self ); |
134 return self; |
140 return self; |
135 } |
141 } |
730 } |
738 } |
731 SetDetailIconShuffleL(); |
739 SetDetailIconShuffleL(); |
732 } |
740 } |
733 else if ( aType == KEikDynamicLayoutVariantSwitch ) |
741 else if ( aType == KEikDynamicLayoutVariantSwitch ) |
734 { |
742 { |
735 if ( iCurrentViewType == EMPXViewCoverFlow ) |
743 if ( iCurrentViewType == EMPXViewMediawall ) |
736 { |
744 { |
737 if ( iDialog ) |
745 if ( iDialog ) |
738 { |
746 { |
739 iDialog->CancelPopup(); |
747 iDialog->CancelPopup(); |
740 iDialog = NULL; |
|
741 } |
748 } |
742 } |
749 } |
743 if( iCurrentViewType == EMPXViewTBone ) |
750 iSetEmptyTextNeeded = ETrue; |
|
751 |
|
752 // Coe env is in middle if notifying observers (controls). |
|
753 // Just to be safe, lets just create a small async callback and then |
|
754 // call HandleLbxItemAdditionL |
|
755 if( !iAsyncCallBack->IsActive() ) |
744 { |
756 { |
745 iCollectionUtility->Collection().BackL(); |
757 iAsyncCallBack->CallBack(); |
746 } |
758 } |
747 else |
759 |
748 { |
760 iLayoutSwitch = ETrue; |
749 // Coe env is in middle if notifying observers (controls). |
|
750 // Just to be save, lets just create a small async callback and then |
|
751 // call HandleLbxItemAdditionL |
|
752 if( !iAsyncCallBack->IsActive() ) |
|
753 { |
|
754 iAsyncCallBack->CallBack(); |
|
755 } |
|
756 } |
|
757 |
761 |
758 if( iCbaHandler ) |
762 if( iCbaHandler ) |
759 iCbaHandler->UpdateCba(); |
763 iCbaHandler->UpdateCba(); |
760 |
764 |
761 TRect clientRect = ((CAknView*)iView)->ClientRect(); |
765 TRect clientRect = ((CAknView*)iView)->ClientRect(); |
762 SetRect( clientRect ); |
766 SetRect( clientRect ); |
763 iBgContext->SetRect(((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect()); |
767 iBgContext->SetRect(((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect()); |
764 } |
768 } |
765 ); |
769 ); |
|
770 if(iMediaWall) |
|
771 iMediaWall->HandleResourceChange( aType ); |
|
772 if(iListWidget) |
|
773 iListWidget->HandleResourceChange( aType ); |
|
774 if(iMwListWidget) |
|
775 iMwListWidget->HandleResourceChange( aType ); |
766 } |
776 } |
767 |
777 |
768 |
778 |
769 // --------------------------------------------------------------------------- |
779 // --------------------------------------------------------------------------- |
770 // From CCoeControl |
780 // From CCoeControl |
1154 // |
1165 // |
1155 void CMPXCollectionViewHgContainer::HandleLbxItemAdditionL() |
1166 void CMPXCollectionViewHgContainer::HandleLbxItemAdditionL() |
1156 { |
1167 { |
1157 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleLbxItemAdditionL" ); |
1168 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleLbxItemAdditionL" ); |
1158 SetCollectionContextL(); |
1169 SetCollectionContextL(); |
|
1170 |
|
1171 // When the collection is reopened after coming from playback view, |
|
1172 // it is reopened in Album-Tracks level (EContextItemAlbum). |
|
1173 // We don't display its content in that context but inturn reopen the |
|
1174 // collection at one level up (Albums) and display it in T-bone view. |
|
1175 // T-Bone view is just a list of albums presented differently. |
|
1176 if ( iContext == EContextItemAlbum ) |
|
1177 { |
|
1178 iCollectionUtility->Collection().BackL(); |
|
1179 iOpenAlbumTracks = ETrue; |
|
1180 return; |
|
1181 } |
|
1182 |
1159 iLastValidMediaItemIndex = 0; |
1183 iLastValidMediaItemIndex = 0; |
1160 |
1184 |
1161 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
1185 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
1162 const TInt count( mediaArray.Count() ); |
1186 TInt count( mediaArray.Count() ); |
1163 MPX_DEBUG2( "CMPXCollectionViewHgContainer::HandleLbxItemAdditionL count=%d", count); |
1187 MPX_DEBUG2( "CMPXCollectionViewHgContainer::HandleLbxItemAdditionL count=%d", count); |
|
1188 |
1164 HandleLbxItemRemovalL(); |
1189 HandleLbxItemRemovalL(); |
1165 |
|
1166 iThumbnailReqMap.Reset(); |
|
1167 iThumbnailReqMap.ReserveL(count); |
|
1168 for ( TInt i = 0; i < count; i++ ) |
|
1169 { |
|
1170 iThumbnailReqMap.Append( EFalse ); |
|
1171 } |
|
1172 |
|
1173 iThumbnailManager->CancelAll(); |
|
1174 |
|
1175 TViewType prevViewType = iCurrentViewType; |
1190 TViewType prevViewType = iCurrentViewType; |
1176 ResolveCurrentViewType(); |
1191 ResolveCurrentViewType(); |
1177 |
1192 |
|
1193 iThumbnailReqMap.Reset(); |
|
1194 if (ShuffleItemPresent()) |
|
1195 iShuffleItem = 1; |
|
1196 else |
|
1197 iShuffleItem = 0; |
|
1198 |
|
1199 count = count + iShuffleItem; |
|
1200 iThumbnailReqMap.ReserveL(count ); |
|
1201 for ( TInt i = 0; i < count ; i++ ) |
|
1202 { |
|
1203 iThumbnailReqMap.Append( EFalse ); |
|
1204 } |
|
1205 |
|
1206 iThumbnailManager->CancelAll(); |
|
1207 |
1178 if( prevViewType == iCurrentViewType && iContext == iPrevContext ) |
1208 if( prevViewType == iCurrentViewType && iContext == iPrevContext ) |
1179 { |
1209 { |
1180 ResizeListL( mediaArray, count ); |
1210 ResizeListL( mediaArray, count ); |
1181 } |
1211 } |
1182 else |
1212 else |
1183 { |
1213 { |
1184 // MediaWall sets the default icon in the construction phase. |
1214 // MediaWall sets the default icon in the construction phase. |
1185 iDefaultIconSet = EFalse; |
1215 iDefaultIconSet = EFalse; |
|
1216 |
|
1217 if( !iLayoutSwitch ) |
|
1218 { |
|
1219 // We only need to use this for one transition coming |
|
1220 // from playback view. |
|
1221 TBool pbv = (iPreviousViewId == TUid::Uid(KMPXPluginTypePlaybackUid)) ? ETrue : EFalse; |
|
1222 if ( pbv ) |
|
1223 { |
|
1224 iPreviousViewId = TUid::Uid(0); |
|
1225 } |
|
1226 BeginFullScreenAnimation( pbv ); |
|
1227 } |
|
1228 |
1186 switch (iCurrentViewType) |
1229 switch (iCurrentViewType) |
1187 { |
1230 { |
1188 case EMPXViewCoverFlow: |
1231 case EMPXViewMediawall: |
1189 { |
1232 { |
1190 TMPXPlaybackState pbState( iPlaybackUtility->StateL() ); |
1233 TMPXPlaybackState pbState( iPlaybackUtility->StateL() ); |
1191 if ( pbState == EPbStatePlaying || pbState == EPbStatePaused ) |
1234 if ( pbState == EPbStatePlaying || pbState == EPbStatePaused ) |
1192 RestoreSelectedAlbumItemL(mediaArray); |
1235 RestoreSelectedAlbumItemL(mediaArray); |
1193 PrepareMediaWallL(mediaArray, count); |
1236 PrepareMediaWallL(mediaArray, count); |
|
1237 iOpenAlbumTracks = EFalse; |
1194 break; |
1238 break; |
1195 } |
1239 } |
1196 case EMPXViewTBone: |
1240 case EMPXViewTBone: |
1197 { |
1241 { |
1198 RestoreSelectedAlbumItemL(mediaArray); |
1242 RestoreSelectedAlbumItemL(mediaArray); |
1199 PrepareMediaWallWithListL( mediaArray, count ); |
1243 PrepareMediaWallWithListL( mediaArray, count ); |
|
1244 // We need to adjust the CBA for this view. |
|
1245 if( iCbaHandler ) |
|
1246 iCbaHandler->UpdateCba(); |
1200 break; |
1247 break; |
1201 } |
1248 } |
1202 case EMPXViewList: |
1249 case EMPXViewList: |
1203 { |
1250 { |
1204 PrepareListL(mediaArray, count); |
1251 PrepareListL(mediaArray, count); |
|
1252 iOpenAlbumTracks = EFalse; |
1205 break; |
1253 break; |
1206 } |
1254 } |
1207 default: |
1255 default: |
1208 User::Leave( KErrGeneral ); |
1256 User::Leave( KErrGeneral ); |
1209 break; |
1257 break; |
1210 } |
1258 } |
1211 |
|
1212 } |
1259 } |
1213 |
1260 |
1214 DrawableWindow()->SetOrdinalPosition( -1 ); |
1261 DrawableWindow()->SetOrdinalPosition( -1 ); |
1215 |
1262 |
1216 CleanPrevView(); |
1263 CleanPrevView(); |
1217 |
|
1218 iPrevViewType = iCurrentViewType; |
1264 iPrevViewType = iCurrentViewType; |
1219 iPrevContext = iContext; |
1265 iPrevContext = iContext; |
|
1266 if ( iSetEmptyTextNeeded ) |
|
1267 { |
|
1268 LoadAndSetEmptyTextL(); |
|
1269 iSetEmptyTextNeeded = EFalse; |
|
1270 } |
1220 if( !iDefaultIconSet ) |
1271 if( !iDefaultIconSet ) |
1221 { |
1272 { |
1222 SetDefaultIconL(); |
1273 SetDefaultIconL(); |
1223 } |
1274 } |
1224 |
1275 |
|
1276 iLayoutSwitch = EFalse; |
1225 } |
1277 } |
1226 |
1278 |
1227 // ----------------------------------------------------------------------------- |
1279 // ----------------------------------------------------------------------------- |
1228 // Handle listbox item addition, preserving the current display index |
1280 // Handle listbox item addition, preserving the current display index |
1229 // ----------------------------------------------------------------------------- |
1281 // ----------------------------------------------------------------------------- |
1573 iMwListWidget->SetRect( mwListRect ); |
1628 iMwListWidget->SetRect( mwListRect ); |
1574 iMwListWidget->DrawNow(); |
1629 iMwListWidget->DrawNow(); |
1575 } |
1630 } |
1576 } |
1631 } |
1577 |
1632 |
|
1633 if( iTranstionType != EMPXTranstionNotDefined ) |
|
1634 { |
|
1635 iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC ); |
|
1636 } |
|
1637 |
|
1638 iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationNone ); |
|
1639 |
1578 if ( iAlbumIndex == KErrNotFound ) |
1640 if ( iAlbumIndex == KErrNotFound ) |
1579 { |
1641 { |
1580 iMediaWall->SetSelectedIndex( iRestoredAlbumIndex ); |
1642 iMediaWall->SetSelectedIndex( iRestoredAlbumIndex ); |
1581 iMediaWall->RefreshScreen(iRestoredAlbumIndex); |
1643 // If we are about to start a transition animation we should draw only |
|
1644 // when we have received first screen of thumbs in Refresh function. |
|
1645 if( iTranstionType == EMPXTranstionNotDefined ) |
|
1646 iMediaWall->RefreshScreen(iRestoredAlbumIndex); |
1582 OpenAlbumL(iRestoredAlbumIndex); |
1647 OpenAlbumL(iRestoredAlbumIndex); |
1583 } |
1648 } |
1584 else |
1649 else |
1585 { |
1650 { |
1586 iMediaWall->SetSelectedIndex( iAlbumIndex ); |
1651 iMediaWall->SetSelectedIndex( iAlbumIndex ); |
1587 iMediaWall->RefreshScreen(iAlbumIndex); |
1652 // If we are about to start a transition animation we should draw only |
|
1653 // when we have received first screen of thumbs in Refresh function. |
|
1654 if( iTranstionType == EMPXTranstionNotDefined ) |
|
1655 iMediaWall->RefreshScreen(iAlbumIndex); |
1588 OpenAlbumL(iAlbumIndex); |
1656 OpenAlbumL(iAlbumIndex); |
1589 } |
1657 } |
1590 iMwListWidget->RefreshScreen(0); |
1658 iMwListWidget->RefreshScreen(0); |
1591 iDefaultIconSet = ETrue; |
1659 |
1592 } |
1660 } |
1593 |
1661 |
1594 // ---------------------------------------------------------------------------- |
1662 // ---------------------------------------------------------------------------- |
1595 // Prepare view for displaying data in Media wall format. |
1663 // Prepare view for displaying data in Media wall format. |
1596 // ---------------------------------------------------------------------------- |
1664 // ---------------------------------------------------------------------------- |
1623 iMediaWall->HandleLosingForeground(); |
1691 iMediaWall->HandleLosingForeground(); |
1624 |
1692 |
1625 iMediaWall->SetMopParent(this); |
1693 iMediaWall->SetMopParent(this); |
1626 iMediaWall->SetSelectionObserver(*this); |
1694 iMediaWall->SetSelectionObserver(*this); |
1627 iMediaWall->SetObserver( this ); // softkey visibility event observer |
1695 iMediaWall->SetObserver( this ); // softkey visibility event observer |
1628 iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront ); |
|
1629 iMediaWall->EnableScrollBufferL( |
1696 iMediaWall->EnableScrollBufferL( |
1630 *this, |
1697 *this, |
1631 KMPXListBufferSizeWithMediaWall, |
1698 KMPXListBufferSizeWithMediaWall, |
1632 KMPXListBufferSizeWithMediaWall / 4); |
1699 KMPXListBufferSizeWithMediaWall / 4); |
1633 // We want softkeys to be drawn on top of mediawall, thats we need to manipulate window pos |
1700 // We want softkeys to be drawn on top of mediawall, thats we need to manipulate window pos |
1634 iMediaWall->DrawableWindow()->SetOrdinalPosition( -1 ); |
1701 iMediaWall->DrawableWindow()->SetOrdinalPosition( -1 ); |
1635 ProvideDataWithoutThumbnailsMwL(aMediaArray); |
1702 ProvideDataWithoutThumbnailsMwL(aMediaArray); |
1636 if( iAlbumIndex == KErrNotFound ) |
1703 if( iAlbumIndex == KErrNotFound ) |
1637 iMediaWall->SetSelectedIndex( iRestoredAlbumIndex ); |
1704 iMediaWall->SetSelectedIndex( iRestoredAlbumIndex + iShuffleItem ); |
1638 else |
1705 else |
1639 iMediaWall->SetSelectedIndex( iAlbumIndex ); |
1706 iMediaWall->SetSelectedIndex( iAlbumIndex + iShuffleItem ); |
1640 } |
1707 } |
1641 else |
1708 else |
1642 { |
1709 { |
1643 // TODO, do we need to refill the data or are the items same in fullscreen coverflow and tbone coverflow???? |
|
1644 // David: Yes because there will be an extra shuffle item in the coverflow list but not in tbone coverflow. |
|
1645 // Index will be off. |
|
1646 if( iMediaWall->Style() != CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen ) |
1710 if( iMediaWall->Style() != CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen ) |
1647 iMediaWall->ChangeStyleL( CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen, appRect, ETrue ); |
1711 iMediaWall->ChangeStyleL( CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen, appRect, ETrue ); |
1648 |
1712 |
1649 iMediaWall->MakeVisible( ETrue ); |
1713 iMediaWall->MakeVisible( ETrue ); |
1650 iMediaWall->SetFocus( ETrue ); |
1714 iMediaWall->SetFocus( ETrue ); |
1651 iMediaWall->EnableScrollBufferL( |
1715 iMediaWall->EnableScrollBufferL( |
1652 *this, |
1716 *this, |
1653 KMPXListBufferSizeWithMediaWall, |
1717 KMPXListBufferSizeWithMediaWall, |
1654 KMPXListBufferSizeWithMediaWall / 4); |
1718 KMPXListBufferSizeWithMediaWall / 4); |
1655 if( iAlbumIndex == KErrNotFound ) |
1719 if( iAlbumIndex == KErrNotFound ) |
1656 iMediaWall->SetSelectedIndex( iRestoredAlbumIndex ); |
1720 iMediaWall->SetSelectedIndex( iRestoredAlbumIndex + iShuffleItem ); |
1657 else |
1721 else |
1658 iMediaWall->SetSelectedIndex( iAlbumIndex ); |
1722 iMediaWall->SetSelectedIndex( iAlbumIndex + iShuffleItem ); |
1659 |
|
1660 iMediaWall->DrawDeferred(); |
|
1661 } |
1723 } |
|
1724 |
|
1725 if( iTranstionType != EMPXTranstionNotDefined ) |
|
1726 { |
|
1727 iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC ); |
|
1728 } |
|
1729 |
|
1730 if( iPopupListRect == TRect(0,0,0,0) ) |
|
1731 { |
|
1732 ResolvePopupListSizeL(); |
|
1733 } |
|
1734 |
|
1735 iMediaWall->SetOpenedItemRect( iPopupListRect ); |
|
1736 iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationZoomToFront ); |
1662 |
1737 |
1663 iDefaultIconSet = ETrue; |
1738 iDefaultIconSet = ETrue; |
1664 } |
1739 } |
1665 |
1740 |
1666 // ---------------------------------------------------------------------------- |
1741 // ---------------------------------------------------------------------------- |
1860 { |
1954 { |
1861 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleItemCommanddL" ); |
1955 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleItemCommanddL" ); |
1862 |
1956 |
1863 if( aCommand == EMPXCmdPlay ) |
1957 if( aCommand == EMPXCmdPlay ) |
1864 { |
1958 { |
1865 switch( iCurrentViewType ) |
1959 if ( iContext == EContextGroupAlbum ) |
1866 { |
1960 { |
1867 case EMPXViewCoverFlow: |
1961 iSelectedAlbumIndex = MediaIndex(iListWidget->SelectedIndex()); |
1868 case EMPXViewTBone: |
1962 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
1869 { |
1963 // Open first song of album & playlist for entire album is created. |
1870 iSelectedAlbumIndex = iMediaWall->SelectedIndex(); |
1964 PlayAlbumL(iSelectedAlbumIndex); |
1871 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
1965 } |
1872 // Open first song of album & playlist for entire album is created. |
1966 else if ( iContext == EContextGroupPlaylist ) |
1873 UpdatePathAndOpenL(0, ETrue); |
1967 { |
1874 break; |
1968 TInt index = MediaIndex(iListWidget->SelectedIndex()); |
1875 } |
1969 PlayPlaylistL(index); |
1876 case EMPXViewList: |
1970 } |
1877 { |
1971 else if ( iContext == EContextGroupGenre ) |
1878 if ( iContext == EContextGroupAlbum ) |
1972 { |
1879 { |
1973 TInt index = MediaIndex(iListWidget->SelectedIndex()); |
1880 iSelectedAlbumIndex = iListWidget->SelectedIndex(); |
1974 PlayGenreL(index); |
1881 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
|
1882 // Open first song of album & playlist for entire album is created. |
|
1883 PlayAlbumL(iSelectedAlbumIndex); |
|
1884 } |
|
1885 else if ( iContext == EContextGroupPlaylist ) |
|
1886 { |
|
1887 TInt index = iListWidget->SelectedIndex(); |
|
1888 PlayPlaylistL(index); |
|
1889 } |
|
1890 else if ( iContext == EContextGroupGenre ) |
|
1891 { |
|
1892 TInt index = iListWidget->SelectedIndex(); |
|
1893 PlayGenreL(index); |
|
1894 } |
|
1895 break; |
|
1896 } |
|
1897 default: |
|
1898 break; |
|
1899 } |
1975 } |
1900 } |
1976 } |
1901 } |
1977 } |
1902 |
1978 |
1903 // --------------------------------------------------------------------------- |
1979 // --------------------------------------------------------------------------- |
1941 // |
2020 // |
1942 void CMPXCollectionViewHgContainer::HandleOpenL( TInt aIndex ) |
2021 void CMPXCollectionViewHgContainer::HandleOpenL( TInt aIndex ) |
1943 { |
2022 { |
1944 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleOpenL" ); |
2023 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleOpenL" ); |
1945 |
2024 |
1946 // Mod by harri, had to enable this block since ganes list components still |
2025 TInt index(MediaIndex(aIndex)); |
1947 // uses this version of the HandleOpen |
2026 |
|
2027 // ganes list components still uses this version of the HandleOpen |
1948 if ( iContext == EContextItemAlbum ) |
2028 if ( iContext == EContextItemAlbum ) |
1949 { |
2029 { |
1950 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
2030 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
1951 UpdatePathAndOpenL(aIndex); |
2031 UpdatePathAndOpenL(index); |
1952 } |
2032 } |
1953 else if ( iContext == EContextGroupAlbum ) |
2033 else if ( iContext == EContextGroupAlbum ) |
1954 { |
2034 { |
1955 SaveSelectedAlbumItemL(aIndex); |
2035 SaveSelectedAlbumItemL(index); |
|
2036 iAlbumIndex = index; |
1956 // Check if shuffle play all was selected. |
2037 // Check if shuffle play all was selected. |
1957 if (!ShufflePlayAllL(aIndex)) |
2038 if (!ShufflePlayAllL(index)) |
1958 { |
2039 { |
1959 // To open the selected album. |
2040 // To open the selected album. |
1960 iView->ProcessCommandL( EMPXCmdCommonEnterKey ); |
2041 PrepareTboneViewL(); |
1961 } |
2042 } |
1962 } |
2043 } |
1963 else if ( iContext == EContextGroupSong || iContext == EContextItemPlaylist ) |
2044 else if ( iContext == EContextGroupSong || iContext == EContextItemPlaylist || iContext == EContextItemGenre ) |
1964 { |
2045 { |
1965 // Check if shuffle play all was selected. |
2046 // Check if shuffle play all was selected. |
1966 if (!ShufflePlayAllL(aIndex)) |
2047 if (!ShufflePlayAllL(index)) |
1967 { |
2048 { |
1968 // To open the selected album. |
2049 // To open the selected album. |
1969 iView->ProcessCommandL( EMPXCmdCommonEnterKey ); |
2050 iView->ProcessCommandL( EMPXCmdCommonEnterKey ); |
1970 } |
2051 } |
1971 } |
2052 } |
1982 // |
2063 // |
1983 void CMPXCollectionViewHgContainer::HandleOpenL( TInt aIndex, CCoeControl* aControl ) |
2064 void CMPXCollectionViewHgContainer::HandleOpenL( TInt aIndex, CCoeControl* aControl ) |
1984 { |
2065 { |
1985 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleOpenL" ); |
2066 MPX_FUNC( "CMPXCollectionViewHgContainer::HandleOpenL" ); |
1986 |
2067 |
1987 if( iContext == EContextGroupAlbum ) |
2068 TInt index(MediaIndex(aIndex)); |
1988 { |
2069 |
1989 iAlbumIndex = aIndex; |
2070 if( iContext == EContextGroupAlbum && index >= 0 ) |
1990 iSelectedAlbumIndex = aIndex; |
2071 { |
1991 SaveSelectedAlbumItemL(aIndex); |
2072 iAlbumIndex = index; |
|
2073 iSelectedAlbumIndex = index; |
|
2074 SaveSelectedAlbumItemL(index); |
1992 } |
2075 } |
1993 |
2076 |
1994 if ( iContext == EContextItemAlbum ) |
2077 if ( iContext == EContextItemAlbum ) |
1995 { |
2078 { |
|
2079 if( iCurrentViewType == EMPXViewTBone ) |
|
2080 { |
|
2081 iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC ); |
|
2082 iMediaWall->DrawNow(); |
|
2083 } |
1996 if ( aControl == iMediaWall ) |
2084 if ( aControl == iMediaWall ) |
1997 { |
2085 { |
1998 // If album was opened, we will play all tracks in the album. |
2086 // If album was opened, we will play all tracks in the album. |
1999 SaveSelectedAlbumItemL(aIndex); |
2087 SaveSelectedAlbumItemL(index); |
2000 // Open first song of album & playlist for entire album is created. |
2088 // Open first song of album & playlist for entire album is created. |
2001 UpdatePathAndOpenL(0, ETrue); |
2089 UpdatePathAndOpenL(0, ETrue); |
2002 } |
2090 } |
2003 else if ( aControl == iMwListWidget ) |
2091 else if ( aControl == iMwListWidget ) |
2004 { |
2092 { |
2005 // If item in list was opened, we only play the selected one. |
2093 // If item in list was opened, we only play the selected one. |
2006 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
2094 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
2007 // Open the selected song of album |
2095 // Open the selected song of album |
2008 UpdatePathAndOpenL(aIndex); |
2096 UpdatePathAndOpenL(index); |
2009 } |
2097 } |
2010 } |
2098 } |
2011 else if ( iContext == EContextGroupAlbum ) |
2099 else if ( iContext == EContextGroupAlbum ) |
2012 { |
2100 { |
2013 if ( aControl == iMediaWall ) |
2101 if ( aControl == iMediaWall ) |
2014 { |
2102 { |
2015 // Check if shuffle play all was selected. |
2103 // Check if shuffle play all was selected. |
2016 if (!ShufflePlayAllL(aIndex)) |
2104 if (!ShufflePlayAllL(index)) |
2017 { |
2105 { |
2018 OpenAlbumL(aIndex); |
2106 OpenAlbumL(index); |
2019 } |
2107 } |
2020 } |
2108 } |
2021 } |
2109 } |
2022 else |
2110 else |
2023 { |
2111 { |
2180 // ----------------------------------------------------------------------------- |
2267 // ----------------------------------------------------------------------------- |
2181 // |
2268 // |
2182 void CMPXCollectionViewHgContainer::ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd ) |
2269 void CMPXCollectionViewHgContainer::ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd ) |
2183 { |
2270 { |
2184 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
2271 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
|
2272 TInt index(0); |
2185 for( TInt i = aBufferStart; i <= aBufferEnd; i++ ) |
2273 for( TInt i = aBufferStart; i <= aBufferEnd; i++ ) |
2186 { |
2274 { |
2187 // Just get the exiting item and update the fields + icon. |
2275 // Just get the exiting item and update the fields + icon. |
2188 CHgItem* item = NULL; |
2276 CHgItem* item = NULL; |
2189 if( iMediaWall ) |
2277 if( iMediaWall ) |
2190 item = &iMediaWall->ItemL(i); |
2278 item = &iMediaWall->ItemL(i); |
2191 else |
2279 else |
2192 item = &iListWidget->ItemL(i); |
2280 item = &iListWidget->ItemL(i); |
2193 |
2281 |
2194 CMPXMedia* currentMedia( mediaArray.AtL( i ) ); |
2282 index = MediaIndex(i); |
2195 AddThumbnailToDisplayedItemL( item, currentMedia, i ); |
2283 if ( index >= 0 ) |
|
2284 { |
|
2285 CMPXMedia* currentMedia( mediaArray.AtL( index ) ); |
|
2286 AddThumbnailToDisplayedItemL( item, currentMedia, index ); |
|
2287 } |
|
2288 else |
|
2289 { |
|
2290 if ( iCurrentViewType == EMPXViewMediawall || |
|
2291 iCurrentViewType == EMPXViewList && (i-iShuffleItem) == -1 ) |
|
2292 SetDetailIconShuffleL(); |
|
2293 iThumbnailReqMap[i] = ETrue; |
|
2294 RefreshNoThumbnailL(i); |
|
2295 } |
2196 } |
2296 } |
2197 } |
2297 } |
2198 |
2298 |
2199 // ----------------------------------------------------------------------------- |
2299 // ----------------------------------------------------------------------------- |
2200 // CMPXCollectionViewHgContainer::ProvideDataWithouThumbnailsL |
2300 // CMPXCollectionViewHgContainer::ProvideDataWithouThumbnailsL |
2244 const CMPXMediaArray& aMediaArray, |
2339 const CMPXMediaArray& aMediaArray, |
2245 TInt aStartIndex ) |
2340 TInt aStartIndex ) |
2246 { |
2341 { |
2247 MPX_FUNC( "CMPXCollectionViewHgContainer::ProvideDataWithoutThumbnailsMwL" ); |
2342 MPX_FUNC( "CMPXCollectionViewHgContainer::ProvideDataWithoutThumbnailsMwL" ); |
2248 |
2343 |
|
2344 if ( ShuffleItemPresent() ) |
|
2345 { |
|
2346 CHgVgItem* item = &iMediaWall->ItemL(0); |
|
2347 SetShuffleItemTextL(item, NULL); |
|
2348 } |
|
2349 |
2249 TInt mediaCount = aMediaArray.Count(); |
2350 TInt mediaCount = aMediaArray.Count(); |
2250 |
2351 |
2251 for ( TInt i = aStartIndex; i < mediaCount ; i++ ) |
2352 for ( TInt i = aStartIndex; i < mediaCount ; i++ ) |
2252 { |
2353 { |
2253 // Just get the exiting item and update the fields + icon. |
|
2254 CMPXMedia* currentMedia( aMediaArray.AtL( i ) ); |
2354 CMPXMedia* currentMedia( aMediaArray.AtL( i ) ); |
2255 |
2355 |
2256 if ( currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == |
2356 if ( currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == |
2257 KMPXInvalidItemId ) |
2357 KMPXInvalidItemId ) |
2258 { |
2358 { |
2259 break; |
2359 break; |
2260 } |
2360 } |
2261 |
|
2262 // Just get the exiting item and update the fields + icon. |
2361 // Just get the exiting item and update the fields + icon. |
2263 |
2362 CHgVgItem* item = &iMediaWall->ItemL(i+iShuffleItem); |
2264 CHgVgItem* item = &iMediaWall->ItemL(i); |
2363 |
2265 TBool shuffleItem(EFalse); |
2364 SetTitleL( item, currentMedia ); |
2266 if ( i == 0 ) |
2365 AddDetailToDisplayedItemL( item, currentMedia, i ); |
2267 { |
|
2268 shuffleItem = SetShuffleItemTextL(item, currentMedia); |
|
2269 } |
|
2270 |
|
2271 if (!shuffleItem) |
|
2272 { |
|
2273 SetTitleL( item, currentMedia ); |
|
2274 AddDetailToDisplayedItemL( item, currentMedia, i ); |
|
2275 } |
|
2276 iLastValidMediaItemIndex = i; |
2366 iLastValidMediaItemIndex = i; |
2277 } |
2367 } |
2278 } |
2368 } |
2279 // ----------------------------------------------------------------------------- |
2369 // ----------------------------------------------------------------------------- |
2280 // CMPXCollectionViewHgContainer::ProvideDataL |
2370 // CMPXCollectionViewHgContainer::ProvideDataL |
2286 MPX_DEBUG3( "CMPXCollectionViewHgContainer::ProvideDataL aStart = %d, aEnd = %d", |
2376 MPX_DEBUG3( "CMPXCollectionViewHgContainer::ProvideDataL aStart = %d, aEnd = %d", |
2287 aStart, aEnd ); |
2377 aStart, aEnd ); |
2288 if ( aStart < 0 ) aStart = 0; |
2378 if ( aStart < 0 ) aStart = 0; |
2289 if ( aEnd < 0 ) aEnd = 0; |
2379 if ( aEnd < 0 ) aEnd = 0; |
2290 |
2380 |
|
2381 TInt index(0); |
2291 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
2382 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
2292 for ( TInt i = aStart; i <= aEnd ; i++ ) |
2383 for ( TInt i = aStart; i <= aEnd ; i++ ) |
2293 { |
2384 { |
2294 // Just get the exiting item and update the fields + icon. |
2385 // Just get the exiting item and update the fields + icon. |
2295 CHgItem* item = NULL; |
2386 CHgItem* item = NULL; |
2296 if( iCurrentViewType == EMPXViewCoverFlow || iCurrentViewType == EMPXViewTBone ) |
2387 if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone ) |
2297 item = &iMediaWall->ItemL(i); |
2388 item = &iMediaWall->ItemL(i); |
2298 else |
2389 else |
2299 item = &iListWidget->ItemL(i); |
2390 item = &iListWidget->ItemL(i); |
2300 |
2391 |
2301 CMPXMedia* currentMedia( mediaArray.AtL( i ) ); |
2392 index = MediaIndex(i); |
2302 |
2393 if ( index >= 0 ) |
2303 AddThumbnailToDisplayedItemL( item, currentMedia, i ); |
2394 { |
2304 } |
2395 CMPXMedia* currentMedia( mediaArray.AtL( index ) ); |
2305 } |
2396 AddThumbnailToDisplayedItemL( item, currentMedia, index ); |
|
2397 } |
|
2398 } |
|
2399 } |
|
2400 |
2306 |
2401 |
2307 // ----------------------------------------------------------------------------- |
2402 // ----------------------------------------------------------------------------- |
2308 // CMPXCollectionViewHgContainer::Release |
2403 // CMPXCollectionViewHgContainer::Release |
2309 // ----------------------------------------------------------------------------- |
2404 // ----------------------------------------------------------------------------- |
2310 // |
2405 // |
2311 void CMPXCollectionViewHgContainer::Release(TInt aReleaseStart, TInt aReleaseEnd) |
2406 void CMPXCollectionViewHgContainer::Release(TInt aReleaseStart, TInt aReleaseEnd) |
2312 { |
2407 { |
2313 MPX_FUNC( "CMPXCollectionViewHgContainer::Release" ); |
2408 MPX_FUNC( "CMPXCollectionViewHgContainer::Release" ); |
2314 |
2409 |
2315 for(; aReleaseStart <= aReleaseEnd; ++aReleaseStart) |
2410 TInt temp = aReleaseStart - iShuffleItem; |
2316 { |
2411 TInt start = temp >=0 ? temp : 0 ; |
2317 MPX_DEBUG2( "-->CMPXCollectionViewHgContainer::Release aReleaseStart = %d", aReleaseStart ); |
2412 TInt end = aReleaseEnd - iShuffleItem; |
2318 iThumbnailManager->CancelThumb( aReleaseStart ); |
2413 |
2319 } |
2414 for(; start <= end; ++start) |
2320 |
2415 { |
|
2416 MPX_DEBUG2( "-->CMPXCollectionViewHgContainer::Release aReleaseStart = %d", start ); |
|
2417 iThumbnailManager->CancelThumb( start ); |
|
2418 } |
2321 } |
2419 } |
2322 |
2420 |
2323 // --------------------------------------------------------------------------- |
2421 // --------------------------------------------------------------------------- |
2324 // Refresh for item without thumbnail |
2422 // Refresh for item without thumbnail |
2325 // --------------------------------------------------------------------------- |
2423 // --------------------------------------------------------------------------- |
2326 // |
2424 // |
2327 void CMPXCollectionViewHgContainer::RefreshNoThumbnailL(TInt aIndex) |
2425 void CMPXCollectionViewHgContainer::RefreshNoThumbnailL(TInt aDisplayIndex) |
2328 { |
2426 { |
2329 MPX_FUNC( "CMPXCollectionViewHgContainer::RefreshNoThumbnail" ); |
2427 MPX_FUNC( "CMPXCollectionViewHgContainer::RefreshNoThumbnail" ); |
2330 |
2428 |
2331 RefreshL(aIndex); |
2429 RefreshL(aDisplayIndex); |
2332 } |
2430 } |
2333 // --------------------------------------------------------------------------- |
2431 // --------------------------------------------------------------------------- |
2334 // Refresh list as needed. |
2432 // Refresh list as needed. |
2335 // This function tries to determine the best time to refresh the screen as to |
2433 // This function tries to determine the best time to refresh the screen as to |
2336 // avoid too many redraws. In some cases, multiple refresh is unavoidable. |
2434 // avoid too many redraws. In some cases, multiple refresh is unavoidable. |
2337 // --------------------------------------------------------------------------- |
2435 // --------------------------------------------------------------------------- |
2338 // |
2436 // |
2339 void CMPXCollectionViewHgContainer::RefreshL(TInt aIndex) |
2437 void CMPXCollectionViewHgContainer::RefreshL(TInt aDisplayIndex) |
2340 { |
2438 { |
2341 if( !iIsForeground ) |
2439 if( !iIsForeground ) |
2342 { |
2440 { |
2343 return; |
2441 return; |
2344 } |
2442 } |
2345 |
2443 |
2346 MPX_FUNC( "CMPXCollectionViewHgContainer::Refresh" ); |
2444 MPX_FUNC( "CMPXCollectionViewHgContainer::Refresh" ); |
2347 |
2445 |
2348 TInt mediaCount = iListBoxArray->MediaArray().Count(); |
2446 TInt mediaCount = iListBoxArray->MediaArray().Count(); |
|
2447 TInt displayCount = mediaCount + iShuffleItem; |
2349 |
2448 |
2350 TInt firstOnScreen = 0; |
2449 TInt firstOnScreen = 0; |
2351 TInt lastOnScreen = 0; |
2450 TInt lastOnScreen = 0; |
2352 |
2451 |
2353 TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); |
2452 TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); |
2354 CHgScroller* listWidget = CurrentListWidget(); |
2453 CHgScroller* listWidget = CurrentListWidget(); |
2355 |
2454 |
2356 if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewCoverFlow ) |
2455 if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewMediawall ) |
2357 { |
2456 { |
2358 firstOnScreen = iMediaWall->FirstIndexOnScreen(); |
2457 firstOnScreen = iMediaWall->FirstIndexOnScreen(); |
2359 lastOnScreen = firstOnScreen + iMediaWall->ItemsOnScreen(); |
2458 lastOnScreen = firstOnScreen + iMediaWall->ItemsOnScreen(); |
2360 } |
2459 } |
2361 else |
2460 else |
2362 { |
2461 { |
2363 firstOnScreen = listWidget->FirstIndexOnScreen(); |
2462 firstOnScreen = listWidget->FirstIndexOnScreen(); |
2364 lastOnScreen = firstOnScreen + listWidget->ItemsOnScreen(); |
2463 lastOnScreen = firstOnScreen + listWidget->ItemsOnScreen(); |
2365 } |
2464 } |
2366 |
2465 |
2367 // Added by Harri |
|
2368 if( firstOnScreen < 0 ) |
2466 if( firstOnScreen < 0 ) |
2369 firstOnScreen = 0; |
2467 firstOnScreen = 0; |
2370 if (lastOnScreen > (mediaCount - 1)) |
2468 if (lastOnScreen > (displayCount - 1)) |
2371 lastOnScreen = mediaCount - 1; |
2469 lastOnScreen = displayCount - 1; |
2372 |
2470 |
2373 // Refresh screen if the item is within view and no more thumbnails expected. |
2471 // Refresh screen if the item is within view and no more thumbnails expected. |
2374 if ( aIndex >= firstOnScreen && aIndex <= lastOnScreen ) |
2472 if ( aDisplayIndex >= firstOnScreen && aDisplayIndex <= lastOnScreen ) |
2375 { |
2473 { |
2376 TBool canRefresh(ETrue); |
2474 TBool canRefresh(ETrue); |
2377 for (TInt i= firstOnScreen; i <= lastOnScreen; i++) |
2475 for (TInt i= firstOnScreen; i <= lastOnScreen; i++) |
2378 { |
2476 { |
2379 if ( !iThumbnailReqMap[i] ) |
2477 if ( !iThumbnailReqMap[i] ) |
3308 // ---------------------------------------------------------------------------- |
3428 // ---------------------------------------------------------------------------- |
3309 |
3429 |
3310 void CMPXCollectionViewHgContainer::SetDetailIconShuffleL() |
3430 void CMPXCollectionViewHgContainer::SetDetailIconShuffleL() |
3311 { |
3431 { |
3312 |
3432 |
3313 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
3433 if (iShuffleItem) |
3314 if (mediaArray.Count()) |
|
3315 { |
3434 { |
3316 CMPXMedia* currentMedia( mediaArray.AtL( 0 ) ); |
3435 CGulIcon* icon = (*iIconArray)[EMPXClvIconShuffle]; |
3317 |
3436 CFbsBitmap* bitmap = icon->Bitmap(); |
3318 TMPXGeneralType type( EMPXNoType ); |
3437 CFbsBitmap* mask = icon->Mask(); |
3319 if ( currentMedia->IsSupported( KMPXMediaGeneralType ) ) |
3438 |
3320 { |
3439 TSize size(240,240); |
3321 type = currentMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ); |
3440 CHgItem* item = NULL; |
3322 } |
3441 if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone ) |
3323 |
3442 { |
3324 TMPXGeneralCategory category( EMPXNoCategory ); |
3443 item = &iMediaWall->ItemL(0); |
3325 if ( currentMedia->IsSupported( KMPXMediaGeneralCategory ) ) |
3444 } |
3326 { |
3445 else if( iCurrentViewType == EMPXViewList ) |
3327 category = currentMedia->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory ); |
3446 { |
3328 } |
3447 item = &iListWidget->ItemL(0); |
3329 |
3448 size = CHgDoubleGraphicListFlat::PreferredImageSize(); |
3330 if ( type == EMPXItem && category == EMPXCommand ) |
3449 } |
3331 { |
3450 else |
3332 |
3451 { |
3333 CGulIcon* icon = (*iIconArray)[EMPXClvIconShuffle]; |
3452 User::Leave( KErrNotSupported ); |
3334 CFbsBitmap* bitmap = icon->Bitmap(); |
3453 } |
3335 CFbsBitmap* mask = icon->Mask(); |
3454 |
3336 |
3455 if ( item ) |
3337 TSize size(240,240); |
3456 { |
3338 CHgItem* item = NULL; |
3457 AknIconUtils::SetSize( bitmap, size ); |
3339 if( iCurrentViewType == EMPXViewCoverFlow || iCurrentViewType == EMPXViewTBone ) |
3458 AknIconUtils::SetSize( mask, size ); |
3340 { |
3459 |
3341 item = &iMediaWall->ItemL(0); |
3460 CGulIcon* iconCopy = CGulIcon::NewL(bitmap, mask); |
3342 } |
3461 iconCopy->SetBitmapsOwnedExternally(ETrue); |
3343 else if( iCurrentViewType == EMPXViewList ) |
3462 item->SetIcon( iconCopy ); |
3344 { |
|
3345 item = &iListWidget->ItemL(0); |
|
3346 size = CHgDoubleGraphicListFlat::PreferredImageSize(); |
|
3347 } |
|
3348 else |
|
3349 { |
|
3350 User::Leave( KErrNotSupported ); |
|
3351 } |
|
3352 |
|
3353 if ( item ) |
|
3354 { |
|
3355 AknIconUtils::SetSize( bitmap, size ); |
|
3356 AknIconUtils::SetSize( mask, size ); |
|
3357 |
|
3358 CGulIcon* iconCopy = CGulIcon::NewL(bitmap, mask); |
|
3359 iconCopy->SetBitmapsOwnedExternally(ETrue); |
|
3360 item->SetIcon( iconCopy ); |
|
3361 } |
|
3362 } |
3463 } |
3363 } |
3464 } |
|
3465 |
|
3466 |
|
3467 |
3364 } |
3468 } |
3365 |
3469 |
3366 // ---------------------------------------------------------------------------- |
3470 // ---------------------------------------------------------------------------- |
3367 // Set the shuffle item text |
3471 // Set the shuffle item text |
3368 // ---------------------------------------------------------------------------- |
3472 // ---------------------------------------------------------------------------- |
3369 |
3473 |
3370 TBool CMPXCollectionViewHgContainer::SetShuffleItemTextL(CHgItem* aItem, CMPXMedia* aMedia) |
3474 TBool CMPXCollectionViewHgContainer::SetShuffleItemTextL(CHgItem* aItem, CMPXMedia* aMedia) |
3371 { |
3475 { |
3372 |
3476 |
3373 TBool res(EFalse); |
3477 TBool res(EFalse); |
3374 TMPXGeneralType type( EMPXNoType ); |
3478 |
3375 if ( aMedia->IsSupported( KMPXMediaGeneralType ) ) |
3479 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
3376 { |
3480 const TInt count( mediaArray.Count() ); |
3377 type = aMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ); |
3481 |
3378 } |
3482 if ( count > 1 && iContext == EContextGroupAlbum || |
3379 |
3483 iContext == EContextGroupSong || |
3380 TMPXGeneralCategory category( EMPXNoCategory ); |
3484 iContext == EContextGroupGenre || |
3381 if ( aMedia->IsSupported( KMPXMediaGeneralCategory ) ) |
3485 iContext == EContextItemPlaylist || |
3382 { |
3486 iContext == EContextItemGenre || |
3383 category = aMedia->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory ); |
3487 iContext == EContextItemSong ) |
3384 } |
3488 { |
3385 |
3489 aItem->SetTitleL( _L("Shuffle All") ); |
3386 if ( type == EMPXItem && category == EMPXCommand ) |
|
3387 { |
|
3388 |
|
3389 if ( aMedia->IsSupported( KMPXMediaGeneralTitle ) ) |
|
3390 { |
|
3391 |
|
3392 const TDesC& title = aMedia->ValueText( KMPXMediaGeneralTitle ); |
|
3393 if ( title.Compare( KNullDesC ) != 0 ) |
|
3394 { |
|
3395 aItem->SetTitleL( title ); |
|
3396 } |
|
3397 else |
|
3398 { |
|
3399 HBufC* unknownText = |
|
3400 StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); |
|
3401 aItem->SetTitleL( *unknownText ); |
|
3402 CleanupStack::PopAndDestroy( unknownText ); |
|
3403 } |
|
3404 } |
|
3405 |
|
3406 if ( aMedia->IsSupported( KMPXMediaColDetailNumberOfItems ) ) |
|
3407 { |
|
3408 TInt songsCount = aMedia->ValueTObjectL<TInt>( KMPXMediaColDetailNumberOfItems ); |
|
3409 |
|
3410 HBufC* songsTitle = StringLoader::LoadLC( R_MPX_COLLECTION_DETAILS_NUMBER_OF_SONGS, songsCount ); |
|
3411 TPtr ptr = songsTitle->Des(); |
|
3412 AknTextUtils::LanguageSpecificNumberConversion( ptr ); |
|
3413 aItem->SetTextL( ptr ); |
|
3414 CleanupStack::PopAndDestroy( songsTitle ); |
|
3415 } |
|
3416 |
3490 |
3417 // We can try to set icon too. |
3491 // We can try to set icon too. |
3418 SetDetailIconShuffleL(); |
3492 SetDetailIconShuffleL(); |
3419 res = ETrue; |
3493 res = ETrue; |
3420 } |
3494 } |
3919 TBool CMPXCollectionViewHgContainer::ShufflePlayAllL(TInt aIndex) |
3996 TBool CMPXCollectionViewHgContainer::ShufflePlayAllL(TInt aIndex) |
3920 { |
3997 { |
3921 MPX_FUNC("CMPXCollectionViewHgContainer::ShufflePlayAllL"); |
3998 MPX_FUNC("CMPXCollectionViewHgContainer::ShufflePlayAllL"); |
3922 |
3999 |
3923 TBool shuffle(EFalse); |
4000 TBool shuffle(EFalse); |
3924 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
4001 |
3925 |
4002 if ( aIndex == -1 ) |
3926 CMPXMedia* currentMedia( mediaArray.AtL( aIndex ) ); |
4003 { |
3927 |
4004 shuffle = ETrue; |
3928 TMPXGeneralType type( EMPXNoType ); |
4005 if ( iContext == EContextItemPlaylist || iContext == EContextItemGenre ) |
3929 if ( currentMedia->IsSupported( KMPXMediaGeneralType ) ) |
4006 { |
3930 { |
4007 CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL(); |
3931 type = currentMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ); |
4008 CleanupStack::PushL( cpath ); |
3932 } |
4009 iPlaylistHelper->InitPlaylistL(*cpath, shuffle); |
3933 |
4010 CleanupStack::PopAndDestroy( cpath ); |
3934 TMPXGeneralCategory category( EMPXNoCategory ); |
4011 } |
3935 if ( currentMedia->IsSupported( KMPXMediaGeneralCategory ) ) |
4012 else |
3936 { |
4013 { |
3937 category = currentMedia->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory ); |
4014 iPlaylistHelper->InitPlaylistL(shuffle); |
3938 } |
4015 } |
3939 |
|
3940 if ( type == EMPXItem && category == EMPXCommand ) |
|
3941 { |
|
3942 shuffle = ETrue; |
|
3943 if ( iContext == EContextItemPlaylist ) |
|
3944 { |
|
3945 CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL(); |
|
3946 CleanupStack::PushL( cpath ); |
|
3947 cpath->Remove(0); // we want to remove index 0 which is shuffle item |
|
3948 iPlaylistHelper->InitPlaylistL(*cpath, shuffle); |
|
3949 CleanupStack::PopAndDestroy( cpath ); |
|
3950 } |
|
3951 else |
|
3952 { |
|
3953 iPlaylistHelper->InitPlaylistL(shuffle); |
|
3954 } |
|
3955 } |
4016 } |
3956 |
4017 |
3957 return shuffle; |
4018 return shuffle; |
3958 } |
4019 } |
3959 |
4020 |
4235 } |
4296 } |
4236 |
4297 |
4237 CTextListBoxModel* model = listBox->Model(); |
4298 CTextListBoxModel* model = listBox->Model(); |
4238 model->SetItemTextArray( songList ); |
4299 model->SetItemTextArray( songList ); |
4239 model->SetOwnershipType( ELbmOwnsItemArray ); |
4300 model->SetOwnershipType( ELbmOwnsItemArray ); |
4240 TBool play = iDialog->ExecuteLD(); |
4301 CleanupStack::Pop( dialog ); |
4241 CleanupStack::Pop( iDialog ); |
4302 iDialog = dialog; |
|
4303 TBool play( EFalse ); |
|
4304 GfxTransEffect::Deregister( iDialog ); |
|
4305 GfxTransEffect::Register( iDialog, KAppUidMusicPlayerX, EFalse ); |
|
4306 // Trap ExecuteLD to make sure iDialog always get reset. |
|
4307 TRAP_IGNORE( play = iDialog->ExecuteLD() ); |
|
4308 iDialog = NULL; |
4242 if( play ) |
4309 if( play ) |
4243 { |
4310 { |
|
4311 iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC ); |
|
4312 iMediaWall->DrawNow(); |
4244 TInt index = listBox->CurrentItemIndex(); |
4313 TInt index = listBox->CurrentItemIndex(); |
4245 // If item in list was opened, we only play the selected one. |
4314 // If item in list was opened, we only play the selected one. |
4246 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
4315 SaveSelectedAlbumItemL(iSelectedAlbumIndex); |
4247 // Open the selected song of album |
4316 // Open the selected song of album |
4248 UpdatePathAndOpenL(index); |
4317 UpdatePathAndOpenL(index); |
4249 } |
4318 } |
4250 else |
4319 else |
4251 { |
4320 { |
4252 // Do nothing if cancel was pressed. |
4321 // Close mediawall "flip animation" |
|
4322 iMediaWall->StartOpeningAnimationL( EFalse ); |
4253 } |
4323 } |
4254 |
4324 |
4255 CleanupStack::PopAndDestroy( listBox ); |
4325 CleanupStack::PopAndDestroy( listBox ); |
4256 |
|
4257 // Close mediawall "flip animation" |
|
4258 iMediaWall->StartOpeningAnimationL( EFalse ); |
|
4259 } |
4326 } |
4260 |
4327 |
4261 |
4328 |
4262 // ----------------------------------------------------------------------------- |
4329 // ----------------------------------------------------------------------------- |
4263 // Shows the album songs in the tbone list. |
4330 // Shows the album songs in the tbone list. |
4385 void CMPXCollectionViewHgContainer::RestoreSelectedAlbumItemL( |
4457 void CMPXCollectionViewHgContainer::RestoreSelectedAlbumItemL( |
4386 const CMPXMediaArray& aMediaArray ) |
4458 const CMPXMediaArray& aMediaArray ) |
4387 { |
4459 { |
4388 MPX_FUNC( "CMPXCollectionViewHgContainer::RestoreSelectedAlbumItemL" ); |
4460 MPX_FUNC( "CMPXCollectionViewHgContainer::RestoreSelectedAlbumItemL" ); |
4389 |
4461 |
4390 CMPXMedia* restoredAlbum = CMPXMedia::NewL(); |
4462 const CMPXMedia* restoredAlbum = iSelectedAlbumHandler->RestoreSelectedAlbum(); |
4391 CleanupStack::PushL( restoredAlbum ); |
4463 iRestoredAlbumIndex = 0; |
4392 ReadFromStreamFileL(restoredAlbum); |
4464 iSelectedAlbumIndex = 0; |
4393 TMPXItemId id=restoredAlbum->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId); |
4465 if ( restoredAlbum ) |
4394 iRestoredAlbumIndex = 0; |
4466 { |
4395 iSelectedAlbumIndex = 0; |
4467 TMPXItemId id=restoredAlbum->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId); |
4396 |
4468 |
4397 for ( TInt i = 0; i < aMediaArray.Count() ; i++ ) |
4469 for ( TInt i = 0; i < aMediaArray.Count() ; i++ ) |
4398 { |
4470 { |
4399 CMPXMedia* currentMedia( aMediaArray.AtL( i ) ); |
4471 CMPXMedia* currentMedia( aMediaArray.AtL( i ) ); |
4400 |
4472 |
4401 if ( (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == id) || |
4473 if ( (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == id) || |
4402 (id.iId1 == 0 && currentMedia->ValueText(KMPXMediaGeneralTitle).Compare( restoredAlbum->ValueText(KMPXMediaGeneralTitle) ) == 0 ) ) |
4474 (id.iId1 == 0 && currentMedia->ValueText(KMPXMediaGeneralTitle).Compare( restoredAlbum->ValueText(KMPXMediaGeneralTitle) ) == 0 ) ) |
4403 { |
4475 { |
4404 iRestoredAlbumIndex = i; |
4476 iRestoredAlbumIndex = i; |
4405 iSelectedAlbumIndex = i; |
4477 iSelectedAlbumIndex = i; |
4406 break; |
4478 break; |
4407 } |
4479 } |
4408 } |
4480 } |
4409 |
4481 } |
4410 CleanupStack::PopAndDestroy( restoredAlbum ); |
|
4411 } |
4482 } |
4412 |
4483 |
4413 // ---------------------------------------------------------------------------- |
4484 // ---------------------------------------------------------------------------- |
4414 // Write the album name, artist name and album art in media data to file |
4485 // Write the album name, artist name and album art in media data to file |
4415 // ---------------------------------------------------------------------------- |
4486 // ---------------------------------------------------------------------------- |
4499 self->HandleLbxItemAdditionL(); |
4570 self->HandleLbxItemAdditionL(); |
4500 } |
4571 } |
4501 return KErrNone; |
4572 return KErrNone; |
4502 } |
4573 } |
4503 |
4574 |
|
4575 // ----------------------------------------------------------------------------- |
|
4576 // Prepare T-bone view |
|
4577 // ----------------------------------------------------------------------------- |
|
4578 // |
|
4579 void CMPXCollectionViewHgContainer::PrepareTboneViewL() |
|
4580 { |
|
4581 MPX_FUNC( "CMPXCollectionViewHgContainer::PrepareTboneViewL" ); |
|
4582 |
|
4583 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
|
4584 TInt mediaCount( mediaArray.Count() ); |
|
4585 HandleLbxItemRemovalL(); |
|
4586 |
|
4587 iPrevContext = EContextGroupAlbum; |
|
4588 iOpenAlbumTracks = ETrue; |
|
4589 iContext = EContextItemAlbum; |
|
4590 iCurrentViewType = EMPXViewTBone; |
|
4591 |
|
4592 if (ShuffleItemPresent()) |
|
4593 iShuffleItem = 1; |
|
4594 else |
|
4595 iShuffleItem = 0; |
|
4596 |
|
4597 TInt listCount = mediaCount + iShuffleItem; |
|
4598 iThumbnailReqMap.Reset(); |
|
4599 iThumbnailReqMap.ReserveL(listCount); |
|
4600 for ( TInt i = 0; i < listCount; i++ ) |
|
4601 { |
|
4602 iThumbnailReqMap.Append( EFalse ); |
|
4603 } |
|
4604 |
|
4605 iThumbnailManager->CancelAll(); |
|
4606 |
|
4607 // MediaWall sets the default icon in the construction phase. |
|
4608 iDefaultIconSet = EFalse; |
|
4609 |
|
4610 if( !iLayoutSwitch ) |
|
4611 { |
|
4612 BeginFullScreenAnimation(); |
|
4613 } |
|
4614 |
|
4615 RestoreSelectedAlbumItemL(mediaArray); |
|
4616 PrepareMediaWallWithListL( mediaArray, mediaCount ); |
|
4617 |
|
4618 DrawableWindow()->SetOrdinalPosition( -1 ); |
|
4619 |
|
4620 CleanPrevView(); |
|
4621 |
|
4622 iPrevViewType = iCurrentViewType; |
|
4623 |
|
4624 if( !iDefaultIconSet ) |
|
4625 { |
|
4626 SetDefaultIconL(); |
|
4627 } |
|
4628 // We need to adjust the CBA for this view. |
|
4629 if( iCbaHandler ) |
|
4630 iCbaHandler->UpdateCba(); |
|
4631 |
|
4632 iLayoutSwitch = EFalse; |
|
4633 } |
|
4634 |
|
4635 // ----------------------------------------------------------------------------- |
|
4636 // Determine if adding shuffle command is needed |
|
4637 // ----------------------------------------------------------------------------- |
|
4638 // |
|
4639 TBool CMPXCollectionViewHgContainer::ShuffleItemPresent() |
|
4640 { |
|
4641 MPX_FUNC( "CMPXCollectionViewHgContainer::ShuffleItemNeeded" ); |
|
4642 |
|
4643 const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray(); |
|
4644 |
|
4645 TBool res = EFalse; |
|
4646 if ( mediaArray.Count() > 1 && |
|
4647 (iContext == EContextGroupAlbum || |
|
4648 iContext == EContextGroupSong || |
|
4649 iContext == EContextItemPlaylist || |
|
4650 iContext == EContextItemGenre || |
|
4651 iContext == EContextItemSong )) |
|
4652 { |
|
4653 res = ETrue; |
|
4654 } |
|
4655 |
|
4656 return res; |
|
4657 } |
|
4658 |
|
4659 // ----------------------------------------------------------------------------- |
|
4660 // Handles translation from list index to media array index |
|
4661 // ----------------------------------------------------------------------------- |
|
4662 // |
|
4663 TInt CMPXCollectionViewHgContainer::MediaIndex(TInt aIndex) const |
|
4664 { |
|
4665 MPX_FUNC( "CMPXCollectionViewHgContainer::MediaIndex" ); |
|
4666 |
|
4667 TInt index(aIndex); |
|
4668 |
|
4669 if ( iShuffleItem ) |
|
4670 { |
|
4671 index = aIndex - 1; |
|
4672 } |
|
4673 |
|
4674 return index; |
|
4675 } |
|
4676 |
|
4677 |
|
4678 // --------------------------------------------------------------------------- |
|
4679 // Offer command by view, if handled, return ETrue. |
|
4680 // --------------------------------------------------------------------------- |
|
4681 // |
|
4682 TBool CMPXCollectionViewHgContainer::OfferCommandL( TInt aCommand ) |
|
4683 { |
|
4684 MPX_FUNC( "CMPXCollectionViewHgContainer::OfferCommandL" ); |
|
4685 |
|
4686 if( aCommand == EAknSoftkeyBack && iContext == EContextItemAlbum ) |
|
4687 { |
|
4688 iOpenAlbumTracks = EFalse; |
|
4689 HandleLbxItemAdditionL(); |
|
4690 return ETrue; |
|
4691 } |
|
4692 else |
|
4693 { |
|
4694 return EFalse; |
|
4695 } |
|
4696 } |
|
4697 |
|
4698 // --------------------------------------------------------------------------- |
|
4699 // Load and set empty text |
|
4700 // --------------------------------------------------------------------------- |
|
4701 // |
|
4702 void CMPXCollectionViewHgContainer::LoadAndSetEmptyTextL() |
|
4703 { |
|
4704 MPX_FUNC( "CMPXCollectionViewHgContainer::LoadAndSetEmptyTextL" ); |
|
4705 |
|
4706 if ( iContext == EContextGroupAlbum ) |
|
4707 { |
|
4708 TInt resId = R_MPX_COLLECTION_ALBUM_LBX_EMPTYTEXT; |
|
4709 HBufC* emptyText = StringLoader::LoadLC( resId ); |
|
4710 SetLbxEmptyTextL( *emptyText ); |
|
4711 CleanupStack::PopAndDestroy( emptyText ); |
|
4712 } |
|
4713 } |
|
4714 |
|
4715 // --------------------------------------------------------------------------- |
|
4716 // Set previous view Uid |
|
4717 // --------------------------------------------------------------------------- |
|
4718 // |
|
4719 void CMPXCollectionViewHgContainer::SetPreviousViewId(TUid aViewUid) |
|
4720 { |
|
4721 MPX_FUNC( "CMPXCollectionViewHgContainer::SetPreviousViewId" ); |
|
4722 |
|
4723 iPreviousViewId = aViewUid; |
|
4724 } |
|
4725 |
|
4726 // --------------------------------------------------------------------------- |
|
4727 // Prepare and begin fullscreen animation effects |
|
4728 // --------------------------------------------------------------------------- |
|
4729 // |
|
4730 void CMPXCollectionViewHgContainer::BeginFullScreenAnimation(TBool aPrevViewWasPlayback) |
|
4731 { |
|
4732 if( iTranstionType != EMPXTranstionNotDefined ) |
|
4733 return; |
|
4734 |
|
4735 iTranstionType = EMPXTranstionToLeft; |
|
4736 |
|
4737 if ( (iPrevContext == EContextUnknown || |
|
4738 iPrevContext == EContextItemAlbum ) && aPrevViewWasPlayback ) |
|
4739 { |
|
4740 iTranstionType = EMPXTranstionToLeft; |
|
4741 } |
|
4742 else if( iPrevContext == EContextUnknown ) |
|
4743 { |
|
4744 // We aren't coming from playback view and prev context is unknown. |
|
4745 // Musicplayer is propably started so we shouldn't use any animation. |
|
4746 iTranstionType = EMPXTranstionNotDefined; |
|
4747 return; |
|
4748 } |
|
4749 else if( iCurrentViewType == EMPXViewTBone ) |
|
4750 { |
|
4751 iTranstionType = EMPXTranstionToRight; |
|
4752 } |
|
4753 |
|
4754 if( iPrevViewType == EMPXViewMediawall || iPrevViewType == EMPXViewTBone ) |
|
4755 { |
|
4756 iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC ); |
|
4757 iMediaWall->DrawNow(); |
|
4758 } |
|
4759 |
|
4760 const TInt flags = AknTransEffect::TParameter::EActivateExplicitCancel; |
|
4761 TRect appRect = ((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect(); |
|
4762 GfxTransEffect::BeginFullScreen( iTranstionType, appRect, |
|
4763 AknTransEffect::EParameterType, |
|
4764 AknTransEffect::GfxTransParam(KAppUidMusicPlayerX, flags)); |
|
4765 } |
|
4766 |
|
4767 // --------------------------------------------------------------------------- |
|
4768 // End fullscreen animation effects |
|
4769 // --------------------------------------------------------------------------- |
|
4770 // |
|
4771 void CMPXCollectionViewHgContainer::EndFullScreenAnimation() |
|
4772 { |
|
4773 if( iTranstionType != EMPXTranstionNotDefined ) |
|
4774 { |
|
4775 GfxTransEffect::EndFullScreen(); |
|
4776 iTranstionType = EMPXTranstionNotDefined; |
|
4777 // TODO: uncomment if really needed. |
|
4778 //iThumbnailManager->Pause(TTimeIntervalMicroSeconds32(KThumbLoadingPauseForTransition)); |
|
4779 } |
|
4780 } |
|
4781 |
|
4782 // --------------------------------------------------------------------------- |
|
4783 // Resolving the size of the popup list rectangle. |
|
4784 // --------------------------------------------------------------------------- |
|
4785 // |
|
4786 void CMPXCollectionViewHgContainer::ResolvePopupListSizeL() |
|
4787 { |
|
4788 // Resolve popuplistbox rect that is used to show the album songs |
|
4789 CAknSinglePopupMenuStyleListBox* listBox = new ( ELeave ) CAknSinglePopupMenuStyleListBox; |
|
4790 CleanupStack::PushL( listBox ); |
|
4791 |
|
4792 CMpxPopupList* dialog = CMpxPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA, |
|
4793 AknPopupLayouts::EDynMenuWindow ); |
|
4794 |
|
4795 CleanupStack::PushL( dialog ); |
|
4796 |
|
4797 listBox->ConstructL( dialog, |
|
4798 EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded ); |
|
4799 |
|
4800 // title can be hardcoded because it is not shown to user. Just for the calculations. |
|
4801 dialog->SetTitleL(_L("Foo")); |
|
4802 iPopupListRect = dialog->LayoutRect(); |
|
4803 |
|
4804 CleanupStack::PopAndDestroy( dialog ); |
|
4805 CleanupStack::PopAndDestroy( listBox ); |
|
4806 } |
4504 // End of File |
4807 // End of File |