Fix N_SE-35850, N_SE-35864, N_SE-35870, N_SE-35902 and N_SE-35866 issue accepted/tizen_2.1/20130425.024239 submit/tizen_2.1/20130424.224233
authorTaeHo Choi <thanks.choi@samsung.com>
Tue, 23 Apr 2013 12:24:37 +0000 (21:24 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Tue, 23 Apr 2013 12:24:37 +0000 (21:24 +0900)
Change-Id: I0c5916c61b1862a888869ec3c0a740cd979be253
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
LICENSE.Flora
inc/MpMainFrame.h
src/MpArtistAlbumListForm.cpp
src/MpMainFrame.cpp
src/MpMiniPlayer.cpp
src/MpMusicPlayerApp.cpp
src/MpMusicPlayerForm.cpp
src/MpMusicPlayerPresentationModel.cpp

index fd90a36..4c59770 100644 (file)
@@ -1,4 +1,4 @@
-Flora License
+Flora License
 
 Version 1.0, April, 2013
 
index 7937523..46926dd 100644 (file)
@@ -28,7 +28,7 @@
 
 class MainFrame
        : public Tizen::Ui::Controls::Frame
-//     , public Tizen::Ui::Controls::IFrameEventListener
+       , public Tizen::Ui::Controls::IFrameEventListener
 {
 public:
        MainFrame(void);
@@ -39,9 +39,13 @@ public:
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
 
-//     virtual void OnFrameTerminating(const Tizen::Ui::Controls::Frame& source);
-//     virtual void OnFrameMinimized(const Tizen::Ui::Controls::Frame& source) ;
-//     virtual void OnFrameRestored(const Tizen::Ui::Controls::Frame& source);
+       virtual void OnFrameActivated(const Tizen::Ui::Controls::Frame& source);
+       virtual void OnFrameRestored(const Tizen::Ui::Controls::Frame& source);
+       virtual void OnFrameTerminating(const Tizen::Ui::Controls::Frame& source);
+
+private:
+       Tizen::Ui::Scenes::SceneId __sceneId;
+       Tizen::Base::Collection::IList* __pDataList;
 };
 
 #endif // _MP_MAIN_FRAME_H_
\ No newline at end of file
index b167f0e..5792a3f 100644 (file)
@@ -184,7 +184,7 @@ ArtistAlbumListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 
 //     for (int iCount = 0; iCount < pSceneManager->GetSceneHistoryN()->GetCount(); iCount++)
 //     {
-//             String* pTemp = new String();
+//             String* pTemp = new (std::nothrow) String();
 //             pSceneManager->GetSceneHistoryN()->GetAt(iCount, *pTemp);
 //             AppLogDebug( "pTemp : %ls", pTemp->GetPointer());
 //     }
index 0427969..c59d3fd 100644 (file)
@@ -28,7 +28,11 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
+//#define GO_TO_SCENE_AFTER_FRAME_MODE_FULL_SCREEN_ACTIVATED
+
 MainFrame::MainFrame(void)
+       : __sceneId(null)
+       , __pDataList(null)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT");
@@ -47,8 +51,7 @@ MainFrame::OnInitializing(void)
        result r = SceneRegister::RegisterAllScenes();
        TryReturn(r == E_SUCCESS, r, "[%s] Scene registering Failed.", GetErrorMessage(r));
 
-//     AddFrameEventListener(*this);
-
+       AddFrameEventListener(*this);
        AppLogDebug("EXIT");
        return r;
 }
@@ -57,57 +60,59 @@ result
 MainFrame::OnTerminating(void)
 {
        AppLogDebug("ENTER");
-//     RemoveFrameEventListener(*this);
+       RemoveFrameEventListener(*this);
        AppLogDebug("EXIT");
        return E_SUCCESS;
 }
 
