Fixed jira issues
[apps/osp/MusicPlayer.git] / src / MpMusicPlayerForm.cpp
index 28f3caa..610a403 100644 (file)
@@ -505,7 +505,7 @@ PlayerForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
        
                        TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
                        pContentsTableView->UpdateTableView();
-                       }
+               }
                break;
 
        case IDA_PLAYER_CONTROLLER_VOLUME:
@@ -929,6 +929,7 @@ PlayerForm::OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graph
                if (__isLongPressed == true)
                {
                        __pPlayerPresentationModel->StopForwardRewind();
+                       __isLongPressed = false;
                }
        }
 
@@ -1404,6 +1405,7 @@ PlayerForm::OnPlayStateChanged(PlayerState playerState)
 
        if (playerState == PLAYER_STATE_ERROR)
        {
+               MusicPlayerApp* pApp = static_cast<MusicPlayerApp*>(App::GetInstance());
                RemoveContextMenu();
                SetContentInfo( __pPlayerPresentationModel->GetCurrentContentIndex());
 
@@ -1416,9 +1418,15 @@ PlayerForm::OnPlayStateChanged(PlayerState playerState)
                        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)
                {
@@ -1439,10 +1447,17 @@ PlayerForm::OnPlayContentChanged(int currentContentIndex)
        {
                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");
 }
@@ -1763,7 +1778,8 @@ PlayerForm::SetFileNotExistState(bool isFileExist)
        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);
@@ -2138,7 +2154,7 @@ PlayerForm::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
 void
 PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
 {
-       AppLogDebug("ENTER");
+       AppLogDebug("ENTER %d",playerScreenState);
 
        if (__playerScreenState == playerScreenState||
          (playerScreenState != PLAYER_SCREEN_STATE_NORMAL &&
@@ -2191,7 +2207,7 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
                        __pShuffleButton->SetShowState(false);
                        __pRepeatButton->SetShowState(false);
                        __prevRepeatStateRunByAppControl = __pPlayerPresentationModel->GetRepeatState();
-                       SetRepeatButtonImage(IDA_TYPE_REPEAT_A);
+//                     SetRepeatButtonImage(IDA_TYPE_REPEAT_A);
 
                        if (__pContentsListViewPanel->GetShowState() == true)
                        {
@@ -2244,9 +2260,9 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
 
        case PLAYER_SCREEN_STATE_ERROR_CONTENT:
                {
-                       if(__pPlayerPresentationModel->IsDuringCall())
+                       if (__pPlayerPresentationModel->IsDuringCall())
                        {
-                               if(__isRunByAppControl)
+                               if (__isRunByAppControl)
                                {
                                        SetPlayerScreenState(PLAYER_SCREEN_STATE_APP_CONTROL);
                                }