added (std::nothrow) in camera and recorder files
authorrahul varna <rahul.varna@samsung.com>
Mon, 1 Apr 2013 02:57:37 +0000 (11:57 +0900)
committerrahul varna <rahul.varna@samsung.com>
Mon, 1 Apr 2013 02:57:37 +0000 (11:57 +0900)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Camera/CameraCaptureForm.cpp
project/src/Player/VideoRecorderPlayerForm.cpp
project/src/Recorder/AudioRecorderForm.cpp
project/src/Recorder/VideoRecorderForm.cpp

index 56ef972..859b0b2 100644 (file)
@@ -376,7 +376,7 @@ CameraCaptureForm::CreateIconListView(void)
        pFooter->GetBounds(x, y, width, height);
        y = (y-height);
 
-       __pIconList = new IconListView;
+       __pIconList = new (std:: nothrow) IconListView;
        TryReturn(__pIconList != null, E_OUT_OF_MEMORY, "Could not create IconListView, no memory");
 
        r = __pIconList->Construct(Rectangle(0, (y-(ICON_HEIGHT*2)), GetClientAreaBounds().width, (ICON_HEIGHT*2)), itemSizes, ICON_LIST_VIEW_STYLE_NORMAL,
@@ -392,6 +392,9 @@ CameraCaptureForm::CreateIconListView(void)
        r = __pIconList->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_OUTLINE);
        TryReturn(r == E_SUCCESS, r, "[%s] __pIconList->SetItemBorderStyle", GetErrorMessage(r));
 
+       r = __pIconList->SetTouchAnimationEnabled(true);
+       TryReturn(r == E_SUCCESS, r, "[%s] __pIconList->SetTouchAnimationEnabled", GetErrorMessage(r));
+
        __pIconList->AddIconListViewItemEventListener(*this);
        AddControl(*__pIconList);
 
@@ -419,10 +422,11 @@ CameraCaptureForm::CreateItem(int index)
        IconListViewItem* pIconListViewItemObj = null;
        result r = E_SUCCESS;
        Bitmap* pCapturedBitmap = null;
+       Footer* pFotter = null;
 
        AppLog("IconListViewItem's CreateItem called index is %d", index);
 
-       pIconListViewItemObj = new IconListViewItem();
+       pIconListViewItemObj = new (std::nothrow) IconListViewItem();
        TryReturn(pIconListViewItemObj != null, null, "could not create IconListViewItem, no memory");
 
        pCapturedBitmap = (Bitmap*)__pCapturedBitmapList->GetAt(index);
@@ -431,6 +435,16 @@ CameraCaptureForm::CreateItem(int index)
        r = pIconListViewItemObj->Construct(*pCapturedBitmap);
        TryReturn(r == E_SUCCESS, null, "[%s] pIconListViewItemObj->Construct",GetErrorMessage(r));
 
+       EnableFooterItem(ID_BUTTON_SETTING, true);
+       EnableFooterItem(ID_BUTTON_CAPTURE, true);
+
+       pFotter = GetFooter();
+       if (pFotter != null)
+       {
+               pFotter->SetBackButtonEnabled(true);
+               pFotter->Draw();
+       }
+
        return pIconListViewItemObj;
 }
 
@@ -444,9 +458,10 @@ CameraCaptureForm::DeleteItem(int index, IconListViewItem* pItem)
 void
 CameraCaptureForm::OnIconListViewItemStateChanged (Tizen::Ui::Controls::IconListView &view, int index, Tizen::Ui::Controls::IconListViewItemStatus status)
 {
-               FreeResources();
-               LaunchImageViewer(index);
-               __background = true;
+       AppLog("OnIconListViewItemStateChanged for index %d", index);
+       FreeResources();
+       LaunchImageViewer(index);
+       __background = true;
 }
 
 result
@@ -1912,7 +1927,7 @@ CameraCaptureForm::ShowCapturedImageThumbnail(String* pFileName)
        result r = E_SUCCESS;
        int deviceOrientation = 0;
 
