Added error pop up back key support
authorrahul varna <rahul.varna@samsung.com>
Mon, 1 Jul 2013 10:05:19 +0000 (15:35 +0530)
committerrahul varna <rahul.varna@samsung.com>
Mon, 1 Jul 2013 10:05:19 +0000 (15:35 +0530)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Camera/CameraCaptureForm.cpp
project/src/MediaPlayerForm.cpp
project/src/Player/CameraPlayerForm.cpp
project/src/Player/VideoRecorderPlayerForm.cpp
project/src/Recorder/AudioRecorderForm.cpp
project/src/Recorder/VideoRecorderForm.cpp

index 17aaeae..af9fb7c 100644 (file)
@@ -266,6 +266,11 @@ CameraCaptureForm::OnKeyPressed(Tizen::Ui::Control& source, const Tizen::Ui::Key
                        *__pShownPopup = null;
                        __pShownPopup = null;
                        __backKeyprocessed = true;
+
+                       EnableFooterItem(ID_BUTTON_SETTING, true);
+                       EnableFooterItem(ID_BUTTON_CAPTURE, true);
+                       GetFooter()->Draw();
+
                        return true;
                }
                if (_pErrorMessagePopup != null)
@@ -3817,7 +3822,6 @@ CameraCaptureForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
        __fileCount = 0;
        __iconListCount = 0;
        __iconListIndex = 0;
-       AppLog("Deactivate starts");
        Deactivate();
 }
 
index afa90c9..8d37e57 100644 (file)
@@ -49,8 +49,6 @@ static const int REQUIRE_WIDTH_PERCENTAGE_LANDSCAPE = 85;
 static const int MILI_SEC = 1000;
 static const int SEC = 60;
 static const int MAX_TIME = 10;
-static const int PLAYER_VOLUME_MAX = 90;
-static const int PLAYER_VOLUME_INCREMENT = 5;
 
 static const int DEVICE_PORTRAIT = 0;
 static const int DEVICE_PORTRAIT_REVERSE = 1;
index e9270cf..9a5a1ed 100644 (file)
@@ -564,6 +564,7 @@ void
 CameraPlayerForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 {
        AppLog("CameraPlayerForm::OnFormBackRequested called");
+       MultiForm::ClearErrorPopup();
        FreeResources();
        SetFooterItem(0, L"Start", ID_BUTTON_START);
        Deactivate();
index 47ff5d4..c43f3ca 100644 (file)
@@ -973,12 +973,6 @@ void
 VideoRecorderPlayerForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 {
        AppLog("CameraCaptureForm::OnFormBackRequested called");
-       if (IsProcessedEvent())
-       {
-               AppLog("Processed Event");
-               ResetProcessedEvent();
-               return;
-       }
 
        __backGroundFlag = true;
        ShowFooterItem(0, false);
@@ -986,7 +980,7 @@ VideoRecorderPlayerForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
        SetFooterItem(0, L"Start", ID_BUTTON_START);
 
        FreeResources();
-       ClearErrorPopup();
+       MultiForm::ClearErrorPopup();
        Deactivate();
 
 }
index 8f6c6c5..0f9caa7 100644 (file)
@@ -771,6 +771,9 @@ AudioRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
                TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListViewQuality->SetItemChecked failed", GetErrorMessage(r));
 
                __qualityIndex = index;
+
+               AppConfig::GetInstance()->SetValue(SECTION, KEY_QUALITY, __qualityIndex);
+               CreateDisplayString();
        }
        else if (&source == __pListViewCodec)
        {
@@ -787,6 +790,11 @@ AudioRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
                TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListViewCodec->SetItemChecked failed", GetErrorMessage(r));
 
                __codecIndex = index;
+
+               CodecType tempCodecType;
+               __pCodecTypeList->GetAt(__codecIndex, tempCodecType);
+               AppConfig::GetInstance()->SetValue(SECTION, KEY_CODEC, tempCodecType);
+               CreateDisplayString();
        }
        else if (&source == __pListViewStreamCallback)
        {
@@ -813,6 +821,16 @@ AudioRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
                {
                        __isStreamCallback = false;
                }
+
+               TryReturnVoid(__pAudioRecorder != null, "__pAudioRecorder handle is null");
+               if (__isStreamCallback == true)
+               {
+                       __pAudioRecorder->AddAudioStreamFilter(*this);
+               }
+               else
+               {
+                       __pAudioRecorder->RemoveAudioStreamFilter(*this);
+               }
        }
 
        Invalidate(true);
@@ -1083,9 +1101,7 @@ AudioRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
 
        case ID_BUTTON_QUALITY_OK:
        {
-               AppConfig::GetInstance()->SetValue(SECTION, KEY_QUALITY, __qualityIndex);
                HidePopUp(__pPopupQuality);
-               CreateDisplayString();
                DeletePopup(__pPopupQuality);
                __pPopupQuality = null;
        }
