Fixed jira issues: N_SE-51076,N_SE-52447, N_SE-52598, N_SE-52769, N_SE-52828, N_SE...
authorAjay Kumar Nayak <ajay.nayak@samsung.com>
Tue, 24 Sep 2013 12:06:45 +0000 (17:36 +0530)
committerAjay Kumar Nayak <ajay.nayak@samsung.com>
Tue, 24 Sep 2013 12:44:22 +0000 (18:14 +0530)
Change-Id: Id92825941e5f4de4f076e802c13c27cc58b82722
Signed-off-by: Ajay Kumar Nayak <ajay.nayak@samsung.com>
src/MpAlbumContentListForm.cpp
src/MpAlbumListPresentationModel.cpp
src/MpArtistContentListForm.cpp
src/MpContentEditPanel.cpp
src/MpMiniPlayer.cpp
src/MpMusicPlayerForm.cpp
src/MpMusicPlayerPresentationModel.cpp
src/MpPlaylistContentListForm.cpp
src/MpPlaylistCreatorForm.cpp
src/MpPlaylistListPanel.cpp

index e53a8de..038f276 100644 (file)
@@ -745,8 +745,12 @@ AlbumContentListForm::UpdateContentList(void)
        {
                SceneManager* pSceneManager = SceneManager::GetInstance();
                AppAssert(pSceneManager);
-               SetScreenState(SCREEN_STATE_NORMAL);
-               pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
+
+               if (pSceneManager->GetCurrentSceneId().Equals(IDSCN_ALBUM_CONTENT_LIST,true))
+               {
+                       SetScreenState(SCREEN_STATE_NORMAL);
+                       pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
+               }
        }
 
        AppLogDebug("EXIT");
index f322e28..a099d14 100644 (file)
@@ -36,11 +36,11 @@ AlbumListPresentationModel::GetInstance(void)
        AppLogDebug("ENTER");
        if (pAlbumListPresentationModelInstance == null)
        {
+               result r = E_SUCCESS;
                pAlbumListPresentationModelInstance = new (std::nothrow) AlbumListPresentationModel();
                TryReturn(pAlbumListPresentationModelInstance != null, null, "AlbumListPresentationModel instance is not created.");
 
-               result r = E_SUCCESS;
-               if(pAlbumListPresentationModelInstance != null)
+               if (pAlbumListPresentationModelInstance != null)
                {
                        r = pAlbumListPresentationModelInstance->Construct();
                        TryCatch(r == E_SUCCESS, , null, "AlbumListPresentationModel instance is not constrcuted.");
index 7b3b58a..ea9113e 100644 (file)
@@ -1097,11 +1097,15 @@ ArtistContentListForm::UpdateContentList(void)
 
        if (__pPresentationModel->GetArtistAlbumListCount() == 0)
        {
-               __headerTitle = L"";
                SceneManager* pSceneManager = SceneManager::GetInstance();
-               AppAssert(pSceneManager);
-               SetScreenState(SCREEN_STATE_NORMAL);
-               pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
+               if (pSceneManager->GetCurrentSceneId().Equals(IDSCN_ARTIST_CONTENT_LIST,true)
+                               || pSceneManager->GetCurrentSceneId().Equals(IDSCN_PLAYLIST_CREATOR,true))
+               {
+                       __headerTitle = L"";
+                       AppAssert(pSceneManager);
+                       SetScreenState(SCREEN_STATE_NORMAL);
+                       pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
+               }
 
        }
        else
index 1d82695..0cc59b4 100644 (file)
@@ -361,8 +361,7 @@ ContentEditPanel::UpdateContentEditScreenState(void)
        AppLogDebug("ENTER");\r
        if (IsEmptyContentList() == true)\r
        {\r
-               ArrayList *pList = new (std::nothrow) ArrayList();\r
-               pList->Construct();\r
+               ArrayList* pList = null;\r
                SceneManager* pSceneManager = SceneManager::GetInstance();\r
                SetShowStateContentTableview(false);\r
                SetShowStateNoContent(true);\r
@@ -376,7 +375,9 @@ ContentEditPanel::UpdateContentEditScreenState(void)
                GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);\r
                GetHeader()->Invalidate(true);\r
                AppAssert(pSceneManager);\r
-               pSceneManager->GoBackward(BackwardSceneTransition(), pList);\r
+               pList = new (std::nothrow) ArrayList();\r
+               pList->Construct();\r
+               pSceneManager->GoBackward(BackwardSceneTransition(),pList);\r
                AppLogDebug("EXIT");\r
                return;\r
        }\r
index 12ea21f..01aa3e2 100644 (file)
@@ -334,7 +334,14 @@ MiniPlayer::OnTimerExpired(Timer& timer)
        {
                MessageBox messageBox;
                int modalResult = 0;
-               messageBox.Construct(L"Error", ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"), MSGBOX_STYLE_NONE, 3000);
+               if (__pPresentationModel->IsDuringCall())
+               {
+                       messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_DURING_CALL"), MSGBOX_STYLE_NONE, 3000);
+               }
+               else
+               {
+                       messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"), MSGBOX_STYLE_NONE, 3000);
+               }
                messageBox.ShowAndWait(modalResult);
        }
 }
index ad7e0d8..c3be40d 100644 (file)
@@ -410,12 +410,12 @@ PlayerForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::Or
        }
        TogglePlayPauseImage(__pPlayerPresentationModel->GetPlayerState());
 