-       pCapturedFilePath = new String;
+       pCapturedFilePath = new (std::nothrow) String;
        TryReturn(pCapturedFilePath != null, ShowErrorVoid(r, METHOD_FILE_LINENO),"pCapturedFilePath failed, no memory");
 
        pCapturedFilePath->Clear();
@@ -1991,16 +2006,6 @@ CameraCaptureForm::OnCameraCaptured(Tizen::Base::ByteBuffer& capturedData, resul
        else
        {
                ShowCapturedImageThumbnail(&__filePath);
-
-               EnableFooterItem(ID_BUTTON_SETTING, true);
-               EnableFooterItem(ID_BUTTON_CAPTURE, true);
-
-               pFotter = GetFooter();
-               if (pFotter != null)
-               {
-                       pFotter->SetBackButtonEnabled(true);
-                       pFotter->Draw();
-               }
        }
 
        return;
@@ -2017,17 +2022,17 @@ CameraCaptureForm::LaunchImageViewer(String* pFile)
 
        AppLog("MediaPlayerForm's LaunchImageViewer invoked file path is %ls", pFile->GetPointer());
 
-       pMediaType = new String;
+       pMediaType = new (std::nothrow) String;
        TryReturnVoid(pMediaType != null, "pMediaType string is null, no memory");
        pMediaType->Clear();
        pMediaType->Append(L"IMAGE");
 
-       pFilePath = new String;
+       pFilePath = new (std::nothrow) String;
        TryReturnVoid(pFilePath != null, "pFilePath string is null, no memory");
        pFilePath->Clear();
        pFilePath->Append(*pFile);
 
-       pDeviceOrientation = new Integer(__deviceOrientation);
+       pDeviceOrientation = new (std::nothrow) Integer(__deviceOrientation);
        TryReturnVoid(pDeviceOrientation != null, "pDeviceOrientation string is null, no memory");
 
        pArg = new (std::nothrow) ArrayList;
@@ -2056,17 +2061,17 @@ CameraCaptureForm::LaunchImageViewer(int index)
 
        AppLog("MediaPlayerForm's LaunchImageViewer invoked file path at index is %d is %ls", index, ((String*)__pCapturedFileNameList->GetAt(index))->GetPointer());
 
-       pMediaType = new String;
+       pMediaType = new (std::nothrow) String;
        TryReturnVoid(pMediaType != null, "pMediaType string is null, no memory");
        pMediaType->Clear();
        pMediaType->Append(L"IMAGE");
 
-       pFilePath = new String;
+       pFilePath = new (std::nothrow) String;
        TryReturnVoid(pFilePath != null, "pFilePath string is null, no memory");
        pFilePath->Clear();
        pFilePath->Append(*(String*)__pCapturedFileNameList->GetAt(index));
 
-       pDeviceOrientation = new Integer(__deviceOrientation);
+       pDeviceOrientation = new (std::nothrow) Integer(__deviceOrientation);
        TryReturnVoid(pDeviceOrientation != null, "pDeviceOrientation string is null, no memory");
 
        pArg = new (std::nothrow) ArrayList;
@@ -2238,7 +2243,7 @@ CameraCaptureForm::CreateEffect(void)
 
                                if (effectType <= 6 && effectType != -1)
                                {
-                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new String(EffectMap[effectType]), effectType);
+                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(EffectMap[effectType]), effectType);
                                        __pSettingItemArrayList->Add(*pItemData);
                                        __pEffectList->Add(effectType);
                                        AppLog("effect return is = %d VALUE = %ls", effectType, EffectMap[effectType]);
@@ -2322,7 +2327,7 @@ CameraCaptureForm::CreateMeteringMode(void)
 
                                if (meteringModeType <= meteringModeCount && meteringModeType != -1)
                                {
-                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new String(pMeteringModeMap[meteringModeType]), meteringModeType);
+                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(pMeteringModeMap[meteringModeType]), meteringModeType);
                                        __pSettingItemArrayList->Add(*pItemData);
                                        __pMeteringModeList->Add(meteringModeType);
                                        AppLog("metering mode return is = %d VALUE = %ls", meteringModeType, pMeteringModeMap[meteringModeType]);
