-Flora License
+Flora License
Version 1.0, April, 2013
class MainFrame
: public Tizen::Ui::Controls::Frame
-// , public Tizen::Ui::Controls::IFrameEventListener
+ , public Tizen::Ui::Controls::IFrameEventListener
{
public:
MainFrame(void);
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
// 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());
// }
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");
result r = SceneRegister::RegisterAllScenes();
TryReturn(r == E_SUCCESS, r, "[%s] Scene registering Failed.", GetErrorMessage(r));
-// AddFrameEventListener(*this);
-
+ AddFrameEventListener(*this);
AppLogDebug("EXIT");
return r;
}
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)
{
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);
// 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
// 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
{
AppLogDebug("ENTER");
AppLogDebug("EXIT");
- return new MusicPlayerApp();
+ return new (std::nothrow) MusicPlayerApp();
}
bool
}
}
__pDataList->Add(pContentPathArrayList);
- __pDataList->Add(*(new Integer(0)));
+ __pDataList->Add(*(new (std::nothrow) Integer(0)));
}
*/
AppLogDebug("EXIT");
UpdateSplitBarState();
TogglePlayPauseImage(PLAYER_STATE_CLOSED);
+ SetRepeatButtonImage(__pPlayerPresentationModel->GetRepeatState());
AppLogDebug("EXIT");
return ThumbnailBase::Construct();
if (__pPlayerPresentationModel != null)
{
__pPlayerPresentationModel->RemoveMusicPlayerEventListener(*this);
-// if (!__pPlayerPresentationModel->GetPlayerState() == PLAYER_STATE_PLAYING)
- {
- __pPlayerPresentationModel->DestroyPlayerPresentationModel();
- }
+ __pPlayerPresentationModel->DestroyPlayerPresentationModel();
}
SettingPresentationModel::GetInstance()->DestroySettingPresentationModel();
AppLogDebug("EXIT");
UiApp* pApp = UiApp::GetInstance();
pApp->Terminate();
}
+ __isRunByAppControl = false;
}
break;
}
else
{
+ if (__pVolumePanel->GetShowState() == false)
+ {
+ __pVolumePanel->SetShowState(true);
+ }
__pPlayerPresentationModel->SetVolume(value);
}
AppLogDebug("EXIT");
__pMoreContextButton->SetEnabled(isFileExist);
__pMoreContextButton->Invalidate(true);
- if (__isRunByAppControl == false)
+ if (__isRunByAppControl == false && GetPlayerScreenState() != PLAYER_SCREEN_STATE_DURING_CALL)
{
__pContentsViewToggleButton->SetEnabled(isFileExist);
__pContentsViewToggleButton->Invalidate(true);
{
__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;
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));
if (GetPlayerState() == PLAYER_STATE_PAUSED)
{
__lastPosition = 0;
+ __seekCompleted = false;
__pPlayer->SeekTo(MIN_SLIDER_COUNT);
InitializeProgress();
}
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;
if (GetPlayerState() == PLAYER_STATE_PAUSED)
{
__lastPosition = 0;
+ __seekCompleted = false;
__pPlayer->SeekTo(MIN_SLIDER_COUNT);
InitializeProgress();
}
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");