-       if (__pContentsListViewPanel->GetShowState())
-       {
-               TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
-               pContentsTableView->UpdateTableView();
-               __pContentsListViewPanel->Invalidate(true);
-       }
+//     if (__pContentsListViewPanel->GetShowState())
+//     {
+//             TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
+////           pContentsTableView->UpdateTableView();
+//             __pContentsListViewPanel->Invalidate(true);
+//     }
        AppLogDebug("EXIT");
 }
 
@@ -1041,6 +1041,7 @@ PlayerForm::OnTouchReleased(const Control& source, const Point& currentPosition,
                                }
                                else
                                {
+                                       __pMsgShowTimer->Cancel();
                                        __pSeekTimer->Cancel();
                                        __playPosition = -1;
                                        PlayAnimation();
@@ -1068,6 +1069,7 @@ PlayerForm::OnTouchReleased(const Control& source, const Point& currentPosition,
                                }
                                else
                                {
+                                       __pMsgShowTimer->Cancel();
                                        __pSeekTimer->Cancel();
                                        __playPosition = -1;
                                        PlayAnimation();
@@ -1190,6 +1192,7 @@ void
 PlayerForm::OnAnimationTransactionStopped(int transactionId)
 {
        AppLogDebug("ENTER");
+       __isAnimationPerformed = false;
        AppLogDebug("EXIT");
 }
 
@@ -1270,7 +1273,14 @@ PlayerForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
        }
        else if (&timer == __pMsgShowTimer)
        {
-               ShowMessageBox(ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"));
+               if(__pPlayerPresentationModel->IsDuringCall())
+               {
+                       ShowMessageBox(ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_DURING_CALL"));
+               }
+               else
+               {
+                       ShowMessageBox(ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"));
+               }
        }
        else if (&timer == __pSeekTimer)
        {
@@ -1472,7 +1482,7 @@ PlayerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        SetFocus();
        __pPlayerPresentationModel->AddMusicPlayerEventListener(*this);
 
-       if (pArgs != null)
+       if (pArgs != null && pArgs->GetCount() > 0 && dynamic_cast<Integer*>(pArgs->GetAt(0)) == null)
        {
                if (IsFailed(__pPlayerPresentationModel->SetContentList(pArgs)))
                {
@@ -1527,10 +1537,8 @@ PlayerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        else
        {
                PlayerState playerState = __pPlayerPresentationModel->GetPlayerState();
-               // GetContentListCount() may return 1 in case of current playing song is deleted and no other song is available
-               if (playerState != PLAYER_STATE_PAUSED
-                               && playerState != PLAYER_STATE_PLAYING
-                               && __pPlayerPresentationModel->GetContentListCount() <= 1)
+               if (__pPlayerPresentationModel->IsDuringCall() == true || playerState == PLAYER_STATE_INITIALIZED
+                                       || playerState == PLAYER_STATE_ERROR)
                {
                        playerState = PLAYER_STATE_ERROR;
                }
@@ -1875,7 +1883,7 @@ PlayerForm::ShowMessageBox(const Tizen::Base::String& showText)
        AppLogDebug("ENTER");
        MessageBox messageBox;
        int modalResult = 0;
-       messageBox.Construct(L"Error", showText, MSGBOX_STYLE_NONE, 3000);
+       messageBox.Construct(L"", showText, MSGBOX_STYLE_NONE, 3000);
        messageBox.ShowAndWait(modalResult);
        AppLogDebug("EXIT");
        return E_SUCCESS;
index 2618eac..eeec739 100644 (file)
@@ -1037,7 +1037,9 @@ PlayerPresentationModel::Pause(void)
        {
                r = __pPlayer->Pause();
                TryCatch(r == E_SUCCESS, , "__pPlayer pause failed..%s\n",GetErrorMessage(r));
-
+       }
+       if (__pPlayer->GetState() == PLAYER_STATE_PAUSED)
+       {
                if (__pPlayStateTimer != null)
                {
                        r = __pPlayStateTimer->Cancel();
@@ -1418,7 +1420,7 @@ PlayerPresentationModel::SetContentList(IList* pArgs)
        AppLogDebug("ENTER");
        TryReturn( pArgs != null && pArgs->GetCount() > 0, E_INVALID_ARG, "Invalid arguments");
        result r = E_SUCCESS;
-       String* temp = null;
+       String* pTemp = null;
 
        if (__pPlayContentList == null)
        {
@@ -1433,11 +1435,11 @@ PlayerPresentationModel::SetContentList(IList* pArgs)
                __pPlayContentList->RemoveAll(true);
        }
 
-       temp = static_cast<String*>(pArgs->GetAt(0));
-       if (temp->Equals(MUSIC, true))
+       pTemp = static_cast<String*>(pArgs->GetAt(0));
+       if (pTemp->Equals(MUSIC, true))
        {
                ArrayList* pContentList = static_cast<ArrayList*>(pArgs->GetAt(2));
-               TryReturn(pContentList != null, E_FAILURE, "pArgs->GetAt(0) is null.")
+               TryReturn(pContentList != null, E_FAILURE, "pArgs->GetAt(2) is null.")
 
                IEnumerator* pEnum = pContentList->GetEnumeratorN();
 
index 27aaa6f..d9a3562 100644 (file)
@@ -705,9 +705,12 @@ PlaylistContentListForm::UpdateContentList(void)
        if (__pPresentationModel->GetContentCount() == 0)
        {
                SceneManager* pSceneManager = SceneManager::GetInstance();
-               ToggleScreenState(SCREEN_STATE_NORMAL);
-               AppAssert(pSceneManager);
-               pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
+               if (pSceneManager->GetCurrentSceneId().Equals(IDSCN_PLAYLIST_CONTENT_LIST,true))
+               {
+                       ToggleScreenState(SCREEN_STATE_NORMAL);
+                       AppAssert(pSceneManager);
+                       pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
+               }
        }
        else
        {
index a4decd0..2a5fa16 100644 (file)
@@ -312,9 +312,12 @@ PlaylistCreatorForm::OnActionPerformed(const Tizen::Ui::Control& source, int act
                                                3000);
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
-                               pList = new (std::nothrow) ArrayList();
-                               pList->Construct();
-                pList->Add(new (std::nothrow) Integer(1));
+                               if (!__previousSceneId.Equals(IDSCN_PLAYER,true))
+                               {
+                                       pList = new (std::nothrow) ArrayList();
+                                       pList->Construct();
+                                       pList->Add(new (std::nothrow) Integer(1));
+                               }
                        }
                        else
                        {
index 3c6515c..ccfb7ab 100644 (file)
@@ -19,6 +19,7 @@
  * @brief              This is the implementation file for PlaylistListPanel class.
  */
 
+#include "MpAllListPresentationModel.h"
 #include "MpCommonUtil.h"
 #include "MpMusicPlayerApp.h"
 #include "MpPlaylistListPanel.h"
@@ -438,36 +439,36 @@ PlaylistListPanel::CreateItem(const int itemIndex, int itemWidth)
 
                String bitmapResName[] = {"34_mostplayed.png", "34_recentlyplayed.png", "34_recentlyadded.png"};
                Bitmap* pBitmap = ResourceManager::GetBitmapN(bitmapResName[itemIndex]);
-               r = CreateTableViewItem(*pItem, defaultPlaylistTitle, *pBitmap, NUM_NOT_DISPLAY_CONTENT_COUNT);
-               delete pBitmap;
-               TryCatch(r == E_SUCCESS, , "CreateTableViewItem failed(%s)", GetErrorMessage(r));
-
-               ArrayList* pPlaylistContentList = __pPlaylistListPresentationModel->GetContentPathListN(itemIndex);
-               if(__pContextItem_default)
+               if (pBitmap != null)
                {
-                       __pContextItem_default->SetEnabled(true);
-
-                       if (pPlaylistContentList != null)
+                       r = CreateTableViewItem(*pItem, defaultPlaylistTitle, *pBitmap, NUM_NOT_DISPLAY_CONTENT_COUNT);
+                       delete pBitmap;
+                       TryCatch(r == E_SUCCESS, , "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+                       ArrayList* pPlaylistContentList = __pPlaylistListPresentationModel->GetContentPathListN(itemIndex);
+                       if(__pContextItem_default)
                        {
-                               if (pPlaylistContentList->GetCount() == 0)
+                               __pContextItem_default->SetEnabled(true);
+
+                               if (pPlaylistContentList != null)
                                {
-                                       __pContextItem_default->SetEnabled(false);
+                                       if (pPlaylistContentList->GetCount() == 0)
+                                       {
+                                               __pContextItem_default->SetEnabled(false);
+                                       }
+
+                                       pPlaylistContentList->RemoveAll(true);
+                                       delete pPlaylistContentList;
                                }
 
-                               pPlaylistContentList->RemoveAll(true);
-                               delete pPlaylistContentList;
+                               __pContextItem_default->Invalidate(true);
+                               pItem->SetContextItem(__pContextItem_default);
                        }
-
-                       __pContextItem_default->Invalidate(true);
-
-                       pItem->SetContextItem(__pContextItem_default);
                }
 
        }
        else
        {
-               Tizen::Base::String* playlistName = __pPlaylistListPresentationModel->GetPlayListName(itemIndex - USER_CONTENT);
-
+               String* playlistName = __pPlaylistListPresentationModel->GetPlayListName(itemIndex - USER_CONTENT);
                if (playlistName != null)
                {
                        int playlistItemCount = __pPlaylistListPresentationModel->GetPlayListItemCount(*playlistName);
@@ -481,10 +482,13 @@ PlaylistListPanel::CreateItem(const int itemIndex, int itemWidth)
                        else
                        {
                                Bitmap* pThumbnail = (ResourceManager::GetBitmapN(L"34_player_list_thum_noitems.png"));
-                               pThumbnail->Scale(Dimension(W_THUMBNAIL, H_THUMBNAIL));
-                               r = CreateTableViewItem(*pItem, *playlistName, *pThumbnail, playlistItemCount);
-                               delete pThumbnail;
-                               TryCatch(r == E_SUCCESS, , "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+                               if (pThumbnail != null)
+                               {
+                                       pThumbnail->Scale(Dimension(W_THUMBNAIL, H_THUMBNAIL));
+                                       r = CreateTableViewItem(*pItem, *playlistName, *pThumbnail, playlistItemCount);
+                                       delete pThumbnail;
+                                       TryCatch(r == E_SUCCESS, , "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+                               }
 
                        }
                }
@@ -793,6 +797,10 @@ PlaylistListPanel::UpdateContentList(void)
        if (__pPlaylistListPresentationModel != null)
        {
                __pPlaylistListPresentationModel->UpdatePlaylistList();
+               if (AllListPresentationModel::GetInstance()->GetTotalCount() <= 0)
+               {
+                       CommonUtil::SetAddtoPlaylistState(false);
+               }
        }
        AppLogDebug("EXIT");
 }