#include <FUi.h>
class VideoPlayerApp
- : public Tizen::App::IAppControlProviderEventListener
- , public Tizen::App::UiApp
+ : public Tizen::App::UiApp
+ , public Tizen::App::IAppControlProviderEventListener
, public Tizen::System::IChargingEventListener
, public Tizen::System::IDeviceEventListener
, public Tizen::System::ISettingEventListener
void SetFrameEnabled(bool enabled);
- virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId,
- const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
- const Tizen::Base::Collection::IMap* pExtraData);
-
virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
virtual bool OnAppInitialized(void);
virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
virtual void OnForeground(void);
+ virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId,
+ const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
+ const Tizen::Base::Collection::IMap* pExtraData);
+
virtual void OnChargingStateChanged(bool charging);
virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
class VideoPlayerPresentationModel;
class VideoPlayerForm
- : public Tizen::App::IAppControlResponseListener
+ : public Tizen::Ui::Controls::Form
+ , public Tizen::App::IAppControlResponseListener
, public Tizen::Base::Runtime::ITimerEventListener
, public Tizen::Media::IAudioRouteEventListener
- , public Tizen::Ui::Controls::Form
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::Controls::ISliderEventListener
, public Tizen::Ui::IActionEventListener
void SetFrameActivated(bool frameActivated);
bool GetFrameActivated(void) const;
+ virtual result OnInitializing(void);
+ virtual result OnTerminating(void);
+ virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+
virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId,
const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult,
const Tizen::Base::Collection::IMap* pExtraData);
virtual void OnAudioRouteAdded(const Tizen::Media::AudioRouteInfo& route);
virtual void OnAudioRouteRemoved(const Tizen::Media::AudioRouteInfo& route);
- virtual result OnInitializing(void);
- virtual result OnTerminating(void);
- virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
-
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
virtual void OnSliderBarMoved(Tizen::Ui::Controls::Slider& source, int value);
#include <FUi.h>
class VolumeSettingPopup
- : public Tizen::Base::Runtime::ITimerEventListener
+ : public Tizen::Ui::Controls::Popup
+ , public Tizen::Base::Runtime::ITimerEventListener
, public Tizen::Ui::Controls::ISliderEventListener
- , public Tizen::Ui::Controls::Popup
, public Tizen::Ui::IActionEventListener
, public Tizen::Ui::IAdjustmentEventListener
, public Tizen::Ui::IKeyEventListener
void
VideoPlayerApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
{
- AppLogDebug("OnBatteryLevelChanged");
+ AppLogDebug("OnBatteryLevelChanged: [%d]", batteryLevel);
UiApp* pApp = UiApp::GetInstance();
TryReturnVoid(pApp != null, "pApp is null");
void
VideoPlayerApp::OnChargingStateChanged(bool charging)
{
- AppLogDebug("OnChargingStateChanged");
+ AppLogDebug("OnChargingStateChanged [%d]", charging);
if (charging == false)
{
UiApp* pApp = UiApp::GetInstance();
+ TryReturnVoid(pApp != null, "pApp is null");
- if (pApp != null)
- {
- IAppFrame* pAppFrame = pApp->GetAppFrame();
+ IAppFrame* pAppFrame = pApp->GetAppFrame();
+ TryReturnVoid(pAppFrame != null, "pAppFrame is null");
- if (pAppFrame != null)
- {
- Frame* pFrame = pAppFrame->GetFrame();
+ Frame* pFrame = pAppFrame->GetFrame();
+ TryReturnVoid(pFrame != null, "pFrame is null");
- if (pFrame != null)
- {
- VideoPlayerForm* pForm = static_cast<VideoPlayerForm*>(pFrame->GetCurrentForm());
+ VideoPlayerForm* pForm = static_cast<VideoPlayerForm*>(pFrame->GetCurrentForm());
+ TryReturnVoid(pForm != null, "pForm is null");
- if (pForm != null)
- {
- pForm->SendUserEvent(REQUEST_VIDEO_EVENT_BATTERY_LEVEL_CHANGED, null);
- }
- }
- }
- }
+ pForm->SendUserEvent(REQUEST_VIDEO_EVENT_BATTERY_LEVEL_CHANGED, null);
}
}
String replace;
__uriData = *pUriData;
__uriData.Replace(original, replace);
- AppLog("__uriData(%ls) pUriData(%ls)", __uriData.GetPointer(), pUriData->GetPointer());
+ AppLogDebug("__uriData(%ls) pUriData(%ls)", __uriData.GetPointer(), pUriData->GetPointer());
}
if (pExtraData != null)
if (key.CompareTo(SETTING_KEY_LANGUAGE) == 0 || key.CompareTo(SETTING_KEY_FONT_SIZE) == 0)
{
- UiApp::GetInstance()->Terminate();
+ UiApp* pApp = UiApp::GetInstance();
+ TryReturnVoid(pApp != null, "pApp is null");
+ pApp->Terminate();
}
}
void
VideoPlayerApp::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
{
- AppLogDebug("OnDeviceStateChanged");
+ AppLogDebug("OnDeviceStateChanged [%d][%ls]", deviceType, state.GetPointer());
String extStoragePath = Environment::GetExternalStoragePath();
String uriData = GetUriData();
static const int SHOW_CONTROL_DURATION = 5000;
static const int MILLISECOND = 1000;
-static const int START_TIME = 0;
+static const int SLIDER_START_VALUE = 0;
static const int SEEK_TIME_NONE = -1;
static const int X_BASE = 0;
static const int MULTI_CONTENT_COUNT = 2;
-static const int MESSAGEBOX_DISPLAY_TIME_3_SEC = 3000;
+static const int MESSAGEBOX_DISPLAY_TIMEOUT = 3000;
-static const wchar_t* INIT_TIME = L"00:00:00";
+static const wchar_t* SLIDER_INIT_TIME = L"00:00:00";
static const RequestId REQUEST_UPDATE_WIRED_ACCESSORY_AND_SPEAKER_MENU = 111;
static const RequestId REQUEST_UPDATE_BLUETOOTHA2DP_AND_SPEAKER_MENU = 112;
case SCREEN_MODE_FIT:
{
- Rectangle videoRect = __pVideoPlayerPresentationModel->GetVideoInfoN(
- __pVideoPlayerPresentationModel->GetMediaPathName());
+ Rectangle videoRect = __pVideoPlayerPresentationModel->GetVideoInfoN(__pVideoPlayerPresentationModel->GetMediaPathName());
Rectangle rect(0, 0, videoRect.width, videoRect.height);
__pUiControlTimer->Cancel();
ShowControl(true);
- UpdateProgressBar(START_TIME);
+ UpdateProgressBar(SLIDER_START_VALUE);
- __pCurrenTimeLabel->SetText(INIT_TIME);
+ __pCurrenTimeLabel->SetText(SLIDER_INIT_TIME);
__pCurrenTimeLabel->Invalidate(true);
pPlayBitmap = pAppResource->GetBitmapN(L"T01-2_control_circle_icon_play.png");
pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString(IDS_COM_POP_UNSUPPORTED_FILE_TYPE, messageBoxString);
- messageBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
+ messageBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIMEOUT);
messageBox.ShowAndWait(modalResult);
UiApp* pApp = UiApp::GetInstance();
pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString(IDS_VPL_POP_UNABLE_TO_PLAY_VIDEO_ERROR_OCCURRED, messageBoxString);
- messageBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
+ messageBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIMEOUT);
messageBox.ShowAndWait(modalResult);
UiApp* pApp = UiApp::GetInstance();
case IDA_CONTEXTMENU_MESSAGE:
{
AppControl* pAppControl = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE);
- if (pAppControl == null)
- {
- return;
- }
+ TryReturnVoid(pAppControl != null, "pAppControl is null");
String filePath = __pVideoPlayerPresentationModel->GetMediaPathName();
- AppLog("filePath(%ls)", filePath.GetPointer());
+
HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
pDataList->Construct();
+
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pList->Add(new (std::nothrow) String(filePath));
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), pList);
case IDA_CONTEXTMENU_EMAIL:
{
AppControl* pAppControl = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE);
- if (pAppControl == null)
- {
- return;
- }
+ TryReturnVoid(pAppControl != null, "pAppControl is null");
String filePath = __pVideoPlayerPresentationModel->GetMediaPathName();
HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
pDataList->Construct();
+
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pList->Add(new (std::nothrow) String(filePath));
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), pList);
playState = __pVideoPlayerPresentationModel->GetState();
- if (playState == PLAYER_STATE_PLAYING || playState == PLAYER_STATE_PAUSED
- || playState == PLAYER_STATE_ENDOFCLIP)
+ if (playState == PLAYER_STATE_PLAYING || playState == PLAYER_STATE_PAUSED || playState == PLAYER_STATE_ENDOFCLIP)
{
if (source.GetName() == L"IDL_MAIN_FORM"
|| source.GetHashCode() == __pOverlayPanel->GetHashCode()
AppResource* pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString(IDS_COM_POP_LOW_BATTERY_UNABLE_TO_LAUNCH_APPLICATION, messageBoxString);
- msgBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
+ msgBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIMEOUT);
msgBox.ShowAndWait(result);
switch (result)
AppResource* pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString(L"IDS_VPL_BODY_UNABLE_TO_PLAY_VIDEO_DURING_CALL", dispString);
- msgBox.Construct(L"", dispString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
+ msgBox.Construct(L"", dispString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIMEOUT);
msgBox.ShowAndWait(modalResult);
switch (modalResult)
static const int MULTI_CONTENT_COUNT = 2;
static const int MAX_PROGRESS_RANGE = 100;
+static const int MESSAGEBOX_DISPLAY_TIMEOUT = 3000;
+
VideoPlayerPresentationModel*
VideoPlayerPresentationModel::__pVideoPlayerPresentationModel = null;
{
delete __pVideoPlayerPresentationModel;
__pVideoPlayerPresentationModel = null;
- return;
}
}
if (GetState() == PLAYER_STATE_PLAYING)
{
pStreamInfo = __pPlayer->GetCurrentMediaStreamInfoN();
- if (pStreamInfo == null)
- {
- TryCatch(pStreamInfo != null, r = E_FAILURE, "__pPlayer->GetCurrentMediaStreamInfoN() is null");
- }
+ TryCatch(pStreamInfo != null, r = E_FAILURE, "__pPlayer->GetCurrentMediaStreamInfoN() is null");
pInfoList = pStreamInfo->GetVideoStreamInfoList();
- if (pInfoList == null)
- {
- TryCatch(pInfoList != null, r = E_FAILURE, "pStreamInfo->GetVideoStreamInfoList() is null");
- }
+ TryCatch(pInfoList != null, r = E_FAILURE, "pStreamInfo->GetVideoStreamInfoList() is null");
pInfo = (const VideoStreamInfo*)pInfoList->GetAt(0);
- if (pInfo == null)
- {
- TryCatch(pInfo != null, r = E_FAILURE, "pInfoList->GetAt() is null");
- }
+ TryCatch(pInfo != null, r = E_FAILURE, "pInfoList->GetAt() is null");
rect.width = pInfo->GetWidth();
rect.height = pInfo->GetHeight();
TryCatch(r == E_SUCCESS,, "__pOverlayRegion->GetBackgroundBufferInfo() failed:%s", GetErrorMessage(r));
delete __pPlayer;
-
__pPlayer = new (std::nothrow) Player();
-
AppLogDebug("__pPlayer [%x]", __pPlayer);
r = __pPlayer->Construct(*this, &bufferInfo);
{
result r = E_FAILURE;
TryReturnVoid(__pPlayer != null, "__pPlayer is null");
+
r = __pPlayer->SetRenderingBuffer(bufferInfo);
TryReturnVoid(r == E_SUCCESS, "__pPlayer->SetRenderingBuffer failed:%s", GetErrorMessage(r));
}
String messageBoxString;
pAppResource->GetString(IDS_COM_POP_UNSUPPORTED_FILE_TYPE, messageBoxString);
MessageBox messageBox;
- messageBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, 3000);
+ messageBox.Construct(L"", messageBoxString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIMEOUT);
int modalResult = 0;
messageBox.ShowAndWait(modalResult);
static const int W_VOLUME_POPUP = 600;
static const int H_VOLUME_POPUP = 180;
-static const int SLIDER_MIN_VALUE = 0;
+static const int MIN_SLIDER_VALUE = 0;
-static const int START_CLOSE_TIME = 3000;
+static const int VOLUME_SETTING_POPUP_TIMEOUT = 3000;
static const int VOLUME_SETTING_DURATION = 200;
static const int X_VOLUME_SLIDER = 100;
__pVolumeSliderTimer = new (std::nothrow) Timer();
r = __pVolumeSettingSlider->Construct(Rectangle(X_VOLUME_SLIDER, Y_VOLUME_SLIDER, W_VOLUME_SLIDER, H_VOLUME_SLIDER),
- BACKGROUND_STYLE_NONE, false, SLIDER_MIN_VALUE, MaxMediaSoundVolume);
+ BACKGROUND_STYLE_NONE, false, MIN_SLIDER_VALUE, MaxMediaSoundVolume);
TryCatch(r == E_SUCCESS,, "__pVolumeSettingSlider->Construct() Failed:%s", GetErrorMessage(r));
r = __pCloseTimer->Construct(*this);
r = Show();
TryReturnVoid(r == E_SUCCESS, "Show() failed:%s", GetErrorMessage(r));
- r = __pCloseTimer->Start(START_CLOSE_TIME);
+ r = __pCloseTimer->Start(VOLUME_SETTING_POPUP_TIMEOUT);
TryReturnVoid(r == E_SUCCESS, "__pCloseTimer->Start() failed:%s", GetErrorMessage(r));
}
}
void
-VolumeSettingPopup::OnTouchReleased(const Control& source, const Point& currentPosition,
- const TouchEventInfo& touchInfo)
+VolumeSettingPopup::OnTouchReleased(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo)
{
result r = E_FAILURE;
SystemInfo::GetValue(MAX_MEDIA_SOUND_VOLUME, maxMediaVolume);
- if (keyCode == KEY_SIDE_UP
- || keyCode == KEY_SIDE_DOWN)
+ if (keyCode == KEY_SIDE_UP || keyCode == KEY_SIDE_DOWN)
{
if (GetShowState() == true)
{
r = SettingInfo::SetVolume(MEDIA_SOUND_VOLUME, adjustment);
TryReturnVoid(r == E_SUCCESS, "SettingInfo::SetVolume() failed:%s", GetErrorMessage(r));
- r = __pCloseTimer->Start(START_CLOSE_TIME);
+ r = __pCloseTimer->Start(VOLUME_SETTING_POPUP_TIMEOUT);
TryReturnVoid(r == E_SUCCESS, "__pCloseTimer->Start() failed:%s", GetErrorMessage(r));
}