Fixed jira issue and modified No songs popup time and add Album Art related to except...
authorMyunkyu <mk70.kang@partner.samsung.com>
Thu, 18 Apr 2013 08:43:37 +0000 (17:43 +0900)
committerMyunkyu <mk70.kang@partner.samsung.com>
Thu, 18 Apr 2013 11:26:10 +0000 (20:26 +0900)
Change-Id: I3d29c0ba3a7de36ea05600f4472a848bf492a242

13 files changed:
inc/MpContentLibaryPanel.h
inc/MpNotificationTicker.h [new file with mode: 0644]
src/MpAlbumListPanel.cpp
src/MpAllListPanel.cpp
src/MpArtistListPanel.cpp
src/MpContentEditPanel.cpp
src/MpContentListPanel.cpp
src/MpFolderListPanel.cpp
src/MpMusicPlayerForm.cpp
src/MpNotificationTicker.cpp [new file with mode: 0644]
src/MpPlaylistContentListForm.cpp
src/MpPlaylistListPanel.cpp
src/MpPlaylistListPresentationModel.cpp

index 0db13ad..67b946a 100644 (file)
@@ -26,6 +26,7 @@
 \r
 class PlayListPickerPopup;\r
 class SharePopup;\r
+class NotificationTicker;\r
 \r
 class ContentLibaryPanel\r
        : public ContentPanel\r
@@ -61,6 +62,9 @@ protected:
        result TryRemoveContextMenu(int actionId);\r
        void RemoveContextMenu(void);\r
 \r
+       result ShowNotificationTicker(Tizen::Base::String text, Tizen::Graphics::Point point, int TickerWidth);\r
+       void RemoveNotificationTicker(void);\r
+\r
        Tizen::Ui::OrientationStatus GetCurrentOrientationMode(void);\r
        void UpdateContentLibaryScreenState(void);\r
 \r
@@ -82,6 +86,7 @@ private:
 \r
        PlayListPickerPopup* __pPlayListPicker;\r
        SharePopup* __pSharePicker;\r
+       NotificationTicker* __pNotificationTicker;\r
 };\r
 \r
 #endif // _MP_CONTENT_LIBARY_PANEL_H_
