Fixed jira issues:N_SE-46501,N_SE-46663, N_SE-46621, N_SE-46405, N_SE-46619, N_SE...
authorajay.nayak <ajay.nayak@samsung.com>
Wed, 17 Jul 2013 11:48:34 +0000 (20:48 +0900)
committerajay.nayak <ajay.nayak@samsung.com>
Wed, 17 Jul 2013 11:48:34 +0000 (20:48 +0900)
Change-Id: Id80d29489bc10c3c1eb639ab6108082fff805f0f
Signed-off-by: ajay.nayak <ajay.nayak@samsung.com>
inc/MpMiniPlayer.h
res/screen-size-normal/IDL_CONTENT_NOTHUMBNAIL_EDITOR_ITEM_PANEL_FONT_SIZE_GIANT.xml [changed mode: 0644->0755]
src/MpContentEditPanel.cpp
src/MpMiniPlayer.cpp
src/MpMusicPlayerForm.cpp
src/MpMusicPlayerPresentationModel.cpp
src/MpPlaylistListPresentationModel.cpp
src/MpTypes.cpp

index 46c6249..eaeffae 100644 (file)
@@ -34,6 +34,7 @@
 
 class MiniPlayer
        : public Tizen::Ui::Controls::Panel
+       , public Tizen::Base::Runtime::ITimerEventListener
        , public Tizen::Ui::IActionEventListener
        , public Tizen::Ui::IKeyEventListener
        , public Tizen::Ui::ITouchEventListener
@@ -50,6 +51,7 @@ public:
        void MiniPlayerDeactivate(void);
 
 protected:
+       virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
        virtual void OnPlayStateChanged(Tizen::Media::PlayerState playerState);
        virtual void OnPlayContentChanged(int currentContentIndex);
        virtual void OnPlayTimeChanged(const Tizen::Base::String& currentDuration, int currentPosition);
@@ -81,6 +83,7 @@ private:
        void DrawBackground(Tizen::Graphics::Canvas& canvas);
 
 private:
+       Tizen::Base::Runtime::Timer* __pMsgTimer;
        Tizen::Ui::Controls::Button* __pMinPlayerPlayToggleButton;
        Tizen::Ui::Controls::Button* __pMinPlayerNextButton;
        Tizen::Ui::Controls::Button* __pMinPlayerPrevButton;
old mode 100644 (file)
new mode 100755 (executable)
index d1c1f3c..02747f8
@@ -17,6 +17,6 @@
     <Label id="IDC_LABEL_CONTENT_TITLE_NAME" parent="IDL_CONTENT_NOTHUMBNAIL_EDITOR_ITEM_PANEL_FONT_SIZE_GIANT">\r
         <property accessibilityHint="" backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" leftMargin="16" text="" textColor="#000000" textSize="106.0" textStyle="LABEL_TEXT_STYLE_NORMAL" topMargin="0" verticalAlign="ALIGN_MIDDLE"/>\r
         <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="true" height="124.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="105.0" marginRight="0.0" marginTop="22.0" mode="Portrait" rightRelation="" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_LEFT" topRelation="" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="409.0" x="105.0" y="40.5"/>\r
-        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="true" height="124.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="105.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="IDC_LABEL_CONTENT_ADDITIONAL_INFO" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_LEFT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="969.0" x="105.0" y="40.5"/>\r
+        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="true" height="124.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_CONTENT_NOTHUMBNAIL_EDITOR_ITEM_PANEL_FONT_SIZE_GIANT" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="105.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="IDC_LABEL_CONTENT_ADDITIONAL_INFO" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_LEFT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="969.0" x="105.0" y="40.5"/>\r
     </Label>\r
 </ScenePanel>\r
index b567d0d..62ab172 100644 (file)
@@ -294,8 +294,8 @@ ContentEditPanel::OnMusicContentUpdateCompleted(void)
        AppLogDebug("ENTER");\r
        __checkedItemCount = INIT_VALUE;\r
 \r
-       RemovePlayListPicker();\r
-       RemoveSharePicker();\r
+//     RemovePlayListPicker();\r
+//     RemoveSharePicker();\r
 \r
        UpdateContentList();\r
        UpdateContentEditScreenState();\r
index 382fa27..3801b37 100644 (file)
@@ -26,6 +26,7 @@
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
+using namespace Tizen::Base::Runtime;
 using namespace Tizen::Graphics;
 using namespace Tizen::Media;
 using namespace Tizen::Ui;
@@ -44,7 +45,8 @@ static const wchar_t* IDB_PAUSE_BUTTON_ICON_DISABLED = L"T02_mini_control_circle
 static const wchar_t* IDB_MINIPLAYER_BACKGROUND = L"T02_mini_player_bg.png";
 
 MiniPlayer::MiniPlayer(void)