-//void
-//MainFrame::OnFrameMinimized(const Tizen::Ui::Controls::Frame& source)
-//{
-//     AppLogDebug("ENTER");
-//     SceneManager* pSceneManager = SceneManager::GetInstance();
-//     AppAssert(pSceneManager);
-//     IListT<SceneId>* pSceneIdList = pSceneManager->GetSceneHistoryN();
-//     if (pSceneIdList == null)
-//     {
-//             AppLogDebug("EXIT(pSceneIdList is null)");
-//             return;
-//     }
-//
-//     IEnumeratorT<SceneId>* pIEnum = pSceneIdList->GetEnumeratorN();
-//     while (pIEnum->MoveNext() == E_SUCCESS)
-//     {
-//             SceneId sceneID;
-//             pIEnum->GetCurrent(sceneID);
-//             pSceneManager->DestroyScene(sceneID);
-//     }
-//     delete pIEnum;
-//
-//     if (pSceneManager->IsSceneAlive(IDSCN_PLAYER) == true)
-//     {
-//             pSceneManager->DestroyScene(IDSCN_PLAYER);
-//     }
-//     AppLogDebug("EXIT");
-//}
-//
-//void
-//MainFrame::OnFrameTerminating(const Tizen::Ui::Controls::Frame& source)
-//{
-//     AppLogDebug("ENTER");
-//     AppLogDebug("EXIT");
-//}
-//
-//void
-//MainFrame::OnFrameRestored(const Tizen::Ui::Controls::Frame& source)
-//{
-//     AppLogDebug("ENTER");
-//     SceneManager* pSceneManager = SceneManager::GetInstance();
-//     AppAssert(pSceneManager);
-//
-//     pSceneManager->BringCurrentSceneToTop();
-//     AppLogDebug("EXIT");
-//}
+void
+MainFrame::OnFrameActivated(const Tizen::Ui::Controls::Frame& source)
+{
+       AppLogDebug("ENTER");
+#ifdef GO_TO_SCENE_AFTER_FRAME_MODE_FULL_SCREEN_ACTIVATED
+       if (__sceneId != null)
+       {
+               SceneManager* pSceneManager = SceneManager::GetInstance();
+               AppAssert(pSceneManager);
+
+               pSceneManager->GoForward(ForwardSceneTransition(__sceneId), __pDataList);
+       }
+
+       __sceneId = null;
+       __pDataList = null;
+#endif
+       AppLogDebug("EXIT");
+}
+
+void
+MainFrame::OnFrameRestored(const Tizen::Ui::Controls::Frame& source)
+{
+       AppLogDebug("ENTER");
+#ifdef GO_TO_SCENE_AFTER_FRAME_MODE_FULL_SCREEN_ACTIVATED
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       AppAssert(pSceneManager);
+
+       pSceneManager->BringCurrentSceneToTop();
+       Invalidate(true);
+#endif
+       AppLogDebug("EXIT");
+}
+
+void
+MainFrame::OnFrameTerminating(const Tizen::Ui::Controls::Frame& source)
+{
+       AppLogDebug("ENTER");
+#ifdef GO_TO_SCENE_AFTER_FRAME_MODE_FULL_SCREEN_ACTIVATED
+       if (__pDataList != null)
+       {
+               __pDataList->RemoveAll();
+               delete __pDataList;
+               __pDataList = null;
+       }
+       __sceneId = null;
+#endif
+       AppLogDebug("EXIT");
+}
 
 result
 MainFrame::GoToInitialScene(const Tizen::Ui::Scenes::SceneId& sceneId, Tizen::Base::Collection::IList* pArgs)
