Fixed an issue that occurs after entered to playform in MusicPlayer and clean up...
authorMyunkyu <mk70.kang@partner.samsung.com>
Mon, 22 Apr 2013 12:12:57 +0000 (21:12 +0900)
committerMyunkyu <mk70.kang@partner.samsung.com>
Mon, 22 Apr 2013 12:12:57 +0000 (21:12 +0900)
Change-Id: Ie618a8358a4601a71a0080718cd6b0194811ba34

inc/MpContentLibaryPanel.h
inc/MpMainFrame.h [changed mode: 0755->0644]
src/MpContentListPanel.cpp
src/MpMainFrame.cpp
src/MpMusicPlayerApp.cpp
src/MpMusicPlayerForm.cpp
src/MpMusicPlayerPresentationModel.cpp

index 67b946a..fc5e086 100644 (file)
@@ -62,7 +62,7 @@ protected:
        result TryRemoveContextMenu(int actionId);\r
        void RemoveContextMenu(void);\r
 \r
-       result ShowNotificationTicker(Tizen::Base::String text, Tizen::Graphics::Point point, int TickerWidth);\r
+       result ShowNotificationTicker(Tizen::Base::String text, int timeOut = 2000);\r
        void RemoveNotificationTicker(void);\r
 \r
        Tizen::Ui::OrientationStatus GetCurrentOrientationMode(void);\r
old mode 100755 (executable)
new mode 100644 (file)
index eaf49bd..7937523
@@ -28,6 +28,7 @@
 
 class MainFrame
        : public Tizen::Ui::Controls::Frame
+//     , public Tizen::Ui::Controls::IFrameEventListener
 {
 public:
        MainFrame(void);
@@ -37,6 +38,10 @@ 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);
 };
 
 #endif // _MP_MAIN_FRAME_H_
\ No newline at end of file
index a6bca8c..b1e0005 100644 (file)
@@ -484,7 +484,7 @@ ContentLibaryPanel::RemovePlayListPicker(void)
 }\r
 \r
 result\r
-ContentLibaryPanel::ShowNotificationTicker(Tizen::Base::String text, Tizen::Graphics::Point point, int TickerWidth)\r
+ContentLibaryPanel::ShowNotificationTicker(Tizen::Base::String text, int timeOut)\r
 {\r
        AppLogDebug("ENTER");\r
        if (__pNotificationTicker == null)\r
@@ -497,10 +497,10 @@ ContentLibaryPanel::ShowNotificationTicker(Tizen::Base::String text, Tizen::Grap
                        __pNotificationTicker = null;\r
                        return E_FAILURE;\r
                }\r
+               __pNotificationTicker->SetBoundTicker(Rectangle(0,0, GetWidth(), 96));\r
        }\r
 \r
-//     __pNotificationTicker->SetBoundTicker(point, TickerWidth);\r
-       __pNotificationTicker->ShowTicker(text);\r
+       __pNotificationTicker->ShowTicker(text, timeOut);\r
        AppLogDebug("EXIT");\r
        return E_SUCCESS;\r
 }\r
index 4faca15..0427969 100644 (file)
@@ -23,6 +23,7 @@
 #include "MpSceneRegister.h"
 
 using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
@@ -45,6 +46,9 @@ MainFrame::OnInitializing(void)
        AppLogDebug("ENTER");
        result r = SceneRegister::RegisterAllScenes();
        TryReturn(r == E_SUCCESS, r, "[%s] Scene registering Failed.", GetErrorMessage(r));
+
+//     AddFrameEventListener(*this);
+
        AppLogDebug("EXIT");
        return r;
 }
