, __pFastForwardButton(null)
, __pFastRewindButton(null)
, __pBackButton(null)
+ , __pShareButton(null)
, __pScreenModeButton(null)
+ , __pRepeatModeButton(null)
, __pHeaderTitle(null)
, __pCurrenTimeLabel(null)
, __pTotalTimeLabel(null)
, __pSlider(null)
+ , __pContextMenuShare(null)
, __actionTouchLongPressed(false)
, __setPauseState(false)
, __isControlVisibleState(true)
__pScreenModeButton->AddActionEventListener(*this);
__pScreenModeButton->AddTouchEventListener(*this);
+ __pShareButton = static_cast<Button*>(__pFunctionPanel->GetControl(IDC_BUTTON_SHARE));
+ TryCatch(__pShareButton != null, r = E_SYSTEM, "__pShareButton is null");
+ __pShareButton->SetActionId(IDA_BUTTON_SHARE);
+ __pShareButton->AddActionEventListener(*this);
+ __pShareButton->AddTouchEventListener(*this);
+
return E_SUCCESS;
CATCH:
__pControllerPanel = static_cast<Panel*>(GetControl(IDC_PANEL_CONTROLLER));
TryCatch(__pControllerPanel != null, r = E_SYSTEM, "__pControllerPanel is null");
+ __pRepeatModeButton = static_cast<Button*>(__pControllerPanel->GetControl(IDC_BUTTON_REPEATMODE));
+ TryCatch(__pRepeatModeButton != null, r = E_SYSTEM, "__pRepeatModeButton is null");
+ __pRepeatModeButton->SetActionId(IDA_BUTTON_REPEATMODE);
+ __pRepeatModeButton->AddActionEventListener(*this);
+ __pRepeatModeButton->AddTouchEventListener(*this);
+
__pPlayPauseButton = static_cast<Button*>(__pControllerPanel->GetControl(IDC_BUTTON_PLAY));
TryCatch(__pPlayPauseButton != null, r = E_SYSTEM, "__pPlayPauseButton is null");
__pPlayPauseButton->SetActionId(IDA_BUTTON_PLAY);
delete __pSoundPathPopup;
__pSoundPathPopup = null;
+ delete __pContextMenuShare;
+ __pContextMenuShare = null;
+
return E_SUCCESS;
}
}
void
-VideoPlayerForm::OnPlayEndOfClip(bool playNextContent)
+VideoPlayerForm::OnPlayEndOfClip(bool playNextContent, int repeatMode)
{
result r = E_FAILURE;
+ Rectangle rect;
Point point(X_BASE, Y_BASE);
Bitmap* pPlayBitmap = null;
+ Bitmap* pBitmapScreenMode = null;
AppLogDebug("OnPlayEndOfClip : %d", playNextContent);
__pScreenModeButton->SetShowState(false);
}
- if (playNextContent == true)
+ switch (repeatMode)
{
- SetScreenMode(SCREEN_MODE_NORMAL, true);
- __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
- __pVideoPlayerPresentationModel->InitializePlayer();
+ case REPEAT_TYPE_OFF:
+ {
+ if (playNextContent == true)
+ {
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
- if (__pScreenModeButton->GetShowState() == false)
+ r = __pVideoPlayerPresentationModel->StartPlay();
+ TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+
+ String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+ rect = __pVideoPlayerPresentationModel->GetVideoInfoN(mediaPathName);
+
+ if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+ else
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+
+ __pSlider->SetEnabled(true);
+
+ if (__pScreenModeButton->GetShowState() == false)
+ {
+ __pScreenModeButton->SetShowState(true);
+ }
+
+ r = PowerManager::KeepScreenOnState(true, false);
+ TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+ }
+ else
+ {
+ r = PowerManager::KeepScreenOnState(false);
+ TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+ }
+ }
+ break;
+
+ case REPEAT_TYPE_ONE:
{
- __pScreenModeButton->SetShowState(true);
+ r = __pVideoPlayerPresentationModel->StartPlay();
+ TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+
+ __pSlider->SetEnabled(true);
+
+ if (__pScreenModeButton->GetShowState() == false)
+ {
+ __pScreenModeButton->SetShowState(true);
+ }
+
+ r = PowerManager::KeepScreenOnState(true, false);
+ TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
}
+ break;
- __pSlider->SetEnabled(true);
+ case REPEAT_TYPE_ALL:
+ {
+ if (playNextContent == true)
+ {
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
- r = __pVideoPlayerPresentationModel->StartPlay();
- TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+ r = __pVideoPlayerPresentationModel->StartPlay();
+ TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
- r = PowerManager::KeepScreenOnState(true, false);
- TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
- }
- else
- {
- r = PowerManager::KeepScreenOnState(false);
- TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+ String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+ rect = __pVideoPlayerPresentationModel->GetVideoInfoN(mediaPathName);
+
+ if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+ else
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+
+ __pSlider->SetEnabled(true);
+
+ if (__pScreenModeButton->GetShowState() == false)
+ {
+ __pScreenModeButton->SetShowState(true);
+ }
+
+ r = PowerManager::KeepScreenOnState(true, false);
+ TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+ }
+ else
+ {
+ if (__pVideoPlayerPresentationModel->GetMediaCount() >= 2)
+ {
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
+ }
+
+ r = __pVideoPlayerPresentationModel->StartPlay();
+ TryCatch(r == E_SUCCESS, , "__pVideoPlayerPresentationModel->StartPlay() Failed:%s", GetErrorMessage(r));
+
+ String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+ rect = __pVideoPlayerPresentationModel->GetVideoInfoN(mediaPathName);
+
+ if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+ else
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+
+ __pSlider->SetEnabled(true);
+
+ if (__pScreenModeButton->GetShowState() == false)
+ {
+ __pScreenModeButton->SetShowState(true);
+ }
+
+ r = PowerManager::KeepScreenOnState(true, false);
+ TryCatch(r == E_SUCCESS, , "PowerManager::KeepScreenOnState() failed:%s", GetErrorMessage(r));
+ }
+ }
+ break;
+
+ default:
+ break;
}
CATCH:
delete pPlayBitmap;
pPlayBitmap = null;
+ delete pBitmapScreenMode;
+ pBitmapScreenMode = null;
}
void
{
__setPauseState = false;
- if ((__pVideoPlayerPresentationModel->GetState() == PLAYER_STATE_ENDOFCLIP))
+ if (playState == PLAYER_STATE_ENDOFCLIP)
{
- if (__pVideoPlayerPresentationModel->GetCurrentMediaIndex() != __pVideoPlayerPresentationModel->GetPreviousMediaIndex())
+ if (__pVideoPlayerPresentationModel->GetCurrentMediaIndex() < __pVideoPlayerPresentationModel->GetPreviousMediaIndex())
{
- SetScreenMode(SCREEN_MODE_NORMAL, true);
- __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
+ if (__pVideoPlayerPresentationModel->GetRepeatMode() == REPEAT_TYPE_ONE)
+ {
+ __pVideoPlayerPresentationModel->ChangeCurrentMediaIndex();
+ }
+ else
+ {
+ SetScreenMode(SCREEN_MODE_NORMAL, true);
+ __pVideoPlayerPresentationModel->SetOverlayPanel(__pOverlayPanel);
+ }
}
- __pVideoPlayerPresentationModel->InitializePlayer();
}
r = __pVideoPlayerPresentationModel->StartPlay();
rect = __pVideoPlayerPresentationModel->GetVideoInfoN(
__pVideoPlayerPresentationModel->GetMediaPathName());
+ if (rect.width > W_NORMAL || rect.height > W_NORMAL)
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_function_icon_screenmode03_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+ else
+ {
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ pBitmapScreenMode = pAppResource->GetBitmapN(L"T01-2_Function_icon_screenmode_press.png");
+ __pScreenModeButton->SetNormalBitmap(point, *pBitmapScreenMode);
+ }
+
if (__pScreenModeButton->GetShowState() == false)
{
__pScreenModeButton->SetShowState(true);
}
break;
+ case IDA_BUTTON_SHARE:
+ {
+ Point point((((GetClientAreaBounds().width - __pFunctionPanel->GetBounds().width) / DIVIDE_BY_TWO)
+ + (__pShareButton->GetBounds().width / DIVIDE_BY_TWO)),
+ __pFunctionPanel->GetBounds().y + __pFunctionPanel->GetBounds().height);
+
+ if (__pContextMenuShare != null)
+ {
+ delete __pContextMenuShare;
+ __pContextMenuShare = null;
+ }
+
+ __pContextMenuShare = new (std::nothrow) ContextMenu();
+ r = __pContextMenuShare->Construct(point, CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD);
+ TryCatch(r == E_SUCCESS, , "__pContextMenuShare->Construct() failed:%s", GetErrorMessage(r));
+
+ __pContextMenuShare->AddItem(L"Message", IDA_CONTEXTMENU_MESSAGE);
+ __pContextMenuShare->AddItem(L"Email", IDA_CONTEXTMENU_EMAIL);
+ __pContextMenuShare->AddActionEventListener(*this);
+ __pContextMenuShare->SetShowState(true);
+ __pContextMenuShare->Show();
+
+ if (playState == PLAYER_STATE_PLAYING)
+ {
+ __pUiControlTimer->Start(SHOW_CONTROL_DURATION);
+ }
+ }
+ break;
+
+ case IDA_CONTEXTMENU_MESSAGE:
+ {
+ AppControl* pAppControl = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE);
+ if (pAppControl == null)
+ {
+ return;
+ }
+
+ HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+ pDataList->Construct();
+
+ String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
+ new (std::nothrow) String(mediaPathName));
+ AppLogDebug("AppControl Data : %ls", mediaPathName.GetPointer());
+
+ pAppControl->Start(null, null, pDataList, this);
+
+ if (pAppControl != null)
+ {
+ delete pAppControl;
+ pAppControl = null;
+ }
+ }
+ break;
+
+ case IDA_CONTEXTMENU_EMAIL:
+ {
+ AppControl* pAppControl = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE);
+ if (pAppControl == null)
+ {
+ return;
+ }
+
+ HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+ pDataList->Construct();
+
+ String mediaPathName = __pVideoPlayerPresentationModel->GetMediaPathName();
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
+ new (std::nothrow) String(mediaPathName));
+ AppLogDebug("AppControl Data : %ls", mediaPathName.GetPointer());
+
+ pAppControl->Start(null, null, pDataList, this);
+
+ if (pAppControl != null)
+ {
+ delete pAppControl;
+ pAppControl = null;
+ }
+ }
+ break;
+
+ case IDA_BUTTON_REPEATMODE:
+ {
+ int repeatMode = __pVideoPlayerPresentationModel->GetRepeatMode();
+
+ switch (repeatMode)
+ {
+ case REPEAT_TYPE_OFF:
+ {
+ SetRepeatButtonImage(REPEAT_TYPE_ONE);
+ }
+ break;
+
+ case REPEAT_TYPE_ONE:
+ {
+ SetRepeatButtonImage(REPEAT_TYPE_ALL);
+ }
+ break;
+
+ case REPEAT_TYPE_ALL:
+ {
+ SetRepeatButtonImage(REPEAT_TYPE_OFF);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (playState == PLAYER_STATE_PLAYING)
+ {
+ __pUiControlTimer->Start(SHOW_CONTROL_DURATION);
+ }
+ }
+ break;
+
case IDA_BUTTON_BACK:
{
Application::GetInstance()->Terminate();
}
void
+VideoPlayerForm::SetRepeatButtonImage(int repeatValue)
+{
+ AppLogDebug("SetRepeatButtonImage");
+ Bitmap* pRepeatBitmap = null;
+ Bitmap* pRepeatPressBitmap = null;
+
+ AppResource* pAppResource = Application::GetInstance()->GetAppResource();
+
+ switch (repeatValue)
+ {
+ case REPEAT_TYPE_OFF:
+ {
+ pRepeatBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat.png");
+ pRepeatPressBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_press.png");
+ }
+ break;
+
+ case REPEAT_TYPE_ONE:
+ {
+ pRepeatBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_1.png");
+ pRepeatPressBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_1_press.png");
+ }
+ break;
+
+ case REPEAT_TYPE_ALL:
+ {
+ pRepeatBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_all.png");
+ pRepeatPressBitmap = pAppResource->GetBitmapN(L"T01-2_function_icon_repeat_all_press.png");
+ }
+ break;
+
+ default:
+ break;
+ }
+ __pRepeatModeButton->SetNormalBitmap(Point(X_BASE, Y_BASE), *pRepeatBitmap);
+ __pRepeatModeButton->SetPressedBitmap(Point(X_BASE, Y_BASE), *pRepeatPressBitmap);
+ __pVideoPlayerPresentationModel->SetRepeatMode(repeatValue);
+
+ delete pRepeatBitmap;
+ pRepeatBitmap = null;
+ delete pRepeatPressBitmap;
+ pRepeatPressBitmap = null;
+}
+
+void
VideoPlayerForm::GetTotalTime(String& totalTime)
{
result r = E_FAILURE;
__pHeaderPanel->SetShowState(false);
__pFunctionPanel->SetShowState(false);
__pControllerPanel->SetShowState(false);
+
+ if (__pContextMenuShare != null)
+ {
+ if (__pContextMenuShare->GetShowState() == true)
+ {
+ __pContextMenuShare->SetShowState(false);
+ }
+ }
+
__isControlVisibleState = false;
}
}
GetTotalTime(totalTime);
__pHeaderTitle->SetText(fileName);
+ __pHeaderTitle->Invalidate(true);
__pTotalTimeLabel->SetText(totalTime);
__pTotalTimeLabel->Invalidate(true);
VideoPlayerForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
{
BatteryLevel batteryLevel;
+ bool isCharging = false;
AppLogDebug("OnUserEventReceivedN");
case REQUEST_VIDEO_EVENT_BATTERY_LEVEL_CHANGED:
{
Battery::GetCurrentLevel(batteryLevel);
+ Battery::IsCharging(isCharging);
if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
{
- OnFormBackRequested(*this);
+ if (isCharging == false)
+ {
+ OnFormBackRequested(*this);
+ }
}
}
break;
default:
break;
}
+}
+
+void
+VideoPlayerForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Tizen::Base::String& operationId,
+ AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
+{
+ AppLogDebug("OnAppControlCompleteResponseReceived : %d", appControlResult);
}
\ No newline at end of file
, __currentMediaIndex(INIT_CONTENT_INDEX)
, __nextMediaIndex(INIT_CONTENT_INDEX)
, __previousMediaIndex(INIT_CONTENT_INDEX)
+ , __repeatMode(REPEAT_TYPE_OFF)
{
}
VideoPlayerPresentationModel::StartPlay(void)
{
result r = E_FAILURE;
+ String mediaPath;
+ String mediaName;
+ String delim = L"/";
PlayerState playState = __pPlayer->GetState();
AppLogDebug("StartPlay : %d", playState);
switch (playState)
{
- case PLAYER_STATE_ENDOFCLIP:
- // fall through
case PLAYER_STATE_INITIALIZED:
// fall through
case PLAYER_STATE_CLOSED:
{
- String mediaPath;
- String mediaName;
- String delim = L"/";
-
mediaPath = GetMediaPathName();
StringTokenizer strTok(mediaPath, delim);
}
break;
+ case PLAYER_STATE_ENDOFCLIP:
+ {
+ if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+ {
+ r = __pPlayer->Play();
+ TryCatch(r == E_SUCCESS, , "__pPlayer->Play() failed:%s", GetErrorMessage(r));
+ }
+ else
+ {
+ mediaPath = GetMediaPathName();
+ StringTokenizer strTok(mediaPath, delim);
+
+ while (strTok.HasMoreTokens())
+ {
+ strTok.GetNextToken(mediaName);
+ }
+
+ if (GetRepeatMode() != REPEAT_TYPE_ONE)
+ {
+ InitializePlayer();
+
+ r = __pPlayer->OpenFile(mediaPath);
+ TryCatch(r == E_SUCCESS, , "__pPlayer->OpenFile() failed:%s", GetErrorMessage(r));
+ }
+
+ r = __pPlayer->Play();
+ TryCatch(r == E_SUCCESS, , "__pPlayer->Play() failed:%s", GetErrorMessage(r));
+
+ mediaName.Append(L"(");
+ mediaName.Append(__currentMediaIndex + 1);
+ mediaName.Append(L"/");
+ mediaName.Append(__pMediaPathArrayList->GetCount());
+ mediaName.Append(L")");
+
+ CallOnPlayContentChanged(mediaName);
+ }
+
+ r = __pTimer->Start(PROGRESS_TIMER_DURATION);
+ TryCatch(r == E_SUCCESS, , "__pTimer->Start() failed:%s", GetErrorMessage(r));
+ }
+ break;
+
case PLAYER_STATE_PAUSED:
{
r = __pPlayer->Play();
__pFastRewindTimer->Cancel();
__playerSeekCompleted = true;
+ __playerLastSeekCompleted = false;
- if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+ switch (GetRepeatMode())
{
- __previousMediaIndex = INIT_CONTENT_INDEX;
- __currentMediaIndex = INIT_CONTENT_INDEX;
- __nextMediaIndex = INIT_CONTENT_INDEX;
- }
- else
- {
- if (__currentMediaIndex == __pMediaPathArrayList->GetCount() - 1)
+ case REPEAT_TYPE_OFF:
{
- __previousMediaIndex = __currentMediaIndex;
- __currentMediaIndex = INIT_CONTENT_INDEX;
- __nextMediaIndex = __currentMediaIndex + 1;
+ if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+ {
+ __previousMediaIndex = INIT_CONTENT_INDEX;
+ __currentMediaIndex = INIT_CONTENT_INDEX;
+ __nextMediaIndex = INIT_CONTENT_INDEX;
+ }
+ else
+ {
+ if (__currentMediaIndex == __pMediaPathArrayList->GetCount() - 1)
+ {
+ __previousMediaIndex = __currentMediaIndex;
+ __currentMediaIndex = INIT_CONTENT_INDEX;
+ __nextMediaIndex = __currentMediaIndex + 1;
+ }
+ else
+ {
+ __previousMediaIndex = __currentMediaIndex;
+ __currentMediaIndex = __nextMediaIndex;
+ __nextMediaIndex = __currentMediaIndex + 1;
+ }
+ }
+
+ if ((__currentMediaIndex > __previousMediaIndex)
+ && (__currentMediaIndex < __pMediaPathArrayList->GetCount()))
+ {
+ playNextContent = true;
+ }
+ else
+ {
+ playNextContent = false;
+ }
}
- else
+ break;
+
+ case REPEAT_TYPE_ONE:
{
- __previousMediaIndex = __currentMediaIndex;
- __currentMediaIndex = __nextMediaIndex;
- __nextMediaIndex = __currentMediaIndex + 1;
+ playNextContent = false;
}
- }
+ break;
- if ((__currentMediaIndex > __previousMediaIndex)
- && (__currentMediaIndex < __pMediaPathArrayList->GetCount()))
- {
- playNextContent = true;
- }
- else
- {
- playNextContent = false;
- }
+ case REPEAT_TYPE_ALL:
+ {
+ if (__pMediaPathArrayList->GetCount() < MULTI_CONTENT_COUNT)
+ {
+ __previousMediaIndex = INIT_CONTENT_INDEX;
+ __currentMediaIndex = INIT_CONTENT_INDEX;
+ __nextMediaIndex = INIT_CONTENT_INDEX;
+ }
+ else
+ {
+ if (__currentMediaIndex == __pMediaPathArrayList->GetCount() - 1)
+ {
+ __previousMediaIndex = __currentMediaIndex;
+ __currentMediaIndex = INIT_CONTENT_INDEX;
+ __nextMediaIndex = __currentMediaIndex + 1;
+ }
+ else
+ {
+ __previousMediaIndex = __currentMediaIndex;
+ __currentMediaIndex = __nextMediaIndex;
+ __nextMediaIndex = __currentMediaIndex + 1;
+ }
+ }
+
+ if ((__currentMediaIndex > __previousMediaIndex)
+ && (__currentMediaIndex < __pMediaPathArrayList->GetCount()))
+ {
+ playNextContent = true;
+ }
+ else
+ {
+ playNextContent = false;
+ }
+ }
+ break;
- __pVideoPlayerEventListener->OnPlayEndOfClip(playNextContent);
+ default:
+ break;
+ }
+ __pVideoPlayerEventListener->OnPlayEndOfClip(playNextContent, __repeatMode);
}
void
AppLogDebug("__pPlayer [%x]", __pPlayer);
return r;
+}
+
+int
+VideoPlayerPresentationModel::GetRepeatMode(void)
+{
+ return __repeatMode;
+}
+
+void
+VideoPlayerPresentationModel::SetRepeatMode(int repeatMode)
+{
+ __repeatMode = repeatMode;
+}
+
+void
+VideoPlayerPresentationModel::ChangeCurrentMediaIndex(void)
+{
+ __currentMediaIndex = __previousMediaIndex;
+ __previousMediaIndex = __currentMediaIndex - 1;
+ __nextMediaIndex = INIT_CONTENT_INDEX;
}
\ No newline at end of file