-       : __pMinPlayerPlayToggleButton(null)
+       : __pMsgTimer(null)
+       , __pMinPlayerPlayToggleButton(null)
        , __pMinPlayerNextButton(null)
        , __pMinPlayerPrevButton(null)
        , __pThumbnailLabel(null)
@@ -61,6 +63,11 @@ MiniPlayer::MiniPlayer(void)
 MiniPlayer::~MiniPlayer(void)
 {
        AppLogDebug("ENTER");
+       if (__pMsgTimer)
+       {
+               __pMsgTimer->Cancel();
+               delete __pMsgTimer;
+       }
        AppLogDebug("EXIT");
 }
 
@@ -105,7 +112,8 @@ MiniPlayer::Construct(void)
        __pProgressBar->SetRange(INIT_VALUE, PROGRESS_MAX_VALUE);
 
        Invalidate(true);
-
+       __pMsgTimer = new (std::nothrow) Timer();
+       __pMsgTimer->Construct(*this);
        AppLogDebug("EXIT");
        return E_SUCCESS;
 }
@@ -288,6 +296,18 @@ MiniPlayer::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 }
 
 void
+MiniPlayer::OnTimerExpired(Timer& timer)
+{
+       if (timer.Equals(*__pMsgTimer))
+       {
+               MessageBox messageBox;
+               int modalResult = 0;
+               messageBox.Construct(L"Error", ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"), MSGBOX_STYLE_NONE, 3000);
+               messageBox.ShowAndWait(modalResult);
+       }
+}
+
+void
 MiniPlayer::OnPlayStateChanged(Tizen::Media::PlayerState playerState)
 {
        AppLogDebug("ENTER");
@@ -311,16 +331,12 @@ MiniPlayer::OnPlayStateChanged(Tizen::Media::PlayerState playerState)
 
                if (playerState == PLAYER_STATE_ERROR)
                {
-                       MessageBox messageBox;
-                       int modalResult = 0;
-
+                       __pMsgTimer->Cancel();
                        SetContentInfo(__pPresentationModel->GetCurrentContentIndex());
                        __pMinPlayerPlayToggleButton->SetEnabled(false);
                        __pProgressBar->SetEnabled(false);
-                       messageBox.Construct(L"Error", ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"), MSGBOX_STYLE_NONE, 3000);
-                       messageBox.ShowAndWait(modalResult);
+                       __pMsgTimer->Start(MESSAGE_BOX_DELAY);
                }
-
        }
 
        AppLogDebug("EXIT");
index a2aaf54..b79c6e4 100644 (file)
@@ -487,6 +487,13 @@ PlayerForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 
        case IDA_BUTTON_CONTENTS_LIST_VIEW:
                {
+                       TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
+
+                       if (pContentsTableView != null)
+                       {
+                               pContentsTableView->UpdateTableView();
+                       }
+
                        __pContentsAlbumViewPanel->SetShowState(false);
                        __pContentsViewToggleButton->SetActionId(IDA_BUTTON_CONTENTS_ALBUM_VIEW);
                        __pContentsListViewPanel->SetShowState(true);
@@ -704,12 +711,12 @@ PlayerForm::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode ke
                }
                break;
 
-       case KEY_ENTER:
-               if (source.Equals(*__pForwardButton) || source.Equals(*__pRewindButton))
-               {
-                       __isLongPressed = false;
-               }
-               break;
+//     case KEY_ENTER:
+//             if (__isLongPressed && (source.Equals(*__pForwardButton) || source.Equals(*__pRewindButton)))
+//             {
+//                     __isLongPressed = false;
+//             }
+//             break;
 
        default:
                break;
@@ -729,6 +736,7 @@ PlayerForm::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode k
                        if (__isLongPressed == true)
                        {
                                __pPlayerPresentationModel->StopForwardRewind();
+                               __isLongPressed = false;
                        }
                        else
                        {
@@ -953,6 +961,7 @@ PlayerForm::OnTouchReleased(const Control& source, const Point& currentPosition,
                if (__isLongPressed == true)
                {
                        __pPlayerPresentationModel->StopForwardRewind();
+                       __isLongPressed = false;
                }
                else
                {
@@ -1462,7 +1471,6 @@ PlayerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        }
        else
        {
-               TableView* pContentsTableView = null;
                PlayerState playerState = __pPlayerPresentationModel->GetPlayerState();
 
                if (playerState != PLAYER_STATE_PAUSED
@@ -1488,12 +1496,7 @@ PlayerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                }
 
                SetFileNotExistState(__pPlayerPresentationModel->IsFileExist(__pPlayerPresentationModel->GetCurrentContentIndex()));
-               pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
 
-               if (pContentsTableView != null)
-               {
-                       pContentsTableView->UpdateTableView();
-               }
        }
 
        Invalidate(true);
@@ -1613,7 +1616,7 @@ PlayerForm::OnPlayStateChanged(PlayerState playerState)
                }
 
                __pMsgShowTimer->Cancel();
-               __pMsgShowTimer->Start(10);
+               __pMsgShowTimer->Start(MESSAGE_BOX_DELAY);
 
                if (pApp != null && pApp->GetRequestId() != null)
                {
@@ -1645,16 +1648,17 @@ PlayerForm::OnPlayContentChanged(int currentContentIndex)
        String* pCurrentPlayConent = __pPlayerPresentationModel->GetPlayContentPath();
        String* pContentPath = __pPlayerPresentationModel->GetContentPath(__pPlayerPresentationModel->GetCurrentContentIndex());
 
-       if (!pContentPath->Equals(*pCurrentPlayConent,true) || !__pPlayerPresentationModel->IsDuringCall())
+       if (!pContentPath->Equals(*pCurrentPlayConent,true) || __pPlayerPresentationModel->IsDuringCall())
        {
-               SetContentInfo(currentContentIndex);
                RemoveOptionMenu();
                RemoveSetAsPicker();
                RemoveSharePicker();
                RemovePlayListPicker();
-               SetFileNotExistState(__pPlayerPresentationModel->IsFileExist(currentContentIndex));
        }
 
+       SetContentInfo(currentContentIndex);
+       SetFileNotExistState(__pPlayerPresentationModel->IsFileExist(currentContentIndex));
+
        if ( __pPlayerPresentationModel->IsDuringCall())
        {
                SetPlayerScreenState(PLAYER_SCREEN_STATE_DURING_CALL);
index be3e3e3..d8b782b 100644 (file)
@@ -620,11 +620,11 @@ PlayerPresentationModel::GetContentInfoN(int contentIndex)
        ContentInformation* pContentInfo = new (std::nothrow) ContentInformation();
        TryReturn(pContentInfo != null, null, "pContentInfo is null.");
 
-       if ( __pCurrentAudioContentInfo != null && contentIndex == __currentContentIndex)
-       {
-               pAudioContentInfo = __pCurrentAudioContentInfo;
-       }
-       else
+//     if ( __pCurrentAudioContentInfo != null && contentIndex == __currentContentIndex)
+//     {
+//             pAudioContentInfo = __pCurrentAudioContentInfo;
+//     }
+//     else
        {
                Tizen::Base::String* contentPath = static_cast<String*>(__pPlayContentList->GetAt(contentIndex));
                if (contentPath == null || File::IsFileExist(*contentPath) == false)
@@ -986,6 +986,7 @@ PlayerPresentationModel::Play(int contentIndex, int sliderPosition, bool bPauseP
                                }
                                if (__pPlayStateTimer != null)
                                {
+                                       __pPlayStateTimer->Cancel();
                                        r = __pPlayStateTimer->Start(PROGRESS_TIMER_DURATION);
                                        TryCatch(r == E_SUCCESS, , "__pPlayStateTimer start failed\n(%s)", GetErrorMessage(r));
                                }
@@ -1302,7 +1303,7 @@ PlayerPresentationModel::StopForwardRewind(void)
                r = __pFastRewindTimer->Cancel();
                TryLog(r == E_SUCCESS, "[%s] __pFastRewindTimer cancel failed", GetErrorMessage(r));
        }
-
+       __pPlayStateTimer->Cancel();
        r = __pPlayStateTimer->Start(PROGRESS_BAR_DURATION_TIMER);
        __xTimesValue = INIT_X_VALUE;
        __seekCompleted = true;
index 9672f52..1781a60 100644 (file)
@@ -166,13 +166,16 @@ PlaylistListPresentationModel::GetPlayListItemContentId(Tizen::Base::String& pla
 {
        AppLogDebug("ENTER");
        PlayList* pPlaylist = PlayListManager::GetInstance()->GetPlayListN(playlist);
+       TryReturn(pPlaylist != null, ContentId(),"No such playlist");
        IList* pSearchList = pPlaylist->GetContentInfoListN();
        if (pSearchList == null)
        {
-               return null;
+               delete pPlaylist;
+               return ContentId();
        }
        ContentInfo* pContentInfo = static_cast<ContentInfo*>(pSearchList->GetAt(0));
        AudioContentInfo* pAudioContentInfo = static_cast<AudioContentInfo*>(pContentInfo);
+
        if (pAudioContentInfo == null)
        {
                pSearchList->RemoveAll(true);
@@ -181,6 +184,7 @@ PlaylistListPresentationModel::GetPlayListItemContentId(Tizen::Base::String& pla
                SetLastResult(E_FAILURE);
                return ContentId();
        }
+
        ContentId contentId = pAudioContentInfo->GetContentId();
        pSearchList->RemoveAll(true);
        delete pSearchList;
index a52628a..7f556eb 100644 (file)
@@ -278,4 +278,4 @@ const int MIN_PLAY_STATE_SLIDER_COUNT = 0;
 
 //timer values
 const int COUNT_MESSAGE_BOX_TIMEOUT = 3000;
-const int MESSAGE_BOX_DELAY = 50;
+const int MESSAGE_BOX_DELAY = 20;