@@ -53,10 +57,58 @@ result
 MainFrame::OnTerminating(void)
 {
        AppLogDebug("ENTER");
+//     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");
+//}
+
 result
 MainFrame::GoToInitialScene(const Tizen::Ui::Scenes::SceneId& sceneId, Tizen::Base::Collection::IList* pArgs)
 {
index 1df55cf..382e538 100644 (file)
@@ -331,6 +331,12 @@ MusicPlayerApp::ParsingArgument(const Tizen::Base::String* pUriData, const Tizen
                sourceStr.Replace(original, replace);
        //      pContentPath = &sourceStr;
 
+               if (__pDataList != null)
+               {
+                       __pDataList->RemoveAll();
+                       delete __pDataList;
+               }
+
                __pDataList = new (std::nothrow) ArrayList();
                __pDataList->Construct();
 
index ce0a5a6..af365fb 100644 (file)
@@ -389,7 +389,7 @@ PlayerForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::Or
                        __pVolumePanel->Invalidate(true);
                }
        }
-
+       TogglePlayPauseImage(__pPlayerPresentationModel->GetPlayerState());
        TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
        pContentsTableView->UpdateTableView();
        __pContentsListViewPanel->Invalidate(true);
@@ -439,7 +439,10 @@ PlayerForm::OnTerminating(void)
        if (__pPlayerPresentationModel != null)
        {
                __pPlayerPresentationModel->RemoveMusicPlayerEventListener(*this);
-               __pPlayerPresentationModel->DestroyPlayerPresentationModel();
+//             if (!__pPlayerPresentationModel->GetPlayerState() == PLAYER_STATE_PLAYING)
+               {
+                       __pPlayerPresentationModel->DestroyPlayerPresentationModel();
+               }
        }
        SettingPresentationModel::GetInstance()->DestroySettingPresentationModel();
        AppLogDebug("EXIT");
@@ -1245,7 +1248,6 @@ PlayerForm::OnChangedContentListByAppControlN(Tizen::Base::Collection::IList* pA
        MusicPlayerApp* pMusicPlayerApp = static_cast<MusicPlayerApp*>(MusicPlayerApp::GetInstance());
        TryReturnVoid(pMusicPlayerApp != null, "Unable to cast UiApp to MusicPlayerApp");
 
-       SetPlayerScreenState(PLAYER_SCREEN_STATE_APP_CONTROL);
        if (pArgs == null || static_cast<String*>(pArgs->GetAt(0))->Equals(MUSIC, false))
        {
                AppLogDebug("EXIT(E_FAILURE)");
@@ -1270,6 +1272,7 @@ PlayerForm::OnChangedContentListByAppControlN(Tizen::Base::Collection::IList* pA
 
        int playIndex = (static_cast<Integer*>(pArgs->GetAt(1)))->ToInt();
        __pPlayerPresentationModel->Play(playIndex, MIN_PLAY_STATE_SLIDER_COUNT);
+       SetPlayerScreenState(PLAYER_SCREEN_STATE_APP_CONTROL);
 
        pArgs->RemoveAll();
        delete pArgs;
@@ -1649,13 +1652,12 @@ PlayerForm::SetFileNotExistState(bool isFileExist)
        __pMoreContextButton->SetEnabled(isFileExist);
        __pMoreContextButton->Invalidate(true);
 
-       __pShuffleButton->SetEnabled(isFileExist);
-       __pShuffleButton->Invalidate(true);
-
        if (__isRunByAppControl == false)
        {
                __pContentsViewToggleButton->SetEnabled(isFileExist);
                __pContentsViewToggleButton->Invalidate(true);
+               __pShuffleButton->SetEnabled(isFileExist);
+               __pShuffleButton->Invalidate(true);
        }
        AppLogDebug("EXIT");
 }
index 5d6e600..e2fd155 100644 (file)
@@ -1056,6 +1056,7 @@ PlayerPresentationModel::MovePreviousContent(bool forceMove)
                CallOnPlayContentChanged(__currentContentIndex);
                if (GetPlayerState() == PLAYER_STATE_PAUSED)
                {
+                       __lastPosition = 0;
                        __pPlayer->SeekTo(MIN_SLIDER_COUNT);
                        InitializeProgress();
                }