@@ -2408,7 +2413,7 @@ CameraCaptureForm::CreateFocusMode(void)
 
                                if (focusModeType <= 4 && focusModeType != -1)
                                {
-                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new String(pFocusModeMap[focusModeType]), focusModeType);
+                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(pFocusModeMap[focusModeType]), focusModeType);
                                        __pSettingItemArrayList->Add(*pItemData);
                                        __pFocusModeList->Add(focusModeType);
                                        AppLog("focus mode return is = %d VALUE = %ls", focusModeType, pFocusModeMap[focusModeType]);
@@ -2507,7 +2512,7 @@ CameraCaptureForm::CreateSceneMode(void)
 
                                if (sceneModeType <= 15 && sceneModeType != -1)
                                {
-                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new String(pSceneModeMap[sceneModeType]), sceneModeType);
+                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(pSceneModeMap[sceneModeType]), sceneModeType);
                                        TryCatch(pItemData != null, ," CreatePopUp Scene Mode failed");
 
                                        __pSettingItemArrayList->Add(*pItemData);
@@ -3394,7 +3399,7 @@ CameraCaptureForm::CreateFlashMode(void)
 
                                if (flashModeType <= 4 && flashModeType != -1)
                                {
-                                       pItemData = new (std::nothrow) SettingListData(new String(pFlashModeMap[flashModeType]), flashModeType);
+                                       pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(pFlashModeMap[flashModeType]), flashModeType);
                                        __pSettingItemArrayList->Add(*pItemData);
                                        __pFlashModeList->Add(flashModeType);
                                        AppLog("flash mode return is = %d VALUE = %ls", flashModeType, pFlashModeMap[flashModeType]);
index d70fcca..2f1d8ae 100644 (file)
@@ -830,17 +830,17 @@ VideoRecorderPlayerForm::LaunchMediaPlayer(bool flag)
 
        AppLog("MediaPlayerForm's LaunchMediaPlayer invoked file path %ls", __filePath.GetPointer());
 
-       pMediaType = new String;
+       pMediaType = new (std::nothrow) String;
        TryReturnVoid(pMediaType != null, "pMediaType string is null, no memory");
        pMediaType->Clear();
        pMediaType->Append(L"VIDEO");
 
-       pFilePath = new String;
+       pFilePath = new (std::nothrow) String;
        TryReturnVoid(pFilePath != null, "pFilePath string is null, no memory");
        pFilePath->Clear();
        pFilePath->Append(__filePath);
 
-       pDeviceOrientation = new Integer(0);
+       pDeviceOrientation = new (std::nothrow) Integer(0);
        TryReturnVoid(pDeviceOrientation != null, "pDeviceOrientation string is null, no memory");
 
        pArg = new (std::nothrow) ArrayList;
index 170241b..ad872de 100644 (file)
@@ -538,7 +538,7 @@ AudioRecorderForm::CheckCallInProgress(void)
        CallStatus callStatus = CALL_STATUS_UNDEFINED;
        CallManager* pCallManager = null;
 
-       pCallManager = new CallManager();
+       pCallManager = new (std::nothrow) CallManager();
        TryReturn(pCallManager != null, false, "pCallManager could not be created");
 
        r = pCallManager->Construct(*this);
@@ -2026,17 +2026,17 @@ AudioRecorderForm::LaunchMediaPlayer(bool flag)
 
        AppLog("MediaPlayerForm's LaunchMediaPlayer invoked file path %ls", filePath.GetPointer());
 
-       pMediaType = new String;
+       pMediaType = new (std::nothrow) String;
        TryReturnVoid(pMediaType != null, "pMediaType string is null, no memory");
        pMediaType->Clear();
        pMediaType->Append(L"AUDIO");
 
-       pFilePath = new String;
+       pFilePath = new (std::nothrow) String;
        TryReturnVoid(pFilePath != null, "pFilePath string is null, no memory");
        pFilePath->Clear();
        pFilePath->Append(filePath);
 
-       pDeviceOrientation = new Integer(0);
+       pDeviceOrientation = new (std::nothrow) Integer(0);
        TryReturnVoid(pDeviceOrientation != null, "pDeviceOrientation string is null, no memory");
 
        pArg = new (std::nothrow) ArrayList;
