void OnScreenOff(void);
Tizen::Base::String GetOperationId(void);
+ RequestId GetRequestId(void);
+ void ResetRequestId(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);
static const int SEARCH_PAGE_NO = 1;
static const int SEARCH_COUNT_PER_PAGE = 30000;
static const int ITEM_HEIGHT = 140;
+static const int SEARCH_ITEM_DIVIDER_HEIGHT = 2;
static const int GROUP_ITEM_HEIGHT = 144;
static const int STRING_LENGTH = 90;
static const int H_NOW_PLAY_BAR = 120;
{
Scene* pScene = pSceneManager->GetCurrentScene();
- PlayerForm* pPlayerForm = dynamic_cast<PlayerForm*>(pScene->GetForm());
+ PlayerForm* pPlayerForm = static_cast<PlayerForm*>(pScene->GetForm());
if (currentSceneId.Equals(IDSCN_PLAYER, false))
{
pPlayerForm->OnChangedContentListByAppControlN(__pDataList);
return __operationId;
}
+RequestId
+MusicPlayerApp::GetRequestId(void)
+{
+ return __requestId;
+}
+
+void
+MusicPlayerApp::ResetRequestId(void)
+{
+ __requestId = null;
+}
+
void
MusicPlayerApp::OnContentFileCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
{
TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
pContentsTableView->UpdateTableView();
- }
+ }
break;
case IDA_PLAYER_CONTROLLER_VOLUME:
if (__isLongPressed == true)
{
__pPlayerPresentationModel->StopForwardRewind();
+ __isLongPressed = false;
}
}
if (playerState == PLAYER_STATE_ERROR)
{
+ MusicPlayerApp* pApp = static_cast<MusicPlayerApp*>(App::GetInstance());
RemoveContextMenu();
SetContentInfo( __pPlayerPresentationModel->GetCurrentContentIndex());
SetPlayerScreenState(PLAYER_SCREEN_STATE_ERROR_CONTENT);
}
ShowMessageBox(ResourceManager::GetString(L"IDS_MUSIC_POP_UNABLE_TO_PLAY_ERROR_OCCURRED"));
+
+ if (pApp != null && pApp->GetRequestId() != null)
+ {
+ AppControlProviderManager::GetInstance()->SendAppControlResult(pApp->GetRequestId(),APP_CTRL_RESULT_SUCCEEDED,null);
+ pApp->ResetRequestId();
+ }
}
- if (playerState == PLAYER_STATE_PAUSED)
+ else if (playerState == PLAYER_STATE_PAUSED)
{
if (__pPlayerPresentationModel->IsDuringCall() == true)
{
{
SetPlayerScreenState(PLAYER_SCREEN_STATE_DURING_CALL);
}
- else
+ else if (__playerScreenState == PLAYER_SCREEN_STATE_DURING_CALL || __playerScreenState == PLAYER_SCREEN_STATE_ERROR_CONTENT)
{
- SetPlayerScreenState(PLAYER_SCREEN_STATE_NORMAL);
-
+ if (__isAppControlDuringCall)
+ {
+ SetPlayerScreenState(PLAYER_SCREEN_STATE_APP_CONTROL);
+ __isAppControlDuringCall = false;
+ }
+ else
+ {
+ SetPlayerScreenState(PLAYER_SCREEN_STATE_NORMAL);
+ }
}
AppLogDebug("EXIT");
}
AppLogDebug("ENTER");
RemoveContextMenu();
- if(GetPlayerScreenState() != PLAYER_SCREEN_STATE_DURING_CALL)
+ if(GetPlayerScreenState() != PLAYER_SCREEN_STATE_DURING_CALL &&
+ GetPlayerScreenState() != PLAYER_SCREEN_STATE_ERROR_CONTENT)
{
__pMoreContextButton->SetEnabled(isFileExist);
__pMoreContextButton->Invalidate(true);
void
PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
{
- AppLogDebug("ENTER");
+ AppLogDebug("ENTER %d",playerScreenState);
if (__playerScreenState == playerScreenState||
(playerScreenState != PLAYER_SCREEN_STATE_NORMAL &&
__pShuffleButton->SetShowState(false);
__pRepeatButton->SetShowState(false);
__prevRepeatStateRunByAppControl = __pPlayerPresentationModel->GetRepeatState();
- SetRepeatButtonImage(IDA_TYPE_REPEAT_A);
+// SetRepeatButtonImage(IDA_TYPE_REPEAT_A);
if (__pContentsListViewPanel->GetShowState() == true)
{
case PLAYER_SCREEN_STATE_ERROR_CONTENT:
{
- if(__pPlayerPresentationModel->IsDuringCall())
+ if (__pPlayerPresentationModel->IsDuringCall())
{
- if(__isRunByAppControl)
+ if (__isRunByAppControl)
{
SetPlayerScreenState(PLAYER_SCREEN_STATE_APP_CONTROL);
}
if (playerState == PLAYER_STATE_PLAYING)
{
r = __pPlayer->Pause();
- TryCatch(r == E_SUCCESS, , "__pPlayer pause failed..\n");
+ TryCatch(r == E_SUCCESS, , "__pPlayer pause failed..%s\n",GetErrorMessage(r));
+
if (__pPlayStateTimer != null)
{
r = __pPlayStateTimer->Cancel();
{
AppLogDebug("ENTER");
int playDuration = __pPlayer->GetDuration();
- __playposition = static_cast<int>(__pPlayer->GetPosition() / (playDuration / TIMER_INTERVAL));
- Forward();
+ if(playDuration != 0)
+ {
+ __playposition = static_cast<int>(__pPlayer->GetPosition() / (playDuration / TIMER_INTERVAL));
+ Forward();
+ }
AppLogDebug("EXIT");
}
result r = SetPlayPosition(__playposition);
if (IsFailed(r))
{
+ AppLogDebug("SetPlayPosition Failed %s",GetErrorMessage(r));
StopForwardRewind();
return;
}
{
AppLogDebug("ENTER");
result r = E_SUCCESS;
+
if (__pFastForwardTimer != null)
{
r = __pFastForwardTimer->Cancel();
TryLog(r == E_SUCCESS, "[%s] __pFastForwardTimer cancel failed", GetErrorMessage(r));
}
+
if (__pFastRewindTimer != null)
{
r = __pFastRewindTimer->Cancel();
TryLog(r == E_SUCCESS, "[%s] __pFastRewindTimer cancel failed", GetErrorMessage(r));
}
+
__xTimesValue = INIT_X_VALUE;
__seekCompleted = true;
AppLogDebug("EXIT");
void
PlayerPresentationModel::OnPlayerSeekCompleted(result r)
{
- AppLogDebug("ENTER");
+ AppLogDebug("ENTER %s",GetErrorMessage(r));
if (r == E_SUCCESS)
{
__seekCompleted = true;
{
AppLogDebug("ENTER");
Tizen::Base::String dbName(App::GetInstance()->GetAppRootPath() + DATABASE_PATH);
- Tizen::Base::String sql = null;
+ Tizen::Base::String sql;
result r = E_SUCCESS;
r = pDatabase->Construct(dbName, true);
TryCatch(r == E_SUCCESS, r = E_FAILURE, "Database can not construct.[%s]", GetErrorMessage(r));
sql.Append(L"CREATE TABLE IF NOT EXISTS playlisttable ( primaryKey INTEGER PRIMARY KEY AUTOINCREMENT, contentId TEXT, playCount INTEGER, playTime TEXT )");
-
+ r = pDatabase->BeginTransaction();
+ TryCatch(r == E_SUCCESS, r = E_FAILURE, "BeginTransaction failed.[%s]", GetErrorMessage(r));
r = pDatabase->ExecuteSql(sql, true);
TryCatch(r == E_SUCCESS, r = E_FAILURE, "ExecuteSql failed.[%s]", GetErrorMessage(r));
r = pDatabase->CommitTransaction();
result r = E_SUCCESS;
- Tizen::Base::String statement = null;
+ Tizen::Base::String statement;
DbEnumerator* pEnum = null;
Tizen::Io::Database* pDatabase = new (std::nothrow) Database();
r = pDatabase->Construct(dbName, false);
+
+ TryReturn(r == E_SUCCESS,null,"pDatabase->Construct failed with error %s",GetErrorMessage(r));
+
if (index == MOST_PLAYED_CONTENT)
{
statement.Append(L"SELECT contentId FROM playlisttable WHERE playCount > 0 ORDER BY playCount DESC");
__pSearchTableView = new (std::nothrow) TableView();
__pSearchTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight()),
- true,
+ false,
TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
__pSearchTableView->SetItemProvider(this);
if (keypadAction == KEYPAD_ACTION_SEARCH)
{
__pSearchBar->HideKeypad();
- if (__pSearchBar->GetText().GetLength() != INIT_VALUE)
+
+ if (__pSearchBar->GetTextLength() != INIT_VALUE)
{
__pPresentationModel->InitializeContentList(__pSearchBar->GetText());
}
GetFooter()->SetShowState(true);
Rectangle clientBounds = GetClientAreaBounds();
__pSearchTableView->SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height - __pSearchBar->GetHeight()));
+
+ if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
+ {
+ __pNoContentTextLabel->SetBounds(X_GAP,(clientBounds.height - H_NO_CONTENT)/2,GetWidth() - (X_GAP * 2),H_NO_CONTENT);
+ }
AppLogDebug("EXIT");
}
AppLogDebug("ENTER");
Rectangle clientBounds = GetClientAreaBounds();
__pSearchTableView->SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height - __pSearchBar->GetHeight()));
+
+ if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
+ {
+ //Rectangle(X_GAP, Y_GAP_NO_CONTENT, GetWidth() - (X_GAP * 2), H_NO_CONTENT)
+ __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(clientBounds.height - H_NO_CONTENT)/2,GetWidth() - (X_GAP * 2),H_NO_CONTENT));
+ }
AppLogDebug("EXIT");
}
{
Rectangle clientBounds = GetClientAreaBounds();
__pSearchTableView->SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height - __pSearchBar->GetHeight()));
+
+ if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
+ {
+ //Rectangle(X_GAP, Y_GAP_NO_CONTENT, GetWidth() - (X_GAP * 2), H_NO_CONTENT)
+ __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(clientBounds.height - H_NO_CONTENT)/2,GetWidth() - (X_GAP * 2),H_NO_CONTENT));
+ }
}
int
SearchForm::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
+ Label* pDividerLabel;
+ bool addDivider = true;
RelativeLayout layout;
layout.Construct();
pArtistNameLabel->SetTextConfig(MAIN_TEXT_SIZE, LABEL_TEXT_STYLE_NORMAL);
pArtistNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
pItem->AddControl(pArtistNameLabel);
+
+ if (itemIndex == __pPresentationModel->GetAlbumIndex()-1)
+ {
+ addDivider = false;
+ }
}
else if (itemIndex < __pPresentationModel->GetSongIndex())
{
pItem->AddControl(pAlbumNameLabel);
pItem->AddControl(pArtistNameLabel);
+
+ if (itemIndex == __pPresentationModel->GetSongIndex()-1)
+ {
+ addDivider = false;
+ }
}
else
{
pSongNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
pItem->AddControl(pSongNameLabel);
+
+ if (itemIndex == __pPresentationModel->GetTotalContentCount()-1)
+ {
+ addDivider = false;
+ }
}
delete pContentInfo;
+ if (addDivider)
+ {
+ pDividerLabel = new (std::nothrow) Label();
+ pDividerLabel->Construct(FloatRectangle(0, ITEM_HEIGHT-SEARCH_ITEM_DIVIDER_HEIGHT, W_CLIENT_AREA,SEARCH_ITEM_DIVIDER_HEIGHT ), L"");
+ pDividerLabel->SetBackgroundColor(__pSearchTableView->GetItemDividerColor());
+ pItem->AddControl(pDividerLabel);
+ }
+
AppLogDebug("EXIT");
return pItem;