\ No newline at end of file
diff --git a/inc/MpNotificationTicker.h b/inc/MpNotificationTicker.h
new file mode 100644 (file)
index 0000000..a63d309
--- /dev/null
@@ -0,0 +1,62 @@
+//\r
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
+//\r
+// Licensed under the Flora License, Version 1.0 (the License);\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//     http://floralicense.org/license/\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an AS IS BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+\r
+/**\r
+ * @file               MpNotificationTicker.h\r
+ * @brief              This is the header file for NotificationTicker class.\r
+ */\r
+\r
+#ifndef _MP_NOTIFICATION_TICKER_H_\r
+#define _MP_NOTIFICATION_TICKER_H_\r
+\r
+#include <FBase.h>\r
+#include <FGraphics.h>\r
+#include <FUi.h>\r
+#include <FUiAnimations.h>\r
+\r
+class NotificationTicker\r
+       : public Tizen::Base::Runtime::ITimerEventListener\r
+       , protected Tizen::Ui::Window\r
+{\r
+public:\r
+       NotificationTicker(void);\r
+       virtual ~NotificationTicker(void);\r
+\r
+       result Construct(void);\r
+\r
+       void SetBoundTicker(Tizen::Graphics::Point point = Tizen::Graphics::Point(0, 0), int width = 720);\r
+       void ShowTicker(const Tizen::Base::String& text, int timeOut = 2000);\r
+       result DestoryTicker(void);\r
+\r
+protected:\r
+       void PlayControlAnimator(bool isShow);\r
+\r
+       virtual result OnInitializing(void);\r
+       virtual result OnTerminating(void);\r
+\r
+       virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);\r
+\r
+private:\r
+       Tizen::Ui::Controls::Panel* __pNotificationTickerPanel;\r
+       Tizen::Ui::Controls::Label* __pTickerTextLabel;\r
+       Tizen::Base::Runtime::Timer* __pTickerTimeOutTimer;\r
+       Tizen::Ui::Animations::VisualElement* __pVisualElement;\r
+\r
+       int __timeOut;\r
+       bool __isDestory;\r
+};\r
+\r
+#endif //_MP_NOTIFICATION_TICKER_H_
\ No newline at end of file
index c984b4f..37c807a 100644 (file)
@@ -119,7 +119,7 @@ AlbumListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId
                        if (__pPresentationModel->GetAllAlbumCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
index e0d217d..c277244 100644 (file)
@@ -344,7 +344,7 @@ AllListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        if (__pPresentationModel->GetTotalCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
index d4e95b6..fb36e2b 100644 (file)
@@ -126,7 +126,7 @@ ArtistListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionI
                        if (__pPresentationModel->GetArtistListCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
index ef65110..b8ecef6 100644 (file)
@@ -225,14 +225,7 @@ ContentEditPanel::SetCheckedCountBallonTooltip(unsigned int checkedItemCount)
        }\r
 \r
        __pBallonTooltip->SetText(CommonUtil::GetStringItemSelected(checkedItemCount));\r
-       if (__pBallonTooltip->GetShowState() == false)\r
-       {\r
-               SetShowStateBalloonTooltip(true);\r
-       }\r
-       else\r
-       {\r
-               __pBallonTooltip->Invalidate(true);\r
-       }\r
+       SetShowStateBalloonTooltip(true);\r
        AppLogDebug("EXIT");\r
 }\r
 \r
index 4d66670..8526965 100644 (file)
@@ -23,6 +23,7 @@
 #include "MpCommonUtil.h"\r
 #include "MpContentLibaryPanel.h"\r
 #include "MpMiniPlayer.h"\r
+#include "MpNotificationTicker.h"\r
 #include "MpPlaylistPickerPopup.h"\r
 #include "MpSceneRegister.h"\r
 #include "MpSharePopup.h"\r
@@ -43,6 +44,7 @@ ContentLibaryPanel::ContentLibaryPanel(void)
        , __pContextMenu(null)\r
        , __pPlayListPicker(null)\r
        , __pSharePicker(null)\r
+       , __pNotificationTicker(null)\r
 {\r
        AppLogDebug("ENTER");\r
        AppLogDebug("EXIT");\r
@@ -75,6 +77,7 @@ ContentLibaryPanel::OnTerminating(void)
        RemovePlayListPicker();\r
        RemoveSharePicker();\r
        RemoveContextMenu();\r
+       RemoveNotificationTicker();\r
        AppLogDebug("EXIT");\r
        return ContentPanel::OnTerminating();\r
 }\r
@@ -479,4 +482,38 @@ ContentLibaryPanel::RemovePlayListPicker(void)
                __pPlayListPicker = null;\r
        }\r
        AppLogDebug("EXIT");\r
+}\r
+\r
+result\r
+ContentLibaryPanel::ShowNotificationTicker(Tizen::Base::String text, Tizen::Graphics::Point point, int TickerWidth)\r
+{\r
+       AppLogDebug("ENTER");\r
+       if (__pNotificationTicker == null)\r
+       {\r
+               __pNotificationTicker =  new (std::nothrow) NotificationTicker();\r
+               result r = __pNotificationTicker->Construct();\r
+               if (IsFailed(r))\r
+               {\r
+                       __pNotificationTicker->DestoryTicker();\r
+                       __pNotificationTicker = null;\r
+                       return E_FAILURE;\r
+               }\r
+       }\r
+\r
+       __pNotificationTicker->SetBoundTicker(point, TickerWidth);\r
+       __pNotificationTicker->ShowTicker(text);\r
+       AppLogDebug("EXIT");\r
+       return E_SUCCESS;\r
+}\r
+\r
+void\r
+ContentLibaryPanel::RemoveNotificationTicker(void)\r
+{\r
+       AppLogDebug("ENTER");\r
+       if (__pNotificationTicker != null)\r
+       {\r
+               __pNotificationTicker->DestoryTicker();\r
+               __pNotificationTicker = null;\r
+       }\r
+       AppLogDebug("EXIT");\r
 }