@@ -1093,11 +1109,7 @@ AudioRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
 
        case ID_BUTTON_CODEC_OK:
        {
-               CodecType tempCodecType;
-               __pCodecTypeList->GetAt(__codecIndex, tempCodecType);
-               AppConfig::GetInstance()->SetValue(SECTION, KEY_CODEC, tempCodecType);
                HidePopUp(__pPopupCodec);
-               CreateDisplayString();
                DeletePopup(__pPopupCodec);
                __pPopupCodec = null;
        }
@@ -1108,16 +1120,6 @@ AudioRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                HidePopUp(__pPopupStreamCallback);
                DeletePopup(__pPopupStreamCallback);
                __pPopupStreamCallback = null;
-
-               TryReturnVoid(__pAudioRecorder != null, "__pAudioRecorder handle is null");
-               if (__isStreamCallback == true)
-               {
-                       __pAudioRecorder->AddAudioStreamFilter(*this);
-               }
-               else
-               {
-                       __pAudioRecorder->RemoveAudioStreamFilter(*this);
-               }
        }
        break;
 
index f0199f7..d410a95 100644 (file)
@@ -166,9 +166,9 @@ VideoRecorderForm::VideoRecorderForm(void)
        , __pPopupZoom(null)
        , __pPopupFlip(null)
        , __pSupportedCodecPopup(null)
-       , __pShownPopup(null)
        , __pPopupAudioStreamCallback(null)
        , __pPopupVideoStreamCallback(null)
+       , __pShownPopup(null)
        , __pListViewEffect(null)
        , __pListViewFocusMode(null)
        , __pListViewIso(null)
