-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
/**
* @file VpVideoPlayerForm.cpp
- * @brief This is the implementation file for VideoPlayerMainForm class.
+ * @brief This is the implementation file for VideoPlayerForm class.
*/
#include <FSystem.h>
static const int Y_BASE = 0;
static const int DIVIDE_BY_TWO = 2;
-static const int MARGIN_PORTRAIT_SLIDER = 42;
-static const int MARGIN_LANDSCAPE_SLIDER = 40;
-
static const int X_NORMAL = 0;
static const int Y_NORMAL = 310;
static const int W_NORMAL = 720;
static const int H_NORMAL = 432;
-static const int WVGA_W_FULL = 1200;
-static const int WVGA_X_FASTREWIND_BTN = 216;
-static const int WVGA_X_PLAYPAUSE_BTN = 532;
-static const int WVGA_X_BACK_BTN = 1049;
-static const int WVGA_X_CURRENT_TIME_LABEL = 10;
-static const int WVGA_X_TOTAL_TIME_LABEL = 1068;
-static const int WVGA_X_SLIDER = 124;
-static const int WVGA_X_VERTICAL_LEFT_LINE = 182;
-static const int WVGA_X_VERTICAL_RIGHT_LINE = 1036;
+static const int W_WVGA_PORTRAIT_HEIGHT = 1200;
+static const int W_WVGA_LANDSCAPE_WIDTH = 1200;
+
+static const int X_WVGA_PORTRAIT_CONTROLLER = 0;
+static const int Y_WVGA_PORTRAIT_CONTROLLER = 974;
+static const int W_WVGA_PORTRAIT_CONTROLLER = 720;
+static const int H_WVGA_PORTRAIT_CONTROLLER = 226;
+static const int X_WVGA_PORTRAIT_FIRST_LINE = 0;
+static const int Y_WVGA_PORTRAIT_FIRST_LINE = 973;
+static const int W_WVGA_PORTRAIT_FIRST_LINE = 720;
+static const int H_WVGA_PORTRAIT_FIRST_LINE = 1;
+static const int X_WVGA_PORTRAIT_CURRENT_TIME = 10;
+static const int Y_WVGA_PORTRAIT_CURRENT_TIME = 1016;
+static const int W_WVGA_PORTRAIT_CURRENT_TIME = 130;
+static const int H_WVGA_PORTRAIT_CURRENT_TIME = 28;
+static const int X_WVGA_PORTRAIT_SLIDER = 136;
+static const int Y_WVGA_PORTRAIT_SLIDER = 974;
+static const int W_WVGA_PORTRAIT_SLIDER = 460;
+static const int H_WVGA_PORTRAIT_SLIDER = 112;
+static const int X_WVGA_PORTRAIT_TOTAL_TIME = 580;
+static const int Y_WVGA_PORTRAIT_TOTAL_TIME = 1016;
+static const int W_WVGA_PORTRAIT_TOTAL_TIME = 130;
+static const int H_WVGA_PORTRAIT_TOTAL_TIME = 28;
+static const int X_WVGA_PORTRAIT_VERTICAL_LEFT_LINE = 136;
+static const int Y_WVGA_PORTRAIT_VERTICAL_LEFT_LINE = 1086;
+static const int W_WVGA_PORTRAIT_VERTICAL_LEFT_LINE = 1;
+static const int H_WVGA_PORTRAIT_VERTICAL_LEFT_LINE = 114;
+static const int X_WVGA_PORTRAIT_FASTREWIND_BTN = 148;
+static const int Y_WVGA_PORTRAIT_FASTREWIND_BTN = 1086;
+static const int W_WVGA_PORTRAIT_FASTREWIND_BTN = 136;
+static const int H_WVGA_PORTRAIT_FASTREWIND_BTN = 114;
+static const int X_WVGA_PORTRAIT_PLAYPAUSE_BTN = 292;
+static const int Y_WVGA_PORTRAIT_PLAYPAUSE_BTN = 1086;
+static const int W_WVGA_PORTRAIT_PLAYPAUSE_BTN = 136;
+static const int H_WVGA_PORTRAIT_PLAYPAUSE_BTN = 114;
+static const int X_WVGA_PORTRAIT_FASTFORWARD_BTN = 436;
+static const int Y_WVGA_PORTRAIT_FASTFORWARD_BTN = 1086;
+static const int W_WVGA_PORTRAIT_FASTFORWARD_BTN = 136;
+static const int H_WVGA_PORTRAIT_FASTFORWARD_BTN = 114;
+static const int X_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 584;
+static const int Y_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 1086;
+static const int W_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 1;
+static const int H_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 114;
+static const int X_WVGA_PORTRAIT_BACK_BTN = 584;
+static const int Y_WVGA_PORTRAIT_BACK_BTN = 1086;
+static const int W_WVGA_PORTRAIT_BACK_BTN = 136;
+static const int H_WVGA_PORTRAIT_BACK_BTN = 114;
+
+static const int X_WVGA_LANDSCAPE_CONTROLLER = 0;
+static const int Y_WVGA_LANDSCAPE_CONTROLLER = 494;
+static const int W_WVGA_LANDSCAPE_CONTROLLER = 1200;
+static const int H_WVGA_LANDSCAPE_CONTROLLER = 226;
+static const int X_WVGA_LANDSCAPE_FIRST_LINE = 0;
+static const int Y_WVGA_LANDSCAPE_FIRST_LINE = 493;
+static const int W_WVGA_LANDSCAPE_FIRST_LINE = 1200;
+static const int H_WVGA_LANDSCAPE_FIRST_LINE = 1;
+static const int X_WVGA_LANDSCAPE_CURRENT_TIME = 20;
+static const int Y_WVGA_LANDSCAPE_CURRENT_TIME = 537;
+static const int W_WVGA_LANDSCAPE_CURRENT_TIME = 130;
+static const int H_WVGA_LANDSCAPE_CURRENT_TIME = 26;
+static const int X_WVGA_LANDSCAPE_SLIDER = 140;
+static const int Y_WVGA_LANDSCAPE_SLIDER = 494;
+static const int W_WVGA_LANDSCAPE_SLIDER = 940;
+static const int H_WVGA_LANDSCAPE_SLIDER = 112;
+static const int X_WVGA_LANDSCAPE_TOTAL_TIME = 1060;
+static const int Y_WVGA_LANDSCAPE_TOTAL_TIME = 537;
+static const int W_WVGA_LANDSCAPE_TOTAL_TIME = 130;
+static const int H_WVGA_LANDSCAPE_TOTAL_TIME = 26;
+static const int X_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 212;
+static const int Y_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 606;
+static const int W_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 2;
+static const int H_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 114;
+static const int X_WVGA_LANDSCAPE_FASTREWIND_BTN = 236;
+static const int Y_WVGA_LANDSCAPE_FASTREWIND_BTN = 606;
+static const int W_WVGA_LANDSCAPE_FASTREWIND_BTN = 136;
+static const int H_WVGA_LANDSCAPE_FASTREWIND_BTN = 114;
+static const int X_WVGA_LANDSCAPE_PLAYPAUSE_BTN = 552;
+static const int Y_WVGA_LANDSCAPE_PLAYPAUSE_BTN = 606;
+static const int W_WVGA_LANDSCAPE_PLAYPAUSE_BTN = 136;
+static const int H_WVGA_LANDSCAPE_PLAYPAUSE_BTN = 114;
+static const int X_WVGA_LANDSCAPE_FASTFORWARD_BTN = 858;
+static const int Y_WVGA_LANDSCAPE_FASTFORWARD_BTN = 606;
+static const int W_WVGA_LANDSCAPE_FASTFORWARD_BTN = 136;
+static const int H_WVGA_LANDSCAPE_FASTFORWARD_BTN = 114;
+static const int X_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 1016;
+static const int Y_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 606;
+static const int W_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 2;
+static const int H_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 114;
+static const int X_WVGA_LANDSCAPE_BACK_BTN = 1064;
+static const int Y_WVGA_LANDSCAPE_BACK_BTN = 606;
+static const int W_WVGA_LANDSCAPE_BACK_BTN = 136;
+static const int H_WVGA_LANDSCAPE_BACK_BTN = 114;
+
+static const int X_HVGA_PORTRAIT_CONTROLLER = 0;
+static const int Y_HVGA_PORTRAIT_CONTROLLER = 1054;
+static const int W_HVGA_PORTRAIT_CONTROLLER = 720;
+static const int H_HVGA_PORTRAIT_CONTROLLER = 226;
+static const int X_HVGA_PORTRAIT_FIRST_LINE = 0;
+static const int Y_HVGA_PORTRAIT_FIRST_LINE = 1053;
+static const int W_HVGA_PORTRAIT_FIRST_LINE = 720;
+static const int H_HVGA_PORTRAIT_FIRST_LINE = 1;
+static const int X_HVGA_PORTRAIT_CURRENT_TIME = 10;
+static const int Y_HVGA_PORTRAIT_CURRENT_TIME = 1096;
+static const int W_HVGA_PORTRAIT_CURRENT_TIME = 130;
+static const int H_HVGA_PORTRAIT_CURRENT_TIME = 28;
+static const int X_HVGA_PORTRAIT_SLIDER = 136;
+static const int Y_HVGA_PORTRAIT_SLIDER = 1054;
+static const int W_HVGA_PORTRAIT_SLIDER = 460;
+static const int H_HVGA_PORTRAIT_SLIDER = 112;
+static const int X_HVGA_PORTRAIT_TOTAL_TIME = 580;
+static const int Y_HVGA_PORTRAIT_TOTAL_TIME = 1096;
+static const int W_HVGA_PORTRAIT_TOTAL_TIME = 130;
+static const int H_HVGA_PORTRAIT_TOTAL_TIME = 28;
+static const int X_HVGA_PORTRAIT_VERTICAL_LEFT_LINE = 136;
+static const int Y_HVGA_PORTRAIT_VERTICAL_LEFT_LINE = 1166;
+static const int W_HVGA_PORTRAIT_VERTICAL_LEFT_LINE = 1;
+static const int H_HVGA_PORTRAIT_VERTICAL_LEFT_LINE = 114;
+static const int X_HVGA_PORTRAIT_FASTREWIND_BTN = 148;
+static const int Y_HVGA_PORTRAIT_FASTREWIND_BTN = 1166;
+static const int W_HVGA_PORTRAIT_FASTREWIND_BTN = 136;
+static const int H_HVGA_PORTRAIT_FASTREWIND_BTN = 114;
+static const int X_HVGA_PORTRAIT_PLAYPAUSE_BTN = 292;
+static const int Y_HVGA_PORTRAIT_PLAYPAUSE_BTN = 1166;
+static const int W_HVGA_PORTRAIT_PLAYPAUSE_BTN = 136;
+static const int H_HVGA_PORTRAIT_PLAYPAUSE_BTN = 114;
+static const int X_HVGA_PORTRAIT_FASTFORWARD_BTN = 436;
+static const int Y_HVGA_PORTRAIT_FASTFORWARD_BTN = 1166;
+static const int W_HVGA_PORTRAIT_FASTFORWARD_BTN = 136;
+static const int H_HVGA_PORTRAIT_FASTFORWARD_BTN = 114;
+static const int X_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 584;
+static const int Y_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 1166;
+static const int W_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 1;
+static const int H_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE = 114;
+static const int X_HVGA_PORTRAIT_BACK_BTN = 584;
+static const int Y_HVGA_PORTRAIT_BACK_BTN = 1166;
+static const int W_HVGA_PORTRAIT_BACK_BTN = 136;
+static const int H_HVGA_PORTRAIT_BACK_BTN = 114;
+
+static const int X_HVGA_LANDSCAPE_CONTROLLER = 0;
+static const int Y_HVGA_LANDSCAPE_CONTROLLER = 494;
+static const int W_HVGA_LANDSCAPE_CONTROLLER = 1280;
+static const int H_HVGA_LANDSCAPE_CONTROLLER = 226;
+static const int X_HVGA_LANDSCAPE_FIRST_LINE = 0;
+static const int Y_HVGA_LANDSCAPE_FIRST_LINE = 493;
+static const int W_HVGA_LANDSCAPE_FIRST_LINE = 1280;
+static const int H_HVGA_LANDSCAPE_FIRST_LINE = 1;
+static const int X_HVGA_LANDSCAPE_CURRENT_TIME = 20;
+static const int Y_HVGA_LANDSCAPE_CURRENT_TIME = 537;
+static const int W_HVGA_LANDSCAPE_CURRENT_TIME = 130;
+static const int H_HVGA_LANDSCAPE_CURRENT_TIME = 26;
+static const int X_HVGA_LANDSCAPE_SLIDER = 160;
+static const int Y_HVGA_LANDSCAPE_SLIDER = 494;
+static const int W_HVGA_LANDSCAPE_SLIDER = 960;
+static const int H_HVGA_LANDSCAPE_SLIDER = 112;
+static const int X_HVGA_LANDSCAPE_TOTAL_TIME = 1130;
+static const int Y_HVGA_LANDSCAPE_TOTAL_TIME = 537;
+static const int W_HVGA_LANDSCAPE_TOTAL_TIME = 130;
+static const int H_HVGA_LANDSCAPE_TOTAL_TIME = 26;
+static const int X_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 212;
+static const int Y_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 606;
+static const int W_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 2;
+static const int H_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE = 114;
+static const int X_HVGA_LANDSCAPE_FASTREWIND_BTN = 286;
+static const int Y_HVGA_LANDSCAPE_FASTREWIND_BTN = 606;
+static const int W_HVGA_LANDSCAPE_FASTREWIND_BTN = 136;
+static const int H_HVGA_LANDSCAPE_FASTREWIND_BTN = 114;
+static const int X_HVGA_LANDSCAPE_PLAYPAUSE_BTN = 572;
+static const int Y_HVGA_LANDSCAPE_PLAYPAUSE_BTN = 606;
+static const int W_HVGA_LANDSCAPE_PLAYPAUSE_BTN = 136;
+static const int H_HVGA_LANDSCAPE_PLAYPAUSE_BTN = 114;
+static const int X_HVGA_LANDSCAPE_FASTFORWARD_BTN = 858;
+static const int Y_HVGA_LANDSCAPE_FASTFORWARD_BTN = 606;
+static const int W_HVGA_LANDSCAPE_FASTFORWARD_BTN = 136;
+static const int H_HVGA_LANDSCAPE_FASTFORWARD_BTN = 114;
+static const int X_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 1066;
+static const int Y_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 606;
+static const int W_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 2;
+static const int H_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE = 114;
+static const int X_HVGA_LANDSCAPE_BACK_BTN = 1144;
+static const int Y_HVGA_LANDSCAPE_BACK_BTN = 606;
+static const int W_HVGA_LANDSCAPE_BACK_BTN = 136;
+static const int H_HVGA_LANDSCAPE_BACK_BTN = 114;
static const int COLOR_THUMB_RED = 0;
static const int COLOR_THUMB_GREEN = 0;
}
VideoPlayerForm::VideoPlayerForm(void)
- : __pOverlayRegion(null)
+ : __pOverlayPanel(null)
, __screenMode(SCREEN_MODE_NORMAL)
, __pSoundPathPopup(null)
, __pUiControlTimer(null)
}
result
-VideoPlayerForm::SetScreenMode(const ScreenMode mode)
+VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
{
result r = E_SUCCESS;
Rectangle clientRect = GetClientAreaBounds();
- delete __pOverlayRegion;
- __pOverlayRegion = null;
-
switch (mode)
{
case SCREEN_MODE_NORMAL:
rect.y = (clientRect.height - rect.height) / DIVIDE_BY_TWO;
}
- __pOverlayRegion->EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, rect, modified);
+ if (destroyOverlay == true)
+ {
+ if (__pOverlayPanel != null)
+ {
+ __pOverlayPanel->RemoveTouchEventListener(*this);
+ RemoveControl(*__pOverlayPanel);
+ __pOverlayPanel = null;
+ }
+
+ __pOverlayPanel = new (std::nothrow) OverlayPanel();
+ r = __pOverlayPanel->Construct(rect);
+ TryCatch(r == E_SUCCESS, , "__pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
- AppLogDebug("SetScreenMode [%d] [%d]", rect.height, rect.width);
+ r = AddControl(*__pOverlayPanel);
+ TryCatch(r == E_SUCCESS, , "AddControl(*__pOverlayPanel) failed:%s", GetErrorMessage(r));
- __pOverlayRegion = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_NORMAL);
- TryCatch(__pOverlayRegion != null, r = E_SYSTEM, "__pOverlayRegion is null");
+ __pOverlayPanel->AddTouchEventListener(*this);
+ }
+ else
+ {
+ __pOverlayPanel->SetBounds(rect);
+ }
+
+ OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, rect, modified);
+ AppLogDebug("SCREEN_MODE_NORMAL : [%d][%d][%d][%d]", rect.x, rect.y, rect.width, rect.height);
+
+ SetControlAlwaysAtBottom(*__pOverlayPanel, true);
__screenMode = SCREEN_MODE_NORMAL;
}
bool modified = false;
Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
+ AppLogDebug("SetScreenMode [%d] [%d]", rect.height, rect.width);
- __pOverlayRegion->EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, rect, modified);
+ if (destroyOverlay == true)
+ {
+ if (__pOverlayPanel != null)
+ {
+ __pOverlayPanel->RemoveTouchEventListener(*this);
+ RemoveControl(*__pOverlayPanel);
+ __pOverlayPanel = null;
+ }
- AppLogDebug("SetScreenMode [%d] [%d]", rect.height, rect.width);
+ __pOverlayPanel = new (std::nothrow) OverlayPanel();
+ r = __pOverlayPanel->Construct(rect);
+ TryCatch(r == E_SUCCESS, , "__pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
+
+ r = AddControl(*__pOverlayPanel);
+ TryCatch(r == E_SUCCESS, , "AddControl(*__pOverlayPanel) failed:%s", GetErrorMessage(r));
- __pOverlayRegion = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_NORMAL);
- TryCatch(__pOverlayRegion != null, r = E_SYSTEM, "__pOverlayRegion is null");
+ __pOverlayPanel->AddTouchEventListener(*this);
+ }
+ else
+ {
+ __pOverlayPanel->SetBounds(rect);
+ }
+
+ OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, rect, modified);
+ AppLogDebug("SCREEN_MODE_FULL : [%d][%d][%d][%d]", rect.x, rect.y, rect.width, rect.height);
+
+ SetControlAlwaysAtBottom(*__pOverlayPanel, true);
__screenMode = SCREEN_MODE_FULL;
}
rect.y = (clientRect.height - rect.height) / DIVIDE_BY_TWO;
}
- __pOverlayRegion->EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, rect, modified);
+ if (destroyOverlay == true)
+ {
+ if (__pOverlayPanel != null)
+ {
+ __pOverlayPanel->RemoveTouchEventListener(*this);
+ RemoveControl(*__pOverlayPanel);
+ __pOverlayPanel = null;
+ }
- AppLogDebug("SetScreenMode [%d] [%d]", rect.height, rect.width);
+ __pOverlayPanel = new (std::nothrow) OverlayPanel();
+ r = __pOverlayPanel->Construct(rect);
+ TryCatch(r == E_SUCCESS, , "__pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
- __pOverlayRegion = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_NORMAL);
- TryCatch(__pOverlayRegion != null, r = E_SYSTEM, "__pOverlayRegion is null");
+ r = AddControl(*__pOverlayPanel);
+ TryCatch(r == E_SUCCESS, , "AddControl(*__pOverlayPanel) failed:%s", GetErrorMessage(r));
+
+ __pOverlayPanel->AddTouchEventListener(*this);
+ }
+ else
+ {
+ __pOverlayPanel->SetBounds(rect);
+ }
+
+ OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, rect, modified);
+ AppLogDebug("SCREEN_MODE_FULL : [%d][%d][%d][%d]", rect.x, rect.y, rect.width, rect.height);
+
+ SetControlAlwaysAtBottom(*__pOverlayPanel, true);
__screenMode = SCREEN_MODE_FIT;
}
return r;
CATCH:
- delete __pOverlayRegion;
- __pOverlayRegion = null;
+ RemoveControl(*__pOverlayPanel);
+ __pOverlayPanel = null;
__screenMode = SCREEN_MODE_NORMAL;
return r;
__pAudioRouteManager = AudioRouteManager::GetInstance();
__pAudioRouteManager->SetAudioRouteEventListener(this);
- SetScreenMode(SCREEN_MODE_NORMAL);
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
__pVideoPlayerPresentationModel = VideoPlayerPresentationModel::GetInstance();
TryCatch(__pVideoPlayerPresentationModel != null, r = E_SYSTEM, "__pVideoPlayerPresentationModel is null");
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->InitializePlayer();
__pVideoPlayerPresentationModel->SetVideoPlayerEventListener(this);
delete __pButtonRightItem;
__pButtonRightItem = null;
- delete __pOverlayRegion;
- __pOverlayRegion = null;
+ RemoveControl(*__pOverlayPanel);
+ __pOverlayPanel = null;
delete __pSoundPathPopup;
__pSoundPathPopup = null;
if (playNextContent == true)
{
- SetScreenMode(SCREEN_MODE_NORMAL);
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->InitializePlayer();
if (__audioRouteMode == AUDIO_ROUTE_SPEAKER_ONLY)
AppLogDebug("OnPlayReleased");
}
-OverlayRegion*
-VideoPlayerForm::GetOverlayRegion(void)
-{
- return __pOverlayRegion;
-}
-
void
VideoPlayerForm::OnActionPerformed(const Control& source, int actionId)
{
String currentTime;
String totalTime;
-
+ Rectangle rect;
Bitmap* pBitmapScreenMode = null;
PlayerState playState = PLAYER_STATE_ERROR;
playState = __pVideoPlayerPresentationModel->GetState();
Rectangle clientRect = GetClientAreaBounds();
- Rectangle rect = __pVideoPlayerPresentationModel->GetVideoInfoN(
- __pVideoPlayerPresentationModel->GetMediaPathName());
switch (actionId)
{
{
if (__pVideoPlayerPresentationModel->GetCurrentMediaIndex() != __pVideoPlayerPresentationModel->GetPreviousMediaIndex())
{
- SetScreenMode(SCREEN_MODE_NORMAL);
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
}
__pVideoPlayerPresentationModel->InitializePlayer();
}
__pSlider->SetEnabled(true);
+ rect = __pVideoPlayerPresentationModel->GetVideoInfoN(
+ __pVideoPlayerPresentationModel->GetMediaPathName());
+
if (__audioRouteMode == AUDIO_ROUTE_SPEAKER_ONLY)
{
if (rect.width > W_NORMAL || rect.height > W_NORMAL)
case IDA_BUTTON_FULLSCREEN:
{
- if (playState != PLAYER_STATE_PLAYING)
- {
- return;
- }
-
if (playState == PLAYER_STATE_PLAYING)
{
__pUiControlTimer->Cancel();
__pUiControlTimer->Start(SHOW_CONTROL_DURATION);
}
+ else
+ {
+ return;
+ }
+
+ rect = __pVideoPlayerPresentationModel->GetVideoInfoN(
+ __pVideoPlayerPresentationModel->GetMediaPathName());
switch (__screenMode)
{
case SCREEN_MODE_FIT:
{
- r = SetScreenMode(SCREEN_MODE_FULL);
+ r = SetScreenMode(SCREEN_MODE_FULL, true);
TryCatch(r == E_SUCCESS, , "SetScreenMode() failed:%s", GetErrorMessage(r));
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->SetRenderingBuffer();
pBitmapScreenMode = pAppResource->GetBitmapN(L"T01_icon_title_screenmode02.png");
{
if (rect.width > W_NORMAL || rect.height > W_NORMAL)
{
- r = SetScreenMode(SCREEN_MODE_NORMAL);
+ r = SetScreenMode(SCREEN_MODE_NORMAL, true);
TryCatch(r == E_SUCCESS, , "SetScreenMode() failed:%s", GetErrorMessage(r));
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->SetRenderingBuffer();
pBitmapScreenMode = pAppResource->GetBitmapN(L"T01_icon_title_screenmode03.png");
}
else
{
- r = SetScreenMode(SCREEN_MODE_NORMAL);
+ r = SetScreenMode(SCREEN_MODE_NORMAL, true);
TryCatch(r == E_SUCCESS, , "SetScreenMode() failed:%s", GetErrorMessage(r));
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->SetRenderingBuffer();
pBitmapScreenMode = pAppResource->GetBitmapN(L"T01_icon_title_screenmode01.png");
{
if (rect.width > W_NORMAL || rect.height > W_NORMAL)
{
- r = SetScreenMode(SCREEN_MODE_FULL);
+ r = SetScreenMode(SCREEN_MODE_FULL, true);
TryCatch(r == E_SUCCESS, , "SetScreenMode() failed:%s", GetErrorMessage(r));
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->SetRenderingBuffer();
pBitmapScreenMode = pAppResource->GetBitmapN(L"T01_icon_title_screenmode02.png");
}
else
{
- r = SetScreenMode(SCREEN_MODE_FIT);
+ r = SetScreenMode(SCREEN_MODE_FIT, true);
TryCatch(r == E_SUCCESS, , "SetScreenMode() failed:%s", GetErrorMessage(r));
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
__pVideoPlayerPresentationModel->SetRenderingBuffer();
pBitmapScreenMode = pAppResource->GetBitmapN(L"T01_icon_title_screenmode03.png");
if (playState != PLAYER_STATE_PAUSED)
{
- if (source.GetName() == L"IDL_MAIN_FORM" && playState == PLAYER_STATE_PLAYING)
+ if ((source.GetName() == L"IDL_MAIN_FORM" || source.GetHashCode() == __pOverlayPanel->GetHashCode())
+ && playState == PLAYER_STATE_PLAYING)
{
if (__isControlVisibleState == true)
{
{
AppLogDebug("OnOrientationChanged");
- SetScreenMode(__screenMode);
-
- __pVideoPlayerPresentationModel->SetOverlayRegion(__pOverlayRegion);
- __pVideoPlayerPresentationModel->SetRenderingBuffer();
+ SetScreenMode(__screenMode, false);
switch (orientationStatus)
{
void
VideoPlayerForm::ChangedControlPos(void)
{
- Rectangle controlRect(0, 0, 0, 0);
- Rectangle posRect(0, 0, 0, 0);
-
- result r = E_FAILURE;
-
AppLogDebug("ChangedControlPos");
- if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT)
+ switch (GetOrientationStatus())
{
- controlRect = __pControlLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pControlLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pControlLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pFastRewindButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFastRewindButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFastRewindButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pPlayPauseButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pPlayPauseButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pPlayPauseButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pFastForwardButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFastForwardButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFastForwardButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pBackButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pBackButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pBackButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- Rectangle controlLabelRect = __pControlLabel->GetBounds();
- controlRect = __pFirstLineLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFirstLineLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFirstLineLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pCurrenTimeLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height + MARGIN_PORTRAIT_SLIDER;
- controlRect.y = posRect.y;
-
- r = __pCurrenTimeLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pCurrenTimeLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pTotalTimeLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height + MARGIN_PORTRAIT_SLIDER;
- controlRect.y = posRect.y;
-
- r = __pTotalTimeLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pTotalTimeLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pSlider->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height;
- controlRect.y = posRect.y;
-
- r = __pSlider->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pSlider->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pVerticalLeftLine->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pVerticalLeftLine->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pVerticalLeftLine->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pVerticalRightLine->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pVerticalRightLine->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pVerticalRightLine->SetBounds() failed:%s", GetErrorMessage(r));
- }
- else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE
- || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- if (GetClientAreaBounds().width <= WVGA_W_FULL)
+ case ORIENTATION_STATUS_PORTRAIT:
{
- controlRect = __pControlLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pControlLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pControlLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pFastRewindButton->GetBounds();
- posRect.x = WVGA_X_FASTREWIND_BTN;
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pFastRewindButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFastRewindButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pPlayPauseButton->GetBounds();
- posRect.x = WVGA_X_PLAYPAUSE_BTN;
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pPlayPauseButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pPlayPauseButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pFastForwardButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFastForwardButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFastForwardButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pBackButton->GetBounds();
- posRect.x = WVGA_X_BACK_BTN;
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pBackButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pBackButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- Rectangle controlLabelRect = __pControlLabel->GetBounds();
- controlRect = __pFirstLineLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFirstLineLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFirstLineLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pCurrenTimeLabel->GetBounds();
- posRect.x = WVGA_X_CURRENT_TIME_LABEL;
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height + MARGIN_LANDSCAPE_SLIDER;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pCurrenTimeLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pCurrenTimeLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pTotalTimeLabel->GetBounds();
- posRect.x = WVGA_X_TOTAL_TIME_LABEL;
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height + MARGIN_LANDSCAPE_SLIDER;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pTotalTimeLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pTotalTimeLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pSlider->GetBounds();
- posRect.x = WVGA_X_SLIDER;
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pSlider->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pSlider->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pVerticalLeftLine->GetBounds();
- posRect.x = WVGA_X_VERTICAL_LEFT_LINE;
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pVerticalLeftLine->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pVerticalLeftLine->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pVerticalRightLine->GetBounds();
- posRect.x = WVGA_X_VERTICAL_RIGHT_LINE;
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.x = posRect.x;
- controlRect.y = posRect.y;
-
- r = __pVerticalRightLine->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pVerticalRightLine->SetBounds() failed:%s", GetErrorMessage(r));
+ if (GetClientAreaBounds().height <= W_WVGA_PORTRAIT_HEIGHT)
+ {
+ __pControlLabel->SetBounds(X_WVGA_PORTRAIT_CONTROLLER, Y_WVGA_PORTRAIT_CONTROLLER, W_WVGA_PORTRAIT_CONTROLLER, H_WVGA_PORTRAIT_CONTROLLER);
+ __pFirstLineLabel->SetBounds(X_WVGA_PORTRAIT_FIRST_LINE, Y_WVGA_PORTRAIT_FIRST_LINE, W_WVGA_PORTRAIT_FIRST_LINE, H_WVGA_PORTRAIT_FIRST_LINE);
+
+ __pCurrenTimeLabel->SetBounds(X_WVGA_PORTRAIT_CURRENT_TIME, Y_WVGA_PORTRAIT_CURRENT_TIME, W_WVGA_PORTRAIT_CURRENT_TIME, H_WVGA_PORTRAIT_CURRENT_TIME);
+ __pSlider->SetBounds(X_WVGA_PORTRAIT_SLIDER, Y_WVGA_PORTRAIT_SLIDER, W_WVGA_PORTRAIT_SLIDER, H_WVGA_PORTRAIT_SLIDER);
+ __pTotalTimeLabel->SetBounds(X_WVGA_PORTRAIT_TOTAL_TIME, Y_WVGA_PORTRAIT_TOTAL_TIME, W_WVGA_PORTRAIT_TOTAL_TIME, H_WVGA_PORTRAIT_TOTAL_TIME);
+
+ __pVerticalLeftLine->SetBounds(X_WVGA_PORTRAIT_VERTICAL_LEFT_LINE, Y_WVGA_PORTRAIT_VERTICAL_LEFT_LINE, W_WVGA_PORTRAIT_VERTICAL_LEFT_LINE,H_WVGA_PORTRAIT_VERTICAL_LEFT_LINE);
+ __pFastRewindButton->SetBounds(X_WVGA_PORTRAIT_FASTREWIND_BTN, Y_WVGA_PORTRAIT_FASTREWIND_BTN, W_WVGA_PORTRAIT_FASTREWIND_BTN, H_WVGA_PORTRAIT_FASTREWIND_BTN);
+ __pPlayPauseButton->SetBounds(X_WVGA_PORTRAIT_PLAYPAUSE_BTN, Y_WVGA_PORTRAIT_PLAYPAUSE_BTN, W_WVGA_PORTRAIT_PLAYPAUSE_BTN, H_WVGA_PORTRAIT_PLAYPAUSE_BTN);
+ __pFastForwardButton->SetBounds(X_WVGA_PORTRAIT_FASTFORWARD_BTN, Y_WVGA_PORTRAIT_FASTFORWARD_BTN, W_WVGA_PORTRAIT_FASTFORWARD_BTN, H_WVGA_PORTRAIT_FASTFORWARD_BTN);
+ __pVerticalRightLine->SetBounds(X_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE, Y_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE, W_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE, H_WVGA_PORTRAIT_VERTICAL_RIGHT_LINE);
+ __pBackButton->SetBounds(X_WVGA_PORTRAIT_BACK_BTN, Y_WVGA_PORTRAIT_BACK_BTN, W_WVGA_PORTRAIT_BACK_BTN, H_WVGA_PORTRAIT_BACK_BTN);
+ }
+ else
+ {
+ __pControlLabel->SetBounds(X_HVGA_PORTRAIT_CONTROLLER, Y_HVGA_PORTRAIT_CONTROLLER, W_HVGA_PORTRAIT_CONTROLLER, H_HVGA_PORTRAIT_CONTROLLER);
+ __pFirstLineLabel->SetBounds(X_HVGA_PORTRAIT_FIRST_LINE, Y_HVGA_PORTRAIT_FIRST_LINE, W_HVGA_PORTRAIT_FIRST_LINE, H_HVGA_PORTRAIT_FIRST_LINE);
+
+ __pCurrenTimeLabel->SetBounds(X_HVGA_PORTRAIT_CURRENT_TIME, Y_HVGA_PORTRAIT_CURRENT_TIME, W_HVGA_PORTRAIT_CURRENT_TIME, H_HVGA_PORTRAIT_CURRENT_TIME);
+ __pSlider->SetBounds(X_HVGA_PORTRAIT_SLIDER, Y_HVGA_PORTRAIT_SLIDER, W_HVGA_PORTRAIT_SLIDER, H_HVGA_PORTRAIT_SLIDER);
+ __pTotalTimeLabel->SetBounds(X_HVGA_PORTRAIT_TOTAL_TIME, Y_HVGA_PORTRAIT_TOTAL_TIME, W_HVGA_PORTRAIT_TOTAL_TIME, H_HVGA_PORTRAIT_TOTAL_TIME);
+
+ __pVerticalLeftLine->SetBounds(X_HVGA_PORTRAIT_VERTICAL_LEFT_LINE, Y_HVGA_PORTRAIT_VERTICAL_LEFT_LINE, W_HVGA_PORTRAIT_VERTICAL_LEFT_LINE, H_HVGA_PORTRAIT_VERTICAL_LEFT_LINE);
+ __pFastRewindButton->SetBounds(X_HVGA_PORTRAIT_FASTREWIND_BTN, Y_HVGA_PORTRAIT_FASTREWIND_BTN, W_HVGA_PORTRAIT_FASTREWIND_BTN, H_HVGA_PORTRAIT_FASTREWIND_BTN);
+ __pPlayPauseButton->SetBounds(X_HVGA_PORTRAIT_PLAYPAUSE_BTN, Y_HVGA_PORTRAIT_PLAYPAUSE_BTN, W_HVGA_PORTRAIT_PLAYPAUSE_BTN, H_HVGA_PORTRAIT_PLAYPAUSE_BTN);
+ __pFastForwardButton->SetBounds(X_HVGA_PORTRAIT_FASTFORWARD_BTN, Y_HVGA_PORTRAIT_FASTFORWARD_BTN, W_HVGA_PORTRAIT_FASTFORWARD_BTN, H_HVGA_PORTRAIT_FASTFORWARD_BTN);
+ __pVerticalRightLine->SetBounds(X_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE, Y_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE, W_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE, H_HVGA_PORTRAIT_VERTICAL_RIGHT_LINE);
+ __pBackButton->SetBounds(X_HVGA_PORTRAIT_BACK_BTN, Y_HVGA_PORTRAIT_BACK_BTN, W_HVGA_PORTRAIT_BACK_BTN, H_HVGA_PORTRAIT_BACK_BTN);
+ }
}
- else
- {
- controlRect = __pControlLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pControlLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pControlLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pFastRewindButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFastRewindButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFastRewindButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pPlayPauseButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pPlayPauseButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pPlayPauseButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pFastForwardButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFastForwardButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFastForwardButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pBackButton->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pBackButton->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pBackButton->SetBounds() failed:%s", GetErrorMessage(r));
-
- Rectangle controlLabelRect = __pControlLabel->GetBounds();
- controlRect = __pFirstLineLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pFirstLineLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pFirstLineLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pCurrenTimeLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height + MARGIN_LANDSCAPE_SLIDER;
- controlRect.y = posRect.y;
-
- r = __pCurrenTimeLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pCurrenTimeLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pTotalTimeLabel->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height + MARGIN_LANDSCAPE_SLIDER;
- controlRect.y = posRect.y;
-
- r = __pTotalTimeLabel->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pTotalTimeLabel->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pSlider->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlLabelRect.height;
- controlRect.y = posRect.y;
-
- r = __pSlider->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pSlider->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pVerticalLeftLine->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
-
- r = __pVerticalLeftLine->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pVerticalLeftLine->SetBounds() failed:%s", GetErrorMessage(r));
-
- controlRect = __pVerticalRightLine->GetBounds();
- posRect.y = GetClientAreaBounds().height - controlRect.height;
- controlRect.y = posRect.y;
+ break;
- r = __pVerticalRightLine->SetBounds(controlRect);
- TryReturnVoid(r == E_SUCCESS, "__pVerticalRightLine->SetBounds() failed:%s", GetErrorMessage(r));
+ case ORIENTATION_STATUS_LANDSCAPE:
+ // fall throuth
+ case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
+ {
+ if (GetClientAreaBounds().width <= W_WVGA_LANDSCAPE_WIDTH)
+ {
+ __pControlLabel->SetBounds(X_WVGA_LANDSCAPE_CONTROLLER, Y_WVGA_LANDSCAPE_CONTROLLER, W_WVGA_LANDSCAPE_CONTROLLER, H_WVGA_LANDSCAPE_CONTROLLER);
+ __pFirstLineLabel->SetBounds(X_WVGA_LANDSCAPE_FIRST_LINE, Y_WVGA_LANDSCAPE_FIRST_LINE, W_WVGA_LANDSCAPE_FIRST_LINE, H_WVGA_LANDSCAPE_FIRST_LINE);
+
+ __pCurrenTimeLabel->SetBounds(X_WVGA_LANDSCAPE_CURRENT_TIME, Y_WVGA_LANDSCAPE_CURRENT_TIME, W_WVGA_LANDSCAPE_CURRENT_TIME, H_WVGA_LANDSCAPE_CURRENT_TIME);
+ __pSlider->SetBounds(X_WVGA_LANDSCAPE_SLIDER, Y_WVGA_LANDSCAPE_SLIDER, W_WVGA_LANDSCAPE_SLIDER, H_WVGA_LANDSCAPE_SLIDER);
+ __pTotalTimeLabel->SetBounds(X_WVGA_LANDSCAPE_TOTAL_TIME, Y_WVGA_LANDSCAPE_TOTAL_TIME, W_WVGA_LANDSCAPE_TOTAL_TIME, H_WVGA_LANDSCAPE_TOTAL_TIME);
+
+ __pVerticalLeftLine->SetBounds(X_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE, Y_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE, W_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE, H_WVGA_LANDSCAPE_VERTICAL_LEFT_LINE);
+ __pFastRewindButton->SetBounds(X_WVGA_LANDSCAPE_FASTREWIND_BTN, Y_WVGA_LANDSCAPE_FASTREWIND_BTN, W_WVGA_LANDSCAPE_FASTREWIND_BTN, H_WVGA_LANDSCAPE_FASTREWIND_BTN);
+ __pPlayPauseButton->SetBounds(X_WVGA_LANDSCAPE_PLAYPAUSE_BTN, Y_WVGA_LANDSCAPE_PLAYPAUSE_BTN, W_WVGA_LANDSCAPE_PLAYPAUSE_BTN, H_WVGA_LANDSCAPE_PLAYPAUSE_BTN);
+ __pFastForwardButton->SetBounds(X_WVGA_LANDSCAPE_FASTFORWARD_BTN, Y_WVGA_LANDSCAPE_FASTFORWARD_BTN, W_WVGA_LANDSCAPE_FASTFORWARD_BTN, H_WVGA_LANDSCAPE_FASTFORWARD_BTN);
+ __pVerticalRightLine->SetBounds(X_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE, Y_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE, W_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE, H_WVGA_LANDSCAPE_VERTICAL_RIGHT_LINE);
+ __pBackButton->SetBounds(X_WVGA_LANDSCAPE_BACK_BTN, Y_WVGA_LANDSCAPE_BACK_BTN, W_WVGA_LANDSCAPE_BACK_BTN, H_WVGA_LANDSCAPE_BACK_BTN);
+ }
+ else
+ {
+ __pControlLabel->SetBounds(X_HVGA_LANDSCAPE_CONTROLLER, Y_HVGA_LANDSCAPE_CONTROLLER, W_HVGA_LANDSCAPE_CONTROLLER, H_HVGA_LANDSCAPE_CONTROLLER);
+ __pFirstLineLabel->SetBounds(X_HVGA_LANDSCAPE_FIRST_LINE, Y_HVGA_LANDSCAPE_FIRST_LINE, W_HVGA_LANDSCAPE_FIRST_LINE, H_HVGA_LANDSCAPE_FIRST_LINE);
+
+ __pCurrenTimeLabel->SetBounds(X_HVGA_LANDSCAPE_CURRENT_TIME, Y_HVGA_LANDSCAPE_CURRENT_TIME, W_HVGA_LANDSCAPE_CURRENT_TIME, H_HVGA_LANDSCAPE_CURRENT_TIME);
+ __pSlider->SetBounds(X_HVGA_LANDSCAPE_SLIDER, Y_HVGA_LANDSCAPE_SLIDER, W_HVGA_LANDSCAPE_SLIDER, H_HVGA_LANDSCAPE_SLIDER);
+ __pTotalTimeLabel->SetBounds(X_HVGA_LANDSCAPE_TOTAL_TIME, Y_HVGA_LANDSCAPE_TOTAL_TIME, W_HVGA_LANDSCAPE_TOTAL_TIME, H_HVGA_LANDSCAPE_TOTAL_TIME);
+
+ __pVerticalLeftLine->SetBounds(X_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE, Y_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE, W_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE, H_HVGA_LANDSCAPE_VERTICAL_LEFT_LINE);
+ __pFastRewindButton->SetBounds(X_HVGA_LANDSCAPE_FASTREWIND_BTN, Y_HVGA_LANDSCAPE_FASTREWIND_BTN, W_HVGA_LANDSCAPE_FASTREWIND_BTN, H_HVGA_LANDSCAPE_FASTREWIND_BTN);
+ __pPlayPauseButton->SetBounds(X_HVGA_LANDSCAPE_PLAYPAUSE_BTN, Y_HVGA_LANDSCAPE_PLAYPAUSE_BTN, W_HVGA_LANDSCAPE_PLAYPAUSE_BTN, H_HVGA_LANDSCAPE_PLAYPAUSE_BTN);
+ __pFastForwardButton->SetBounds(X_HVGA_LANDSCAPE_FASTFORWARD_BTN, Y_HVGA_LANDSCAPE_FASTFORWARD_BTN, W_HVGA_LANDSCAPE_FASTFORWARD_BTN, H_HVGA_LANDSCAPE_FASTFORWARD_BTN);
+ __pVerticalRightLine->SetBounds(X_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE, Y_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE, W_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE, H_HVGA_LANDSCAPE_VERTICAL_RIGHT_LINE);
+ __pBackButton->SetBounds(X_HVGA_LANDSCAPE_BACK_BTN, Y_HVGA_LANDSCAPE_BACK_BTN, W_HVGA_LANDSCAPE_BACK_BTN, H_HVGA_LANDSCAPE_BACK_BTN);
+ }
}
+ break;
+
+ default:
+ break;
}
}