\ No newline at end of file
index 52b80e4..de86cfe 100644 (file)
@@ -118,7 +118,7 @@ FolderListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionI
                        if (__pPresentationModel->GetAllFolderCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
index 016357b..f5c7973 100644 (file)
@@ -1469,12 +1469,20 @@ PlayerForm::UpdateAnimationAlbumArt(AlbumArtImage position)
        case ALBUM_ART_IMAGE_CURRENT:
                {
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_CURRENT] = __pPlayerPresentationModel->GetContentAlbumArtN(__pPlayerPresentationModel->GetCurrentContentIndex());
+                       if (pAlbumArtBitmap[ALBUM_ART_IMAGE_CURRENT] != null)
+                       {
+                               pAlbumArtBitmap[ALBUM_ART_IMAGE_CURRENT]->Scale(floatDimension);
+                       }
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS] = __pPlayerPresentationModel->GetContentAlbumArtN(__pPlayerPresentationModel->GetPreviousContentIndex());
+                       if (pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS] != null)
+                       {
+                               pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS]->Scale(floatDimension);
+                       }
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT] = __pPlayerPresentationModel->GetContentAlbumArtN(__pPlayerPresentationModel->GetNextContentIndex());
-
-                       pAlbumArtBitmap[ALBUM_ART_IMAGE_CURRENT]->Scale(floatDimension);
-                       pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS]->Scale(floatDimension);
-                       pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT]->Scale(floatDimension);
+                       if (pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT] != null)
+                       {
+                               pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT]->Scale(floatDimension);
+                       }
                }
                break;
 
@@ -1482,9 +1490,11 @@ PlayerForm::UpdateAnimationAlbumArt(AlbumArtImage position)
                {
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_CURRENT] = null;
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS] = __pPlayerPresentationModel->GetContentAlbumArtN(__pPlayerPresentationModel->GetPreviousContentIndex());
+                       if (pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS] != null)
+                       {
+                               pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS]->Scale(floatDimension);
+                       }
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT] = null;
-
-                       pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS]->Scale(floatDimension);
                }
                break;
 
@@ -1493,8 +1503,10 @@ PlayerForm::UpdateAnimationAlbumArt(AlbumArtImage position)
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_CURRENT] = null;
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_PREVIOUS] = null;
                        pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT] = __pPlayerPresentationModel->GetContentAlbumArtN(__pPlayerPresentationModel->GetNextContentIndex());
-
-                       pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT]->Scale(floatDimension);
+                       if (pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT] != null)
+                       {
+                               pAlbumArtBitmap[ALBUM_ART_IMAGE_NEXT]->Scale(floatDimension);
+                       }
                }
                break;
 