@@ -121,6 +126,15 @@ MainFrame::GoToInitialScene(const Tizen::Ui::Scenes::SceneId& sceneId, Tizen::Ba
        {
                AppLogDebug("GoToInitialScene pArgs is not null(%ls)", sceneId.GetPointer());
        }
+#ifdef GO_TO_SCENE_AFTER_FRAME_MODE_FULL_SCREEN_ACTIVATED
+       if (GetShowMode() != FRAME_SHOW_MODE_FULL_SCREEN)
+       {
+               __sceneId = sceneId;
+               __pDataList = pArgs;
+               return E_SUCCESS;
+       }
+#endif
+
        SceneManager* pSceneManager = SceneManager::GetInstance();
        AppAssert(pSceneManager);
        result r = pSceneManager->GoForward(ForwardSceneTransition(sceneId), pArgs);
index 174b0da..f09a200 100644 (file)
@@ -199,7 +199,7 @@ MiniPlayer::SetPauseButtonImage(void)
 //     pEnrichedText->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP);\r
 //     pEnrichedText->SetTextAbbreviationEnabled(true);\r
 //\r
-//     TextElement* pTextElement1 = new TextElement();\r
+//     TextElement* pTextElement1 = new (std::nothrow) TextElement();\r
 //     r = pTextElement1->Construct(__titleName);\r
 //     if (IsFailed(r))\r
 //     {\r
@@ -212,7 +212,7 @@ MiniPlayer::SetPauseButtonImage(void)
 //      font.Construct(FONT_STYLE_BOLD, 30);\r
 //      pTextElement1->SetFont(font);\r
 //\r
-//     TextElement* pTextElement2 = new TextElement();\r
+//     TextElement* pTextElement2 = new (std::nothrow) TextElement();\r
 //     r = pTextElement2->Construct(__artistName);\r
 //     if (IsFailed(r))\r
 //     {\r
index 382e538..7e99252 100644 (file)
@@ -77,7 +77,7 @@ MusicPlayerApp::CreateInstance(void)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT");
-       return new MusicPlayerApp();
+       return new (std::nothrow) MusicPlayerApp();
 }
 
 bool
@@ -393,7 +393,7 @@ MusicPlayerApp::ParsingArgument(const Tizen::Base::String* pUriData, const Tizen
                        }
                }
                __pDataList->Add(pContentPathArrayList);
-               __pDataList->Add(*(new Integer(0)));
+               __pDataList->Add(*(new (std::nothrow) Integer(0)));
        }
 */
        AppLogDebug("EXIT");
index af365fb..4ba4b90 100644 (file)
@@ -329,6 +329,7 @@ PlayerForm::OnInitializing(void)
 
        UpdateSplitBarState();
        TogglePlayPauseImage(PLAYER_STATE_CLOSED);
+       SetRepeatButtonImage(__pPlayerPresentationModel->GetRepeatState());
 
        AppLogDebug("EXIT");
        return ThumbnailBase::Construct();
@@ -439,10 +440,7 @@ PlayerForm::OnTerminating(void)
        if (__pPlayerPresentationModel != null)
        {
                __pPlayerPresentationModel->RemoveMusicPlayerEventListener(*this);
-//             if (!__pPlayerPresentationModel->GetPlayerState() == PLAYER_STATE_PLAYING)
-               {
-                       __pPlayerPresentationModel->DestroyPlayerPresentationModel();
-               }
+               __pPlayerPresentationModel->DestroyPlayerPresentationModel();
        }
        SettingPresentationModel::GetInstance()->DestroySettingPresentationModel();
        AppLogDebug("EXIT");
@@ -544,6 +542,7 @@ PlayerForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                UiApp* pApp = UiApp::GetInstance();
                                pApp->Terminate();
                        }
+                       __isRunByAppControl = false;
                }
                break;
 
@@ -1003,6 +1002,10 @@ PlayerForm::OnSliderBarMoved(Tizen::Ui::Controls::Slider& source, int value)
        }
        else
        {
+               if (__pVolumePanel->GetShowState() == false)
+               {
+                       __pVolumePanel->SetShowState(true);
+               }
                __pPlayerPresentationModel->SetVolume(value);
        }
        AppLogDebug("EXIT");
@@ -1652,7 +1655,7 @@ PlayerForm::SetFileNotExistState(bool isFileExist)
        __pMoreContextButton->SetEnabled(isFileExist);
        __pMoreContextButton->Invalidate(true);
 