index 6e70e86..f854726 100644 (file)
@@ -532,7 +532,7 @@ VideoRecorderForm::ReadAudioPreProcessedFile(String fileName)
 
        SAFE_DELETE(__pPreAudioFile);
 
-       __pPreAudioFile = new File;
+       __pPreAudioFile = new (std::nothrow) File;
        TryReturnVoid(__pPreAudioFile != null, "[%s] Reading pre processed audio file failed", GetErrorMessage(r));
 
        r = __pPreAudioFile->Construct(audioStreamFilePath, L"r");
@@ -3022,7 +3022,7 @@ VideoRecorderForm::CreateEffect(void)
 
                                if (effectType <= 6 && effectType != -1)
                                {
-                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new String(EffectMap[effectType]), effectType);
+                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(EffectMap[effectType]), effectType);
                                        __pSettingItemArrayList->Add(*pItemData);
                                        __pEffectList->Add(effectType);
                                        AppLog("effect return is = %d VALUE = %ls", effectType, EffectMap[effectType]);
@@ -3119,7 +3119,7 @@ VideoRecorderForm::CreateFocusMode(void)
 
                                if (focusModeType <= 4 && focusModeType != -1)
                                {
-                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new String(pFocusModeMap[focusModeType]), focusModeType);
+                                       SettingListData* pItemData = new (std::nothrow) SettingListData(new (std::nothrow) String(pFocusModeMap[focusModeType]), focusModeType);
                                        __pSettingItemArrayList->Add(*pItemData);
                                        __pFocusModeList->Add(focusModeType);
                                        AppLog("focus mode return is = %d VALUE = %ls", focusModeType, pFocusModeMap[focusModeType]);
@@ -4247,7 +4247,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                        if (value == true && r == E_SUCCESS)
                        {
 
-                               pData = new (std::nothrow) SettingListData(new String(L"Brightness"), (int) ID_MENU_BRIGHTNESS);
+                               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Brightness"), (int) ID_MENU_BRIGHTNESS);
                                __pSettingItemArrayList->Add(*pData);
                        }
 
@@ -4262,7 +4262,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
 
                        if (r == E_SUCCESS)
                        {
-                               pData = new (std::nothrow) SettingListData(new String(L"Focus Mode"), (int) ID_MENU_FOCUSMODE);
+                               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Focus Mode"), (int) ID_MENU_FOCUSMODE);
                                __pSettingItemArrayList->Add(*pData);
                        }
 
@@ -4276,7 +4276,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                        }
                        if (r == E_SUCCESS)
                        {
-                               pData = new (std::nothrow) SettingListData(new String(L"IsoLevel"), (int) ID_MENU_ISOLEVEL);
+                               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"IsoLevel"), (int) ID_MENU_ISOLEVEL);
                                __pSettingItemArrayList->Add(*pData);
                        }
 
@@ -4290,7 +4290,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                        }
                        if (r == E_SUCCESS)
                        {
-                               pData = new (std::nothrow) SettingListData(new String(L"WhiteBalance"), (int) ID_MENU_WHITEBALANCE);
+                               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"WhiteBalance"), (int) ID_MENU_WHITEBALANCE);
                                __pSettingItemArrayList->Add(*pData);
                        }
 
@@ -4307,7 +4307,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
 
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Scene Mode"), (int) ID_MENU_SCENE_MODE);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Scene Mode"), (int) ID_MENU_SCENE_MODE);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4322,7 +4322,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
 
                if (value == true && r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Exposure"), (int) ID_MENU_EXPOSURE);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Exposure"), (int) ID_MENU_EXPOSURE);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4336,7 +4336,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                }
                if (value == true && r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Contrast"), (int) ID_MENU_CONTRAST);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Contrast"), (int) ID_MENU_CONTRAST);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4351,7 +4351,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
 
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Effect"), (int) ID_MENU_EFFECT);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Effect"), (int) ID_MENU_EFFECT);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4365,7 +4365,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                }
                if (value == true && r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"ZoomLevel"), (int) ID_MENU_ZOOMLEVEL);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"ZoomLevel"), (int) ID_MENU_ZOOMLEVEL);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4379,7 +4379,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                }
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Frame Rate"), (int) ID_MENU_FRAME_RATE);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Frame Rate"), (int) ID_MENU_FRAME_RATE);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4395,7 +4395,7 @@ VideoRecorderForm::CreateSettingPopUp(void)
                }
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Flip Type"), (int) ID_MENU_FLIP_TYPE);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Flip Type"), (int) ID_MENU_FLIP_TYPE);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4409,32 +4409,32 @@ VideoRecorderForm::CreateSettingPopUp(void)
                }
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Recording Resolution"), (int) ID_MENU_RECORDING_RESOLUTION);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Recording Resolution"), (int) ID_MENU_RECORDING_RESOLUTION);
                        __pSettingItemArrayList->Add(*pData);
                }
 
 