diff --git a/src/MpNotificationTicker.cpp b/src/MpNotificationTicker.cpp
new file mode 100644 (file)
index 0000000..62da726
--- /dev/null
@@ -0,0 +1,189 @@
+//\r
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
+//\r
+// Licensed under the Flora License, Version 1.0 (the License);\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//     http://floralicense.org/license/\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an AS IS BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+\r
+/**\r
+ * @file               MpNotificationTicker.cpp\r
+ * @brief              This is the implementation file for NotificationTicker class.\r
+ */\r
+\r
+#include "MpCommonUtil.h"\r
+#include "MpNotificationTicker.h"\r
+\r
+using namespace Tizen::Base;\r
+using namespace Tizen::Base::Runtime;\r
+using namespace Tizen::Graphics;\r
+using namespace Tizen::Ui;\r
+using namespace Tizen::Ui::Animations;\r
+using namespace Tizen::Ui::Controls;\r
+\r
+NotificationTicker::NotificationTicker(void)\r
+       : __pNotificationTickerPanel(null)\r
+       , __pTickerTextLabel(null)\r
+       , __pTickerTimeOutTimer(null)\r
+       , __timeOut(0)\r
+       , __isDestory(false)\r
+{\r
+       AppLogDebug("ENTER");\r
+       AppLogDebug("EXIT");\r
+}\r
+\r
+NotificationTicker::~NotificationTicker(void)\r
+{\r
+       AppLogDebug("ENTER");\r
+       if (__pTickerTimeOutTimer != null)\r
+       {\r
+               __pTickerTimeOutTimer->Cancel();\r
+               delete __pTickerTimeOutTimer;\r
+               __pTickerTimeOutTimer = null;\r
+       }\r
+\r
+       if (__pNotificationTickerPanel != null)\r
+       {\r
+               RemoveControl(__pNotificationTickerPanel);\r
+               __pNotificationTickerPanel = null;\r
+\r
+               __pTickerTextLabel = null;\r
+       }\r
+       AppLogDebug("EXIT");\r
+}\r
+\r
+result\r
+NotificationTicker::Construct(void)\r
+{\r
+       AppLogDebug("ENTER");\r
+       RelativeLayout layout;\r
+       layout.Construct();\r
+\r
+       __pNotificationTickerPanel = new (std::nothrow) Panel();\r
+       result r = __pNotificationTickerPanel->Construct(L"IDL_NOTIFICATION_TICKER_PANEL");\r
+       TryCatch(r == E_SUCCESS, , "Construct failed(%s)", GetErrorMessage(r));\r
+\r
+       r = Window::Construct(layout, __pNotificationTickerPanel->GetBounds());\r
+       TryCatch(r == E_SUCCESS, , "Construct failed(%s)", GetErrorMessage(r));\r
+\r
+       __pTickerTextLabel = static_cast<Label*>(__pNotificationTickerPanel->GetControl(L"IDC_LABEL_NOTIFICATION_TEXT"));\r
+       __pTickerTimeOutTimer = new (std::nothrow) Timer();\r
+       r = __pTickerTimeOutTimer->Construct(*this);\r
+       TryCatch(r == E_SUCCESS, , "Construct failed(%s)", GetErrorMessage(r));\r
+\r
+       AddControl(__pNotificationTickerPanel);\r
+       CommonUtil::SetLayoutFitToContainer(*this, *__pNotificationTickerPanel);\r
+\r
+       SetShowState(false);\r
+\r
+       AppLogDebug("EXIT");\r
+       return r;\r
+\r
+CATCH:\r
+       delete __pNotificationTickerPanel;\r
+       __pNotificationTickerPanel = null;\r
+\r
+       delete __pTickerTimeOutTimer;\r
+       __pTickerTimeOutTimer = null;\r
+\r
+       AppLogDebug("EXIT(%s)", GetErrorMessage(r));\r
+       return r;\r
+}\r
+\r
+void\r
+NotificationTicker::SetBoundTicker(Tizen::Graphics::Point point, int width)\r
+{\r
+       AppLogDebug("ENTER");\r
+       SetPosition(point);\r
+       SetSize(width, GetHeight());\r
+       AppLogDebug("EXIT");\r
+}\r
+\r
+void\r
+NotificationTicker::ShowTicker(const Tizen::Base::String& text, int timeOut)\r
+{\r
+       AppLogDebug("ENTER");\r
+       __pTickerTextLabel->SetText(text);\r
+       __timeOut = timeOut;\r
+       if (GetShowState() == false)\r
+       {\r
+//             SetShowState(true);\r
+               PlayControlAnimator(true);\r
+       }\r
+       Show();\r
+       AppLogDebug("EXIT");\r
+}\r
+\r
+result\r
+NotificationTicker::DestoryTicker(void)\r
+{\r
+       AppLogDebug("ENTER");\r
+       __isDestory= true;\r
+       AppLogDebug("EXIT");\r
+       return Destroy();\r
+}\r
+\r
+void\r
+NotificationTicker::PlayControlAnimator(bool isShow)\r
+{\r
+       AppLogDebug("ENTER");\r
+       AnimationTransaction::Begin();\r
+       GetControlAnimator()->SetShowState(isShow);\r
+       AnimationTransaction::Commit();\r
+       AppLogDebug("EXIT");\r
+}\r
+\r
+result\r
+NotificationTicker::OnInitializing(void)\r
+{\r
+       AppLogDebug("ENTER");\r
+       if (__pTickerTimeOutTimer != null)\r
+       {\r
+               __pTickerTimeOutTimer->Cancel();\r
+               __pTickerTimeOutTimer->Start(__timeOut);\r
+       }\r
+       AppLogDebug("EXIT");\r
+       return E_SUCCESS;\r
+}\r
+\r
+result\r
+NotificationTicker::OnTerminating(void)\r
+{\r
+       AppLogDebug("ENTER");\r
+       __timeOut = 0;\r
+       if (__pTickerTimeOutTimer != null)\r
+       {\r
+               __pTickerTimeOutTimer->Cancel();\r
+       }\r
+\r
+       if (__isDestory == true)\r
+       {\r
+               RemoveControl(__pNotificationTickerPanel);\r
+\r
+               __pNotificationTickerPanel = null;\r
+               __pTickerTextLabel = null;\r
+\r
+               delete __pTickerTimeOutTimer;\r
+               __pTickerTimeOutTimer = null;\r
+       }\r
+\r
+       AppLogDebug("EXIT");\r
+       return E_SUCCESS;\r
+}\r
+\r
+void\r
+NotificationTicker::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)\r
+{\r
+       AppLogDebug("ENTER");\r
+//     SetShowState(false);\r
+       PlayControlAnimator(false);\r
+       AppLogDebug("EXIT");\r
+}
\ No newline at end of file
index 244b505..b4371c9 100644 (file)
@@ -138,7 +138,7 @@ PlaylistContentListForm::OnActionPerformed(const Tizen::Ui::Control& source, int
                        if (__pPresentationModel->GetContentCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
@@ -155,7 +155,7 @@ PlaylistContentListForm::OnActionPerformed(const Tizen::Ui::Control& source, int
                        if (__pPresentationModel->GetContentCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
index f478ec0..cd16e18 100644 (file)
@@ -161,7 +161,7 @@ PlaylistListPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                        if (__pPlaylistListPresentationModel->GetAllPlayListCount() == 0)
                        {
                                MessageBox messageBox;
-                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_BODY_NO_PLAYLISTS"), MSGBOX_STYLE_NONE, 500);
+                               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_BODY_NO_PLAYLISTS"), MSGBOX_STYLE_NONE, 3000);
 
                                int modalResult = 0;
                                messageBox.ShowAndWait(modalResult);
index 9e0f83a..33ac853 100644 (file)
@@ -475,9 +475,12 @@ PlaylistListPresentationModel::UpdatePlaylistContentList(const int contentType,
        else if (contentType == USER_CONTENT)
        {
                PlayList* pPlaylist = PlayListManager::GetInstance()->GetPlayListN(*__pQueryName);
-               __pContentList = pPlaylist->GetContentInfoListN();
-               delete pPlaylist;
-               pPlaylist = null;
+               if (pPlaylist != null)
+               {
+                       __pContentList = pPlaylist->GetContentInfoListN();
+                       delete pPlaylist;
+                       pPlaylist = null;
+               }
        }
        AppLogDebug("EXIT");
 }