-       if (__isRunByAppControl == false)
+       if (__isRunByAppControl == false && GetPlayerScreenState() != PLAYER_SCREEN_STATE_DURING_CALL)
        {
                __pContentsViewToggleButton->SetEnabled(isFileExist);
                __pContentsViewToggleButton->Invalidate(true);
@@ -2095,6 +2098,15 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
                {
                        __pPlayPauseButton->SetEnabled(false);
                        __pMoreContextButton->SetEnabled(false);
+                       __pContentsViewToggleButton->SetEnabled(false);
+
+                       if (__pContentsListViewPanel->GetShowState() == true)
+                       {
+                               __pContentsListViewPanel->SetShowState(false);
+                               __pContentsViewToggleButton->SetActionId(IDA_BUTTON_CONTENTS_LIST_VIEW);
+                               __pContentsAlbumViewPanel->SetShowState(true);
+                       }
+
                        Bitmap* pThumb = ResourceManager::GetBitmapN(L"music_play_grid_thumb_loading.png");
                        static_cast<Label*>(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*pThumb);
                        delete pThumb;
index e2fd155..a55510b 100644 (file)
@@ -870,7 +870,7 @@ PlayerPresentationModel::Play(int contentIndex, int sliderPosition, bool bPauseP
 
                        AppLogDebug("%d", __pPlayer->GetState());
                        r = __pPlayer->Play();
-                       TryCatch(r == E_SUCCESS, , "Play failed\n(%s)", GetErrorMessage(r));
+                       TryCatch(r == E_SUCCESS, , "Play failed(%s)", GetErrorMessage(r));
                        if (sliderPosition != 0 && playerState != PLAYER_STATE_PAUSED)
                        {
                                r = __pPlayer->SeekTo(sliderPosition * (__pPlayer->GetDuration() / TIMER_INTERVAL));
@@ -1057,6 +1057,7 @@ PlayerPresentationModel::MovePreviousContent(bool forceMove)
                if (GetPlayerState() == PLAYER_STATE_PAUSED)
                {
                        __lastPosition = 0;
+                       __seekCompleted = false;
                        __pPlayer->SeekTo(MIN_SLIDER_COUNT);
                        InitializeProgress();
                }
@@ -1080,39 +1081,6 @@ PlayerPresentationModel::MoveNextContent(void)
                AppLogDebug("EXIT");
                return;
        }
-//     String currentDuration = null;
-
-//     ClosePlayer();
-//     InitializeProgress();
-//     InitializePlayer();
-
-/*     if (IsShuffleEnable())
-       {
-               srand(int(time(NULL)));
-               __currentContentIndex = rand() % __pPlayContentList->GetCount();
-       }
-       else
-       {
-               if(__currentContentIndex == __pPlayContentList->GetCount() - 1
-                       || __removedContentIndex == __pPlayContentList->GetCount())
-               {
-                       __currentContentIndex = 0;
-               }
-               else
-               {
-                       if (__removedContentIndex != INIT_CONTENT_INDEX)
-                       {
-                               __currentContentIndex = __removedContentIndex;
-                       }
-                       else
-                       {
-                               __currentContentIndex++;
-                       }
-               }
-               __removedContentIndex = INIT_CONTENT_INDEX;
-       }
-       */
-
        __currentContentIndex = __nextContentIndex;
        GenerateNextIndex();
        __removedContentIndex = INIT_CONTENT_INDEX;
@@ -1123,6 +1091,7 @@ PlayerPresentationModel::MoveNextContent(void)
                if (GetPlayerState() == PLAYER_STATE_PAUSED)
                {
                        __lastPosition = 0;
+                       __seekCompleted = false;
                        __pPlayer->SeekTo(MIN_SLIDER_COUNT);
                        InitializeProgress();
                }
@@ -1581,7 +1550,7 @@ PlayerPresentationModel::InitializeProgress(void)
                TryLog(r == E_SUCCESS, "[%s] __pPlayStateTimer cancel failed.", GetErrorMessage(r));
        }
        __playposition = MIN_SLIDER_COUNT;
-       __seekCompleted = true;
+//     __seekCompleted = true;
        __xTimesValue = INIT_VALUE;
        CallOnPlayTimeChanged(currentDuration, __playposition);
        AppLogDebug("EXIT");