@@ -324,7 +324,6 @@ VideoRecorderForm::OnKeyPressed(Tizen::Ui::Control& source, const Tizen::Ui::Key
                {
                        (*__pShownPopup)->RemoveAllControls();
                        (*__pShownPopup)->SetShowState(false);
-                       AppLog(" Removing the control");
                        delete *__pShownPopup;
                        *__pShownPopup = null;
                        __pShownPopup = null;
@@ -335,7 +334,7 @@ VideoRecorderForm::OnKeyPressed(Tizen::Ui::Control& source, const Tizen::Ui::Key
                {
                        _pErrorMessagePopup->RemoveAllControls();
                        _pErrorMessagePopup->SetShowState(false);
-                       AppLog(" Removing the control");
+
                        SAFE_DELETE(_pErrorMessagePopup);
                        _isProcessedEvent = true;
                        _inErrorState = false;
@@ -1885,7 +1884,6 @@ VideoRecorderForm::OnTerminating(void)
 void
 VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 {
-       result r = E_SUCCESS;
        AppLog("Enter action id = %d", actionId);
 
        switch (actionId)
@@ -2061,16 +2059,6 @@ VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
        {
                HidePopUp(__pPopupAudioStreamCallback);
                DeletePopup(&__pPopupAudioStreamCallback);
-
-               TryReturnVoid(__pVideoRecorder != null, "__pVideoRecorder handle is null");
-               if (__isAudioStreamCallback == true)
-               {
-                       __pVideoRecorder->AddAudioStreamFilter(*this);
-               }
-               else
-               {
-                       __pVideoRecorder->RemoveAudioStreamFilter(*this);
-               }
        }
        break;
 
@@ -2078,33 +2066,6 @@ VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
        {
                HidePopUp(__pPopupVideoStreamCallback);
                DeletePopup(&__pPopupVideoStreamCallback);
-
-               TryReturnVoid(__pCamera != null, "__pCamera handle is null");
-               if (__isVideoStreamCallback == true)
-               {
-                       __pCamera->AddVideoStreamFilter(*this);
-               }
-               else
-               {
-                       __pCamera->RemoveVideoStreamFilter(*this);
-               }
-
-               r = __pCamera->StopPreview();
-               TryReturnVoid(r == E_SUCCESS,"[%s] __pCamera->StopPreview()", GetErrorMessage(r));
-
-               r = __pOverlay->GetBackgroundBufferInfo(__bufferInfo);
-               TryReturnVoid(r == E_SUCCESS,"[%s] __pOverlay->GetBackgroundBufferInfo", GetErrorMessage(r));
-
-               if (__previewByCallback == 1)
-               {
-                       r = __pCamera->StartPreview(null, true);
-                       TryReturnVoid(r == E_SUCCESS, "[%s] __pCamera->StartPreview", GetErrorMessage(r));
-               }
-               else
-               {
-                       r = __pCamera->StartPreview(&__bufferInfo, false);
-                       TryReturnVoid(r == E_SUCCESS, "[%s] __pCamera->StartPreview", GetErrorMessage(r));
-               }
        }
        break;
 
@@ -2125,7 +2086,6 @@ VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                HidePopUp(__pPopupExposure);
                DeletePopup(&__pPopupExposure);
                __pExposureSlider = null;
-               ShowFooterItems();
        }
        break;
 
@@ -2134,7 +2094,6 @@ VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                HidePopUp(__pPopupBrightness);
                DeletePopup(&__pPopupBrightness);
                __pBrightnessSlider = null;
-               ShowFooterItems();
        }
        break;
 
@@ -2143,7 +2102,6 @@ VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                HidePopUp(__pPopupContrast);
                DeletePopup(&__pPopupContrast);
                __pContrastSlider = null;
-               ShowFooterItems();
        }
        break;
 
@@ -2152,32 +2110,12 @@ VideoRecorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actio
                HidePopUp(__pPopupZoom);
                DeletePopup(&__pPopupZoom);
                __pZoomLevelSlider = null;
-               ShowFooterItems();
        }
        break;
 
        case ID_BUTTON_FLIP_OK:
        {
-               CameraFlipType flipType = __pCamera->GetFlip();
                HidePopUp(__pPopupFlip);
-               if (flipType != __flipType)
-               {
-                       r = __pCamera->StopPreview();
-                       TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->StopPreview", GetErrorMessage(r));
-                       r = __pCamera->SetFlip(__flipType);
-                       TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetFlip", GetErrorMessage(r));
-                       AppLog("Set Flip return = %s value = %d", GetErrorMessage(r), __flipType);
-                       if (__previewByCallback == 1)
-                       {
-                               r = __pCamera->StartPreview(null, true);
-                               TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->StartPreview", GetErrorMessage(r));
-                       }
-                       else
-                       {
-                               r = __pCamera->StartPreview(&__bufferInfo, false);
-                               TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->StartPreview", GetErrorMessage(r));
-                       }
-               }
                DeletePopup(&__pPopupFlip);
        }
        break;
@@ -2794,6 +2732,16 @@ VideoRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
                {
                        __isAudioStreamCallback = false;
                }
+
+               TryReturnVoid(__pVideoRecorder != null, "__pVideoRecorder handle is null");
+               if (__isAudioStreamCallback == true)
+               {
+                       __pVideoRecorder->AddAudioStreamFilter(*this);
+               }
+               else
+               {
+                       __pVideoRecorder->RemoveAudioStreamFilter(*this);
+               }
        }
        else if (&source == __pListViewVideoStreamCallback)
        {
@@ -2820,6 +2768,33 @@ VideoRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
                {
                        __isVideoStreamCallback = false;
                }
+
+               TryReturnVoid(__pCamera != null, "__pCamera handle is null");
+               if (__isVideoStreamCallback == true)
+               {
+                       __pCamera->AddVideoStreamFilter(*this);
+               }
+               else
+               {
+                       __pCamera->RemoveVideoStreamFilter(*this);
+               }
+
+               r = __pCamera->StopPreview();
+               TryReturnVoid(r == E_SUCCESS,"[%s] __pCamera->StopPreview()", GetErrorMessage(r));
+
+               r = __pOverlay->GetBackgroundBufferInfo(__bufferInfo);
+               TryReturnVoid(r == E_SUCCESS,"[%s] __pOverlay->GetBackgroundBufferInfo", GetErrorMessage(r));
+
+               if (__previewByCallback == 1)
+               {
+                       r = __pCamera->StartPreview(null, true);
+                       TryReturnVoid(r == E_SUCCESS, "[%s] __pCamera->StartPreview", GetErrorMessage(r));
+               }
+               else
+               {
+                       r = __pCamera->StartPreview(&__bufferInfo, false);
+                       TryReturnVoid(r == E_SUCCESS, "[%s] __pCamera->StartPreview", GetErrorMessage(r));
+               }
        }
        else if (&source == __pListViewVideoCodec)
        {
@@ -2898,7 +2873,27 @@ VideoRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
                TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListViewFlipType->SetItemChecked", GetErrorMessage(r));
 
                __flipType = (CameraFlipType) index;
-               AppLog("flip type = %d selected", index);
+
+               CameraFlipType flipType = __pCamera->GetFlip();
+               if (flipType != __flipType)
+               {
+                       r = __pCamera->StopPreview();
+                       TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->StopPreview", GetErrorMessage(r));
+                       r = __pCamera->SetFlip(__flipType);
+                       TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetFlip", GetErrorMessage(r));
+                       AppLog("Set Flip return = %s value = %d", GetErrorMessage(r), __flipType);
+                       if (__previewByCallback == 1)
+                       {
+                               r = __pCamera->StartPreview(null, true);
+                               TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->StartPreview", GetErrorMessage(r));
+                       }
+                       else
+                       {
+                               r = __pCamera->StartPreview(&__bufferInfo, false);
+                               TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pCamera->StartPreview", GetErrorMessage(r));
+                       }
+               }
+
        }
        else if (&source == __pListViewSetting)
        {
@@ -3028,6 +3023,8 @@ VideoRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
 
        Invalidate(true);
 
+       ShowFooterItems();
+
        return;
 CATCH:
        __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;