-               pData = new (std::nothrow) SettingListData(new String(L"Recording Quality"), (int) ID_MENU_RECORDING_QUALITY);
+               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Recording Quality"), (int) ID_MENU_RECORDING_QUALITY);
                __pSettingItemArrayList->Add(*pData);
 
                r = GetMediaCapability(VIDEORECORDER_VIDEO_CODEC);
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Video Codec"), (int) ID_MENU_VIDEO_CODEC);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Video Codec"), (int) ID_MENU_VIDEO_CODEC);
                        __pSettingItemArrayList->Add(*pData);
                }
 
                r = GetMediaCapability(VIDEORECORDER_AUDIO_CODEC);
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"Audio Codec"), (int) ID_MENU_AUDIO_CODEC);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Audio Codec"), (int) ID_MENU_AUDIO_CODEC);
                        __pSettingItemArrayList->Add(*pData);
                }
 
                r = GetMediaCapability(VIDEORECORDER_FORMAT);
                if (r == E_SUCCESS)
                {
-                       pData = new (std::nothrow) SettingListData(new String(L"File Format"), (int) ID_MENU_FILE_FORMAT);
+                       pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"File Format"), (int) ID_MENU_FILE_FORMAT);
                        __pSettingItemArrayList->Add(*pData);
                }
 
@@ -4455,11 +4455,11 @@ VideoRecorderForm::CreateSettingPopUp(void)
                }
 
                //Add stream callback
-               pData = new (std::nothrow) SettingListData(new String(L"Audio Pre-Processing"), (int) ID_MENU_AUDIO_STREAM_CALLBACK);
+               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Audio Pre-Processing"), (int) ID_MENU_AUDIO_STREAM_CALLBACK);
                __pSettingItemArrayList->Add(*pData);
 
                //Add stream callback
-               pData = new (std::nothrow) SettingListData(new String(L"Video Pre-Processing"), (int) ID_MENU_VIDEO_STREAM_CALLBACK);
+               pData = new (std::nothrow) SettingListData(new (std::nothrow) String(L"Video Pre-Processing"), (int) ID_MENU_VIDEO_STREAM_CALLBACK);
                __pSettingItemArrayList->Add(*pData);
 
                r = AddListView(&__pListViewSetting, __pPopupSetting, ID_BUTTON_SETTING_OK);
@@ -4606,17 +4606,17 @@ VideoRecorderForm::LaunchMediaPlayer(bool flag)
 
        AppLog("MediaPlayerForm's LaunchMediaPlayer invoked file path %ls", __filePath.GetPointer());
 
-       pMediaType = new String;
+       pMediaType = new (std::nothrow) String;
        TryReturnVoid(pMediaType != null, "pMediaType string is null, no memory");
        pMediaType->Clear();
        pMediaType->Append(L"VIDEO");
 
-       pFilePath = new String;
+       pFilePath = new (std::nothrow) String;
        TryReturnVoid(pFilePath != null, "pFilePath string is null, no memory");
        pFilePath->Clear();
        pFilePath->Append(__filePath);
 
-       pDeviceOrientation = new Integer(0);
+       pDeviceOrientation = new (std::nothrow) Integer(0);
        TryReturnVoid(pDeviceOrientation != null, "pDeviceOrientation string is null, no memory");
 
        pArg = new (std::nothrow) ArrayList;