--- a/mpxmusicplayer/app/group/mpx.mmp Tue May 25 12:39:12 2010 +0300
+++ b/mpxmusicplayer/app/group/mpx.mmp Wed Jun 09 09:38:28 2010 +0300
@@ -110,6 +110,10 @@
#endif //FF_OOM_MONITOR2_COMPONENT
LIBRARY iaupdateapi.lib //IAD
+// Transition libs
+LIBRARY gfxtrans.lib
+LIBRARY cdlengine.lib
+
START RESOURCE ../data/mpx_reg.rss
DEPENDS mpx.rsg
// Do not change the UID below.
--- a/mpxmusicplayer/app/src/mpxappui.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxmusicplayer/app/src/mpxappui.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -73,6 +73,9 @@
#include <mpxcollectionplugin.hrh>
#include <mpxcommandgeneraldefs.h>
#include <mpxcollectioncommanddefs.h>
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntranseffect.h>
+#include <layoutmetadata.cdl.h>
// Cover UI start
//#ifdef __COVER_DISPLAY
@@ -2723,8 +2726,12 @@
// OpenL the blank playlist
iCollectionUtility->Collection().OpenL();
}
- // Default start up state for local playback is Playing
- MPXTlsHelper::SetLaunchModeL( EMPXLaunchModePlaying );
+ // do not change launch mode if track mode, required for saving file
+ if ( EMPXLaunchModeTrack != MPXTlsHelper::LaunchMode() )
+ {
+ // Default start up state for local playback is Playing
+ MPXTlsHelper::SetLaunchModeL( EMPXLaunchModePlaying );
+ }
CleanupStack::PopAndDestroy( cPath );
CleanupStack::PopAndDestroy( &attrs );
}
@@ -3607,6 +3614,17 @@
{
// Move Music Player to background
// magic: -1 = force wg to background
+ if ( !Layout_Meta_Data::IsLandscapeOrientation() )
+ {
+ GfxTransEffect::BeginFullScreen(
+ AknTransEffect::EApplicationExit,
+ TRect(),
+ AknTransEffect::EParameterType,
+ AknTransEffect::GfxTransParam( KAppUidMusicPlayerX,
+ AknTransEffect::TParameter::EActivateExplicitCancel |
+ AknTransEffect::TParameter::EEndCheck ) );
+ }
+
iEikonEnv->RootWin().SetOrdinalPosition( -1 );
break;
}
--- a/mpxplugins/serviceplugins/playbackplugins/audioeffects/src/mpxaudioeffectengine.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/audioeffects/src/mpxaudioeffectengine.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -109,9 +109,20 @@
iProp->LoadFromFileL();
if(iMdaPlayer)
{
- if(iMdaPlayer->SetBalance(iProp->Balance())!=KErrNone)
+ TInt currentBalance;
+ TInt err = iMdaPlayer->GetBalance(currentBalance);
+ if( err !=KErrNone )
+ {
+ User::Leave(KErrNotSupported);
+ }
+ // don't set non-changed values:
+ if( iProp->Balance() != currentBalance )
{
- User::Leave(KErrNotSupported);
+ err = iMdaPlayer->SetBalance(iProp->Balance());
+ if( err !=KErrNone )
+ {
+ User::Leave(KErrNotSupported);
+ }
}
}
}
@@ -219,14 +230,18 @@
}
}
- iStereoEffect->EnableL();
- TUint8 level = 30;
- iStereoEffect->SetStereoWideningLevelL( level );
- iStereoEffect->ApplyL();
+ if ( !iStereoEffect->IsEnabled() )
+ {
+ iStereoEffect->EnableL();
+ TUint8 level = 30;
+ iStereoEffect->SetStereoWideningLevelL( level );
+ iStereoEffect->ApplyL();
+ }
+
}
else
{
- if (iStereoEffect) // If audio effects was not on, then no need to disable
+ if (iStereoEffect && iStereoEffect->IsEnabled() ) // If audio effects was not on, then no need to disable
{
iStereoEffect->DisableL();
}
@@ -295,12 +310,15 @@
}
}
- iLoudnessEffect->EnableL();
+ if( !iLoudnessEffect->IsEnabled() )
+ {
+ iLoudnessEffect->EnableL();
+ }
}
else
- {
- if( iLoudnessEffect ) // Only disable if it was constructed
- {
+ {
+ if( iLoudnessEffect && iLoudnessEffect->IsEnabled() )
+ {
iLoudnessEffect->DisableL();
}
}
--- a/mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/serviceplugins/playbackplugins/localaudio/src/mpxlocalaudioplayback.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -435,14 +435,19 @@
{
// Re-init audio effects
MPX_DEBUG1("CMPXLocalAudioPlayback::CommandL EPbApplyEffect");
- iAudioEffects->DestroyAudioEffect();
if( ( aData == KAudioEffectsID || aData == KEqualizerID ) &&
( EStateInitialised == iState ) )
{
+ // Here we rely on CreateAudioEffectsL() to be safe to be called
+ // in order to just set values again
TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
if(err)
{
MPX_DEBUG2("EPbApplyEffect err = %d", err);
+ // Sometimes we get KErrAccessDenied, then destroying effects
+ // and setting them again should help. This is a work-around,
+ // and would be good to be fixed more properly.
+ iAudioEffects->DestroyAudioEffect();
TRAPD(err, iAudioEffects->CreateAudioEffectsL() );
if(err)
{
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -506,7 +506,7 @@
const TKeyEvent& aKeyEvent,
TEventCode aType )
{
- MPX_DEBUG4( "CMPXCollectionViewHgContainer::HandleKeyEventL(iCode=%d, iScanCode=%d, aType=%d)",
+ MPX_DEBUG4( "CMPXCollectionViewHgContainer::OfferKeyEventL(iCode=%d, iScanCode=%d, aType=%d)",
aKeyEvent.iCode, aKeyEvent.iScanCode, aType );
if ( aKeyEvent.iCode == EKeyUpArrow ||
@@ -576,20 +576,37 @@
aKeyEvent.iCode, aKeyEvent.iScanCode, aKeyEvent.iModifiers, aType );
TKeyResponse response( EKeyWasNotConsumed );
- if ( aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter )
+
+ CHgScroller* list = CurrentListWidget();
+ if ( list )
+ {
+ response = list->OfferKeyEventL( aKeyEvent, aType );
+ }
+ if ( response == EKeyWasNotConsumed && iMediaWall )
{
- SaveSelectedAlbumItemL(iAlbumIndex);
+ response = iMediaWall->OfferKeyEventL( aKeyEvent, aType );
+ // Softkeys are hidden when left/right keys are used in mediawall.
+ if ( response == EKeyWasConsumed && iCurrentViewType == EMPXViewMediawall )
+ {
+ if( iCbaHandler )
+ iCbaHandler->ChangeCbaVisibility( EFalse );
+ }
+ }
+
+ // When LSK is pressed, make the softkeys visible.
+ if ( response == EKeyWasNotConsumed && aKeyEvent.iCode == EKeyDevice0 )
+ {
+ if( iCbaHandler )
+ iCbaHandler->ChangeCbaVisibility( ETrue );
+ }
+
+ if ( response == EKeyWasNotConsumed &&
+ (aKeyEvent.iCode == EKeyOK ||
+ aKeyEvent.iCode == EKeyEnter ) )
+ {
// Handle enter key pressed
iView->ProcessCommandL( EMPXCmdCommonEnterKey );
}
- if ( iListWidget )
- {
- iListWidget->OfferKeyEventL( aKeyEvent, aType );
- }
- else if( iMediaWall )
- {
- iMediaWall->OfferKeyEventL( aKeyEvent, aType );
- }
if ( response == EKeyWasNotConsumed &&
aType == EEventKey &&
aKeyEvent.iCode == EKeyBackspace && iView )
@@ -2663,11 +2680,6 @@
//
void CMPXCollectionViewHgContainer::RefreshL(TInt aDisplayIndex)
{
- if( !iIsForeground )
- {
- return;
- }
-
MPX_FUNC( "CMPXCollectionViewHgContainer::Refresh" );
TInt mediaCount = iListBoxArray->MediaArray().Count();
@@ -5158,9 +5170,8 @@
CleanupStack::PushL( dialog );
- listBox->ConstructL( dialog,
- EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded );
-
+ listBox->ConstructL( dialog, EAknListBoxViewerFlags );
+
// title can be hardcoded because it is not shown to user. Just for the calculations.
dialog->SetTitleL(_L("Foo"));
iPopupListRect = dialog->LayoutRect();
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -6086,6 +6086,20 @@
CloseWaitNoteL();
iOpeningNote = EFalse;
}
+
+/* This code is added to avoid CBA flicker which happens after pressing "Now playing"
+ from artist&album view and pressing BACK from Playback view.
+ While going to playback view, reset CBA to "Back". */
+ if( !aForeground && iViewUtility->ActiveViewType().iUid == KMPXPluginTypePlaybackUid )
+ {
+ TRAP_IGNORE( CEikButtonGroupContainer* cba = Cba();
+ if ( cba )
+ {
+ cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ cba->DrawDeferred();
+ } );
+ }
+
#ifdef BACKSTEPPING_INCLUDED
iActivateBackStepping = EFalse;
MPX_DEBUG3("CMPXCollectionViewHgImp::HandleForegroundEventL - is in foreground=%d, this view=0x%x",
@@ -7061,9 +7075,7 @@
// it has not been saved
aMenuPane->SetItemDimmed( EMPXCmdSavePlaylist,
( !iCommonUiHelper->IsHostMessagingBrowserL() || !MPXTlsHelper::NeedSave() ) );
- TBool isListEmpty( iContainer->TotalListItemCount() == 0 );
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, isListEmpty );
-
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
break;
}
case R_MPX_PLAYBACK_COLLECTION_MUSICSHOP_SUB_MENU:
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -1740,7 +1740,8 @@
if ( EPbRepeatAll == iRepeatMode )
{
if ( aCurrentIndex == aCount-1 &&
- 1 == iLastSkipDirection )
+ 1 == iLastSkipDirection &&
+ 1 != iRandomMode )
{
skip = EFalse;
displayError = ETrue;
@@ -2735,7 +2736,10 @@
iContainer->RestoreButtons( iPlaybackState );
iPlaybackUtility->CommandL( EPbCmdStopSeeking );
}
-
+
+ if ( aForeground && ( iViewUtility->ActiveViewType() == TUid::Uid( KMPXPluginTypePlaybackUid )) )
+ TRAP_IGNORE(UpdateTitlePaneL());
+
MPX_DEBUG1( "<---CMPXCommonPlaybackViewImp::HandleForegroundEventL()" );
}
--- a/mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss Wed Jun 09 09:38:28 2010 +0300
@@ -285,26 +285,30 @@
},
DLG_LINE
{
- type = EEikCtNumberEditor;
+ type = EEikCtEdwin;
prompt = qtn_nmp_song_details_track_number;
id = EMPXMetadataEditorDlgCtrlIdTrackNumber;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
- control = NUMBER_EDITOR
+ control = EDWIN
{
- min = KMPXSongDetailsTrackNumMin;
- max = KMPXSongDetailsTrackNumMax;
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsNumTextWidth;
+ default_input_mode = EAknEditorNumericInputMode;
+ allowed_input_modes = EAknEditorNumericInputMode;
};
},
DLG_LINE
{
- type = EEikCtNumberEditor;
+ type = EEikCtEdwin;
prompt = qtn_nmp_song_details_year;
id = EMPXMetadataEditorDlgCtrlIdYear;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
- control = NUMBER_EDITOR
+ control = EDWIN
{
- min = KMPXSongDetailsYearMin;
- max = KMPXSongDetailsYearMax;
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsNumTextWidth;
+ default_input_mode = EAknEditorNumericInputMode;
+ allowed_input_modes = EAknEditorNumericInputMode;
};
},
DLG_LINE
@@ -373,7 +377,27 @@
};
tooltip = qtn_aknexpopfield_hint_text;
},
- DLG_LINE
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_nmp_song_details_licences;
+ id = EMPXMetadataEditorDlgCtrlIdDRMDetail;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
{
type = EEikCtEdwin;
prompt = qtn_mp_fd_filename;
@@ -822,26 +846,30 @@
},
DLG_LINE
{
- type = EEikCtNumberEditor;
+ type = EEikCtEdwin;
prompt = qtn_nmp_song_details_episode_number;
id = EMPXMetadataEditorDlgCtrlIdTrackNumber;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
- control = NUMBER_EDITOR
+ control = EDWIN
{
- min = KMPXSongDetailsTrackNumMin;
- max = KMPXSongDetailsTrackNumMax;
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsNumTextWidth;
+ default_input_mode = EAknEditorNumericInputMode;
+ allowed_input_modes = EAknEditorNumericInputMode;
};
},
DLG_LINE
{
- type = EEikCtNumberEditor;
+ type = EEikCtEdwin;
prompt = qtn_nmp_song_details_year;
id = EMPXMetadataEditorDlgCtrlIdYear;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
- control = NUMBER_EDITOR
+ control = EDWIN
{
- min = KMPXSongDetailsYearMin;
- max = KMPXSongDetailsYearMax;
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsNumTextWidth;
+ default_input_mode = EAknEditorNumericInputMode;
+ allowed_input_modes = EAknEditorNumericInputMode;
};
},
DLG_LINE
@@ -890,27 +918,47 @@
};
tooltip = qtn_aknexpopfield_hint_text;
},
- DLG_LINE
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_nmp_song_details_licences;
+ id = EMPXMetadataEditorDlgCtrlIdDRMDetail;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
{
- type = EEikCtEdwin;
- prompt = qtn_mp_fd_filename;
- id = EMPXMetadataEditorDlgCtrlIdFileName;
- itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
- control = EDWIN
- {
- flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
- width = KMPXSongDetailsTextWidth;
- lines = KMPXSongDetailsTextLines;
- maxlength = KMPXSongDetailsTextMaxLen;
- // added to limit expanding in forms.
- // If you want full screen use 6 here
- max_view_height_in_lines = 6;
- // if you have the line above, you must have this.
- // It is calculable from LAF
- base_line_delta = 21;
- };
- },
- DLG_LINE
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_fd_filename;
+ id = EMPXMetadataEditorDlgCtrlIdFileName;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
{
type = EEikCtEdwin;
prompt = qtn_mp_details_format;
@@ -930,7 +978,7 @@
base_line_delta = 21;
};
},
- DLG_LINE
+ DLG_LINE
{
type = EEikCtEdwin;
prompt = qtn_mp_details_duration;
@@ -950,7 +998,7 @@
base_line_delta = 21;
};
},
- DLG_LINE
+ DLG_LINE
{
type = EEikCtEdwin;
prompt = qtn_mp_details_bitrate;
@@ -993,6 +1041,46 @@
DLG_LINE
{
type = EEikCtEdwin;
+ prompt = qtn_mp_details_last_playback_position;
+ id = EMPXMetadataEditorDlgCtrlIdLastPlayedPosition;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_published;
+ id = EMPXMetadataEditorDlgCtrlIdLastPublished;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
prompt = qtn_mp_details_size;
id = EMPXMetadataEditorDlgCtrlIdSize;
itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
@@ -1503,64 +1591,6 @@
buf = qtn_mp_details_playback_complete;
}
-RESOURCE DLG_LINE r_mpx_cui_last_playback_position
- {
- type=EEikCtEdwin;
- prompt = qtn_mp_details_last_playback_position ;
- id= EMPXMetadataEditorDlgCtrlIdLastPlayedPosition ;
- //control=EDWIN { flags= KMultiLineExpandingEditorFlags; maxlength=168; width=3; lines=1;};
- control = EDWIN
- {
- flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
- width = KMPXSongDetailsTextWidth;
- lines = KMPXSongDetailsTextLines;
- maxlength = KMPXSongDetailsTextMaxLen;
- // added to limit expanding in forms.
- // If you want full screen use 6 here
- max_view_height_in_lines = 6;
- // if you have the line above, you must have this.
- // It is calculable from LAF
- base_line_delta = 21;
- };
- }
-
-RESOURCE DLG_LINE r_mpx_cui_details_published
- {
- type=EEikCtEdwin;
- prompt = qtn_mp_details_published ;
- id= EMPXMetadataEditorDlgCtrlIdLastPublished ;
- //control=EDWIN { flags= KMultiLineExpandingEditorFlags; maxlength=168; width=3; lines=1;};
- control = EDWIN
- {
- flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
- width = KMPXSongDetailsTextWidth;
- lines = KMPXSongDetailsTextLines;
- maxlength = KMPXSongDetailsTextMaxLen;
- // added to limit expanding in forms.
- // If you want full screen use 6 here
- max_view_height_in_lines = 6;
- // if you have the line above, you must have this.
- // It is calculable from LAF
- base_line_delta = 21;
- };
- }
-
-RESOURCE DLG_LINE r_mpx_cui_licence_info
- {
- type=EEikCtEdwin;
- prompt = qtn_nmp_song_details_licences ;
- id= EMPXMetadataEditorDlgCtrlIdDRMDetail ;
- control = EDWIN
- {
- flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable ;
- width = KMPXSongDetailsTextWidth;
- lines = KMPXSongDetailsTextLines;
- maxlength = KMPXSongDetailsTextMaxLen;
- max_view_height_in_lines = 6;
- base_line_delta = 21;
- };
- }
-
RESOURCE TBUF r_mpx_cui_licence_det_link { buf = qtn_nmp_song_details_licences_details; }
// End of File
--- a/mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh Wed Jun 09 09:38:28 2010 +0300
@@ -24,6 +24,7 @@
#define KMPXSongDetailsTextLines 20
#define KMPXSongDetailsTextMaxLen 255
+#define KMPXSongDetailsNumTextWidth 4
#define KMPXSongDetailsTrackNumMin 0
#define KMPXSongDetailsTrackNumMax 999
#define KMPXSongDetailsYearMin 0
--- a/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp Tue May 25 12:39:12 2010 +0300
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp Wed Jun 09 09:38:28 2010 +0300
@@ -732,21 +732,25 @@
CCoeControl* coeControl = ControlOrNull( EMPXMetadataEditorDlgCtrlIdYear );
if ( coeControl )
{
- CEikNumberEditor* control = static_cast<CEikNumberEditor*>( coeControl );
+ CEikEdwin* control = static_cast<CEikEdwin*>( coeControl );
if ( control )
{
- TInt num = control->Number();
- if ( num != iYear )
+ TBuf<KMPXSongDetailsNumTextWidth> num;
+ control->GetText( num );
+ TLex numLex( num );
+ TInt LexToInt;
+ numLex.Val( LexToInt );
+ if ( LexToInt != iYear )
{
MPX_DEBUG3( "CMPXMetadataEditorDialog::SaveFormDataL year changed from %d to %d", iYear, num );
TDateTime newYear;
- newYear.Set( num, EJanuary, 0, 0, 0, 0, 0 );
+ newYear.Set( LexToInt, EJanuary, 0, 0, 0, 0, 0 );
TTime year( newYear );
iMedia->SetTObjectValueL<TInt64>(
KMPXMediaMusicYear, year.Int64() );
media->SetTObjectValueL<TInt64>(
KMPXMediaMusicYear, year.Int64() );
- iYear = num;
+ iYear = LexToInt;
changed = ETrue;
}
else
@@ -1083,6 +1087,7 @@
HBufC* stringBuf = HBufC::NewLC( KMPXFileDetailsMaxBufferLen );
TPtr stringBufPtr = stringBuf->Des();
stringBufPtr.AppendNum( samplingRateNum );
+ AknTextUtils::LanguageSpecificNumberConversion( stringBufPtr );
HBufC* samplingrate = StringLoader::LoadLC(
R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr );
aDataArray->AppendL( samplingrate->Des() );
@@ -1123,7 +1128,7 @@
PopulatePodcastFileDetailsL( aHeadingsArray, aDataArray );
}
- // Get last modified time
+ // Get modified
TTime time;
User::LeaveIfError( fs.Modified( uri, time ) );
ConvertToLocalTimeL( time );
@@ -2154,34 +2159,6 @@
void CMPXMetadataEditorDialog::PrepareForFocusTransitionL()
{
MPX_FUNC( "CMPXMetadataEditorDialog::PrepareForFocusTransitionL" );
- TInt err = KErrNone;
-
- CEikNumberEditor* myTrackNumberEditor = static_cast<CEikNumberEditor*>
- ( ControlOrNull( EMPXMetadataEditorDlgCtrlIdTrackNumber ) );
-
- CEikNumberEditor* myYearNumberEditor = static_cast<CEikNumberEditor*>
- ( ControlOrNull( EMPXMetadataEditorDlgCtrlIdYear ) );
-
- if ( myTrackNumberEditor )
- {
- // if length 0 trap error and set to 0.
- MPX_TRAP( err, myTrackNumberEditor->Number() );
- if ( err )
- {
- myTrackNumberEditor->SetNumber( KMPXMinNumDateTrack );
- }
- }
-
- if ( myYearNumberEditor )
- {
- // if length 0 trap error and set to 0.
- MPX_TRAP( err, myYearNumberEditor->Number() );
- if ( err )
- {
- myYearNumberEditor->SetNumber( KMPXMinNumDateTrack );
- }
- }
-
CAknForm::PrepareForFocusTransitionL();
}
@@ -2443,14 +2420,6 @@
SetTitlePaneL();
SetNaviLabelL();
- _LIT( KZero, "0" );
-
- SetControlNumberL( EMPXMetadataEditorDlgCtrlIdTrackNumber, KZero,
- KMPXSongDetailsTrackNumMin, KMPXSongDetailsTrackNumMax );
-
- SetControlNumberL ( EMPXMetadataEditorDlgCtrlIdYear, KZero,
- KMPXSongDetailsYearMin, KMPXSongDetailsYearMax );
-
// Get media property for the current song
if ( iParam ) // Dialog launched from CollectionView
@@ -2663,22 +2632,16 @@
const TDesC& aValue, TInt aMinValue, TInt aMaxValue )
{
MPX_FUNC( "CMPXMetadataEditorDialog::SetControlNumberL" );
- CEikNumberEditor* myNumberEditor = static_cast< CEikNumberEditor* >
+ CEikEdwin* myEdwin = static_cast< CEikEdwin* >
( ControlOrNull( aControlId ) );
-
- TInt defaultValue( 0 );
- if ( aMinValue > 0 )
- {
- defaultValue = aMinValue;
- }
-
- if ( myNumberEditor )
+
+ if ( myEdwin )
{
if ( aValue.Length() > 0 )
{
- TLex trackNumLex( aValue );
+ TLex numLex( aValue );
TInt LexToInt;
- if ( trackNumLex.Val( LexToInt ) == KErrNone )
+ if ( numLex.Val( LexToInt ) == KErrNone )
{
if ( LexToInt > aMaxValue )
{
@@ -2688,16 +2651,10 @@
{
LexToInt = aMinValue;
}
- myNumberEditor->SetNumber( LexToInt );
+ TBuf<KMPXSongDetailsNumTextWidth> num;
+ num.AppendNum( LexToInt );
+ myEdwin->SetTextL( &num );
}
- else
- {
- myNumberEditor->SetNumber( defaultValue );
- }
- }
- else
- {
- myNumberEditor->SetNumber( defaultValue );
}
}
}
@@ -2771,6 +2728,7 @@
case EMPXMetadataEditorDlgCtrlIdAlbum:
case EMPXMetadataEditorDlgCtrlIdComment:
case EMPXMetadataEditorDlgCtrlIdComposer:
+ case EMPXMetadataEditorDlgCtrlIdTrackNumber:
{
CEikEdwin* control = static_cast<CEikEdwin*>( coeControl );
if ( control )
@@ -2807,24 +2765,6 @@
}
break;
}
- case EMPXMetadataEditorDlgCtrlIdTrackNumber:
- {
- CEikNumberEditor* control = static_cast<CEikNumberEditor*>( coeControl );
- if ( control )
- {
- TInt num = control->Number();
- MPX_DEBUG2( "CMPXMetadataEditorDialog::UpdateMediaObjectWithControlL number from control %d", num );
- buf = HBufC::NewLC( KMPXFileDetailsMaxBufferLen );
- TPtr bufPtr = buf->Des();
- bufPtr.AppendNum( num );
- }
- else
- {
- // should not reach here
- User::Leave( KErrArgument );
- }
- break;
- }
default:
{
// should not reach here
@@ -2870,16 +2810,18 @@
ASSERT(iMedia);
TBool drmProtected(iMedia->ValueTObjectL<TBool> (KMPXMediaDrmProtected));
MPX_DEBUG2( "CMPXMetadataEditorDialog::PopulateFileDetailsL drm protected: %d", drmProtected );
-
+
if (drmProtected)
{
HBufC* detail = StringLoader::LoadLC( R_MPX_CUI_LICENCE_DET_LINK );
- InsertLineL(9,R_MPX_CUI_LICENCE_INFO,ActivePageId() );
SetControlTextL(EMPXMetadataEditorDlgCtrlIdDRMDetail, detail->Des(),
KNullDesC);
CleanupStack::PopAndDestroy( detail );
}
-
+ else
+ {
+ DeleteLine(EMPXMetadataEditorDlgCtrlIdDRMDetail,EFalse);
+ }
// Get filename
const TDesC& uri = iMedia->ValueText(KMPXMediaGeneralUri);
TParsePtrC parse(uri);
@@ -2942,6 +2884,7 @@
HBufC* stringBuf = HBufC::NewLC(KMPXFileDetailsMaxBufferLen);
TPtr stringBufPtr = stringBuf->Des();
stringBufPtr.AppendNum(samplingRateNum);
+ AknTextUtils::LanguageSpecificNumberConversion( stringBufPtr );
HBufC* samplingrate = StringLoader::LoadLC(
R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr);
SetControlTextL(EMPXMetadataEditorDlgCtrlIdSamplingrate,
@@ -3049,97 +2992,91 @@
//
void CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL()
{
- InsertLineL(13,R_MPX_CUI_LAST_PLAYBACK_POSITION,ActivePageId() );
-
- TInt lastPbPosition((TInt) iMedia->ValueTObjectL<TInt> (
- KMPXMediaGeneralLastPlaybackPosition));
-
- if (lastPbPosition > 0)
- {
- // convert milliseconds to seconds
- lastPbPosition = lastPbPosition / KSecondInMilliseconds;
- CMPXCommonUiHelper::TMPXDuratDisplayMode lastPbPositionMode =
- CMPXCommonUiHelper::EMPXDuratAuto;
- if (lastPbPosition > KOneHourInSeconds)
- {
- lastPbPositionMode = CMPXCommonUiHelper::EMPXDuratHMS;
- }
- HBufC* stringBuf = iCommonUiHelper->DisplayableDurationL(
- lastPbPosition, lastPbPositionMode);
- CleanupStack::PushL(stringBuf);
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
- *stringBuf, KNullDesC);
- CleanupStack::PopAndDestroy(stringBuf);
- }
- else if (lastPbPosition == 0 && iMedia->IsSupported(
- KMPXMediaGeneralPlayCount) && iMedia->ValueTObjectL<TInt> (
- KMPXMediaGeneralPlayCount) > 0)
- {
- HBufC* stringBuf = StringLoader::LoadLC(
- R_MPX_CUI_METADATAEDITOR_PLAYBACK_COMPLETE);
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
- *stringBuf, KNullDesC);
- CleanupStack::PopAndDestroy(stringBuf);
-
- }
- else
- {
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
- KNullDesC, KNullDesC);
- }
+ TInt lastPbPosition((TInt) iMedia->ValueTObjectL<TInt> (
+ KMPXMediaGeneralLastPlaybackPosition ));
+ if (lastPbPosition > 0)
+ {
+ // convert milliseconds to seconds
+ lastPbPosition = lastPbPosition / KSecondInMilliseconds;
+ CMPXCommonUiHelper::TMPXDuratDisplayMode lastPbPositionMode =
+ CMPXCommonUiHelper::EMPXDuratAuto;
+ if (lastPbPosition > KOneHourInSeconds)
+ {
+ lastPbPositionMode = CMPXCommonUiHelper::EMPXDuratHMS;
+ }
+ HBufC* stringBuf = iCommonUiHelper->DisplayableDurationL(
+ lastPbPosition, lastPbPositionMode);
+ CleanupStack::PushL(stringBuf);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ *stringBuf, KNullDesC);
+ CleanupStack::PopAndDestroy(stringBuf);
+ }
+ else if (lastPbPosition == 0 && iMedia->IsSupported(
+ KMPXMediaGeneralPlayCount) && iMedia->ValueTObjectL<TInt> (
+ KMPXMediaGeneralPlayCount) > 0)
+ {
+ HBufC* stringBuf = StringLoader::LoadLC(
+ R_MPX_CUI_METADATAEDITOR_PLAYBACK_COMPLETE);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ *stringBuf, KNullDesC);
+ CleanupStack::PopAndDestroy(stringBuf);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ KNullDesC, KNullDesC);
+ }
- InsertLineL(14,R_MPX_CUI_DETAILS_PUBLISHED,ActivePageId() );
-
- // Get published
- if (iMedia->IsSupported(TMPXAttribute(KMPXMediaIdPodcast,
- EMPXMediaPodcastPubDate)))
- {
- TInt64 timeInt(
- (TInt64) iMedia->ValueTObjectL<TInt64> (TMPXAttribute(
- KMPXMediaIdPodcast, EMPXMediaPodcastPubDate)));
- TTime time(timeInt);
- ConvertToLocalTimeL(time);
- HBufC* modDateTime = HBufC::NewLC(KMPXMaxTimeLength
- + KMPXDurationDisplayResvLen);
- HBufC* format = StringLoader::LoadLC(R_QTN_DATE_USUAL_WITH_ZERO);
- TPtr modDatePtr = modDateTime->Des();
- MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
- CleanupStack::PopAndDestroy(format);
- if (err != KErrNone || time == 0)
- {
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
- KNullDesC, KNullDesC);
- }
- else
- {
- format = StringLoader::LoadLC(R_QTN_TIME_USUAL_WITH_ZERO);
- HBufC* modTime = HBufC::NewLC(format->Length()
- + KMPXDurationDisplayResvLen);
- TPtr modTimePtr = modTime->Des();
- MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
- if (err != KErrNone)
- {
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
- KNullDesC, KNullDesC);
- }
- else
- {
- modDatePtr.Append(KMPXSpace);
- modDatePtr.Append(modTimePtr);
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
- modTimePtr, KNullDesC);
- }
- CleanupStack::PopAndDestroy(modTime);
- CleanupStack::PopAndDestroy(format);
- }
- CleanupStack::PopAndDestroy(modDateTime);
- }
- else
- {
- SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
- KNullDesC, KNullDesC);
- }
- }
+ // Get published
+ if (iMedia->IsSupported(TMPXAttribute(KMPXMediaIdPodcast,
+ EMPXMediaPodcastPubDate)))
+ {
+ TInt64 timeInt(
+ (TInt64) iMedia->ValueTObjectL<TInt64> (TMPXAttribute(
+ KMPXMediaIdPodcast, EMPXMediaPodcastPubDate)));
+ TTime time(timeInt);
+ ConvertToLocalTimeL(time);
+ HBufC* modDateTime = HBufC::NewLC(KMPXMaxTimeLength
+ + KMPXDurationDisplayResvLen);
+ HBufC* format = StringLoader::LoadLC(R_QTN_DATE_USUAL_WITH_ZERO);
+ TPtr modDatePtr = modDateTime->Des();
+ MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
+ CleanupStack::PopAndDestroy(format);
+ if (err != KErrNone || time == 0)
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ KNullDesC, KNullDesC);
+ }
+ else
+ {
+ format = StringLoader::LoadLC(R_QTN_TIME_USUAL_WITH_ZERO);
+ HBufC* modTime = HBufC::NewLC(format->Length()
+ + KMPXDurationDisplayResvLen);
+ TPtr modTimePtr = modTime->Des();
+ MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
+ if (err != KErrNone)
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ KNullDesC, KNullDesC);
+ }
+ else
+ {
+ modDatePtr.Append(KMPXSpace);
+ modDatePtr.Append(modTimePtr);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ modTimePtr, KNullDesC);
+ }
+ CleanupStack::PopAndDestroy(modTime);
+ CleanupStack::PopAndDestroy(format);
+ }
+ CleanupStack::PopAndDestroy(modDateTime);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ KNullDesC, KNullDesC);
+ }
+ }
// -----------------------------------------------------------------------------
// CMPXMetadataEditorDialog::LaunchDrmInfoL