2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CmCamcorderForm.cpp
19 * @brief This is the implementation file for CamcorderForm class.
22 #include "CmCameraApp.h"
23 #include "CmCamcorderForm.h"
24 #include "CmCameraStarterThread.h"
25 #include "CmCameraPresentationModel.h"
27 using namespace Tizen::App;
28 using namespace Tizen::Base;
29 using namespace Tizen::Base::Collection;
30 using namespace Tizen::Base::Runtime;
31 using namespace Tizen::Graphics;
32 using namespace Tizen::Io;
33 using namespace Tizen::Media;
34 using namespace Tizen::System;
35 using namespace Tizen::Telephony;
36 using namespace Tizen::Ui;
37 using namespace Tizen::Ui::Controls;
38 using namespace Tizen::Ui::Scenes;
39 using namespace Tizen::Uix;
41 static const int INDEX_FREE_SPACE_BUFFER_LEN = 10;
42 static const int MAX_CAMERA_EXPOSURE_VALUE = 8;
43 static const int CAMERA_EXPOSURE_VALUE_ZERO = 0;
44 static const int CAMERA_EXPOSURE_VALUE_ONE = 1;
45 static const int SLIDER_RECTVALID_X_POS = 430;
46 static const int CAMERA_GUIDELINE_ENABLE = 1;
47 static const int STORAGE_VALUE_ZERO = 0;
48 static const int STORAGE_DISPLAY_PLACE = 300;
49 static const int CAMERA_FOCUS_NOT_READY = 0;
50 static const int CAMERA_FOCUS_READY = 1;
51 static const int CAMERA_FOCUS_FAIL = 2;
52 static const int UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN = 2048;
53 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 55;
54 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT = 8;
55 static const int X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 8;
56 static const int Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE = 10;
57 static const int FONT_SIZE_RESOLUTION_MENU_ITEM = 30;
58 static const int FONT_SIZE_SETTING_MENU_ITEM = 34;
59 static const int FONT_SIZE_SETTING_SUB_MENU_ITEM = 34;
60 static const int H_SETTING_MENU_ITEM = 67;
61 static const int X_SETTING_MENU_LIST_LANDSCAPE = 38;
62 static const int Y_SETTING_MENU_LIST_LANDSCAPE = 350;
63 static const int Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN = 200;
64 static const int W_SETTING_MENU_LIST_LANDSCAPE = 539;
65 static const int H_SETTING_MENU_LIST_LANDSCAPE = 380;
66 static const int H_SETTING_MENU_LIST_MARGIN = 200;
67 static const int X_SETTING_MENU_LIST_PORTRAIT = 36;
68 static const int Y_SETTING_MENU_LIST_PORTRAIT = 135;
69 static const int W_SETTING_MENU_LIST_PORTRAIT = 538;
70 static const int H_SETTING_MENU_LIST_PORTRAIT = 360;
71 static const int X_SETTING_MENU_CONTESTS = 34;
72 static const int Y_SETTING_MENU_CONTESTS = 0;
73 static const int W_SETTING_MENU_CONTESTS = 280;
74 static const int H_SETTING_MENU_CONTESTS = 65;
75 static const int X_SETTING_MENU_CONTENTS_VALUE = 280;
76 static const int Y_SETTING_MENU_CONTENTS_VALUE = 0;
77 static const int W_SETTING_MENU_CONTENTS_VALUE = 290;
78 static const int H_SETTING_MENU_CONTENTS_VALUE = 67;
79 static const int H_SETTING_SUBMENU_ITEM = 88;
80 static const int X_SETTING_SUBMENU_RADIO_ICON = 0;
81 static const int X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN = 390;
82 static const int X_WHITE_BALANCE_RADIO_ICON_MARGIN = 376;
83 static const int X_SETTING_SUBMENU_RADIO_ICON_MARGIN = 350;
84 static const int Y_SETTING_SUBMENU_RADIO_ICON = 0;
85 static const int W_SETTING_SUBMENU_RADIO_ICON = 84;
86 static const int H_SETTING_SUBMENU_RADIO_ICON = 84;
87 static const int X_SETTING_SUBMENU_ICON = 75;
88 static const int X_SETTING_SUBMENU_ICON_MARGIN = 65;
89 static const int Y_SETTING_SUBMENU_ICON = 0;
90 static const int W_SETTING_SUBMENU_ICON = 88;
91 static const int H_SETTING_SUBMENU_ICON = 88;
92 static const int X_SETTING_SUBMENU_2TEXT_ITEM = 75;
93 static const int Y_SETTING_SUBMENU_2TEXT_ITEM = 0;
94 static const int W_SETTING_SUBMENU_2TEXT_ITEM = 320;
95 static const int H_SETTING_SUBMENU_2TEXT_ITEM = 84;
96 static const int X_FLASH_SETTING_SUBMENU_3TEXT_ITEM = 57;
97 static const int X_SETTING_SUBMENU_3TEXT_ITEM = 165;
98 static const int X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN = 70;
99 static const int Y_SETTING_SUBMENU_3TEXT_ITEM = 0;
100 static const int W_SETTING_SUBMENU_3TEXT_ITEM = 250;
101 static const int H_SETTING_SUBMENU_3TEXT_ITEM = 84;
102 static const int X_SUBMENU_PANEL_START_PORTRAIT = 170;
103 static const int X_SUBMENU_PANEL_START_LANDSCAPE = 340;
104 static const int Y_SUBMENU_PANEL_OFFSET_PORTRAIT = 150;
105 static const int Y_SUBMENU_PANEL_START_PORTRAIT = 75;
106 static const int X_SUBMENU_WB_MODE_PANEL = 340;
107 static const int Y_SUBMENU_WB_MODE_PANEL = 60;
108 static const int Y_SUBMENU_WB_MODE_PANEL_MARGIN = 85;
109 static const int W_SUBMENU_WB_MODE_PANEL = 460;
110 static const int H_SUBMENU_WB_MODE_PANEL_MARGIN = 88;
111 static const int X_SUBMENU_WB_MODE_LIST = 10;
112 static const int Y_SUBMENU_WB_MODE_LIST = 64;
113 static const int W_SUBMENU_WB_MODE_LIST = 456;
114 static const int H_SUBMENU_WB_MODE_LIST = 90;
115 static const int X_CLOSE_BUTTON_PORTRAIT = 82;
116 static const int Y_CLOSE_BUTTON_PORTRAIT = 40;
117 static const int X_CLOSE_BUTTON_LANDSCAPE = 40;
118 static const int Y_CLOSE_BUTTON_LANDSCAPE = 82;
119 static const int X_EXPOSURE_PANEL_SLIDER_LANDSCAPE = 40;
120 static const int Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE = 190;
121 static const int W_EXPOSURE_PANEL_SLIDER_LANDSCAPE = 60;
122 static const int H_EXPOSURE_PANEL_SLIDER_LANDSCAPE = 336;
123 static const int X_EXPOSURE_PANEL_SLIDER_PORTRAIT = 190;
124 static const int Y_EXPOSURE_PANEL_SLIDER_PORTRAIT = 40;
125 static const int W_EXPOSURE_PANEL_SLIDER_PORTRAIT = 336;
126 static const int H_EXPOSURE_PANEL_SLIDER_PORTRAIT = 60;
127 static const int OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON = 20;
128 static const int X_FLASH_MODE_SETTING_LIST_RECT = 26;
129 static const int Y_FLASH_MODE_SETTING_LIST_RECT = 94;
130 static const int W_FLASH_MODE_SETTING_LIST_RECT = 428;
131 static const int H_FLASH_MODE_SETTING_LIST_RECT = 350;
132 static const int X_FLASH_MODE_SETTING_LIST_LANDSCAPE = 38;
133 static const int Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN = 150;
134 static const int Y_FLASH_MODE_SETTING_LIST_LANDSCAPE = 94;
135 static const int W_FLASH_MODE_SETTING_LIST_LANDSCAPE = 480;
136 static const int H_FLASH_MODE_SETTING_LIST_LANDSCAPE = 350;
137 static const int H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN = 200;
138 static const int X_FLASH_MODE_SETTING_LIST_PORTRAIT = 112;
139 static const int Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN = 50;
140 static const int Y_FLASH_MODE_SETTING_LIST_PORTRAIT = 85;
141 static const int W_FLASH_MODE_SETTING_LIST_PORTRAIT = 480;
142 static const int H_FLASH_MODE_SETTING_LIST_PORTRAIT = 350;
143 static const int H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN = 200;
144 static const int X_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT = 311;
145 static const int Y_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT = 6;
146 static const int W_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT = 48;
147 static const int H_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT = 90;
148 static const int X_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE = 516;
149 static const int Y_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE = 0;
150 static const int W_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE = 90;
151 static const int H_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE = 48;
152 static const int FONT_SIZE_INDICATOR_STORAGE_FREE_SPACE = 38;
153 static const int CAMERA_PANEL_SUM_SIZE = 320;
154 static const int PREVIEW_OVERLAY_PANEL_SIZE = 960;
155 static const int PREVIEW_OVERLAY_PANEL_SIZE_MARGIN = 80;
156 static const int X_PREVIEW_OVERLAY_PORTRAIT = 0;
157 static const int Y_PREVIEW_OVERLAY_PORTRAIT = 160;
158 static const int W_PREVIEW_OVERLAY_PORTRAIT = 720;
159 static const int H_PREVIEW_OVERLAY_PORTRAIT = 960;
160 static const int W_FULL_PREVIEW_OVERLAY_PORTRAIT = 720;
161 static const int X_PREVIEW_OVERLAY_LANDSCAPE = 160;
162 static const int Y_PREVIEW_OVERLAY_LANDSCAPE = 0;
163 static const int W_PREVIEW_OVERLAY_LANDSCAPE = 960;
164 static const int H_PREVIEW_OVERLAY_LANDSCAPE = 720;
165 static const int W_FULL_PREVIEW_OVERLAY_LANDSCAPE = 1280;
166 static const int W_THUMBNAIL_SCALE_SIZE = 80;
167 static const int H_THUMBNAIL_SCALE_SIZE = 80;
168 static const int X_THUMBNAIL_BUTTON_IMG = 14;
169 static const int Y_THUMBNAIL_BUTTON_IMG = 14;
170 static const int X_BASE_POS = 0;
171 static const int Y_BASE_POS = 0;
172 static const int FRAME_SKIP = 4;
173 static const int BITS_PER_BYTE = 8;
174 static const int BYTE_BUFFER_START_POS = 0;
175 static const int BYTE_ARRAY_START_POS = 0;
176 static const int CAMERA_TIMER_ONE_MILLI_SEC = 1;
177 static const int REG_DEFAULT_VALUE_ZERO = 0;
178 static const int DIVIDE_BY_TWO = 2;
179 static const int INDEX_UNIT_TWENTY = 20;
180 static const int CAMERA_EXPOSURE_TIMER_VALUE = 2000;
181 static const int INDEX_UNIT_ZERO = 0;
182 static const int INDEX_UNIT_ONE = 1;
183 static const int FLASH_MODE_OFF = 0;
184 static const int FLASH_MODE_ON = 1;
185 static const int FLASH_MODE_AUTO = 2;
186 static const int SET_RECORD_START_TIMER_0_SEC = 0;
187 static const int SET_RECORD_START_TIMER_2_SEC = 1;
188 static const int SET_RECORD_START_TIMER_5_SEC = 2;
189 static const int SET_RECORD_START_TIMER_10_SEC = 3;
190 static const int CAMCORDER_TIMER_1_SEC = 1000;
191 static const int CAMCORDER_TIMER_2_SEC = 2000;
192 static const int CAMCORDER_TIMER_5_SEC = 5000;
193 static const int CAMCORDER_TIMER_10_SEC = 10000;
194 static const int SETTING_TIMER_2_SEC_COUNT = 2;
195 static const int SETTING_TIMER_5_SEC_COUNT = 5;
196 static const int SETTING_TIMER_10_SEC_COUNT = 10;
197 static const int CAMCORDER_TIMER_LIMIT = 120000;
198 static const int CAMCORDER_CHARGING_TIMER = 1000;
199 static const int PREVIEW_FAIL_TIMER = 1000;
200 static const int SETTING_TIMER_RECORD_0_SEC = 0;
201 static const int SETTING_TIMER_RECORD_2_SEC = 1;
202 static const int SETTING_TIMER_RECORD_5_SEC = 2;
203 static const int SETTING_TIMER_RECORD_10_SEC = 3;
204 static const int CAMCORDER_TIMER_ONE_SEC = 1000;
205 static const int CAMCORDER_FORM_PRIMARY_MODE = 0;
206 static const int CAMCORDER_FORM_SECONDARY_MODE = 1;
207 static const int SUBMENU_WB_COUNT = 5;
208 static const int SUBMENU_GUIDELINE_COUNT = 2;
209 static const int SUBMENU_GUIDELINE_OFF = 0;
210 static const int SUBMENU_GUIDELINE_ON = 1;
211 static const int SUBMENU_MODE_OFF = 0;
212 static const int SUBMENU_MODE_ON = 1;
213 static const int SUBMENU_MODE_AUTO = 2;
214 static const int SUBMENU_STORAGE_TYPE_PHONE = 0;
215 static const int SUBMENU_STORAGE_TYPE_MEMORYCARD = 1;
216 static const int MAX_SUBMENU_CONTENT = 10;
217 static const int DRAW_INITIALIZED = 0;
218 static const int DRAW_MOVED = 1;
219 static const int DRAW_RELEASED = 2;
220 static const int DISABLE_GUIDELINE = 0;
221 static const int MAX_SETTING_MENU_COUNT = 2;
222 static const int MAX_GENERAL_TAB_SETTING_MENU_COUNT = 5;
224 static const int MAX_FLASH_MENU_COUNT = 3;
225 static const int MENU_COUNT_CLEAR = 0;
226 static const int SUBMENU_STORAGE_TYPE_COUNT = 2;
227 static const int SUBMENU_TIMER_COUNT = 4;
228 static const int MENU_MODE_DISABLE = -1;
229 static const int MENU_TWO_ELEMENT = 2;
230 static const int MENU_THREE_ELEMENT = 3;
231 static const int EXPOSURE_TIMER_IS_ALIVE = 1;
232 static const int MODE_AUTO = 0;
233 static const int MODE_WHITEBALANCE_INCANDESCENT = 1;
234 static const int MODE_FLUORESCENT = 2;
235 static const int MODE_DAYLIGHT = 3;
236 static const int MODE_CLOUDY = 4;
238 static const int DISPLAY_WVGA = 1200;
240 static const int DIVIDE_THOUSAND = 1000;
241 static const int SECONDS_PER_HOUR = 3600;
242 static const int SECONDS_PER_MINUTE = 60;
243 static const int FRAME_RATE = 2;
244 static const int UNIT_TEN = 10;
245 static const int UNIT_TWELVE = 12;
246 static const int UNIT_ZEROTOZERO = 00;
247 static const int UNIT_HUNDRED = 100;
248 static const int UNIT_TWENTY = 20;
249 static const int UNIT_THOUSAND = 1000;
251 static const int X_SUBMENU_TIMER_MODE_PANEL = 340;
252 static const int Y_SUBMENU_TIMER_MODE_PANEL = 120;
253 static const int W_SUBMENU_TIMER_MODE_PANEL = 460;
254 static const int H_SUBMENU_TIMER_MODE_PANEL = 445;
256 static const int X_SUBMENU_TIMER_MODE_LIST = 20;
257 static const int Y_SUBMENU_TIMER_MODE_LIST = 64;
258 static const int W_SUBMENU_TIMER_MODE_LIST = 431;
259 static const int H_SUBMENU_TIMER_MODE_LIST = 420;
261 static const int X_SUBMENU_GUIDELINE_MODE_PANEL = 340;
262 static const int Y_SUBMENU_GUIDELINE_MODE_PANEL = 260;
263 static const int W_SUBMENU_GUIDELINE_MODE_PANEL = 460;
264 static const int H_SUBMENU_GUIDELINE_MODE_PANEL = 265;
265 static const int X_SUBMENU_GUIDELINE_MODE_LIST = 20;
266 static const int Y_SUBMENU_GUIDELINE_MODE_LIST = 64;
267 static const int W_SUBMENU_GUIDELINE_MODE_LIST = 431;
268 static const int H_SUBMENU_GUIDELINE_MODE_LIST = 240;
270 static const int X_SUBMENU_STORAGE_MODE_LIST = 20;
271 static const int Y_SUBMENU_STORAGE_MODE_LIST = 64;
272 static const int W_SUBMENU_STORAGE_MODE_LIST = 431;
273 static const int H_SUBMENU_STORAGE_MODE_LIST = 240;
275 static const int X_SUBMENU_STORAGE_MODE_PANEL = 340;
276 static const int Y_SUBMENU_STORAGE_MODE_PANEL = 320;
277 static const int W_SUBMENU_STORAGE_MODE_PANEL = 460;
278 static const int H_SUBMENU_STORAGE_MODE_PANEL = 265;
280 static const int RECORDING_RESOLOTION_WIDTH = 640;
281 static const int RECORDING_RESOLOTION_HEIGHT = 480;
283 static const int X_INDICATOR_BATTERY_PORTRAIT = 300;
284 static const int Y_INDICATOR_BATTERY_PORTRAIT = 4;
285 static const int X_INDICATOR_BATTERY_LANDSCAPE = 582;
286 static const int Y_INDICATOR_BATTERY_LANDSCAPE = 4;
288 static const int X_BACK_BUTTON_POSITION = 63;
289 static const int Y_BACK_BUTTON_POSITION = 63;
291 static const int SCREEN_OVERLAY_HELP_ENABLE = 1;
292 static const int SCREEN_OVERLAY_HELP_DISABLE = 0;
294 static const int GAP_W_POPUP_ITEM = 5;
295 static const int W_DELETE_POPUP = 688;
296 static const int H_DELETE_POPUP = 204;
297 static const int H_DELETE_LABEL = 94;
298 static const int Y_DELETE_BUTTON = 114;
299 static const int H_DELETE_BUTTON = 74;
301 static const int SUPPORTED_CAMERA_NUM = 1;
303 static const int BRIGHTNESS_DIVIDER_PORTRAIT_MODE = 31;
305 static const wchar_t* IDS_MENU_SETTING_MAIN_MENU_NAME = L"SettingMainMenu";
306 static const wchar_t* IDS_MENU_SETTING_GEN_MAIN_MENU_NAME = L"SettingGenMainMenu";
307 static const wchar_t* IDS_GENERAL_SETTING_SUB_MENU= L"GeneralSettingsSubMenu";
308 static const wchar_t* IDS_CAMERA_SETTING_SUB_MENU= L"CameraSettingsSubMenu";
309 static const wchar_t* IDS_MENU_FLASH_MENU_NAME = L"FlashMenu";
310 static const wchar_t* IDS_MENU_WB_MENU_NAME = L"WBMenu";
311 static const wchar_t* IDS_WB_BUTTON_NAME = L"WhiteBalanceButton";
312 static const wchar_t* IDS_FLASH_BUTTON_NAME = L"FlashButton";
313 static const wchar_t* IDS_RECORDE_BUTTON_NAME = L"RecordButton";
314 static const wchar_t* IDS_THUMBNAIL_PANLE_NAME = L"ThumbnailPanel";
315 static const wchar_t* IDS_SETTING_UI_PANEL_NAME = L"SettingPanel";
316 static const wchar_t* IDS_ACTION_UI_PANEL_NAME = L"ActionPanel";
317 static const wchar_t* IDS_ACTION_UI_CAMCORDER_MODE = L"ActionCamcorderMode";
318 static const wchar_t* IDS_INIT_REG_KEY = L"NONE";
319 static const wchar_t* IDS_CAMERA_INFO_PANEL_NAME = L"CameraInfoPanel";
321 static const wchar_t* INIT_REC_TIME = L"00:00";
322 static const wchar_t* INIT_MAX_REC_TIME = L"00:00";
323 static const wchar_t* INIT_REC_SIZE = L"0000M";
325 CamcorderForm::CamcorderForm(void)
326 : __screenMode(SCREEN_MODE_NORMAL)
327 , __pOverlayPanel(null)
328 , __pRecordTimer(null)
329 , __camcoderTabMainMenuCount(MENU_MODE_DISABLE)
330 , __camcoderTabSubMenuCount(MENU_MODE_DISABLE)
331 , __camcoderTabSettingMode(CAMCORDER_SUB_MENU_CONTENT_MAX)
332 , __generalTabMainMenuCount(MENU_MODE_DISABLE)
333 , __generalTabSubMenuCount(MENU_MODE_DISABLE)
334 , __generalTabSettingMode(CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX)
335 , __settingIsoIndex(0)
336 , __settingWhiteBalance(0)
337 , __settingTimeInterval(0)
338 , __settingExposure(0)
339 , __recordTimeCount(0)
340 , __recordingMaxTime(0)
341 , _closeTimerValue(0)
342 , __previewResolutionWidth(0)
343 , __previewResolutionHeight(0)
344 , __pRecordingResolutionWidth(0)
345 , __pRecordingResolutionHeight(0)
346 , __pRecordingResolutionIndex(0)
347 , __lowMemoryCapacity(false)
348 , __isMemoryFull(false)
349 , __isLockScreenMode(false)
350 , __isOrientationChanged(false)
351 , __doRecording(false)
352 ,__recorderStopped(false)
353 , __pSettingPanel(null)
354 , __pActionPanel(null)
355 , __dir(ORIENTATION_STATUS_NONE)
356 , __pSettingLine(null)
357 , __pCameraIconLabel(null)
358 , __pCamcoderIconLabel(null)
360 , __pRecordButton(null)
361 , __pThumbnailButton(null)
362 , __pBackButton(null)
363 , __pBatteryState(null)
364 , __pRecLabelRed(null)
365 , __pRecLabelText(null)
366 , __pElapsedTimeLable(null)
367 , __pElapsedTimeMaxLable(null)
368 , __pElapsedRecordSizeLable(null)
369 , __pButtonPoint(Point(0, 0))
370 , __pSettingMenuString(null)
371 , __pSettingGeneralMenuString(null)
372 , __pCameraStarterThread(null)
374 , __pRecordingResolutionList(null)
375 , __pCamcoderSetting(null)
376 , __pGeneralSetting(null)
377 , __pCamcorderSettingLable(null)
378 , __pGeneralSettingLable(null)
379 , __pFileEventManager(null)
382 , __isCapacityBelow(false)
383 , __pCancelPopup(null)
384 , __setTimerInterval(false)
385 , __pRecordPauseBitmap(null)
387 AppLogDebug("ENTER");
391 CamcorderForm::~CamcorderForm(void)
393 AppLogDebug("ENTER");
398 CamcorderForm::OnInitializing(void)
400 AppLogDebug("ENTER");
401 result r = E_SUCCESS;
402 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
403 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
404 int storageType = STORAGE_TYPE_PHONE;
405 int timerInterval = 0;
406 Point currentPosition;
407 String filePath = L"";
409 _appControlActionCompleted = false;
411 AddKeyEventListener(*this);
413 AddOrientationEventListener(*this);
414 SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
415 __dir = GetOrientationStatus();
417 _pCameraPresentationModel->SetOrientation(__dir);
420 InitPreviewFailPopupTimer();
423 InitChargingCompletedTimer();
424 _pCurrentSourceForm = SOURCE_FORM_CAMCORDER;
426 _pCameraInfoPanel = new (std::nothrow) CameraInfoPanel();
427 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
429 if (__dir == ORIENTATION_STATUS_PORTRAIT
430 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
432 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
433 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
434 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
438 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
439 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
440 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
443 if (__dir == ORIENTATION_STATUS_PORTRAIT
444 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
446 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
450 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
453 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
456 storageType = STORAGE_TYPE_PHONE;
459 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
461 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
462 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
463 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
466 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
467 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
469 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
470 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
472 r = _pCameraInfoPanel->Initialize(rect);
473 TryCatch(r == E_SUCCESS, , "_pCameraInfoPanel Initialize fail[%s]", GetErrorMessage(r));
476 _isHwKeySupported = ((CameraApp*) Application::GetInstance())->CheckHwKeySupport();
477 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
478 _pCameraInfoPanel->SetDrawMarkerFocus(true);
479 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
480 _pCameraInfoPanel->SetCurrentMode(CameraPresentationModel::CAMERA_MODE_RECORD);
481 _pCameraInfoPanel->SetStorageType(storageType);
482 _pCameraInfoPanel->SetTimerType(timerInterval);
483 _pCameraInfoPanel->SetDrawIndicator(true);
484 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
485 _pCameraInfoPanel->AddTouchEventListener(*this);
486 _pCameraInfoPanel->SetName(IDS_CAMERA_INFO_PANEL_NAME);
487 AddOrientationEventListener(*_pCameraInfoPanel);
488 AddControl(_pCameraInfoPanel);
489 SetControlAlwaysOnTop(*_pCameraInfoPanel, true);
491 SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
492 r = InitSettingMenuPanel();
493 //TryCatch(r == E_SUCCESS, , "InitSettingMenuPanel() fail[%s]", GetErrorMessage(r));
495 r = InitActionMenuPanel();
496 TryCatch(r == E_SUCCESS, , "InitActionMenuPanel() fail[%s]", GetErrorMessage(r));
500 __pRecLabelRed->SetShowState(false);
501 __pRecLabelRed->Invalidate(true);
506 __pRecLabelText->SetShowState(false);
507 __pRecLabelText->Invalidate(true);
510 InitScreenOverlayHelp();
511 CheckBatteryStatus();
514 r = InitializePopup();
515 AppLogDebug("InitializePopup()fail[%s]", GetErrorMessage(r));
517 __pFileEventManager = new (std::nothrow) FileEventManager();
518 r = __pFileEventManager->Construct(*this);
519 TryCatch(r == E_SUCCESS, , "Construct() fail[%s]", GetErrorMessage(r));
521 filePath = _pCameraPresentationModel->GetfilePath(storageType);
522 AppLogDebug("filePath %ls", filePath.GetPointer());
524 if (File::IsFileExist(filePath))
526 __pFileEventPath = filePath;
527 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
528 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
535 delete _pCameraInfoPanel;
537 ShowCameraFailPopup();
539 AppLogDebug("EXIT - CATCH");
544 CamcorderForm::OnTerminating(void)
546 AppLogDebug("ENTER");
547 result r = E_SUCCESS;
549 _pCameraPresentationModel->KeepScreenOnState(false, true);
551 _pCameraPresentationModel->RemovePresentationChangedEventListener(null);
553 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
555 __lowMemoryCapacity = false;
557 __doRecording = false;
559 __setTimerInterval = false;
561 _pCameraPresentationModel->SetIntervalTimerRun(false);
563 __isCapacityBelow = false;
565 RemoveAllEventListener();
567 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
569 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
570 AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
572 if (__isLockScreenMode)
574 AppLogDebug("OnTerminating KEY_POWER_HOLD");
575 __isLockScreenMode = false;
578 __isOrientationChanged = false;
580 __screenMode = SCREEN_MODE_NORMAL;
582 _pCameraPresentationModel = null;
583 __pCameraStarterThread = null;
588 if (__pRecordPauseBitmap)
590 delete __pRecordPauseBitmap;
593 if (__pSettingMenuString)
596 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
598 delete [] __pSettingMenuString[idx];
600 delete __pSettingMenuString;
603 if (__pSettingGeneralMenuString)
606 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
608 delete [] __pSettingGeneralMenuString[idx];
610 delete __pSettingGeneralMenuString;
613 if (__pRecordingResolutionList)
615 __pRecordingResolutionList->RemoveAll(true);
616 delete __pRecordingResolutionList;
620 if (__pFileEventManager != null)
622 delete __pFileEventManager;
623 __pFileEventManager = null;
631 CamcorderForm::SetStartRecording(void)
633 AppLogDebug("ENTER");
634 result r = E_SUCCESS;
635 int timerInterval = 0;
637 timerInterval = GetTimerIntervalValue();
639 switch (timerInterval)
641 case SETTING_TIMER_RECORD_0_SEC:
643 if (_pIntervalValueTimer)
645 _pIntervalValueTimer->Cancel();
649 __setTimerInterval = false;
651 _pCameraPresentationModel->SetIntervalTimerRun(false);
653 _pCameraPresentationModel->StartRecord();
654 r = StartRecordTimer();
655 TryReturnVoid(r == E_SUCCESS, "StartRecordTimer() fail[%s]", GetErrorMessage(r));
657 r = SetRecordButton(true);
658 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
660 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
662 _pCameraInfoPanel->SetDrawPopupTimer(false);
664 _pCameraInfoPanel->Invalidate(true);
669 AutoFocusPerformed();
671 StartInitChargingTimer();
675 case SETTING_TIMER_RECORD_2_SEC:
677 case SETTING_TIMER_RECORD_5_SEC:
679 case SETTING_TIMER_RECORD_10_SEC:
681 r = SetRecordStartTimer(timerInterval);
682 TryReturnVoid(r == E_SUCCESS, "SetRecordStartTimer() fail[%s]", GetErrorMessage(r));
684 __setTimerInterval = true;
685 _pCameraPresentationModel->SetIntervalTimerRun(true);
689 r = DrawTimerPopup();
690 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
701 CamcorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
703 AppLogDebug("ENTER");
704 bool onVideoRecorderStopped = false;
705 result r = E_SUCCESS;
706 int selfPortraitEnable = 0;
707 int guideLineEnable = 0;
711 case IDA_BUTTON_CAMCORDER_FLASH:
713 int selfPortraitEnable = 0;
714 result r = E_SUCCESS;
716 bool isCharging = false;
717 BatteryLevel batteryLevel;
719 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
720 isCharging = _pCameraPresentationModel->IsCharging();
722 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
726 selfPortraitEnable = 0;
729 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
731 AppLogDebug("FLASEH OFF!!!");
735 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
737 if (value == true && r == E_SUCCESS)
739 if (batteryLevel == BATTERY_LOW && isCharging == false)
744 AppResource* pAppResource = null;
746 pAppResource = Application::GetInstance()->GetAppResource();
747 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
749 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
751 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
752 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
753 msgBox.ShowAndWait(result);
762 AppLogDebug("FLASEH OFF!!!");
768 case IDA_BUTTON_CAMCORDER_SETTING:
770 result r = E_SUCCESS;
772 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
773 _pAppTimer->Cancel();
775 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
776 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
782 case IDA_BUTTON_CLOSE_SETTING:
784 result r = E_SUCCESS;
786 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
787 _pAppTimer->Cancel();
789 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
790 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
796 case IDA_BUTTON_CAMCORDER_QUICK_SETTING:
798 result r = E_SUCCESS;
800 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
801 _pAppTimer->Cancel();
803 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
804 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
806 MakeCamcoderTabSettingPopup();
810 case IDA_BUTTON_SETTING_CAMCODER:
812 result r = E_SUCCESS;
814 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
815 _pAppTimer->Cancel();
817 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
818 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
820 if (_pListViewGeneralTabMainMenu)
822 _pListViewGeneralTabMainMenu->SetShowState(false);
825 if (_pListViewGeneralTabSubMenu)
827 _pListViewGeneralTabSubMenu->SetShowState(false);
830 MakeCamcoderTabSettingPopup();
834 case IDA_BUTTON_SETTING_GENERAL:
836 result r = E_SUCCESS;
838 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
839 _pAppTimer->Cancel();
841 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
842 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
844 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
846 if (_pListViewCameraTabMainMenu)
848 _pListViewCameraTabMainMenu->SetShowState(false);
850 if (_pListViewCameraTabSubMenu)
852 _pListViewCameraTabSubMenu->SetShowState(false);
855 MakeGeneralTabSettingPopup();
859 case IDA_BUTTON_CAMCORDER_SELF:
861 result r = E_SUCCESS;
864 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
866 AppLogDebug("Camera Preview is not");
870 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
871 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
872 if (cameraCount < SUPPORTED_CAMERA_NUM)
874 AppLogDebug("The physical direction of the camera is not exit");
878 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
880 MakeSettingPopupTab(false);
884 if (onVideoRecorderStopped == false)
887 MakeRecordingResolutionList(true);
896 case IDA_BUTTON_CAMERA_EV:
898 if (_pCameraInfoPanel->GetDrawExposure() == true)
900 AppLogDebug("Draw is Exposure status");
904 ExposureValuePerformed();
908 case IDA_BUTTON_CAMERA_WB:
910 result r = E_SUCCESS;
911 int selfPortraitEnable = 0;
913 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
914 _pAppTimer->Cancel();
916 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
917 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
919 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
920 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
922 if (_pCameraInfoPanel->GetDrawExposure() == true)
924 _closeTimerValue = 0;
926 if (_pExposureCloseTimer)
928 _pExposureCloseTimer->Cancel();
931 _pCameraInfoPanel->SetDrawExposure(false);
935 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
937 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
941 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
946 SetWhiteBalancePopop();
950 AppLogDebug("WB is not support");
955 case IDA_BUTTON_CAMCORDER_AUTO_FOCUS:
957 //AutoFocusPerformed();
961 case IDA_BUTTON_CAMCORDER_THUMBNAIL:
966 case IDA_BUTTON_RECORDING_POPUP_OK:
968 result r = E_SUCCESS;
969 AppLogDebug("IDA_BUTTON_RECORDING_POPUP_OK");
971 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
972 _pAppTimer->Cancel();
974 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
975 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
979 __pCancelPopup->SetShowState(false);
980 __pCancelPopup->Invalidate(true);
991 case IDA_BUTTON_RECORDING_POPUP_CANCEL:
993 AppLogDebug("IDA_BUTTON_RECORDING_POPUP_CANCEL");
994 result r = E_SUCCESS;
998 __pCancelPopup->SetShowState(false);
999 __pCancelPopup->Invalidate(true);
1002 _isRecording = true;
1004 _pCameraPresentationModel->SetCancelRecord(false);
1006 r = SetRecordPauseBitmap(false);
1007 //TryCatch(r == E_SUCCESS, , "SetRecordPauseBitmap start fail[%s]", GetErrorMessage(r));
1008 AppLogDebug("SetRecordPauseBitmap() fail[%s]", GetErrorMessage(r));
1010 r = SetRecordPauseButton(false);
1011 TryReturnVoid(r == E_SUCCESS, "SetRecordPauseButton fail[%s]", GetErrorMessage(r));
1013 _pCameraPresentationModel->StartRecord();
1015 __pRecordTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
1019 case IDA_BUTTON_CAMCORDER_BACK:
1021 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
1022 result r = E_SUCCESS;
1024 r = BackButtonPerformed();
1025 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
1031 AppLogDebug("ResetPopup : yes");
1032 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1034 _pResetPopUp->SetShowState(false);
1036 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
1037 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
1039 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
1041 r = DrawMarker(false);
1042 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
1044 SetGuideLine(REG_DEFAULT_VALUE_ZERO);
1047 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
1048 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
1050 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
1052 BufferInfo bufferinfo;
1054 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
1056 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
1057 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
1059 r = ToggleCameraDirection(CAMCORDER_FORM_PRIMARY_MODE);
1060 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
1062 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1063 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1065 _pCameraPresentationModel->StartPreview(&bufferinfo);
1067 _pCameraPresentationModel->SetContinuousAutoFocus();
1070 RestoreDefaultSetting();
1072 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1073 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
1075 MakeRecordingResolutionList(true);
1077 MakeSettingPopupTab(false);
1081 r = UpdateUiPanelIcon();
1082 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
1084 r = SetScreenOverlayHelpTimer();
1085 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
1087 r = DrawScreenOverlayHelp();
1088 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
1090 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
1091 _pFlashButton->Invalidate(true);
1098 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1100 _pResetPopUp->SetShowState(false);
1102 MakeSettingPopupTab(false);
1103 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
1111 AppLogDebug("EXIT");
1115 CamcorderForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
1117 AppLogDebug("ENTER");
1118 result r = E_SUCCESS;
1119 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1126 _isRecording = false;
1128 _pCameraPresentationModel->StopCamera();
1130 r = SendAppControlResult(pCameraApp->GetRequestId());
1131 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
1132 AppLogDebug("EXIT");
1136 CamcorderForm::SetUri(const Tizen::Base::String& uri)
1138 AppLogDebug("ENTER");
1139 AppLogDebug("[URI] %ls", uri.GetPointer());
1140 __uri = String(uri);
1141 AppLogDebug("EXIT");
1145 CamcorderForm::SetMime(const Tizen::Base::String& mime)
1147 AppLogDebug("ENTER");
1148 AppLogDebug("[MIME] %ls", mime.GetPointer());
1149 __mime = String(mime);
1150 AppLogDebug("EXIT");
1153 const Tizen::Base::String&
1154 CamcorderForm::GetUri(void) const
1156 AppLogDebug("ENTER");
1157 AppLogDebug("EXIT");
1161 const Tizen::Base::String&
1162 CamcorderForm::GetMime(void) const
1164 AppLogDebug("ENTER");
1165 AppLogDebug("EXIT");
1170 CamcorderForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
1172 AppLogDebug("ENTER");
1173 if (_appControlActionCompleted)
1175 AppLogDebug("EXIT - App Terminate");
1178 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
1179 AppLogDebug("EXIT");
1183 CamcorderForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
1185 AppLogDebug("ENTER");
1186 bool isExistThumbnail = false;
1187 Bitmap* pBitmap = null;
1188 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
1190 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
1192 if (isExistThumbnail == false)
1194 AppLogDebug("Thumbnail is not found");
1196 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
1198 _pThumbnailPanel->SetShowState(false);
1199 _pThumbnailPanel->Draw();
1200 _pThumbnailPanel->Show();
1202 __pThumbnailButton->SetShowState(true);
1204 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1205 TryReturnVoid(pBitmap != null, "pBitmap is null");
1207 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
1212 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1213 TryReturnVoid(pBitmap != null, "pBitmap is null");
1215 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
1220 __pThumbnailButton->Draw();
1221 __pThumbnailButton->Show();
1228 AppLogDebug("pThumbnailBitmap is not null");
1230 AppLogDebug("EXIT");
1234 CamcorderForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
1236 AppLogDebug("ENTER");
1237 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
1238 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
1239 Rectangle clientRect = GetClientAreaBounds();
1241 Point currentPosition;
1242 result r = E_SUCCESS;
1244 int previewResolutionSize = 0;
1245 int storageType = STORAGE_TYPE_PHONE;
1246 bool isRunStartPreviewThread = false;
1247 BufferInfo bufferinfo;
1248 bool isInitCameraStaus = false;
1249 bool isCharging = false;
1250 BatteryLevel batteryLevel;
1252 _isRecording = false;
1254 _isRecordingPause = false;
1256 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1257 _pAppTimer->Cancel();
1258 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
1259 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
1261 _batteryStatus = GetCurrentBatteryState();
1262 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
1264 StartPreviewFailPopupTimer();
1266 StartInitChargingTimer();
1268 _pCameraPresentationModel->AddPresentationChangedEventListener(*this);
1270 _pCameraPresentationModel->KeepScreenOnState(true, false);
1272 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
1273 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
1277 dim = _pCameraPresentationModel->GetPreviewResolution();
1278 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
1280 __previewResolutionWidth = dim.width;
1281 __previewResolutionHeight = dim.height;
1283 dim = _pCameraPresentationModel->GetRecordingResolution();
1284 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
1286 __pRecordingResolutionWidth = dim.width;
1287 __pRecordingResolutionHeight = dim.height;
1289 if (__pCancelPopup != null)
1291 delete __pCancelPopup;
1292 __pCancelPopup = null;
1295 AppLogDebug("__screenMode [%d]", __screenMode);
1297 r = SetScreenMode(__screenMode, true);
1298 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
1300 if (__dir == ORIENTATION_STATUS_PORTRAIT
1301 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1303 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
1307 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
1310 if (__dir == ORIENTATION_STATUS_PORTRAIT
1311 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1313 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
1317 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
1320 r = SetRecordButton(false);
1321 AppLogDebug("SetRecordButton fail[%s]", GetErrorMessage(r));
1323 _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1325 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
1326 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
1328 if (regVal == DISABLE_GUIDELINE)
1339 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1341 _pCameraInfoPanel->SetDrawPopupTimer(false);
1343 _pCameraInfoPanel->Invalidate(true);
1346 MakeSettingPopupTab(false);
1352 __pRecLabelRed->SetShowState(false);
1353 __pRecLabelRed->Invalidate(true);
1356 if (__pRecLabelText)
1358 __pRecLabelText->SetShowState(false);
1359 __pRecLabelText->Invalidate(true);
1362 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1363 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
1365 if (isInitCameraStaus)
1367 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
1368 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
1370 if (isRunStartPreviewThread)
1372 r = RunStartPreviewThread();
1373 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
1375 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
1379 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1380 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1382 _pCameraPresentationModel->StartPreview(&bufferinfo);
1385 _pCameraPresentationModel->SetContinuousAutoFocus();
1387 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
1389 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
1391 SetCamcorderSettingsDevice();
1393 AppLogDebug("OnSceneActivatedN");
1396 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1397 isCharging = _pCameraPresentationModel->IsCharging();
1399 AppLogDebug("batteryLevel = %d", batteryLevel);
1400 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1402 if (isCharging == false)
1408 CheckBatteryStatus();
1412 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
1414 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
1416 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
1417 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
1419 AppLogDebug("EXIT");
1423 CamcorderForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
1425 AppLogDebug("ENTER");
1426 _pCameraPresentationModel->KeepScreenOnState(false, true);
1428 _isRecording = false;
1430 _isRecordingPause = false;
1432 __isOrientationChanged = false;
1436 __setTimerInterval = false;
1437 _pCameraPresentationModel->SetIntervalTimerRun(false);
1443 _pAppTimer->Cancel();
1446 if (_pIntervalValueTimer)
1448 _pIntervalValueTimer->Cancel();
1451 if (_pChargingTimer)
1453 _pChargingTimer->Cancel();
1456 if (_pHelpCloseTimer)
1458 _pHelpCloseTimer->Cancel();
1463 if (__pCancelPopup != null)
1465 delete __pCancelPopup;
1466 __pCancelPopup = null;
1469 OnHelpCloseTimerExpired();
1475 MakeSettingPopupTab(false);
1477 HideUiSettingMenu();
1479 if (__pOverlayPanel)
1481 RemoveControl(*__pOverlayPanel);
1482 __pOverlayPanel = null;
1485 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
1486 AppLogDebug("EXIT");
1490 CamcorderForm::Update(bool isInvalidated)
1492 AppLogDebug("ENTER");
1493 result r = E_SUCCESS;
1494 Bitmap* pThumbnailBitmap = null;
1495 Bitmap* pRotateBitmap = null;
1496 Bitmap* pBitmap = null;
1498 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1500 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1504 __pSwButton->SetShowState(false);
1509 if (__pCameraIconLabel)
1511 __pCameraIconLabel->SetShowState(true);
1514 if (__pCamcoderIconLabel)
1516 __pCamcoderIconLabel->SetShowState(true);
1521 __pSwButton->SetShowState(true);
1527 if (!_isHwKeySupported)
1529 __pBackButton->SetShowState(true);
1533 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
1535 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
1537 if (pThumbnailBitmap == null)
1539 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
1541 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1543 __pThumbnailButton->SetShowState(false);
1544 _pThumbnailPanel->SetShowState(false);
1548 _pThumbnailPanel->SetShowState(true);
1563 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
1564 ImageRotationType rotationType = IMAGE_ROTATION_0;
1566 if (__setTimerInterval || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1568 __pThumbnailButton->SetShowState(false);
1569 _pThumbnailPanel->SetShowState(false);
1573 _pThumbnailPanel->SetShowState(true);
1576 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
1577 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1579 rotationType = IMAGE_ROTATION_270;
1583 rotationType = IMAGE_ROTATION_0;
1586 pRotateBitmap = RotationImageN(pThumbnailBitmap, rotationType);
1587 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
1589 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
1590 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
1592 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
1594 delete pRotateBitmap;
1595 pRotateBitmap = null;
1610 AppLogDebug("CameraForm::Update :: Not thummail");
1611 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
1613 AppControlRequestHideButton();
1617 if (!_isHwKeySupported)
1619 __pBackButton->SetShowState(true);
1623 _pThumbnailPanel->SetShowState(false);
1627 _pThumbnailPanel->Invalidate(true);
1631 _pThumbnailPanel->Draw();
1632 _pThumbnailPanel->Show();
1645 TryCatch(__pThumbnailButton != null, , "__pThumbnailButton is null");
1647 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1648 TryCatch(pBitmap != null, , "pBitmap is null");
1650 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
1654 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1655 TryCatch(pBitmap != null, , "pBitmap is null");
1657 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
1663 AppLogDebug("EXIT");
1667 delete pRotateBitmap;
1668 pRotateBitmap = null;
1674 CamcorderForm::OnCameraActionRecorderClosed(void)
1676 AppLogDebug("ENTER");
1677 result r = E_SUCCESS;
1678 Bitmap* pThumbnailBitmap = null;
1679 Bitmap* pRotateBitmap = null;
1680 ImageRotationType rotationType = IMAGE_ROTATION_0;
1682 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
1683 TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
1685 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
1686 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1688 rotationType = IMAGE_ROTATION_270;
1692 rotationType = IMAGE_ROTATION_0;
1695 pRotateBitmap = RotationImageN(pThumbnailBitmap, rotationType);
1696 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
1698 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
1699 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
1701 _pThumbnailPanel->SetShowState(true);
1702 _pThumbnailPanel->Invalidate(true);
1703 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
1704 _pThumbnailPanel->SetDrawSliderImg();
1706 delete pRotateBitmap;
1707 pRotateBitmap = null;
1709 AppLogDebug("EXIT");
1713 delete pRotateBitmap;
1714 pRotateBitmap = null;
1720 CamcorderForm::OnCameraActionPerformed(CameraActionEvent event)
1722 AppLogDebug("ENTER");
1725 __doRecording = false;
1727 if (_pIntervalValueTimer)
1729 _pIntervalValueTimer->Cancel();
1734 _pPopupTimer->Cancel();
1737 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1739 _pCameraInfoPanel->SetDrawPopupTimer(false);
1741 _pCameraInfoPanel->Invalidate(true);
1744 AppLogDebug("OnCameraActionPerformed - event %d", event);
1748 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1750 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1751 DrawFocus(CAMERA_FOCUS_READY);
1755 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1757 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1758 if (_pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING)
1760 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED : NOT STATE_RECORDING");
1761 DrawFocus(CAMERA_FOCUS_READY);
1765 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED : STATE_RECORDING");
1766 DrawFocus(CAMERA_FOCUS_READY);
1767 InitMakerFocusTimer();
1769 _pMakerFocusTimer->Cancel();
1770 _pMakerFocusTimer->Start(CAMCORDER_TIMER_ONE_SEC);
1775 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1777 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1778 DrawFocus(CAMERA_FOCUS_FAIL);
1782 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_CANCELED:
1784 AppLogDebug("VIDEO_RECORDER_CANCELED_LISTENER.");
1785 StartInitAppTimer();
1787 _isRecording = false;
1788 __doRecording = false;
1792 case CAMERA_ACTION_EVENT_VIDEO_THUMBNAIL_BUTTON_LOCK:
1794 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_THUMBNAIL_BUTTON_LOCK.");
1799 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_PREVIEWED:
1801 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_RECORDER_PREVIEWED.");
1805 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_CLOSED:
1807 AppLogDebug("VIDEO_RECORDER_CLOSED_LISTENER.");
1808 int requestType = 0;
1809 result r = E_SUCCESS;
1810 bool isCharging = false;
1811 BatteryLevel batteryLevel;
1813 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1819 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
1821 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
1823 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1825 AppLogDebug("Recrrder after TerminateApp");
1826 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1827 pCameraApp->SetFrameEnabled(false);
1831 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1835 StartInitAppTimer();
1837 r = OnCameraActionRecorderClosed();
1838 TryReturnVoid(r == E_SUCCESS, "OnCameraActionRecorderClosed Fail[%]", GetErrorMessage(r));
1843 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1844 isCharging = _pCameraPresentationModel->IsCharging();
1846 AppLogDebug("batteryLevel = %d", batteryLevel);
1847 AppLogDebug("isCharging = %d", isCharging);
1849 if (isCharging == false)
1851 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1855 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1859 AppLogDebug("GetCameraState : %ld", _pCameraPresentationModel->GetCameraState());
1861 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
1864 if (UiApp::GetInstance()->GetAppUiState()== APP_UI_STATE_FOREGROUND)
1866 _pCameraPresentationModel->SetStartPreviewException(false);
1873 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_END_REACHED:
1875 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_RECORDER_END_REACHED.");
1876 int requestType = 0;
1877 result r = E_SUCCESS;
1879 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1885 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
1887 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1889 AppLogDebug("RECORDER_END_REACHED after TerminateApp");
1891 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1892 pCameraApp->SetFrameEnabled(false);
1895 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1899 AppLogDebug("RECORDER_END_REACHED");
1901 StartInitAppTimer();
1903 SetRecordEndReached();
1905 r = OnCameraActionRecorderClosed();
1906 TryReturnVoid(r == E_SUCCESS, "OnCameraActionRecorderClosed Fail[%]", GetErrorMessage(r));
1913 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_ERROR_OCCURRED:
1915 AppLogDebug("VIDEO_RECORDER_ERROR_OCCURRED_LISTENER.");
1916 RecorderErrorReason recorderErrorStatus = _pCameraPresentationModel->GetRecorderErrorStatus();
1917 AppLogDebug("Recorder error status is %ld",recorderErrorStatus);
1919 if (__pBatteryState != null)
1921 __pBatteryState->SetShowState(true);
1922 __pBatteryState->Draw();
1923 __pBatteryState->Show();
1926 AppLogDebug("Camcorder State = %d ", _pCameraPresentationModel->GetRecorderState());
1927 AppLogDebug("Camera State = %d ", _pCameraPresentationModel->GetCameraState());
1929 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1931 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED)
1933 AppLogDebug("Reinitialising the camcorder");
1938 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_ERROR)
1940 __recorderStopped = true;
1949 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_PAUSED:
1951 AppLogDebug("VIDEO_RECORDER_PAUSED_LISTENER.");
1952 StartInitAppTimer();
1956 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_STARTED:
1958 AppLogDebug("VIDEO_RECORDER_STARTED_LISTENER.");
1963 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_STOPPED:
1965 AppLogDebug("VIDEO_RECORDER_STOPPED_LISTENER.");
1967 if (!__recorderStopped)
1974 __recorderStopped = false;
1979 AppLogDebug("camera state is %ld",_pCameraPresentationModel->GetCameraState());
1981 StartInitAppTimer();
1985 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
1987 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
1988 bool isEnabled = false;
1989 bool isInitCameraStaus = false;
1991 bool isCharging = false;
1992 BatteryLevel batteryLevel;
1994 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1995 isEnabled = pCameraApp->IsFrameEnabled();
1997 if (isEnabled == false)
1999 pCameraApp->SetFrameEnabled(true);
2002 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
2003 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
2005 if (isInitCameraStaus == false)
2007 AppLogDebug("InitCamera is fail");
2011 if (__pCancelPopup != null)
2013 delete __pCancelPopup;
2014 __pCancelPopup = null;
2017 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2019 if (_pCameraPresentationModel->IsCameraPoweredOn())
2021 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED && CameraPoweredOn");
2023 if (__pBatteryState != null)
2025 __pBatteryState->SetShowState(true);
2026 __pBatteryState->Draw();
2027 __pBatteryState->Show();
2031 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
2033 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED)
2039 if (_pCameraPresentationModel->GetStartPreviewException() &&
2040 _pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW )
2043 _pCameraPresentationModel->SetStartPreviewException(false);
2046 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2047 isCharging = _pCameraPresentationModel->IsCharging();
2049 AppLogDebug("batteryLevel = %d", batteryLevel);
2050 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2052 if (isCharging == false)
2054 ShowLowBatteryPopup();
2061 if (!CheckCallStatus())
2063 GetCameraToForeground();
2066 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2067 isCharging = _pCameraPresentationModel->IsCharging();
2069 AppLogDebug("batteryLevel = %d", batteryLevel);
2070 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2072 if (isCharging == false)
2074 ShowLowBatteryPopup();
2079 CheckBatteryStatus();
2082 HideUiModeChangedButton();
2084 if (_pThumbnailPanel != null)
2086 _pThumbnailPanel->DeleteOldBitmap();
2093 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
2095 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
2096 bool isInitCameraStaus = false;
2098 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
2099 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
2101 if (isInitCameraStaus == false)
2103 AppLogDebug("InitCamera is fail");
2107 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2109 if (__pCancelPopup != null)
2111 delete __pCancelPopup;
2112 __pCancelPopup = null;
2115 MakeSettingPopupTab(false);
2117 HideUiModeChangedButton();
2119 if (_pThumbnailPanel != null)
2121 _pThumbnailPanel->DeleteOldBitmap();
2125 InitElapsedTimeLable();
2126 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
2128 _pResetPopUp->SetShowState(false);
2130 SendCameraToBackground();
2134 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
2136 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
2138 ShowCameraFailPopup();
2142 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
2144 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
2146 if (CheckCallStatus())
2151 if (_pCameraPresentationModel->GetStartPreviewException())
2153 ShowCameraFailPopup();
2158 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
2160 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
2161 bool isCharging = false;
2162 BatteryLevel batteryLevel;
2163 result r = E_SUCCESS;
2165 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2166 isCharging = _pCameraPresentationModel->IsCharging();
2168 AppLogDebug("batteryLevel = %d", batteryLevel);
2169 AppLogDebug("isCharging = %d", isCharging);
2172 if (isCharging == false)
2174 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2176 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
2178 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2180 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
2181 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
2184 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
2186 _pCameraPresentationModel->StopRecord();
2187 _pCameraPresentationModel->UpdateContentFile();
2193 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
2198 CheckBatteryStatus();
2203 CheckBatteryStatus();
2208 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
2210 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
2212 _batteryStatus = GetCurrentBatteryState();
2214 AppLogDebug("batteryStatus = %d", _batteryStatus);
2216 CheckBatteryStatus();
2220 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
2222 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
2223 bool doHidePopup = false;
2224 int requestType = 0;
2225 result r = E_SUCCESS;
2227 requestType = _pCameraPresentationModel->GetAppControlRequestType();
2228 if (__pCancelPopup != null)
2230 delete __pCancelPopup;
2231 __pCancelPopup = null;
2232 _pCameraPresentationModel->SetCancelRecord(true);
2236 _pAppTimer->Cancel();
2237 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
2245 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
2247 AppLogDebug("Camera Captured after TerminateApp");
2250 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
2254 AppLogDebug("recorderstate is %d",_pCameraPresentationModel->GetRecorderState());
2255 AppLogDebug("_isRecording is %d",_isRecording);
2256 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING
2257 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STOPPING)
2261 AppLogDebug("_isRecording");
2263 __doRecording = false;
2265 _isRecordingPause = false;
2267 __setTimerInterval = false;
2269 _pCameraPresentationModel->SetIntervalTimerRun(false);
2273 if (__pElapsedTimeLable)
2275 __pElapsedTimeLable->SetShowState(false);
2276 __pElapsedTimeLable->Invalidate(true);
2279 if (__pElapsedTimeMaxLable)
2281 __pElapsedTimeMaxLable->SetShowState(false);
2282 __pElapsedTimeMaxLable->Invalidate(true);
2285 if (__pElapsedRecordSizeLable)
2287 __pElapsedRecordSizeLable->SetShowState(false);
2288 __pElapsedRecordSizeLable->Invalidate(true);
2291 __pRecLabelRed->SetShowState(false);
2292 __pRecLabelRed->Invalidate(true);
2294 __pRecLabelText->SetShowState(false);
2295 __pRecLabelText->Invalidate(true);
2301 if (__setTimerInterval)
2303 AppLogDebug("__setTimerInterval");
2304 CancelTimerIntervalRecord();
2308 if (_pListViewCameraTabMainMenu != null)
2310 if (_pListViewCameraTabMainMenu->GetShowState() == true)
2316 if (_pListViewCameraTabSubMenu != null)
2318 if (_pListViewCameraTabSubMenu->GetShowState() == true)
2324 if (_pListViewGeneralTabMainMenu != null)
2326 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
2332 if (_pListViewGeneralTabSubMenu != null)
2334 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
2340 if (doHidePopup == true)
2348 case CAMERA_ACTION_EVENT_BACK_BUTTON_ACTIVATED:
2350 AppLogDebug("CAMERA_ACTION_EVENT_BACK_BUTTON_ACTIVATED");
2351 if (__pBackButton != null)
2353 if (!_isHwKeySupported)
2355 __pBackButton->SetEnabled(true);
2364 AppLogDebug("EXIT");
2368 CamcorderForm::InitSettingMenuPanel(void)
2370 AppLogDebug("ENTER");
2371 result r = E_SUCCESS;
2372 int cameraCount = 0;
2374 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
2375 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
2377 __pSettingPanel->AddTouchEventListener(*this);
2378 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
2380 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
2381 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2383 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
2384 _pFlashButton->SetActionId(IDA_BUTTON_CAMCORDER_FLASH);
2385 _pFlashButton->AddActionEventListener(*this);
2386 _pFlashButton->AddTouchEventListener(*this);
2388 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
2389 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2391 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMCORDER_SELF);
2392 _pSelfShotButton->AddActionEventListener(*this);
2393 _pSelfShotButton->AddTouchEventListener(*this);
2395 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
2396 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2398 _pSettingButton->SetActionId(IDA_BUTTON_CAMCORDER_SETTING);
2399 _pSettingButton->AddActionEventListener(*this);
2400 _pSettingButton->AddTouchEventListener(*this);
2402 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
2403 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
2404 __pSettingLine->AddTouchEventListener(*this);
2406 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
2407 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
2409 _pQuickSettingButton->AddTouchEventListener(*this);
2410 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMCORDER_QUICK_SETTING);
2411 _pQuickSettingButton->AddActionEventListener(*this);
2413 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
2414 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2416 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
2417 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
2418 _pWhiteBalanceButton->AddTouchEventListener(*this);
2419 _pWhiteBalanceButton->AddActionEventListener(*this);
2421 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
2422 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2424 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
2425 _pExposureValueButton->AddTouchEventListener(*this);
2426 _pExposureValueButton->AddActionEventListener(*this);
2428 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
2429 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2431 _pCloseButton->AddTouchEventListener(*this);
2433 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2434 || __dir == ORIENTATION_STATUS_PORTRAIT)
2436 _pCloseButton->SetSize(X_CLOSE_BUTTON_PORTRAIT, Y_CLOSE_BUTTON_PORTRAIT);
2440 _pCloseButton->SetSize(X_CLOSE_BUTTON_LANDSCAPE, Y_CLOSE_BUTTON_LANDSCAPE);
2442 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
2443 _pCloseButton->AddActionEventListener(*this);
2445 _pAutoFocus = static_cast<Button*>(GetControl(L"IDC_AUTOFOCUS_BUTTON"));
2446 TryCatch(_pAutoFocus != null, r = E_SYSTEM, "_pAutoFocus is null");
2448 _pAutoFocus->SetActionId(IDA_BUTTON_CAMCORDER_AUTO_FOCUS);
2449 _pAutoFocus->AddTouchEventListener(*this);
2450 _pAutoFocus->AddActionEventListener(*this);
2452 r = UpdateUiPanelIcon();
2453 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
2455 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
2456 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
2457 if (cameraCount > SUPPORTED_CAMERA_NUM)
2459 _pSelfShotButton->SetEnabled(true);
2463 _pSelfShotButton->SetEnabled(false);
2466 AppLogDebug("EXIT");
2470 _pFlashButton = null;
2471 _pSelfShotButton = null;
2472 _pSettingButton = null;
2473 __pSettingLine = null;
2474 _pQuickSettingButton = null;
2475 _pWhiteBalanceButton = null;
2476 _pExposureValueButton = null;
2477 _pCloseButton = null;
2484 CamcorderForm::UpdateUiPanelIcon(void)
2486 AppLogDebug("ENTER");
2487 result r = E_SUCCESS;
2488 int selfPortraitEnable = 0;
2489 Bitmap* pBitmap = null;
2490 Bitmap* pBitmapRotate = null;
2493 ImageRotationType rotationType = IMAGE_ROTATION_0;
2495 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2496 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
2498 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2500 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2501 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2503 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2504 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2506 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2507 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2509 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2514 delete pBitmapRotate;
2515 pBitmapRotate = null;
2517 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2518 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2520 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2521 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2523 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2528 delete pBitmapRotate;
2529 pBitmapRotate = null;
2531 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2533 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2535 if (value == true && r == E_SUCCESS)
2537 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2538 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2542 case FLASH_MODE_OFF:
2544 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2545 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2547 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2548 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2550 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2555 delete pBitmapRotate;
2556 pBitmapRotate = null;
2558 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2559 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2561 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2562 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2564 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2569 delete pBitmapRotate;
2570 pBitmapRotate = null;
2576 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2577 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2579 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2580 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2582 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2587 delete pBitmapRotate;
2588 pBitmapRotate = null;
2590 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
2591 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2593 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2594 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2596 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2601 delete pBitmapRotate;
2602 pBitmapRotate = null;
2606 case FLASH_MODE_AUTO:
2608 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2609 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2611 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2612 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2614 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2619 delete pBitmapRotate;
2620 pBitmapRotate = null;
2622 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
2623 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2625 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2626 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2628 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2633 delete pBitmapRotate;
2634 pBitmapRotate = null;
2644 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2645 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2647 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2648 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2650 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2651 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2653 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2658 delete pBitmapRotate;
2659 pBitmapRotate = null;
2661 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2663 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2665 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2666 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2668 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2673 delete pBitmapRotate;
2674 pBitmapRotate = null;
2677 _pFlashButton->Invalidate(true);
2678 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2680 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2682 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2684 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2686 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2688 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2690 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2691 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2693 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2698 delete pBitmapRotate;
2699 pBitmapRotate = null;
2701 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2703 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2705 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2707 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2709 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2711 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2712 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2714 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2719 delete pBitmapRotate;
2720 pBitmapRotate = null;
2722 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2724 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2728 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2730 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2732 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2733 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2735 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2740 delete pBitmapRotate;
2741 pBitmapRotate = null;
2743 if (__dir == ORIENTATION_STATUS_PORTRAIT
2744 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2746 _pCloseButton->SetSize(X_CLOSE_BUTTON_PORTRAIT, Y_CLOSE_BUTTON_PORTRAIT);
2750 rotationType = IMAGE_ROTATION_270;
2751 _pCloseButton->SetSize(X_CLOSE_BUTTON_LANDSCAPE, Y_CLOSE_BUTTON_LANDSCAPE);
2754 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2755 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
2757 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2758 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingButton::pBitmapRotate is null");
2760 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2765 delete pBitmapRotate;
2766 pBitmapRotate = null;
2768 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2769 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
2771 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2772 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingButton::pBitmapRotate is null");
2774 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2779 delete pBitmapRotate;
2780 pBitmapRotate = null;
2782 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2784 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2785 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2787 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2788 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2790 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2795 delete pBitmapRotate;
2796 pBitmapRotate = null;
2798 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2799 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2800 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2802 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2807 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2808 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2810 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2815 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2817 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2819 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2823 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2828 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2829 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2831 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2836 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2837 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2839 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2846 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2847 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2849 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2854 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2855 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2857 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2863 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2865 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2866 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2868 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2870 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2871 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2873 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2878 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2880 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2881 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2883 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2884 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2886 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2887 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2892 delete pBitmapRotate;
2893 pBitmapRotate = null;
2895 AppLogDebug("EXIT");
2899 if (pBitmap != null)
2909 CamcorderForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPsition, const Tizen::Ui::TouchEventInfo& touchInfo)
2911 AppLogDebug("ENTER");
2912 result r = E_SUCCESS;
2913 String controlName = "L";
2915 if (_appControlActionCompleted)
2917 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
2921 controlName = source.GetName();
2923 StartInitAppTimer();
2925 if (_pCameraInfoPanel->GetDrawExposure() == true)
2927 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
2928 _pExposureCloseTimer->Cancel();
2930 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
2931 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
2933 AppLogDebug("EXIT");
2937 CamcorderForm::OnTouchModeSwitch(void)
2939 AppLogDebug("ENTER");
2940 bool onVideoRecorderStopped = false;
2941 result r = E_SUCCESS;
2943 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
2945 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
2947 AppLogDebug("Return Camera transform");
2952 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
2953 AppLogDebug("pSceneManager->GoForward : onVideoRecorderStopped = %d", onVideoRecorderStopped);
2955 if (onVideoRecorderStopped == false)
2957 SceneManager* pSceneManager = SceneManager::GetInstance();
2958 AppAssert(pSceneManager);
2960 AppLogDebug("IDA_BUTTON_CAMCORDER_MODE");
2962 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
2963 TryReturnVoid(r == E_SUCCESS, "Reg setvalue fail[%s]", GetErrorMessage(r));
2967 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMERA));
2968 TryReturnVoid(r == E_SUCCESS, "SceneManager::GoForward fail[%s]", GetErrorMessage(r));
2978 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
2980 AppLogDebug("EXIT");
2984 CamcorderForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
2986 AppLogDebug("ENTER");
2987 result r = E_SUCCESS;
2989 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
2990 if (__dir == ORIENTATION_STATUS_PORTRAIT
2991 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2993 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
2994 _closeTimerValue = 0;
2996 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
2997 _pExposureCloseTimer->Cancel();
2999 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
3000 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
3004 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
3005 _closeTimerValue = 0;
3007 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3008 _pExposureCloseTimer->Cancel();
3010 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
3011 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
3013 AppLogDebug("EXIT");
3017 CamcorderForm::OnTouchDoHidePopup(void)
3019 AppLogDebug("ENTER");
3020 bool doHidePopup = false;
3022 if (_pListViewCameraTabMainMenu != null)
3024 if (_pListViewCameraTabMainMenu->GetShowState() == true)
3030 if (_pListViewGeneralTabMainMenu != null)
3032 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
3038 if (_pListFlashMainMenu != null)
3040 if (_pListFlashMainMenu->GetShowState() == true)
3046 if (_pListViewCameraTabSubMenu != null)
3048 if (_pListViewCameraTabSubMenu->GetShowState() == true)
3054 if (_pListViewGeneralTabSubMenu != null)
3056 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
3062 if (_pListWbMainMenu != null)
3064 if (_pListWbMainMenu->GetShowState() == true)
3070 if (_pCameraInfoPanel->GetDrawExposure() == true)
3072 doHidePopup = false;
3075 AppLogDebug("EXIT");
3080 CamcorderForm::DoRecording(void)
3082 AppLogDebug("ENTER");
3083 bool onVideoRecorderStopped = false;
3087 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3089 AppLogDebug("Camcorder State = %d ", _pCameraPresentationModel->GetRecorderState());
3091 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED
3092 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_OPENED
3093 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
3094 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_CLOSED
3095 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STOPPED
3098 _pCameraPresentationModel->SetFocusMode(CAMERA_FOCUS_MODE_NONE);
3100 if (_pChargingTimer)
3102 _pChargingTimer->Cancel();
3105 __doRecording = true;
3107 _isRecordingPause = false;
3109 __pBatteryState->SetShowState(false);
3110 __pBatteryState->Draw();
3111 __pBatteryState->Show();
3113 _pCameraInfoPanel->SetDrawIndicator(false);
3114 _pCameraInfoPanel->Draw();
3115 _pCameraInfoPanel->Show();
3117 DoRecordHideUiPanel();
3121 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3123 if (onVideoRecorderStopped == false)
3134 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3136 if (onVideoRecorderStopped == true)
3141 AppLogDebug("EXIT");
3145 CamcorderForm::DoStopRecording(void)
3147 AppLogDebug("ENTER");
3150 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3152 __doRecording = false;
3154 _isRecordingPause = false;
3156 __setTimerInterval = false;
3158 _pCameraPresentationModel->SetIntervalTimerRun(false);
3166 StartInitChargingTimer();
3168 _pCameraPresentationModel->SetContinuousAutoFocus();
3169 AppLogDebug("EXIT");
3173 CamcorderForm::OnTouchLaunchImageview(void)
3175 AppLogDebug("ENTER");
3176 bool onVideoRecorderStopped = false;
3177 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
3178 String fullFileName = L"";
3180 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
3182 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3184 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
3185 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
3187 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
3188 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3190 if (onVideoRecorderStopped == false)
3192 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_RECORD);
3194 if (fullFileName == L"")
3196 AppLogDebug("file do not found");
3200 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
3208 AppLogDebug("LaunchImageview");
3209 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3211 if (onVideoRecorderStopped == false)
3213 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_RECORD);
3215 if (fullFileName == L"")
3217 AppLogDebug("file do not found");
3230 AppLogDebug("EXIT");
3234 CamcorderForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
3236 AppLogDebug("ENTER");
3237 String controlName = L"";
3238 int checkActivePanel = -1;
3239 bool doHidePopup = false;
3241 if (_appControlActionCompleted)
3243 AppLogDebug("OnTouchReleased >> TerminateApp Execution");
3247 controlName = source.GetName();
3249 if (_pCameraInfoPanel->GetDrawExposure() == true)
3251 if (source.Equals(*__pRecordButton) == true)
3253 _closeTimerValue = 0;
3255 if (_pExposureCloseTimer)
3257 _pExposureCloseTimer->Cancel();
3260 _pCameraInfoPanel->SetDrawExposure(false);
3265 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
3267 OnTouchDrawExposure(currentPosition);
3272 doHidePopup = OnTouchDoHidePopup();
3273 AppLogDebug("doHidePopup = %d", doHidePopup);
3275 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
3277 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
3279 DrawTouchAutoFocus(currentPosition);
3284 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
3285 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
3287 if (_pCameraInfoGeneralSubPanel != null)
3289 if (_pCameraInfoGeneralSubPanel->GetShowState())
3291 checkActivePanel = 0;
3294 if (_pCameraInfoSubPanel != null)
3296 if (_pCameraInfoSubPanel->GetShowState())
3298 checkActivePanel = 1;
3302 if (checkActivePanel != -1)
3304 if (checkActivePanel == 0)
3306 _pCameraInfoGeneralSubPanel->SetShowState(false);
3310 _pCameraInfoSubPanel->SetShowState(false);
3320 if ((controlName.Equals(String(IDS_RECORDE_BUTTON_NAME)))&&(source.Equals(*__pRecordButton) == true))
3322 AppLogDebug("Camera State = %d ", _pCameraPresentationModel->GetCameraState());
3324 if (_isRecording == false)
3326 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW
3327 && _pCameraPresentationModel->GetCameraState() != CAMERA_STATE_AUTO_FOCUSING
3330 AppLogDebug("It is trying to start the recording ");
3334 AppLogDebug("DoRecording");
3339 AppLogDebug("DoStopRecording");
3340 __recorderStopped = true;
3345 if (source.Equals(*__pCamcorderSettingLable) == true)
3347 CheckCamcorderSettingLabel();
3350 if (source.Equals(*__pGeneralSettingLable) == true)
3352 CheckGeneralSettingLabel();
3355 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
3356 && _pThumbnailPanel->GetShowState() == true
3357 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
3358 && _pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING
3361 if (source.Equals(*_pThumbnailPanel) == true)
3363 AppLogDebug("Touch Thumbnail button");
3364 OnTouchLaunchImageview();
3367 AppLogDebug("EXIT");
3371 CamcorderForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
3373 AppLogDebug("ENTER");
3374 String controlName = L"";
3375 result r = E_SUCCESS;
3377 if (_appControlActionCompleted)
3379 AppLogDebug("OnTouchMoved >> TerminateApp Execution");
3383 controlName = source.GetName();
3385 if ((controlName.Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
3387 OnTouchModeSwitch();
3391 if (_pCameraInfoPanel->GetDrawExposure() == true)
3393 AppLogDebug("control name is %ls",controlName.GetPointer());
3395 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
3397 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
3398 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3399 _closeTimerValue = 0;
3401 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3402 _pExposureCloseTimer->Cancel();
3405 AppLogDebug("EXIT");
3409 CamcorderForm::OnAppTimerExpired(void)
3411 AppLogDebug("ENTER");
3412 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
3413 result r = E_SUCCESS;
3415 AppLogDebug("_pAppTimer expire");
3420 _isRecording = false;
3422 _pCameraPresentationModel->StopCamera();
3424 r = SendAppControlResult(pCameraApp->GetRequestId());
3425 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
3426 AppLogDebug("EXIT");
3430 CamcorderForm::OnSettingTimerExpired(void)
3432 AppLogDebug("ENTER");
3433 result r = E_SUCCESS;
3435 _pIntervalValueTimer->Cancel();
3437 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
3439 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
3441 _pCameraInfoPanel->Invalidate(true);
3443 _pCameraInfoPanel->SetDrawPopupTimer(false);
3445 _pCameraInfoPanel->Invalidate(true);
3447 _isRecording = true;
3449 __setTimerInterval = false;
3450 _pCameraPresentationModel->SetIntervalTimerRun(false);
3452 _pCameraPresentationModel->StartRecord();
3454 r = StartRecordTimer();
3455 TryReturnVoid(r == E_SUCCESS, "StartRecordTimer() fail[%s]", GetErrorMessage(r));
3457 r = SetRecordButton(true);
3458 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
3460 AutoFocusPerformed();
3461 AppLogDebug("EXIT");
3465 CamcorderForm::OnPopupTimerExpired(void)
3467 AppLogDebug("ENTER");
3468 if (_isRecording != true)
3472 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
3474 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
3476 _pCameraInfoPanel->Invalidate(true);
3478 AppLogDebug("_timeCount=%d", _timeCount);
3480 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
3485 AppLogDebug("EXIT");
3489 CamcorderForm::OnRecordTimerExpired(void)
3491 AppLogDebug("ENTER");
3492 result r = E_SUCCESS;
3494 if (_isRecording == true)
3496 __recordTimeCount++;
3498 AppLogDebug("__pRecordTimer expire");
3500 __recordingMaxTime = _pCameraPresentationModel->GetMaxRecordingTime();
3502 r = DrawRecord(true);
3503 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
3505 r = DrawRecordTimer();
3506 TryReturnVoid(r == E_SUCCESS, "DrawRecordTimer() fail[%s]", GetErrorMessage(r));
3508 AppLogDebug("EXIT");
3512 CamcorderForm::OnExposureCloseTimerExpired(void)
3514 AppLogDebug("ENTER");
3517 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
3519 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
3521 if (_pCameraInfoPanel->GetDrawExposure() == true)
3523 _pCameraInfoPanel->SetDrawExposure(false);
3529 _closeTimerValue = 0;
3531 _pExposureCloseTimer->Cancel();
3533 AppLogDebug("EXIT");
3537 CamcorderForm::OnPreviewFailPopupTimerExpired(void)
3539 AppLogDebug("ENTER");
3541 if (CheckCallStatus())
3546 ShowCameraFailPopup();
3547 AppLogDebug("EXIT");
3551 CamcorderForm::OnChargingCompletedTimerExpired(void)
3553 AppLogDebug("ENTER");
3554 Bitmap* pBitmap = null;
3555 result r = E_SUCCESS;
3557 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3559 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3561 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
3565 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
3570 if (_chargingCount % DIVIDE_BY_TWO)
3572 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
3576 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
3578 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
3580 if (_chargingCount >= BATTERY_STATE_20)
3582 _chargingCount = INDEX_UNIT_ZERO;
3586 __pBatteryState->SetBackgroundBitmap(*pBitmap);
3587 __pBatteryState->Invalidate(true);
3589 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3590 AppLogDebug("_chargingCount = %d", _chargingCount);
3591 AppLogDebug("_blinkCount = %d", _blinkCount);
3596 AppLogDebug("EXIT");
3600 AppLogDebug("EXIT - CATCH");
3605 CamcorderForm::OnChargingTimerExpired(void)
3607 AppLogDebug("ENTER");
3608 Bitmap* pBitmap = null;
3609 result r = E_SUCCESS;
3610 int maxChargingCnt = 0;
3611 int batteryLevel = 0;
3612 Battery::GetCurrentLevelInPercentage(batteryLevel);
3614 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3616 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3618 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
3622 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
3625 AppLogDebug("batteryLevel = %d", batteryLevel);
3629 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3630 AppLogDebug("_chargingCount = %d", _chargingCount);
3632 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
3634 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
3638 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
3640 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
3642 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
3644 AppLogDebug("maxCount = %d", maxChargingCnt);
3646 if (maxChargingCnt >= BATTERY_STATE_20)
3648 _chargingCount = INDEX_UNIT_ZERO;
3651 __pBatteryState->SetBackgroundBitmap(*pBitmap);
3652 __pBatteryState->Invalidate(true);
3657 AppLogDebug("EXIT");
3661 AppLogDebug("EXIT - CATCH");
3666 CamcorderForm::OnMakerFocusTimerExpired(void)
3668 AppLogDebug("ENTER");
3669 result r = E_SUCCESS;
3671 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3673 _pCameraInfoPanel->Invalidate(true);
3675 r = _pMakerFocusTimer->Cancel();
3677 delete _pMakerFocusTimer;
3678 _pMakerFocusTimer = null;
3679 AppLogDebug("EXIT");
3683 CamcorderForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
3685 AppLogDebug("ENTER");
3686 if (timer.Equals(*_pAppTimer))
3688 AppLogDebug("_pAppTimer");
3689 OnAppTimerExpired();
3691 else if (timer.Equals(*_pIntervalValueTimer))
3693 AppLogDebug("_pIntervalValueTimer");
3695 OnSettingTimerExpired();
3696 StartInitChargingTimer();
3698 else if (timer.Equals(*_pPopupTimer))
3700 AppLogDebug("_pPopupTimer");
3701 OnPopupTimerExpired();
3703 else if (timer.Equals(*__pRecordTimer))
3705 AppLogDebug("__pRecordTimer");
3706 OnRecordTimerExpired();
3708 if (!_isHwKeySupported)
3710 __pBackButton->SetShowState(true);
3711 __pBackButton->Invalidate(true);
3714 __pRecordButton->SetShowState(true);
3715 __pRecordButton->Invalidate(true);
3717 else if (timer.Equals(*_pExposureCloseTimer))
3719 AppLogDebug("_pExposureCloseTimer");
3720 OnExposureCloseTimerExpired();
3722 else if (timer.Equals(*_pMakerFocusTimer))
3724 AppLogDebug("_pMakerFocusTimer");
3725 OnMakerFocusTimerExpired();
3727 else if (timer.Equals(*_pHelpCloseTimer))
3729 AppLogDebug("__pHelpCloseTimer");
3730 OnHelpCloseTimerExpired();
3732 else if (timer.Equals(*_pChargingTimer))
3734 result r = E_SUCCESS;
3735 AppLogDebug("_pChargingTimer");
3736 bool isCharging = false;
3738 _batteryStatus = GetCurrentBatteryState();
3739 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3741 isCharging = _pCameraPresentationModel->IsCharging();
3745 if (_batteryStatus == BATTERY_STATE_20)
3747 _chargingCount = INDEX_UNIT_ZERO;
3749 _blinkCount = INDEX_UNIT_ZERO;
3751 _pChargingTimer->Cancel();
3753 StartInitChargingCompletedTimer();
3757 r = OnChargingTimerExpired();
3764 _blinkCount = INDEX_UNIT_ZERO;
3766 _pChargingTimer->Cancel();
3768 if (_batteryStatus == BATTERY_STATE_20)
3770 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
3772 StartInitChargingCompletedTimer();
3776 else if (timer.Equals(*_pChargingCompletedTimer))
3778 result r = E_SUCCESS;
3779 AppLogDebug("__pChargingCompletedTimer");
3780 bool isCharging = false;
3782 isCharging = _pCameraPresentationModel->IsCharging();
3784 _batteryStatus = GetCurrentBatteryState();
3785 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3787 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
3789 if (_blinkCount == INDEX_UNIT_TWENTY)
3791 AppLogDebug("__pChargingCompletedTimer cancel");
3793 _chargingCount = INDEX_UNIT_ZERO;
3795 _blinkCount = INDEX_UNIT_ZERO;
3797 _pChargingCompletedTimer->Cancel();
3799 CheckBatteryStatus();
3803 AppLogDebug("OnChargingCompletedTimerExpired");
3805 r = OnChargingCompletedTimerExpired();
3810 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
3812 _chargingCount = INDEX_UNIT_ZERO;
3814 _blinkCount = INDEX_UNIT_ZERO;
3816 _pChargingCompletedTimer->Cancel();
3818 CheckBatteryStatus();
3821 else if (timer.Equals(*_pPreviewFailPopupTimer))
3823 AppLogDebug("__pPreviewFailPopupTimer");
3824 _pPreviewFailPopupTimer->Cancel();
3826 if (_pCameraPresentationModel->GetStartPreviewException())
3828 OnPreviewFailPopupTimerExpired();
3833 AppLogDebug("Not expire");
3835 AppLogDebug("EXIT");
3839 CamcorderForm::InitActionMenuPanel(void)
3841 AppLogDebug("ENTER");
3842 result r = E_SUCCESS;
3843 Rectangle rectThumbnailButton;
3844 Rectangle clientArea = GetClientAreaBounds();
3846 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
3847 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
3849 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
3851 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
3852 || __dir == ORIENTATION_STATUS_PORTRAIT)
3854 if (clientArea.height == DISPLAY_WVGA)
3856 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
3860 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
3865 if (clientArea.width == DISPLAY_WVGA)
3867 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
3871 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
3874 __pActionPanel->AddTouchEventListener(*this);
3876 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
3877 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3878 __pBatteryState->AddTouchEventListener(*this);
3880 __pCamcoderSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
3881 TryCatch(__pCamcoderSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
3882 __pCamcoderSetting->SetActionId(IDA_BUTTON_SETTING_CAMCODER);
3883 __pCamcoderSetting->AddActionEventListener(*this);
3884 __pCamcoderSetting->SetShowState(false);
3886 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
3887 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
3888 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
3889 __pGeneralSetting->AddActionEventListener(*this);
3890 __pGeneralSetting->SetShowState(false);
3892 __pCamcorderSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
3893 TryCatch(__pCamcorderSettingLable != null, r = E_SYSTEM, "__pCamcorderSettingLable is null");
3894 __pCamcorderSettingLable->AddTouchEventListener(*this);
3895 __pCamcorderSettingLable->SetShowState(false);
3897 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
3898 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
3899 __pGeneralSettingLable->AddTouchEventListener(*this);
3900 __pGeneralSettingLable->SetShowState(false);
3902 __pRecLabelRed = static_cast<Label*>(GetControl(L"IDC_REC_LABEL_RED"));
3903 TryCatch(__pRecLabelRed != null, r = E_SYSTEM, "__pRecLabelRed is null");
3904 __pRecLabelRed->AddTouchEventListener(*this);
3906 __pRecLabelText = static_cast<Label*>(GetControl(L"IDC_REC_LABEL_TEXT"));
3907 TryCatch(__pRecLabelText != null, r = E_SYSTEM, "__pRecLabelRed is null");
3908 __pRecLabelText->AddTouchEventListener(*this);
3910 __pElapsedTimeLable = static_cast< Label* >(GetControl(L"IDC_REC_TIME"));
3911 TryCatch(__pElapsedTimeLable != null, r = E_SYSTEM, "__pElapsedTimeLable is null");
3912 __pElapsedTimeLable->AddTouchEventListener(*this);
3914 __pElapsedTimeMaxLable = static_cast< Label* >(GetControl(L"IDC_REC_MAX_TIME"));
3915 TryCatch(__pElapsedTimeMaxLable != null, r = E_SYSTEM, "__pElapsedTimeMaxLable is null");
3916 __pElapsedTimeMaxLable->AddTouchEventListener(*this);
3918 __pElapsedRecordSizeLable = static_cast< Label* >(GetControl(L"IDC_REC_SIZE"));
3919 TryCatch(__pElapsedRecordSizeLable != null, r = E_SYSTEM, "__pElapsedRecordSizeLable is null");
3920 __pElapsedRecordSizeLable->AddTouchEventListener(*this);
3922 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
3923 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
3924 __pCameraIconLabel->AddTouchEventListener(*this);
3926 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
3927 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
3929 __pSwButton->SetName(IDS_ACTION_UI_CAMCORDER_MODE);
3930 __pSwButton->AddTouchEventListener(*this);
3932 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
3933 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
3934 __pCamcoderIconLabel->AddTouchEventListener(*this);
3936 __pBackButton = static_cast<Button*>(GetControl(L"IDC_CAMERA_BACK"));
3937 TryCatch(__pBackButton != null, r = E_SYSTEM, "__pBackButton is null");
3938 __pBackButton->SetActionId(IDA_BUTTON_CAMCORDER_BACK);
3939 __pBackButton->AddActionEventListener(*this);
3940 //__pBackButton->AddTouchEventListener(*this);
3942 if (_isHwKeySupported)
3944 __pBackButton->SetShowState(false);
3947 __pRecordButton = static_cast<Button*>(GetControl(L"IDC_RECORD_BUTTON"));
3948 TryCatch(__pRecordButton != null, r = E_SYSTEM, "pRecodeButton is null");
3950 __pRecordButton->SetName(IDS_RECORDE_BUTTON_NAME);
3951 __pRecordButton->AddTouchEventListener(*this);
3953 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
3955 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
3956 || __dir == ORIENTATION_STATUS_PORTRAIT)
3958 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
3959 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
3963 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
3964 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
3967 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
3968 TryCatch(_pThumbnailPanel != null, r = E_FAILURE, "_pThumbnailPanel is null");
3970 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
3971 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
3973 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
3974 _pThumbnailPanel->AddTouchEventListener(*this);
3975 _pThumbnailPanel->SetShowState(false);
3976 AddControl(_pThumbnailPanel);
3977 AddOrientationEventListener(*_pThumbnailPanel);
3979 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
3980 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
3981 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMCORDER_THUMBNAIL);
3982 __pThumbnailButton->AddActionEventListener(*this);
3983 __pThumbnailButton->SetShowState(false);
3984 __pThumbnailButton->AddTouchEventListener(*this);
3986 r = UpdateUiActionPanelIcon();
3987 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() fail");
3989 AppLogDebug("EXIT");
3993 __pCameraIconLabel = null;
3995 __pCamcoderIconLabel = null;
3996 __pRecordButton = null;
3997 __pThumbnailButton = null;
3998 __pBackButton = null;
3999 __pCamcoderSetting = null;
4000 __pGeneralSetting = null;
4001 __pCamcorderSettingLable = null;
4002 __pGeneralSettingLable = null;
4004 delete _pThumbnailPanel;
4005 _pThumbnailPanel = null;
4011 CamcorderForm::UpdateUiActionPanelIcon(void)
4013 AppLogDebug("ENTER");
4014 result r = E_SUCCESS;
4015 Bitmap* pBitmap = null;
4016 Bitmap* pBitmapRotate = null;
4018 ImageRotationType rotationType = IMAGE_ROTATION_0;
4019 Point ptModeChangeButton;
4020 if (__dir == ORIENTATION_STATUS_PORTRAIT
4021 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4023 rotationType = IMAGE_ROTATION_90;
4024 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
4026 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
4027 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
4029 rotationType = IMAGE_ROTATION_0;
4030 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
4033 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
4035 if (__dir == ORIENTATION_STATUS_PORTRAIT
4036 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4038 rotationType = IMAGE_ROTATION_90;
4040 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
4041 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
4043 rotationType = IMAGE_ROTATION_0;
4046 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
4047 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4049 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
4054 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
4055 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4057 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4058 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ChangeMode::pBitmapRotate is null");
4060 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4061 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4065 delete pBitmapRotate;
4066 pBitmapRotate = null;
4068 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
4069 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4071 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
4075 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
4076 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4078 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
4083 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
4084 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4086 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4087 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4089 __pBackButton->SetSize(X_BACK_BUTTON_POSITION, Y_BACK_BUTTON_POSITION);
4090 __pBackButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4095 delete pBitmapRotate;
4096 pBitmapRotate = null;
4098 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
4099 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4101 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4102 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4104 __pBackButton->SetSize(X_BACK_BUTTON_POSITION, Y_BACK_BUTTON_POSITION);
4105 __pBackButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4110 delete pBitmapRotate;
4111 pBitmapRotate = null;
4113 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
4114 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4116 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4117 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4119 __pBackButton->SetSize(X_BACK_BUTTON_POSITION, Y_BACK_BUTTON_POSITION);
4120 __pBackButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
4125 delete pBitmapRotate;
4126 pBitmapRotate = null;
4128 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
4129 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4131 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4132 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4134 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4138 delete pBitmapRotate;
4139 pBitmapRotate = null;
4141 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_PRESS);
4142 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4144 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4145 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4147 __pRecordButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4151 delete pBitmapRotate;
4152 pBitmapRotate = null;
4154 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
4155 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4157 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4158 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4160 __pRecordButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
4164 delete pBitmapRotate;
4165 pBitmapRotate = null;
4167 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
4168 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
4170 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
4174 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
4175 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
4177 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
4181 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMCODER);
4182 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderSetting::pBitmap is null");
4184 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4185 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CamcoderSetting::pBitmapRotate is null");
4187 __pCamcoderSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
4188 __pCamcoderSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
4193 delete pBitmapRotate;
4194 pBitmapRotate = null;
4196 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
4197 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
4199 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4200 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
4202 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
4203 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
4208 delete pBitmapRotate;
4209 pBitmapRotate = null;
4211 AppLogDebug("EXIT");
4215 if (pBitmap != null)
4225 CamcorderForm::Initialize(void)
4227 AppLogDebug("ENTER");
4228 result r = E_SUCCESS;
4230 Construct(L"IDL_CAMCORDER_FORM");
4232 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
4233 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
4235 AppLogDebug("EXIT");
4243 CamcorderForm::InitAppTimer(void)
4245 AppLogDebug("ENTER");
4246 _pAppTimer = new (std::nothrow) Timer();
4247 _pAppTimer->Construct(*this);
4248 AppLogDebug("EXIT");
4252 CamcorderForm::InitChargingTimer(void)
4254 AppLogDebug("ENTER");
4255 _pChargingTimer = new (std::nothrow) Timer();
4256 _pChargingTimer->Construct(*this);
4257 AppLogDebug("EXIT");
4261 CamcorderForm::InitChargingCompletedTimer(void)
4263 AppLogDebug("ENTER");
4264 _pChargingCompletedTimer = new (std::nothrow) Timer();
4265 _pChargingCompletedTimer->Construct(*this);
4266 AppLogDebug("EXIT");
4270 CamcorderForm::InitPreviewFailPopupTimer(void)
4272 AppLogDebug("ENTER");
4273 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
4274 _pPreviewFailPopupTimer->Construct(*this);
4275 AppLogDebug("EXIT");
4279 CamcorderForm::InitMakerFocusTimer(void)
4281 AppLogDebug("ENTER");
4282 _pMakerFocusTimer = new (std::nothrow) Timer();
4283 _pMakerFocusTimer->Construct(*this);
4284 AppLogDebug("EXIT");
4288 CamcorderForm::InitSettingTimer(void)
4290 AppLogDebug("ENTER");
4291 _pIntervalValueTimer = new (std::nothrow) Timer();
4292 _pIntervalValueTimer->Construct(*this);
4293 AppLogDebug("EXIT");
4297 CamcorderForm::StartInitChargingTimer(void)
4299 AppLogDebug("ENTER");
4300 result r = E_SUCCESS;
4301 bool isCharging = false;
4303 isCharging = _pCameraPresentationModel->IsCharging();
4309 if (_pChargingTimer)
4311 _pChargingTimer->Cancel();
4313 r = _pChargingTimer->StartAsRepeatable(CAMCORDER_CHARGING_TIMER);
4314 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4319 if (_pChargingTimer)
4321 _pChargingTimer->Cancel();
4324 AppLogDebug("EXIT");
4328 CamcorderForm::StartInitAppTimer(void)
4330 AppLogDebug("ENTER");
4331 result r = E_SUCCESS;
4333 TryReturnVoid(_pCameraPresentationModel != null, "_pCameraPresentationModel is null");
4334 if (_pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING)
4336 AppLogDebug("StartInitAppTimer : RecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
4338 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
4339 _pAppTimer->Cancel();
4341 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
4342 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
4344 AppLogDebug("EXIT");
4348 CamcorderForm::StartPreviewFailPopupTimer(void)
4350 AppLogDebug("ENTER");
4351 result r = E_SUCCESS;
4353 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
4355 _pPreviewFailPopupTimer->Cancel();
4357 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
4358 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
4359 AppLogDebug("EXIT");
4363 CamcorderForm::StartInitChargingCompletedTimer(void)
4365 AppLogDebug("ENTER");
4366 result r = E_SUCCESS;
4367 bool isCharging = false;
4369 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4371 isCharging = _pCameraPresentationModel->IsCharging();
4373 _batteryStatus = GetCurrentBatteryState();
4374 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4376 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4378 if (_pChargingCompletedTimer)
4380 _pChargingCompletedTimer->Cancel();
4387 r = DrawBatteryLevelFull();
4388 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4390 AppLogDebug("EXIT");
4393 _chargingCount = INDEX_UNIT_ZERO;
4395 if (_batteryStatus == BATTERY_STATE_20)
4397 if (_pChargingCompletedTimer)
4399 _pChargingCompletedTimer->Cancel();
4401 r = _pChargingCompletedTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
4402 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4407 if (_pChargingCompletedTimer)
4409 _pChargingCompletedTimer->Cancel();
4415 CheckBatteryStatus();
4417 AppLogDebug("EXIT");
4421 CamcorderForm::StopInitAppTimer(void)
4423 AppLogDebug("ENTER");
4426 _pAppTimer->Cancel();
4428 AppLogDebug("EXIT");
4432 CamcorderForm::StopInitChargingTimer(void)
4434 AppLogDebug("ENTER");
4437 if (_pChargingTimer)
4439 _pChargingTimer->Cancel();
4441 AppLogDebug("EXIT");
4445 CamcorderForm::UpdateUiIndicatorStorage(Canvas* pCanvas, const String& str)
4447 AppLogDebug("ENTER");
4452 result r = E_SUCCESS;
4455 int textClearWidth = 0;
4456 int textClearHeight= 0;
4460 listRect = pCanvas->GetBounds();
4462 pFnt = new (std::nothrow) Font();
4463 pFnt->Construct(FONT_STYLE_PLAIN, FONT_SIZE_INDICATOR_STORAGE_FREE_SPACE);
4465 r = pCanvas->SetFont(*pFnt);
4466 TryCatch(r == E_SUCCESS, , "Canvas::SetFont() fail[%s]", GetErrorMessage(r));
4468 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
4469 if (__dir == ORIENTATION_STATUS_PORTRAIT
4470 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4472 point.x = X_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT - (dim.width / DIVIDE_BY_TWO);
4473 point.y = Y_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT;
4475 textClearX = point.x;
4476 textClearY = point.y;
4477 textClearWidth = W_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT;
4478 textClearHeight = H_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT;
4482 point.x = X_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE - (dim.width / DIVIDE_BY_TWO);
4483 point.y = Y_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE;
4485 textClearX = point.x;
4486 textClearY = point.y;
4487 textClearWidth = W_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE;
4488 textClearHeight = H_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE;
4491 r = pCanvas->Clear(Rectangle(textClearX, textClearY, textClearWidth, textClearHeight));
4492 TryCatch(r == E_SUCCESS, , "Canvas Clear() fail[%s]", GetErrorMessage(r));
4494 r = pCanvas->DrawText(point, str);
4495 TryCatch(r == E_SUCCESS, , "Canvas::DrawText() fail[%s]", GetErrorMessage(r));
4501 AppLogDebug("EXIT");
4512 CamcorderForm::SetRecordStartTimer(int timeInterval)
4514 AppLogDebug("ENTER");
4515 result r = E_SUCCESS;
4517 AppLogDebug("timeInterval = %d", timeInterval);
4519 switch (timeInterval)
4521 case SET_RECORD_START_TIMER_0_SEC:
4526 case SET_RECORD_START_TIMER_2_SEC:
4528 _pIntervalValueTimer->Cancel();
4530 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_2_SEC);
4531 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4535 case SET_RECORD_START_TIMER_5_SEC:
4537 _pIntervalValueTimer->Cancel();
4539 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_5_SEC);
4540 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4544 case SET_RECORD_START_TIMER_10_SEC:
4546 _pIntervalValueTimer->Cancel();
4548 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_10_SEC);
4549 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4555 AppLogDebug("timmer Invail element id");
4560 AppLogDebug("EXIT");
4568 CamcorderForm::CancelTimer(void)
4570 AppLogDebug("ENTER");
4571 if (_pAppTimer != null)
4573 _pAppTimer->Cancel();
4576 if (_pIntervalValueTimer != null)
4578 _pIntervalValueTimer->Cancel();
4583 _pPopupTimer->Cancel();
4586 if (_pExposureCloseTimer)
4588 _pExposureCloseTimer->Cancel();
4591 if (_pHelpCloseTimer)
4593 _pHelpCloseTimer->Cancel();
4596 if (_pChargingCompletedTimer != null)
4600 _pChargingCompletedTimer->Cancel();
4603 if (_pPreviewFailPopupTimer != null)
4605 _pPreviewFailPopupTimer->Cancel();
4607 AppLogDebug("EXIT");
4611 CamcorderForm::MakeRecordingResolutionList(bool remakeList = false)
4613 AppLogDebug("ENTER");
4614 Dimension dimResolution;
4615 IList* pTempList = null;
4616 String* pItemString = null;
4618 result r = E_SUCCESS;
4621 Dimension dimension;
4622 Dimension tempDimention(RECORDING_RESOLOTION_WIDTH, RECORDING_RESOLOTION_HEIGHT);
4623 int recordingResolutionIdx = 0;
4627 if (__pRecordingResolutionList)
4629 __pRecordingResolutionList->RemoveAll(true);
4632 delete __pRecordingResolutionList;
4633 __pRecordingResolutionList = null;
4636 if (__pRecordingResolutionList == null)
4638 __pRecordingResolutionList = new (std::nothrow) ArrayList();
4639 r = __pRecordingResolutionList->Construct();
4640 TryCatch(r == E_SUCCESS, , "__pRecordingResolutionList construct fail[%s]", GetErrorMessage(r));
4642 pTempList = _pCameraPresentationModel->GetRecordingResolutionList();
4643 TryCatch(pTempList != null, , "GetRecordingResolutionList() return null");
4645 tot = pTempList->GetCount();
4649 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4651 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4653 AppLogDebug("GetRecordingResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4654 if (dimResolution == tempDimention)
4656 tempString.Format(32, L"%dX%d(60FPS)", dimResolution.width, dimResolution.height);
4657 pItemString = new (std::nothrow) String(tempString);
4658 TryCatch(pItemString != null, , "pItemString is null");
4660 __pRecordingResolutionList->Add(*pItemString);
4661 recordingResolutionIdx = idx;
4667 AppLogDebug("Not Support CaptureResolution");
4670 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(recordingResolutionIdx)));
4673 __pRecordingResolutionWidth = dimResolution.width;
4674 __pRecordingResolutionHeight = dimResolution.height;
4676 AppLogDebug("recordingResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4678 AppLogDebug("EXIT");
4682 if (__pRecordingResolutionList)
4684 __pRecordingResolutionList->RemoveAll(true);
4686 delete __pRecordingResolutionList;
4687 __pRecordingResolutionList = null;
4692 CamcorderForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4694 AppLogDebug("ENTER");
4695 AppLogDebug("EXIT");
4699 CamcorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4701 AppLogDebug("ENTER");
4702 result r = E_SUCCESS;
4704 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4706 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4708 r = ProcessCamcorderTabMainListPopup(index);
4709 TryReturnVoid(r == E_SUCCESS, "ProcessCamcorderTabMainListPopup() fail[%s]", GetErrorMessage(r));
4712 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4714 r = ProcessCamcorderTabSubListPopup(index);
4715 TryReturnVoid(r == E_SUCCESS, "ProcessCamcorderTabSubListPopup() fail[%s]", GetErrorMessage(r));
4717 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4719 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4721 r = ProcessGeneraTabMainListPopup(index);
4722 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4725 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4727 r = ProcessGeneraTabSubListPopup(index);
4728 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4730 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4732 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4734 r = ProcessFlashListPopup(index);
4735 UpdateUiPanelIcon();
4737 TryReturnVoid(r == E_SUCCESS, "ProcessFlashListPopup() fail[%s]", GetErrorMessage(r));
4739 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4741 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4743 r = SubListPopupWbMode(index);
4744 TryReturnVoid(r == E_SUCCESS, "SubListPopupWbMode() fail[%s]", GetErrorMessage(r));
4749 AppLogDebug("EXIT");
4753 CamcorderForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4755 AppLogDebug("ENTER");
4756 AppLogDebug("EXIT");
4760 CamcorderForm::OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment)
4762 AppLogDebug("ENTER");
4763 AppLogDebug("EXIT");
4767 CamcorderForm::OnSliderBarMoved(Tizen::Ui::Controls::Slider& source, int value)
4769 AppLogDebug("ENTER");
4770 AppLogDebug("EXIT");
4774 CamcorderForm::CreateItem(int index, int itemWidth)
4776 AppLogDebug("ENTER");
4777 CustomItem* pItem = null;
4778 bool createSubMenu = false;
4779 bool createGenSubMenu = false;
4781 if (_pListViewCameraTabSubMenu)
4783 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4785 createSubMenu = true;
4786 pItem = CreateCamcorderTabSubMenuItem(index, itemWidth);
4790 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4795 AppLogDebug("EXIT");
4801 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4803 if (createSubMenu == false)
4805 pItem = CreateCamcorderTabMainMenuItem(index, itemWidth);
4809 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4814 AppLogDebug("EXIT");
4820 if (_pListViewGeneralTabSubMenu)
4822 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4824 createGenSubMenu = true;
4825 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4829 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4834 AppLogDebug("EXIT");
4840 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4842 if (createGenSubMenu == false)
4844 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4848 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4853 AppLogDebug("EXIT");
4859 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4861 pItem = CreateFlashMainMenuItem(index, itemWidth);
4865 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListFlashMainMenu");
4870 AppLogDebug("EXIT");
4875 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4877 pItem = CreateWhiteBalanceItem(index, itemWidth);
4881 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListWbMainMenu");
4886 AppLogDebug("EXIT");
4891 AppLogDebug("EXIT");
4896 CamcorderForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4898 AppLogDebug("ENTER");
4902 AppLogDebug("EXIT");
4907 CamcorderForm::GetItemCount(void)
4909 AppLogDebug("ENTER");
4910 if (_pListViewCameraTabSubMenu)
4912 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4914 return GetCamcorderTabSettingSubMenuCount();
4918 if (_pListViewCameraTabMainMenu)
4920 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4922 return GetCamcorderTabSettingMainMenuCount();
4926 if (_pListViewGeneralTabSubMenu)
4928 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4930 return GetGeneralTabSettingSubMenuCount();
4934 if (_pListViewGeneralTabMainMenu)
4936 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4938 AppLogDebug("EXIT");
4939 return GetGeneralTabSettingMainMenuCount();
4943 if (_pListFlashMainMenu)
4945 return GetCamcorderTabSettingMainMenuCount();
4948 if (_pListWbMainMenu)
4950 AppLogDebug("EXIT");
4951 return GetCamcorderTabSettingMainMenuCount();
4954 AppLogDebug("EXIT");
4959 CamcorderForm::GetTimerIntervalValue(void) const
4961 AppLogDebug("ENTER");
4962 result r = E_SUCCESS;
4963 int timerInterval = 0;
4965 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
4966 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
4968 AppLogDebug("EXIT");
4969 return timerInterval;
4976 CamcorderForm::SetGuideLine(int guideLineEnable)
4978 AppLogDebug("ENTER");
4979 result r = E_SUCCESS;
4981 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
4982 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
4983 AppLogDebug("EXIT");
4987 CamcorderForm::RestoreDefaultSetting(void)
4989 AppLogDebug("ENTER");
4990 result r = E_SUCCESS;
4991 int selfPortraitEnable = 0;
4992 bool exposureValue = false;
4993 bool brighnesstValue = false;
4994 int adjustValue = 0;
4996 r = _pCameraPresentationModel->ResetCameraSettingsRegistry( );
4997 TryCatch(r == E_SUCCESS, , "ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
4999 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5000 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5002 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5004 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
5008 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
5011 if (exposureValue == true && r == E_SUCCESS)
5013 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
5014 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5016 AppLogDebug("adjustValue = %d", adjustValue);
5018 _pCameraPresentationModel->SetExposure(adjustValue);
5022 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5024 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5028 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5031 if (brighnesstValue == true && r == E_SUCCESS)
5033 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5034 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5036 AppLogDebug("adjustValue = %d", adjustValue);
5038 _pCameraPresentationModel->SetBrightness(adjustValue);
5042 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5044 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5047 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5048 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5053 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5056 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5057 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5063 AppLogDebug("adjustValue = %d", adjustValue);
5065 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5068 AppLogDebug("EXIT");
5072 AppLogDebug("EXIT - CATCH");
5077 CamcorderForm::DrawMarker(bool useGuidline)
5079 AppLogDebug("ENTER");
5080 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5081 result r = E_SUCCESS;
5083 if (__dir == ORIENTATION_STATUS_PORTRAIT
5084 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5086 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5090 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5095 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5099 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5102 _pCameraInfoPanel->Invalidate(true);
5104 AppLogDebug("EXIT");
5109 CamcorderForm::DrawFocus(int focusMode)
5111 AppLogDebug("ENTER");
5112 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5113 result r = E_SUCCESS;
5114 int selfPortraitEnable = 0;
5115 bool focusSupport = false;
5117 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5118 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5120 if (__dir == ORIENTATION_STATUS_PORTRAIT
5121 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5123 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5127 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5130 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5132 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5136 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5139 if (focusSupport == true && r == E_SUCCESS)
5141 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5143 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5145 _pCameraInfoPanel->Invalidate(true);
5149 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5151 _pCameraInfoPanel->Invalidate(true);
5154 AppLogDebug("EXIT");
5162 CamcorderForm::ToggleCameraDirection(int direction)
5164 AppLogDebug("ENTER");
5165 result r = E_SUCCESS;
5166 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5168 Point currentPosition;
5169 BufferInfo bufferinfo;
5170 bool isInitCameraStaus = false;
5172 if (_pAppTimer != null)
5174 _pAppTimer->Cancel();
5176 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
5177 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5180 if (direction == CAMCORDER_FORM_SECONDARY_MODE)
5182 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_RECORD, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
5184 else if (direction == CAMCORDER_FORM_PRIMARY_MODE)
5186 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_RECORD, CameraPresentationModel::CAMERA_DIRECTION_BACK);
5188 TryCatch(r == E_SUCCESS, , "_pCameraPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
5190 dim = _pCameraPresentationModel->GetPreviewResolution();
5191 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
5193 AppLogDebug("SelfPortraitMode __screenMode [%d]", __screenMode);
5195 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5197 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
5201 r = SetScreenMode(__screenMode, true);
5203 TryCatch(r == E_SUCCESS, , "SetScreenMode is fail[%s]", GetErrorMessage(r));
5205 if (__dir == ORIENTATION_STATUS_PORTRAIT
5206 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5208 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5212 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5215 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5216 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
5218 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
5219 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
5221 if (isInitCameraStaus)
5223 AppLogDebug("calling camcordersettings");
5224 _pCameraPresentationModel->StartPreview(&bufferinfo);
5226 _pCameraPresentationModel->SetContinuousAutoFocus();
5230 SetCamcorderSettingsDevice();
5234 AppLogDebug("not calling camcordersettings");
5237 AppLogDebug("EXIT");
5245 CamcorderForm::DrawTimerPopup(void)
5247 AppLogDebug("ENTER");
5248 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5249 result r = E_SUCCESS;
5251 if (__dir == ORIENTATION_STATUS_PORTRAIT
5252 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5254 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5258 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5261 _pCameraInfoPanel->SetDrawPopupTimer(true);
5265 _pCameraInfoPanel->Invalidate(true);
5267 AppLogDebug("EXIT");
5272 CamcorderForm::SetFlashPopop(void)
5274 AppLogDebug("ENTER");
5275 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_RECT, Y_FLASH_MODE_SETTING_LIST_RECT, W_FLASH_MODE_SETTING_LIST_RECT, H_FLASH_MODE_SETTING_LIST_RECT);
5276 MakeSettingPopupTab(false);
5279 if (__dir == ORIENTATION_STATUS_PORTRAIT
5280 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5282 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5283 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5287 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5288 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5291 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5292 _pCameraInfoPanel->Invalidate(true);
5293 SetCamcorderTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5295 if (_pListFlashMainMenu == null)
5297 _pListFlashMainMenu = new (std::nothrow) ListView();
5298 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5300 _pListFlashMainMenu->SetItemProvider(*this);
5301 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5302 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5303 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5307 _pListFlashMainMenu->SetBounds(rectList);
5308 _pListFlashMainMenu->SetShowState(true);
5310 _pListFlashMainMenu->UpdateList();
5311 AppLogDebug("EXIT");
5315 CamcorderForm::SetWhiteBalancePopop(void)
5317 AppLogDebug("ENTER");
5318 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5319 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5320 MakeSettingPopupTab(false);
5323 if (__dir == ORIENTATION_STATUS_PORTRAIT
5324 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5326 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5327 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5331 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5332 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5335 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5336 _pCameraInfoPanel->Invalidate(true);
5337 SetCamcorderTabSettingMainMenuCount(SUBMENU_WB_COUNT);
5339 if (_pListWbMainMenu == null)
5341 _pListWbMainMenu = new (std::nothrow) ListView();
5342 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5344 _pListWbMainMenu->SetItemProvider(*this);
5345 _pListWbMainMenu->AddListViewItemEventListener(*this);
5346 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5350 _pListWbMainMenu->SetBounds(rectList);
5351 _pListWbMainMenu->SetShowState(true);
5353 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5355 _pListWbMainMenu->UpdateList();
5356 AppLogDebug("EXIT");
5361 CamcorderForm::ProcessCamcorderTabMainListPopup(int index)
5363 AppLogDebug("ENTER");
5364 Rectangle rectPanel;
5366 String strTitle = L"";
5367 String listName = L"";
5368 result r = E_SUCCESS;
5369 AppResource* pAppResource = null;
5370 bool drawPopup = true;
5372 pAppResource = Application::GetInstance()->GetAppResource();
5373 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
5375 listName = _pListViewCameraTabMainMenu->GetName();
5376 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5378 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5380 _pCameraInfoSubPanel->SetShowState(false);
5381 _pCameraInfoSubPanel->RemoveControl(*_pListViewCameraTabSubMenu);
5382 _pListViewCameraTabSubMenu = null;
5383 RemoveControl(*_pCameraInfoSubPanel);
5384 _pCameraInfoSubPanel = null;
5386 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5391 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
5393 if (__pRecordingResolutionList)
5395 int captrueResolutionCnt = __pRecordingResolutionList->GetCount();
5396 if (captrueResolutionCnt > 1)
5398 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5399 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL + Y_SUBMENU_WB_MODE_PANEL_MARGIN;
5400 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5401 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captrueResolutionCnt * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5403 int X_List = X_SUBMENU_WB_MODE_LIST;
5404 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5405 int W_List = W_SUBMENU_WB_MODE_LIST;
5406 int H_List = (captrueResolutionCnt * H_SUBMENU_WB_MODE_LIST);
5408 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5409 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5411 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5412 SetCamcorderTabSubMenuListviewState(captrueResolutionCnt, CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE);
5422 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
5429 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5430 AppLogDebug("Invaild index");
5438 if (__dir == ORIENTATION_STATUS_PORTRAIT
5439 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5441 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5442 rectPanel.y += Y_SUBMENU_PANEL_START_PORTRAIT;
5446 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5449 if (_pCameraInfoSubPanel == null)
5451 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5452 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5454 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5455 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5457 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5458 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5459 AddOrientationEventListener(*this);
5460 AddControl(_pCameraInfoSubPanel);
5461 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5464 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5465 _pCameraInfoPanel->Invalidate(true);
5466 _pCameraInfoSubPanel->Invalidate(true);
5468 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5469 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5471 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5472 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5473 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5475 _pListViewCameraTabSubMenu->UpdateList();
5479 AppLogDebug("EXIT");
5483 if (_pCameraInfoSubPanel)
5485 RemoveControl(*_pCameraInfoSubPanel);
5486 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5490 delete _pListViewCameraTabSubMenu;
5493 _pCameraInfoSubPanel = null;
5494 _pListViewCameraTabSubMenu = null;
5500 CamcorderForm::ProcessGeneraTabMainListPopup(int index)
5502 AppLogDebug("ENTER");
5503 Rectangle rectPanel;
5505 String strTitle = L"";
5506 String listName = L"";
5507 result r = E_SUCCESS;
5508 bool drawPopup = true;
5509 AppResource* pAppResource = null;
5511 pAppResource = Application::GetInstance()->GetAppResource();
5512 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
5514 listName = _pListViewGeneralTabMainMenu->GetName();
5515 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
5517 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
5519 _pCameraInfoGeneralSubPanel->SetShowState(false);
5520 _pCameraInfoGeneralSubPanel->RemoveControl(*_pListViewGeneralTabSubMenu);
5521 _pListViewGeneralTabSubMenu = null;
5522 RemoveControl(*_pCameraInfoGeneralSubPanel);
5523 _pCameraInfoGeneralSubPanel = null;
5525 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5530 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
5532 AppLogDebug("Set Timer");
5533 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
5534 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
5535 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL);
5536 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
5537 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
5538 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
5542 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
5544 AppLogDebug("Set geo tag or guideline mode");
5546 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
5547 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
5549 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
5550 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL);
5551 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
5552 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
5556 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
5558 AppLogDebug("Set storage mode");
5560 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
5561 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
5562 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL);
5563 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
5564 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
5565 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
5569 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
5571 AppLogDebug("Camcorder Reset");
5574 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
5576 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
5579 if (_pResetPopUp == null)
5581 _pResetPopUp = new (std::nothrow) Popup();
5582 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
5583 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
5588 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
5589 TryCatch(_pYes != null, , "Reset Popup not created!");
5590 _pYes->SetActionId(IDA_BTN_YES);
5591 _pYes->AddActionEventListener(*this);
5592 _pYes->SetShowState(true);
5597 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
5598 TryCatch(_pNo != null, , "Reset Popup not created!");
5599 _pNo->SetActionId(IDA_BTN_NO);
5600 _pNo->AddActionEventListener(*this);
5601 _pNo->SetShowState(true);
5602 _pResetPopUp->Show();
5605 _pResetPopUp->SetShowState(true);
5606 _pResetPopUp->Invalidate(true);
5607 _pResetPopUp->Show();
5611 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
5613 result r = E_SUCCESS;
5615 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
5616 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
5618 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
5620 r = SetScreenOverlayHelpTimer();
5621 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
5623 r = DrawScreenOverlayHelp();
5624 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
5628 MakeSettingPopupTab(false);
5637 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5638 AppLogDebug("Invaild index");
5646 if (__dir == ORIENTATION_STATUS_PORTRAIT
5647 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5649 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5650 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5654 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5657 if (_pCameraInfoGeneralSubPanel == null)
5659 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
5660 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoGeneralSubPanel is null");
5662 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
5663 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
5665 if (index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
5666 index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
5667 index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
5669 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
5671 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
5672 AddOrientationEventListener(*this);
5673 AddControl(_pCameraInfoGeneralSubPanel);
5674 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
5677 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
5678 _pCameraInfoPanel->Invalidate(true);
5679 _pCameraInfoGeneralSubPanel->Invalidate(true);
5681 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
5682 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5684 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
5685 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
5686 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
5688 _pListViewGeneralTabSubMenu->UpdateList();
5692 AppLogDebug("EXIT");
5696 if (_pCameraInfoGeneralSubPanel)
5698 RemoveControl(*_pCameraInfoGeneralSubPanel);
5699 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5703 delete _pListViewGeneralTabSubMenu;
5706 _pCameraInfoGeneralSubPanel = null;
5707 _pListViewGeneralTabSubMenu = null;
5709 AppLogDebug("EXIT - CATCH");
5714 CamcorderForm::ProcessFlashListPopup(int index)
5716 AppLogDebug("ENTER");
5717 Rectangle rectPanel;
5719 String strTitle = L"";
5720 String listName = L"";
5721 Bitmap* pBitmapNormal = null;
5722 Bitmap* pBitmapPress = null;
5723 result r = E_SUCCESS;
5724 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5726 AppLogDebug("Sub Menu (%d)", index);
5729 int selfPortraitEnable = 0;
5731 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5732 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5734 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5735 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5737 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5739 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5740 regVal = SUBMENU_MODE_OFF;
5741 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5742 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5743 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5747 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5749 if (value == true && r == E_SUCCESS)
5751 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5755 case SUBMENU_MODE_OFF:
5757 regVal = SUBMENU_MODE_OFF;
5758 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5759 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5760 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5764 case SUBMENU_MODE_ON:
5766 regVal = SUBMENU_MODE_ON;
5767 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5768 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5769 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5773 case SUBMENU_MODE_AUTO:
5775 regVal = SUBMENU_MODE_AUTO;
5776 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5777 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5778 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5788 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5790 regVal = SUBMENU_MODE_OFF;
5791 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5792 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5793 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5797 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5798 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
5800 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5802 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5804 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5805 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5807 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5809 delete pBitmapNormal;
5810 pBitmapNormal = null;
5812 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5813 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5815 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5817 delete pBitmapPress;
5818 pBitmapPress = null;
5823 SetCamcorderTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5824 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5826 _pCameraPresentationModel->SetFlashMode(cameraFlashMode);
5828 AppLogDebug("EXIT");
5836 CamcorderForm::SubListPopupWbMode(int index)
5838 AppLogDebug("ENTER");
5839 result r = E_SUCCESS;
5841 int selfPortraitEnable = 0;
5843 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5844 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5846 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5848 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5852 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5853 AppLogDebug("result is %s",GetErrorMessage(r));
5858 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
5862 AppLogDebug("result is %s",GetErrorMessage(r));
5863 AppLogDebug("Target unsupport - white balance same");
5865 __settingWhiteBalance = index;
5866 regVal = __settingWhiteBalance;
5868 AppLogDebug("regVal = %d", regVal);
5869 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5871 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
5872 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5876 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
5877 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5880 AppLogDebug("EXIT");
5884 AppLogDebug("EXIT - CATCH");
5889 CamcorderForm::SubListPopupGuidelineMode(int index)
5891 AppLogDebug("ENTER");
5892 result r = E_SUCCESS;
5898 case SUBMENU_MODE_OFF:
5900 AppLogDebug("Setting - Guideline = off");
5901 guideLine = SUBMENU_MODE_OFF;
5902 SetGuideLine(guideLine);
5903 r = DrawMarker(false);
5904 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
5908 case SUBMENU_MODE_ON:
5910 AppLogDebug("Setting - Guideline = on");
5911 guideLine = SUBMENU_MODE_ON;
5912 SetGuideLine(guideLine);
5913 r = DrawMarker(true);
5914 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
5920 AppLogDebug("Setting - Guideline, Invail element id");
5927 AppLogDebug("Set vaule");
5929 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
5930 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5932 AppLogDebug("EXIT");
5936 AppLogDebug("EXIT - CATCH");
5941 CamcorderForm::SubListPopupStorageTypeMode(int index)
5943 AppLogDebug("ENTER");
5944 int storage = STORAGE_TYPE_PHONE;
5945 String filePath = L"";
5946 result r = E_SUCCESS;
5950 case SUBMENU_STORAGE_TYPE_PHONE:
5952 AppLogDebug("Setting - Storage type = Phone");
5953 storage = STORAGE_TYPE_PHONE;
5954 SetStorageType(storage);
5958 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
5960 AppLogDebug("Setting - Storage type = card");
5961 storage = STORAGE_TYPE_MEMORYCARD;
5963 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
5965 SetStorageType(storage);
5969 AppLogDebug("Setting - don't draw t-flash icon");
5976 AppLogDebug("Setting - Storage, Invaild index id");
5981 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
5985 _pCameraInfoPanel->SetStorageType(storage);
5986 _pCameraInfoPanel->Invalidate(true);
5988 if (__pFileEventManager == null)
5990 __pFileEventManager = new (std::nothrow) FileEventManager();
5991 r = __pFileEventManager->Construct(*this);
5992 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
5995 filePath = _pCameraPresentationModel->GetfilePath(storage);
5996 AppLogDebug("filePath %ls", filePath.GetPointer());
5998 if (File::IsFileExist(__pFileEventPath))
6000 __pFileEventManager->RemovePath(__pFileEventPath);
6003 if (File::IsFileExist(filePath))
6005 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
6006 __pFileEventPath = filePath;
6009 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
6010 AppLogDebug("EXIT");
6014 CamcorderForm::SubListPopupTimerMode(int index)
6016 AppLogDebug("ENTER");
6017 result r = E_SUCCESS;
6020 __settingTimeInterval = index;
6023 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
6024 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6026 AppLogDebug("EXIT");
6030 AppLogDebug("EXIT - CATCH");
6035 CamcorderForm::SubListPopupResolutionMode(int index)
6037 AppLogDebug("ENTER");
6038 IList* pList = _pCameraPresentationModel->GetRecordingResolutionList();
6039 int resolutionCnt = 0;
6040 result r = E_SUCCESS;
6041 int selfPortraitEnable = 0;
6043 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6044 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6048 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
6049 //Dimension dimResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
6050 Dimension dimResolution = _pCameraPresentationModel->GetRecordingResolution();
6051 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dimResolution.width, dimResolution.height);
6053 if ((__pRecordingResolutionWidth == dimResolution.width )&& (__pRecordingResolutionHeight == dimResolution.height))
6055 AppLogDebug("RESOLUTION Same");
6059 _pCameraPresentationModel->StopPreview();
6061 _pCameraPresentationModel->SetRecordingResolution(dimResolution);
6063 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
6065 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
6069 r = SetScreenMode(__screenMode, true);
6072 AppLogDebug("dimResolution(W:%d, H:%d)", dimResolution.width, dimResolution.height);
6076 __pRecordingResolutionIndex = index;
6078 AppLogDebug("EXIT");
6082 AppLogDebug("EXIT - CATCH");
6087 CamcorderForm::SubListPopupOverlayHelpMode(int index)
6089 AppLogDebug("ENTER");
6090 int value = SUBMENU_MODE_OFF;
6091 result r = E_SUCCESS;
6093 String strRegKey = IDS_INIT_REG_KEY;
6097 case SUBMENU_MODE_OFF:
6099 value = SUBMENU_MODE_OFF;
6104 case SUBMENU_MODE_ON:
6106 AppLogDebug("Setting - Guideline = on");
6107 value = SUBMENU_MODE_ON;
6118 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
6119 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6121 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
6123 r = SetScreenOverlayHelpTimer();
6124 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6126 r = DrawScreenOverlayHelp();
6127 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6129 AppLogDebug("EXIT");
6133 AppLogDebug("EXIT - CATCH");
6138 CamcorderForm::ProcessCamcorderTabSubListPopup(int index)
6140 AppLogDebug("ENTER");
6141 result r = E_SUCCESS;
6143 CamcorderTabSubMenuContent camSubMenuContent = CAMCORDER_SUB_MENU_CONTENT_MAX;
6145 camSubMenuContent = GetCamcorderTabSettingSubMenuMode();
6147 switch (camSubMenuContent)
6149 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
6151 r = SubListPopupResolutionMode(index);
6152 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
6156 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
6165 MakeSettingPopupTab(false);
6169 AppLogDebug("EXIT");
6173 AppLogDebug("EXIT - CATCH");
6178 CamcorderForm::ProcessGeneraTabSubListPopup(int index)
6180 AppLogDebug("ENTER");
6181 String strRegKey = IDS_INIT_REG_KEY;
6182 result r = E_SUCCESS;
6183 int selfPortraitEnable = 0;
6184 CamcorderGeneralTabSubMenuContent idx = CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6186 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6187 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6189 idx = GetGeneralTabSettingSubMenuMode();
6193 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6195 r = SubListPopupTimerMode(index);
6196 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6200 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6202 r = SubListPopupGuidelineMode(index);
6203 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6207 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6209 SubListPopupStorageTypeMode(index);
6213 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6218 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6227 MakeSettingPopupTab(false);
6231 AppLogDebug("EXIT");
6235 MakeSettingPopupTab(false);
6238 AppLogDebug("EXIT - CATCH");
6243 CamcorderForm::StartRecordTimer(void)
6245 AppLogDebug("ENTER");
6246 result r = E_SUCCESS;
6247 if (__pRecordTimer == null)
6249 __recordTimeCount = 0;
6250 __recordingMaxTime = 0;
6252 __pRecordTimer = new (std::nothrow) Timer();
6253 __pRecordTimer->Construct(*this);
6255 r = __pRecordTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
6256 TryCatch(r == E_SUCCESS, , "Timer::StartAsRepeatable fail[%s]", GetErrorMessage(r));
6259 AppLogDebug("EXIT");
6263 delete __pRecordTimer;
6264 __pRecordTimer = null;
6266 AppLogDebug("EXIT - CATCH");
6271 CamcorderForm::EndRecordTimer(void)
6273 AppLogDebug("ENTER");
6276 __recordingMaxTime = 0;
6277 __pRecordTimer->Cancel();
6278 delete __pRecordTimer;
6279 __pRecordTimer = null;
6281 AppLogDebug("EXIT");
6285 CamcorderForm::StartPopupTimer(void)
6287 AppLogDebug("ENTER");
6288 result r = E_SUCCESS;
6289 int settingTimer = 0;
6293 _pPopupTimer = new (std::nothrow) Timer();
6294 _pPopupTimer->Construct(*this);
6296 r = _pPopupTimer->StartAsRepeatable(CAMCORDER_TIMER_1_SEC);
6297 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6299 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, settingTimer);
6300 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6302 if (settingTimer == SETTING_TIMER_RECORD_2_SEC)
6304 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6306 else if (settingTimer == SETTING_TIMER_RECORD_5_SEC)
6308 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6310 else if (settingTimer == SETTING_TIMER_RECORD_10_SEC)
6312 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6315 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6317 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6319 _pCameraInfoPanel->Invalidate(true);
6321 AppLogDebug("EXIT");
6325 delete _pPopupTimer;
6326 _pPopupTimer = null;
6332 CamcorderForm::StopPopupTimer(void)
6334 AppLogDebug("ENTER");
6335 result r = E_SUCCESS;
6336 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6338 r = _pPopupTimer->Cancel();
6340 delete _pPopupTimer;
6341 _pPopupTimer = null;
6343 AppLogDebug("EXIT");
6351 CamcorderForm::SetRecordPauseButton(bool start)
6353 AppLogDebug("ENTER");
6354 Bitmap* pBitmap = null;
6355 Bitmap* pBitmapRotate = null;
6356 result r = E_SUCCESS;
6358 ImageRotationType rotationType = IMAGE_ROTATION_0;
6359 Point ptModeChangeButton;
6361 TryCatch(__pRecordButton != null, r = E_SYSTEM, "__pRecordButton is null");
6362 TryCatch(__pRecordPauseBitmap != null, r = E_SYSTEM, "__pRecordPauseBitmap is null");
6364 if (__dir == ORIENTATION_STATUS_PORTRAIT
6365 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6367 rotationType = IMAGE_ROTATION_90;
6368 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
6370 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
6371 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
6373 rotationType = IMAGE_ROTATION_0;
6374 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
6377 pBitmapRotate = RotationImageN(__pRecordPauseBitmap, rotationType);
6378 TryCatch(pBitmapRotate != null, , "pBitmap is null");
6380 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
6381 __pRecordButton->Invalidate(true);
6386 delete pBitmapRotate;
6387 pBitmapRotate = null;
6389 AppLogDebug("EXIT");
6393 AppLogDebug("EXIT - CATCH");
6398 CamcorderForm::SetRecordButton(bool start)
6400 AppLogDebug("ENTER");
6401 Bitmap* pBitmap = null;
6402 Bitmap* pBitmapRotate = null;
6403 result r = E_SUCCESS;
6404 ImageRotationType rotationType = IMAGE_ROTATION_0;
6405 Point ptModeChangeButton;
6407 TryCatch(__pRecordButton != null, r = E_SYSTEM, "__pRecordButton is null");
6409 if (__dir == ORIENTATION_STATUS_PORTRAIT
6410 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6412 rotationType = IMAGE_ROTATION_90;
6413 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
6415 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
6416 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
6418 rotationType = IMAGE_ROTATION_0;
6419 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
6424 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_RECORDING_SHUTTER_NORMAL);
6428 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
6430 TryCatch(pBitmap != null, , "pBitmap is null");
6432 pBitmapRotate = RotationImageN(pBitmap, rotationType);
6433 TryCatch(pBitmapRotate != null, , "pBitmap is null");
6435 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
6436 __pRecordButton->Invalidate(true);
6441 delete pBitmapRotate;
6442 pBitmapRotate = null;
6444 AppLogDebug("EXIT");
6448 if (pBitmap != null)
6454 AppLogDebug("EXIT - CATCH");
6459 CamcorderForm::ExposureValuePerformed(void)
6461 AppLogDebug("ENTER");
6462 result r = E_SUCCESS;
6463 bool exposureValue = false;
6464 bool brighnesstValue = false;
6465 int selfPortraitEnable = 0;
6466 int adjustValue = 0;
6468 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
6469 _pAppTimer->Cancel();
6471 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
6472 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
6474 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6475 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6477 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6478 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6480 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6482 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6486 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6489 if (exposureValue == true && r == E_SUCCESS)
6491 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
6493 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
6494 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6496 AppLogDebug("adjustValue = %d", adjustValue);
6498 _pCameraPresentationModel->SetExposure(adjustValue);
6500 MakeSettingPopupTab(false);
6504 r = CreateExposureSlider();
6505 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
6507 r = DrawExposureSlider();
6508 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6512 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6514 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6518 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6521 if (brighnesstValue == true && r == E_SUCCESS)
6523 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
6525 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
6526 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6528 AppLogDebug("adjustValue = %d", adjustValue);
6530 _pCameraPresentationModel->SetBrightness(adjustValue);
6532 MakeSettingPopupTab(false);
6536 r = CreateExposureSlider();
6537 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
6539 r = DrawExposureSlider();
6540 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6544 AppLogDebug("Exposure do not support");
6547 AppLogDebug("EXIT");
6551 CamcorderForm::AutoFocusPerformed(void)
6553 AppLogDebug("ENTER");
6554 Point currentPosition;
6555 int selfPortraitEnable = 0;
6556 bool focusSupport = false;
6557 result r = E_SUCCESS;
6559 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
6561 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
6563 if (__dir == ORIENTATION_STATUS_PORTRAIT
6564 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6566 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
6567 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
6568 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
6572 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
6573 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
6574 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
6577 //if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
6579 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6580 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
6582 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6584 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
6588 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
6591 if (focusSupport == true && r == E_SUCCESS)
6593 AppLogDebug("focus is Support");
6595 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
6597 _pCameraInfoPanel->SetDrawMarkerFocus(true);
6599 DrawFocus(CAMERA_FOCUS_NOT_READY);
6603 _pCameraInfoPanel->SetDrawMarkerFocus(false);
6605 _pCameraInfoPanel->Invalidate(true);
6608 _pCameraPresentationModel->SetContinuousAutoFocus();
6611 AppLogDebug("EXIT");
6615 CamcorderForm::SetContinuousAutoFocusButton(void)
6617 AppLogDebug("ENTER");
6618 result r = E_SUCCESS;
6619 int selfPortraitEnable = 0;
6620 bool focusSupport = false;
6621 Bitmap* pBitmap = null;
6623 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6624 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
6626 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6628 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
6632 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
6635 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_AUTOFOCUS);
6636 TryReturnVoid(pBitmap != null, "pBitmap is null");
6638 _pAutoFocus->SetNormalBackgroundBitmap(*pBitmap);
6643 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_AUTOFOCUS_PRESS);
6644 TryReturnVoid(pBitmap != null, "pBitmap is null");
6646 _pAutoFocus->SetPressedBackgroundBitmap(*pBitmap);
6651 if (focusSupport == true && r == E_SUCCESS)
6653 _pAutoFocus->SetShowState(true);
6657 _pAutoFocus->SetShowState(false);
6659 _pAutoFocus->Invalidate(true);
6660 AppLogDebug("EXIT");
6664 CamcorderForm::BackButtonPerformed(void)
6666 AppLogDebug("ENTER");
6667 result r = E_SUCCESS;
6668 bool onVideoRecorderStopped = false;
6670 if (_pHelpGoToGallery->GetShowState() == true)
6672 OnHelpCloseTimerExpired();
6673 AppLogDebug("SCREEN OVERLAY HELP");
6677 if (_pCameraPresentationModel->GetPreviewState() == false)
6679 AppLogDebug("StartPreview do not call");
6680 __pBackButton->SetEnabled(false);
6684 AppLogDebug("RecorderState = %d", _pCameraPresentationModel->GetRecorderState());
6685 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
6687 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING)
6689 AppLogDebug("No RECORDER_STATE_RECORDING AND PAUSE");
6693 if (__pCancelPopup == null)
6695 r = InitializePopup();
6696 TryCatch(r == E_SUCCESS, , "InitializePopup fail[%s]", GetErrorMessage(r));
6698 __pCancelPopup->SetShowState(true);
6699 __pCancelPopup->Show();
6703 __pCancelPopup->SetShowState(true);
6704 __pCancelPopup->Show();
6708 TryCatch(r == E_SUCCESS, , "PauseRecord fail[%s]", GetErrorMessage(r));
6712 if (_isRecording == true)
6714 AppLogDebug("No RECORDER_STATE_RECORDING and _isRecording = true >> DO NOT APP TERMINATE");
6718 if (_pCameraInfoPanel->GetDrawExposure() == true)
6720 _closeTimerValue = 0;
6722 if (_pExposureCloseTimer)
6724 _pExposureCloseTimer->Cancel();
6727 _pCameraInfoPanel->SetDrawExposure(false);
6732 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6734 r = PressBackButton();
6735 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
6739 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
6740 AppLogDebug("onVideoRecorderStopped = %d", onVideoRecorderStopped);
6742 if (onVideoRecorderStopped == false)
6744 if (__setTimerInterval)
6746 AppLogDebug("__setTimerInterval");
6747 CancelTimerIntervalRecord();
6752 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
6763 AppLogDebug("EXIT");
6767 AppLogDebug("EXIT - CATCH");
6772 CamcorderForm::PressBackButton(void)
6774 AppLogDebug("ENTER");
6775 bool onVideoRecorderStopped = false;
6776 result r = E_SUCCESS;
6778 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
6780 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6782 AppLogDebug("PressBackButton >> Back to the App");
6783 if (onVideoRecorderStopped == false)
6785 if (_isRecording == false)
6787 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
6791 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
6799 AppLogDebug("EXIT");
6804 CamcorderForm::SetBackButton(void)
6806 AppLogDebug("ENTER");
6807 Bitmap* pBitmap = null;
6808 Dimension dimScaleSize = Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE);
6809 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
6811 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6813 if (__pThumbnailButton)
6815 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
6817 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
6818 SetControlAlwaysOnTop(*__pThumbnailButton, false);
6822 if (_pThumbnailPanel)
6824 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
6826 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
6827 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
6831 AppControlRequestHideButton();
6835 if (__pThumbnailButton)
6837 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
6839 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
6840 SetControlAlwaysOnTop(*__pThumbnailButton, true);
6844 if (_pThumbnailPanel)
6846 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
6848 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
6849 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
6853 if (__pCameraIconLabel)
6855 __pCameraIconLabel->SetShowState(true);
6858 if (__pCamcoderIconLabel)
6860 __pCamcoderIconLabel->SetShowState(true);
6865 __pSwButton->SetShowState(true);
6869 if (_pThumbnailPanel)
6871 _pThumbnailPanel->SetShowState(false);
6872 _pThumbnailPanel->Draw();
6873 _pThumbnailPanel->Show();
6876 TryCatch(__pThumbnailButton != null, , "__pThumbnailButton is null");
6878 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
6879 TryCatch(pBitmap != null, , "pBitmap is null");
6881 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
6885 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
6886 TryCatch(pBitmap != null, , "pBitmap is null");
6888 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
6889 __pThumbnailButton->SetShowState(true);
6896 AppLogDebug("EXIT");
6900 AppLogDebug("EXIT - CATCH");
6905 CamcorderForm::SetSelfModeButton(void)
6907 AppLogDebug("ENTER");
6908 int selfPortraitEnable = 0;
6909 result r = E_SUCCESS;
6912 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
6914 AppLogDebug("Return Camera transform");
6918 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6919 TryReturnVoid(r == E_SUCCESS, "Reg getvalue fail[%s]", GetErrorMessage(r));
6921 if (selfPortraitEnable == CAMCORDER_FORM_PRIMARY_MODE)
6923 AppLogDebug("PRIMARY -> SECONDARY");
6925 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
6926 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6928 r = ToggleCameraDirection(CAMCORDER_FORM_SECONDARY_MODE);
6929 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
6931 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
6932 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6934 r = UpdateUiPanelIcon();
6935 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
6937 else if (selfPortraitEnable == CAMCORDER_FORM_SECONDARY_MODE)
6939 AppLogDebug("SECONDARY -> PRIMARY");
6940 int primaryFlashValue = FLASH_MODE_OFF;
6942 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
6943 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6945 r = ToggleCameraDirection(CAMCORDER_FORM_PRIMARY_MODE);
6946 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
6948 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
6949 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
6951 if (value == true && r == E_SUCCESS)
6953 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
6954 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6958 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
6963 r = UpdateUiPanelIcon();
6964 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
6967 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
6968 _pFlashButton->Invalidate(true);
6970 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
6971 _pSelfShotButton->Invalidate(true);
6972 AppLogDebug("EXIT");
6976 CamcorderForm::SetCamcorderSettingsDevice(void)
6978 AppLogDebug("ENTER");
6983 result r = E_SUCCESS;
6984 bool exposureValue = false;
6985 bool brighnesstValue = false;
6986 int selfPortraitEnable = 0;
6988 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6989 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6991 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6993 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6997 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7000 if (exposureValue == true && r == E_SUCCESS)
7002 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
7003 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7005 _pCameraPresentationModel->SetExposure(exposure);
7009 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7011 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7015 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7018 if (brighnesstValue == true && r == E_SUCCESS)
7020 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
7021 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
7023 _pCameraPresentationModel->SetBrightness(brightness);
7027 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7029 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
7033 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
7038 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
7039 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
7041 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)isoIndex);
7044 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7047 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
7050 AppLogDebug("primary mode wb is set");
7051 r =_pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
7052 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
7057 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
7060 AppLogDebug("secondary mode wb is set");
7061 r =_pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
7062 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
7066 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
7067 AppLogDebug("EXIT");
7071 CamcorderForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
7073 AppLogDebug("ENTER");
7074 Bitmap* pBitmap = null;
7075 ByteBuffer* pSrcByteBuff = null;
7076 ByteBuffer dstByteBuff;
7077 BufferInfo buffInfo;
7078 result r = E_SUCCESS;
7082 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
7084 if (rotationType == IMAGE_ROTATION_0)
7086 pBitmap = new (std::nothrow) Bitmap();
7087 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
7088 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
7090 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
7094 dim.width = pSrcBitmap->GetWidth();
7095 dim.height = pSrcBitmap->GetHeight();
7097 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
7099 r = dstByteBuff.Construct(size);
7100 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
7102 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
7103 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
7105 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
7106 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
7108 dim.width = buffInfo.width;
7109 dim.height = buffInfo.height;
7111 size = buffInfo.pitch * buffInfo.height;
7113 pSrcByteBuff = new (std::nothrow) ByteBuffer();
7114 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
7116 r = pSrcByteBuff->Construct(size);
7117 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
7119 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
7120 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
7122 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
7123 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
7125 r = pSrcBitmap->Unlock();
7126 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
7128 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
7129 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
7131 if (rotationType == IMAGE_ROTATION_90
7132 || rotationType == IMAGE_ROTATION_270)
7134 dim.width = buffInfo.height;
7135 dim.height = buffInfo.width;
7139 dim.width = buffInfo.width;
7140 dim.height = buffInfo.height;
7143 pBitmap = new (std::nothrow) Bitmap();
7144 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
7145 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
7147 delete pSrcByteBuff;
7148 pSrcByteBuff = null;
7150 AppLogDebug("EXIT");
7154 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
7155 if(pBitmap != null) //Prevent issue fix.
7160 if (pSrcByteBuff != null)
7162 delete pSrcByteBuff;
7163 pSrcByteBuff = null;
7170 CamcorderForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
7172 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
7173 result r = E_SUCCESS;
7174 int adjustEntryValue = 0;
7175 int currentEntryValue = 0;
7177 bool exposureValue = false;
7178 bool brighnesstValue = false;
7179 int selfPortraitEnable = 0;
7180 bool IsSliderAdjustValue = false;
7182 if (__dir == ORIENTATION_STATUS_PORTRAIT
7183 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7185 step = movableValidRect.width / maxEntryValue;
7186 if (currentPosition.x > movableValidRect.x)
7188 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
7190 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
7191 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
7193 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
7198 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
7201 IsSliderAdjustValue = true;
7205 IsSliderAdjustValue = false;
7210 step = movableValidRect.height / maxEntryValue;
7211 if (currentPosition.y > movableValidRect.y)
7213 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
7214 IsSliderAdjustValue = true;
7218 IsSliderAdjustValue = false;
7222 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7223 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7225 if (entryName.Equals(String(EXPOSURE_VALUE)))
7227 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7229 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7233 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7236 if (exposureValue == true && r == E_SUCCESS)
7238 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
7239 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7243 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7245 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7249 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7252 if (brighnesstValue == true && r == E_SUCCESS)
7254 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
7255 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7259 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
7261 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7263 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7267 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7270 if (exposureValue == true && r == E_SUCCESS)
7272 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
7273 TryCatch(r == E_SUCCESS, , "etValue() fail[%s]", GetErrorMessage(r));
7277 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7279 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7283 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7286 if (brighnesstValue == true && r == E_SUCCESS)
7288 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
7289 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
7293 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7295 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7299 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7302 if (exposureValue == true && r == E_SUCCESS)
7304 _pCameraPresentationModel->SetExposure(adjustEntryValue);
7308 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7310 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7314 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7317 if (brighnesstValue == true && r == E_SUCCESS)
7319 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
7323 AppLogDebug("SetBrightness do not support");
7329 AppLogDebug("EXIT");
7337 CamcorderForm::CreateExposureSlider(void)
7339 AppLogDebug("ENTER");
7340 result r = E_SUCCESS;
7342 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
7344 _closeTimerValue = 0;
7345 _pExposureCloseTimer = new (std::nothrow) Timer();
7346 _pExposureCloseTimer->Construct(*this);
7348 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
7349 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
7351 _pCameraInfoPanel->SetDrawExposure(true);
7352 _pCameraInfoPanel->Invalidate(true);
7354 AppLogDebug("EXIT");
7358 delete _pExposureCloseTimer;
7359 _pExposureCloseTimer = null;
7365 CamcorderForm::DrawExposureSlider(void)
7367 AppLogDebug("ENTER");
7368 Point buttonPosition;
7369 result r = E_SUCCESS;
7372 int selfPortraitEnable = 0;
7373 bool exposureValue = false;
7374 bool brighnesstValue = false;
7376 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7377 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7379 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7381 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7385 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7388 if (exposureValue == true && r == E_SUCCESS)
7390 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
7391 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7392 AppLogDebug("Exposure value %d", exposure);
7396 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7398 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7402 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7405 if (brighnesstValue == true && r == E_SUCCESS)
7407 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
7408 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7409 AppLogDebug("Exposure value %d",exposure);
7413 if (__dir == ORIENTATION_STATUS_PORTRAIT
7414 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7416 step = W_EXPOSURE_PANEL_SLIDER_PORTRAIT / MAX_CAMERA_EXPOSURE_VALUE;
7418 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7419 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7420 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
7424 step = H_EXPOSURE_PANEL_SLIDER_LANDSCAPE / MAX_CAMERA_EXPOSURE_VALUE;
7426 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7427 buttonPosition.y = (step * exposure) + Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7428 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
7431 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
7432 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7434 AppLogDebug("EXIT");
7442 CamcorderForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
7444 AppLogDebug("ENTER");
7445 result r = E_SUCCESS;
7446 Point buttonPosition;
7447 Rectangle rectSlider;
7448 float adjustedXvalue = 0;
7449 int adjustedXinInt = 0;
7451 bool isSliderRectValid = false;
7453 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
7455 if (__dir == ORIENTATION_STATUS_PORTRAIT
7456 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7460 case DRAW_INITIALIZED:
7462 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7463 buttonPosition.y = currentPosition.y;
7464 isSliderRectValid = true;
7470 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_PORTRAIT + W_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7472 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_PORTRAIT + H_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7474 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7475 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7476 isSliderRectValid = true;
7478 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
7480 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7481 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7483 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
7484 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
7486 if ((adjustedXvalue - adjustedXinInt) != 0)
7488 adjustedXinInt = adjustedXinInt+1;
7491 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
7493 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_PORTRAIT + adjustedXinInt;
7494 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
7495 r = SetSliderAdjustValue(currentPosition, Rectangle(X_EXPOSURE_PANEL_SLIDER_PORTRAIT, Y_EXPOSURE_PANEL_SLIDER_PORTRAIT, W_EXPOSURE_PANEL_SLIDER_PORTRAIT, H_EXPOSURE_PANEL_SLIDER_PORTRAIT), EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7496 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7500 isSliderRectValid = false;
7505 isSliderRectValid = false;
7512 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_PORTRAIT + W_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7514 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_PORTRAIT + H_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7516 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7517 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7518 isSliderRectValid = true;
7519 r = SetSliderAdjustValue(currentPosition, Rectangle(X_EXPOSURE_PANEL_SLIDER_PORTRAIT, Y_EXPOSURE_PANEL_SLIDER_PORTRAIT, W_EXPOSURE_PANEL_SLIDER_PORTRAIT, H_EXPOSURE_PANEL_SLIDER_PORTRAIT), EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7520 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7525 isSliderRectValid = false;
7528 if ((buttonPosition.y % FRAME_SKIP) != 0)
7530 isSliderRectValid = false;
7543 case DRAW_INITIALIZED:
7545 buttonPosition.x = currentPosition.x;
7546 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7547 isSliderRectValid = true;
7553 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_LANDSCAPE + W_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7555 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE + H_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7557 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7558 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7559 isSliderRectValid = true;
7560 r = SetSliderAdjustValue(currentPosition, Rectangle(X_EXPOSURE_PANEL_SLIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE, W_EXPOSURE_PANEL_SLIDER_LANDSCAPE, H_EXPOSURE_PANEL_SLIDER_LANDSCAPE), EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7561 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7566 isSliderRectValid = false;
7573 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_LANDSCAPE + W_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7575 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE + H_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7577 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7578 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7579 isSliderRectValid = true;
7580 r = SetSliderAdjustValue(currentPosition, Rectangle(X_EXPOSURE_PANEL_SLIDER_LANDSCAPE, Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE, W_EXPOSURE_PANEL_SLIDER_LANDSCAPE, H_EXPOSURE_PANEL_SLIDER_LANDSCAPE), EXPOSURE_VALUE, MAX_CAMERA_EXPOSURE_VALUE);
7581 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7586 isSliderRectValid = false;
7589 if ((buttonPosition.y % FRAME_SKIP) != 0)
7591 isSliderRectValid = false;
7601 if (isSliderRectValid)
7603 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
7604 _pCameraInfoPanel->Invalidate(true);
7607 AppLogDebug("EXIT");
7616 CamcorderForm::ShowExposureSlider(void)
7618 AppLogDebug("ENTER");
7619 result r = E_SUCCESS;
7620 int selfPortraitEnable = CAMCORDER_FORM_PRIMARY_MODE;
7621 bool exposureValue = false;
7622 bool brighnesstValue = false;
7624 if (_pExposureCloseTimer)
7626 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7627 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
7629 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
7633 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7635 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7639 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7642 if (exposureValue == true && r == E_SUCCESS)
7644 r = CreateExposureSlider();
7645 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7647 r = DrawExposureSlider();
7648 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7652 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7654 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7658 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7661 if (brighnesstValue == true && r == E_SUCCESS)
7663 r = CreateExposureSlider();
7664 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7666 r = DrawExposureSlider();
7667 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7672 AppLogDebug("EXIT");
7676 CamcorderForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7678 AppLogDebug("ENTER");
7679 result r = E_SUCCESS;
7680 bool modified = false;
7681 bool isValidRect = false;
7682 Dimension dimRendererSize;
7684 if (__screenMode == SCREEN_MODE_NORMAL)
7686 Dimension dim = Dimension(0, 0);
7687 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7688 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7689 Rectangle clientRect = GetClientAreaBounds();
7690 bool isToCompensated = false;
7692 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7693 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7695 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7697 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7698 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7702 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7703 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7708 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7710 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7711 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7715 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7716 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7720 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7722 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7723 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7725 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7726 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7728 if (modified == true)
7730 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7733 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7734 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7736 if (evaluateBoundsRect.height == rect.height)
7738 isToCompensated = false;
7742 isToCompensated = true;
7747 if (evaluateBoundsRect.width == rect.width)
7749 isToCompensated = false;
7753 isToCompensated = true;
7757 r = __pOverlayPanel->SetBounds(rect);
7758 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7759 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7761 if (isToCompensated == true)
7763 AppLogDebug("isToCompensated = true");
7765 rect = __pOverlayPanel->GetBounds();
7766 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7768 r = __pOverlayPanel->SetBounds(rect);
7769 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7770 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7773 dimRendererSize = __pOverlayPanel->GetSize();
7774 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7775 __pOverlayPanel->SetRenderSize(dimRendererSize);
7779 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7780 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7781 Rectangle clientRect = GetClientAreaBounds();
7782 bool isToCompensated = false;
7784 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7785 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7787 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7789 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7793 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7798 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7800 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7804 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7808 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7810 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7811 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7813 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7814 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7816 if (modified == true)
7818 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7821 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7822 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7824 if (evaluateBoundsRect.height == rect.height)
7826 isToCompensated = false;
7830 isToCompensated = true;
7835 if (evaluateBoundsRect.width == rect.width)
7837 isToCompensated = false;
7841 isToCompensated = true;
7845 r = __pOverlayPanel->SetBounds(rect);
7846 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7847 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7849 if (isToCompensated == true)
7851 rect = __pOverlayPanel->GetBounds();
7852 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7854 r = __pOverlayPanel->SetBounds(rect);
7855 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7856 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7859 dimRendererSize = __pOverlayPanel->GetSize();
7860 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7861 __pOverlayPanel->SetRenderSize(dimRendererSize);
7863 AppLogDebug("EXIT");
7867 CamcorderForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7869 AppLogDebug("ENTER");
7870 result r = E_SUCCESS;
7871 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7872 BufferInfo bufferinfo;
7873 int selfPortraitEnable = CAMCORDER_FORM_PRIMARY_MODE;
7874 int guideLineEnable = DISABLE_GUIDELINE;
7875 String listName = L"";
7877 if (_appControlActionCompleted)
7879 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7881 if (__dir != orientationStatus)
7883 __dir = orientationStatus;
7888 if (__dir != orientationStatus)
7890 __isOrientationChanged = true;
7892 if (_pAppTimer != null)
7894 _pAppTimer->Cancel();
7896 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
7899 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7900 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
7902 SetOverlayPanelOrientationChanged(orientationStatus);
7904 if (__pOverlayPanel)
7906 switch (orientationStatus)
7908 case ORIENTATION_STATUS_PORTRAIT:
7910 AppLogDebug("PORTRAIT");
7911 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7915 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7917 AppLogDebug("PORTRAIT REVERSE");
7918 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7922 case ORIENTATION_STATUS_LANDSCAPE:
7924 AppLogDebug("LANDSCAPE");
7925 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7929 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7931 AppLogDebug("LANDSCAPE REVERSE");
7932 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7941 __dir = orientationStatus;
7943 _pCameraPresentationModel->SetOrientation(__dir);
7945 if (__screenMode == SCREEN_MODE_FULL)
7947 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
7949 HidePanel(true, true);
7953 HidePanel(false, true);
7957 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7958 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7960 if (guideLineEnable == DISABLE_GUIDELINE)
7962 r = DrawMarker(false);
7966 r = DrawMarker(true);
7968 TryReturnVoid(r == E_SUCCESS, "DrawMarker fail[%s]", GetErrorMessage(r));
7970 UpdateUiPanelIcon();
7971 UpdateUiActionPanelIcon();
7972 OnHelpCloseTimerExpired();
7975 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
7977 if (_pHelpCloseTimer)
7979 _pHelpCloseTimer->Cancel();
7981 delete _pHelpCloseTimer;
7982 _pHelpCloseTimer = null;
7985 HideScreenOverlayHelp();
7987 _pCameraInfoPanel->SetDrawIndicator(false);
7988 _pCameraInfoPanel->Invalidate(true);
7991 if (_pListViewCameraTabMainMenu != null)
7993 listName = _pListViewCameraTabMainMenu->GetName();
7994 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
8000 if (_pListViewGeneralTabMainMenu != null)
8002 listName = _pListViewGeneralTabMainMenu->GetName();
8003 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
8009 if (_pListFlashMainMenu != null)
8011 listName = _pListFlashMainMenu->GetName();
8013 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)) && _pListFlashMainMenu->GetShowState() == true)
8019 if (_pListWbMainMenu != null)
8021 listName = _pListWbMainMenu->GetName();
8023 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME)) && _pListWbMainMenu->GetShowState() == true)
8029 if (_pListViewCameraTabSubMenu != null)
8031 if (_pListViewCameraTabSubMenu->GetShowState() == true)
8037 if (_pListViewGeneralTabSubMenu != null)
8039 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
8045 MakeSettingPopupTab(false);
8047 ShowExposureSlider();
8049 __isOrientationChanged = false;
8051 AppLogDebug("EXIT");
8055 CamcorderForm::HidePopup(void)
8057 AppLogDebug("ENTER");
8058 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
8060 if (_pListViewCameraTabSubMenu)
8062 if (_pCameraInfoSubPanel != null)
8064 _pCameraInfoSubPanel->SetShowState(false);
8066 _pListViewCameraTabSubMenu->SetShowState(false);
8069 if (_pListViewCameraTabMainMenu)
8071 _pListViewCameraTabMainMenu->SetShowState(false);
8074 if (_pListViewGeneralTabSubMenu)
8076 if (_pCameraInfoGeneralSubPanel != null)
8078 _pCameraInfoGeneralSubPanel->SetShowState(false);
8080 _pListViewGeneralTabSubMenu->SetShowState(false);
8083 if (_pListViewGeneralTabMainMenu)
8085 _pListViewGeneralTabMainMenu->SetShowState(false);
8088 if (_pListFlashMainMenu)
8090 _pListFlashMainMenu->SetShowState(false);
8093 if (_pListWbMainMenu)
8095 _pListWbMainMenu->SetShowState(false);
8098 _pCameraInfoPanel->SetDrawExposure(false);
8099 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
8100 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
8101 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
8102 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
8104 if (__isOrientationChanged)
8106 __isOrientationChanged = false;
8108 _pCameraInfoPanel->Invalidate(true);
8112 _pCameraInfoPanel->Draw();
8113 _pCameraInfoPanel->Show();
8115 AppLogDebug("EXIT");
8119 CamcorderForm::CheckStorageInfo(void)
8121 AppLogDebug("ENTER");
8122 result r = E_SUCCESS;
8123 MessageBox messageBox;
8125 String strTemp = L"";
8126 int remainedNum = 0;
8127 int remainedNumOfTwenty = 0;
8129 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
8130 AppLogDebug("<<<< remainedNum = %d", remainedNum);
8132 remainedNum = remainedNum * UNIT_HUNDRED;
8133 AppLogDebug(">>>> remainedNum = %d", remainedNum);
8135 remainedNumOfTwenty = (remainedNum * UNIT_TWENTY) / UNIT_HUNDRED;
8136 AppLogDebug(">>>> remainedNumOfTwenty ( 20% ) = %d", remainedNumOfTwenty);
8138 if (remainedNum > remainedNumOfTwenty)
8140 AppLogDebug("capacity is over 20%");
8141 __isCapacityBelow = false;
8145 AppLogDebug("capacity is below 20%");
8146 __isCapacityBelow = true;
8149 if (remainedNum == STORAGE_VALUE_ZERO)
8151 if (__lowMemoryCapacity == false)
8153 __lowMemoryCapacity = true;
8154 __isMemoryFull = false;
8155 r = messageBox.Construct(L"", L"Low Memory Left. You may take some photo depending on the subject", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
8157 else if (__lowMemoryCapacity == true)
8159 __isMemoryFull = true;
8160 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
8162 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
8164 r = messageBox.ShowAndWait(result);
8165 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
8169 case MSGBOX_RESULT_OK:
8171 if (__lowMemoryCapacity == true)
8173 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
8174 _pCameraInfoPanel->SetStorageTitle(strTemp);
8175 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
8176 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
8177 _pCameraInfoPanel->Invalidate(true);
8180 if (__isMemoryFull == true)
8182 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
8183 _pCameraInfoPanel->SetStorageTitle(strTemp);
8184 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
8185 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
8186 _pCameraInfoPanel->Invalidate(true);
8196 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
8200 if (_isRecording == false)
8202 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
8204 _pCameraInfoPanel->SetStorageTitle(strTemp);
8205 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
8206 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
8207 _pCameraInfoPanel->Invalidate(true);
8210 SetStartRecording();
8214 AppLogDebug("_isRecording = true");
8219 AppLogDebug("EXIT");
8223 CamcorderForm::SetOverlayRendererRotation(void)
8225 AppLogDebug("ENTER");
8227 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8231 case ORIENTATION_STATUS_PORTRAIT:
8233 AppLogDebug("PORTRAIT");
8234 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8238 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8240 AppLogDebug("PORTRAIT REVERSE");
8241 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8245 case ORIENTATION_STATUS_LANDSCAPE:
8247 AppLogDebug("LANDSCAPE");
8248 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8252 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8254 AppLogDebug("LANDSCAPE REVERSE");
8255 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8262 AppLogDebug("EXIT");
8266 CamcorderForm::CreateOverlayRegion(Rectangle rect)
8268 AppLogDebug("ENTER");
8269 result r = E_SUCCESS;
8271 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8272 r = __pOverlayPanel->Construct(rect);
8273 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8274 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8276 r = AddControl(__pOverlayPanel);
8277 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8278 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8280 __pOverlayPanel->AddTouchEventListener(*this);
8282 AppLogDebug("EXIT");
8286 RemoveControl(*__pOverlayPanel);
8287 __pOverlayPanel = null;
8288 AppLogDebug("EXIT - CATCH");
8293 CamcorderForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8295 AppLogDebug("ENTER");
8296 result r = E_SUCCESS;
8297 bool modified = false;
8298 bool isValidRect = false;
8299 bool isToCompensated = false;
8300 Dimension dimRendererSize;
8302 if (destroyOverlay == true)
8304 if (__pOverlayPanel)
8306 __pOverlayPanel->RemoveTouchEventListener(*this);
8307 RemoveControl(*__pOverlayPanel);
8308 __pOverlayPanel = null;
8311 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8312 AppLogDebug("Input bounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8314 if (isWideMode == false)
8316 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8320 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8322 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8324 if (modified == true)
8326 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8329 if (__dir == ORIENTATION_STATUS_PORTRAIT
8330 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8332 if (evaluateBoundsRect.height == rect.height)
8334 isToCompensated = false;
8338 isToCompensated = true;
8343 if (evaluateBoundsRect.width == rect.width)
8345 isToCompensated = false;
8349 isToCompensated = true;
8353 r = CreateOverlayRegion(rect);
8354 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8356 if (isToCompensated == true)
8358 AppLogDebug("isToCompensated = true");
8360 rect = __pOverlayPanel->GetBounds();
8361 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8363 r = __pOverlayPanel->SetBounds(rect);
8364 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8365 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8368 dimRendererSize = __pOverlayPanel->GetSize();
8369 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8370 __pOverlayPanel->SetRenderSize(dimRendererSize);
8374 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8376 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8377 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8379 if (isWideMode == false)
8381 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8385 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8387 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8389 if (modified == true)
8391 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8394 if (__dir == ORIENTATION_STATUS_PORTRAIT
8395 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8397 if (evaluateBoundsRect.height == rect.height)
8399 isToCompensated = false;
8403 isToCompensated = true;
8408 if (evaluateBoundsRect.width == rect.width)
8410 isToCompensated = false;
8414 isToCompensated = true;
8418 r = __pOverlayPanel->SetBounds(rect);
8419 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8420 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8422 if (isToCompensated == true)
8424 rect = __pOverlayPanel->GetBounds();
8425 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8427 r = __pOverlayPanel->SetBounds(rect);
8428 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8429 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8432 dimRendererSize = __pOverlayPanel->GetSize();
8433 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8434 __pOverlayPanel->SetRenderSize(dimRendererSize);
8436 AppLogDebug("EXIT");
8440 RemoveControl(*__pOverlayPanel);
8441 __pOverlayPanel = null;
8442 AppLogDebug("EXIT - CATCH");
8447 CamcorderForm::SetOverlayPanelWideMode(bool isRemoved)
8449 AppLogDebug("ENTER");
8450 result r = E_SUCCESS;
8451 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8452 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8453 Rectangle clientRect = GetClientAreaBounds();
8455 if (__dir == ORIENTATION_STATUS_PORTRAIT
8456 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8458 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8460 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8464 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8469 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8471 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8475 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8479 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8480 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8481 AppLogDebug("EXIT");
8485 CamcorderForm::SetOverlayPanelNormalMode(bool isRemoved)
8487 AppLogDebug("ENTER");
8488 result r = E_SUCCESS;
8489 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8490 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8491 Rectangle clientRect = GetClientAreaBounds();
8493 if (__dir == ORIENTATION_STATUS_PORTRAIT
8494 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8496 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8498 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8499 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8503 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8504 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8509 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8511 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8512 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8516 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8517 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8521 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8522 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8523 AppLogDebug("EXIT");
8527 CamcorderForm::SetCamcorderMode(void)
8529 AppLogDebug("ENTER");
8530 result r = E_SUCCESS;
8531 int previewResolutionSize = 0;
8533 BufferInfo bufferinfo;
8535 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
8536 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8538 dim = _pCameraPresentationModel->GetPreviewResolution();
8539 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
8541 __previewResolutionWidth = dim.width;
8542 __previewResolutionHeight = dim.height;
8544 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8545 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
8547 _pCameraPresentationModel->StartPreview(&bufferinfo);
8549 _pCameraPresentationModel->SetContinuousAutoFocus();
8551 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8553 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8554 AppLogDebug("EXIT");
8558 CamcorderForm::SetScreenMode(const ScreenMode mode, bool destory)
8560 AppLogDebug("ENTER");
8561 result r = E_SUCCESS;
8564 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8568 case SCREEN_MODE_NORMAL:
8570 if (destory == true)
8572 if (__screenMode != mode)
8574 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8575 _pAppTimer->Cancel();
8577 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
8578 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8580 _pCameraPresentationModel->KeepScreenOnState(true, false);
8582 _pCameraPresentationModel->StopCamera();
8585 SetOverlayPanelNormalMode(true);
8587 SetOverlayRendererRotation();
8589 if (__screenMode != mode)
8595 AppLogDebug("__screenMode = mode");
8597 __screenMode = SCREEN_MODE_NORMAL;
8601 SetOverlayPanelNormalMode(false);
8603 SetOverlayRendererRotation();
8605 __screenMode = SCREEN_MODE_NORMAL;
8608 HidePanel(false, false);
8610 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8614 case SCREEN_MODE_FULL:
8616 Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
8618 if (destory == true)
8620 if (__screenMode != mode)
8622 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8623 _pAppTimer->Cancel();
8625 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
8626 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8628 _pCameraPresentationModel->KeepScreenOnState(true, false);
8630 _pCameraPresentationModel->StopCamera();
8633 SetOverlayPanelWideMode(true);
8635 SetOverlayRendererRotation();
8637 if (__screenMode != mode)
8643 AppLogDebug("__screenMode = mode");
8645 __screenMode = SCREEN_MODE_FULL;
8649 SetOverlayPanelWideMode(false);
8651 SetOverlayRendererRotation();
8653 __screenMode = SCREEN_MODE_FULL;
8656 HidePanel(true, false);
8658 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8669 AppLogDebug("EXIT");
8673 __screenMode = SCREEN_MODE_NORMAL;
8674 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8680 CamcorderForm::InDrawFocus(void)
8682 AppLogDebug("ENTER");
8683 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8684 Rectangle clientRect = GetClientAreaBounds();
8685 Point currentPosition;
8686 int selfPortraitEnable = 0;
8687 result r = E_SUCCESS;
8688 bool focusSupport = false;
8690 if (__dir == ORIENTATION_STATUS_PORTRAIT
8691 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8693 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
8694 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
8698 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
8699 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
8702 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8703 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
8705 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8707 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
8711 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
8714 if (focusSupport == true && r == E_SUCCESS)
8716 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
8717 _pCameraInfoPanel->SetDrawMarkerFocus(true);
8718 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
8722 _pCameraInfoPanel->SetDrawMarkerFocus(false);
8723 _pCameraInfoPanel->Draw();
8724 _pCameraInfoPanel->Show();
8726 AppLogDebug("EXIT");
8730 CamcorderForm::StartRecord(void)
8732 AppLogDebug("ENTER");
8733 result r = E_SUCCESS;
8734 int timerIntervalVale = 0;
8736 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
8737 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
8739 InitMakerFocusTimer();
8741 _pCameraInfoPanel->SetDrawMarkerFocus(false);
8743 _pCameraInfoPanel->SetDrawIndicator(false);
8745 _pCameraInfoPanel->Invalidate(true);
8747 _pMakerFocusTimer->Cancel();
8749 _pMakerFocusTimer->Start(CAMCORDER_TIMER_ONE_SEC);
8751 _pCameraInfoPanel->CheckAvailableStorageSpace();
8755 if (__pThumbnailButton)
8757 __pThumbnailButton->SetShowState(false);
8758 __pThumbnailButton->Invalidate(true);
8761 if (__pBackButton && !_isHwKeySupported)
8763 if (timerIntervalVale != INDEX_UNIT_ZERO)
8765 __pBackButton->SetShowState(false);
8769 __pBackButton->SetShowState(true);
8771 __pBackButton->Invalidate(true);
8774 if (_pThumbnailPanel)
8776 _pThumbnailPanel->SetShowState(false);
8777 _pThumbnailPanel->Invalidate(true);
8779 AppLogDebug("EXIT");
8783 CamcorderForm::StopRecord(void)
8785 AppLogDebug("ENTER");
8786 result r = E_SUCCESS;
8790 _pCameraInfoPanel->SetDrawIndicator(true);
8791 _pCameraInfoPanel->Invalidate(true);
8793 if (_pMakerFocusTimer)
8795 _pMakerFocusTimer->Cancel();
8798 _isRecording = false;
8800 _isRecordingPause = false;
8802 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
8803 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
8804 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
8805 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING
8806 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSING
8809 r = _pCameraPresentationModel->StopRecord();
8810 TryCatch(r == E_SUCCESS, , "Stop record failed [%s]",GetErrorMessage(r));
8813 r = DrawRecord(false);
8814 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8820 r = SetRecordButton(false);
8821 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8825 if (_pIntervalValueTimer)
8827 _pIntervalValueTimer->Cancel();
8832 _pPopupTimer->Cancel();
8835 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8837 _pCameraInfoPanel->SetDrawPopupTimer(false);
8839 _pCameraInfoPanel->Invalidate(true);
8841 AppLogDebug("EXIT");
8844 AppLogDebug("Caught record stop exception. Terminating app");
8845 _pCameraPresentationModel->SetRecordStopException(true);
8846 _pCameraPresentationModel->CancelRecord();
8851 CamcorderForm::HideRecLabe(void)
8853 AppLogDebug("ENTER");
8854 if (__pElapsedTimeLable)
8856 __pElapsedTimeLable->SetShowState(false);
8857 __pElapsedTimeLable->Invalidate(true);
8860 if (__pElapsedTimeMaxLable)
8862 __pElapsedTimeMaxLable->SetShowState(false);
8863 __pElapsedTimeMaxLable->Invalidate(true);
8866 if (__pElapsedRecordSizeLable)
8868 __pElapsedRecordSizeLable->SetShowState(false);
8869 __pElapsedRecordSizeLable->Invalidate(true);
8874 __pRecLabelRed->SetShowState(false);
8875 __pRecLabelRed->Invalidate(true);
8878 if (__pRecLabelText)
8880 __pRecLabelText->SetShowState(false);
8881 __pRecLabelText->Invalidate(true);
8883 AppLogDebug("EXIT");
8887 CamcorderForm::SetRecordPauseBitmap(bool start)
8889 AppLogDebug("ENTER");
8892 __pRecordPauseBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_RECORDING_SHUTTER_NORMAL);
8896 __pRecordPauseBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
8898 TryCatch(__pRecordPauseBitmap != null, , "__pRecordPauseBitmap is null");
8900 AppLogDebug("EXIT");
8904 delete __pRecordPauseBitmap;
8905 __pRecordPauseBitmap = null;
8907 AppLogDebug("EXIT - CATCH");
8912 CamcorderForm::PauseRecord(void)
8914 AppLogDebug("ENTER");
8915 result r = E_SUCCESS;
8917 r = SetRecordPauseBitmap(true);
8918 //TryCatch(r == E_SUCCESS, , "SetRecordPauseBitmap start fail[%s]", GetErrorMessage(r));
8919 AppLogDebug("SetRecordPauseBitmap() fail[%s]", GetErrorMessage(r));
8921 r = SetRecordPauseButton(true);
8922 TryCatch(r == E_SUCCESS, , "SetRecordPauseButton start fail[%s]", GetErrorMessage(r));
8924 _isRecording = false;
8926 _isRecordingPause = true;
8928 _pCameraPresentationModel->PauseRecord();
8930 __pRecordTimer->Cancel();
8934 r = DrawPauseRecord();
8935 TryCatch(r == E_SUCCESS, , "DrawPauseRecord start fail[%s]", GetErrorMessage(r));
8937 AppLogDebug("EXIT");
8941 AppLogDebug("EXIT - CATCH");
8946 CamcorderForm::CancelRecord(void)
8948 AppLogDebug("ENTER");
8949 result r = E_SUCCESS;
8953 _pCameraInfoPanel->SetDrawIndicator(true);
8954 _pCameraInfoPanel->Invalidate(true);
8956 if (_pMakerFocusTimer)
8958 _pMakerFocusTimer->Cancel();
8961 _isRecording = false;
8963 _pCameraPresentationModel->SetCancelRecord(true);
8965 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
8966 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
8967 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
8968 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING
8969 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSING
8972 _pCameraPresentationModel->StopRecord();
8975 r = DrawRecord(false);
8976 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8982 r = SetRecordButton(false);
8983 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8987 _pIntervalValueTimer->Cancel();
8991 _pPopupTimer->Cancel();
8994 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8996 _pCameraInfoPanel->SetDrawPopupTimer(false);
8998 _pCameraInfoPanel->Invalidate(true);
9000 AppLogDebug("EXIT");
9004 CamcorderForm::CancelTimerIntervalRecord(void)
9006 AppLogDebug("ENTER");
9007 if (_pIntervalValueTimer)
9009 _pIntervalValueTimer->Cancel();
9012 __doRecording = false;
9016 __pBatteryState->SetShowState(true);
9017 __pBatteryState->Draw();
9019 _pCameraInfoPanel->SetDrawIndicator(true);
9020 _pCameraInfoPanel->Invalidate(true);
9022 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
9023 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
9024 _pCameraInfoPanel->Draw();
9025 _pCameraInfoPanel->Show();
9027 _pCameraInfoPanel->SetDrawPopupTimer(false);
9028 _pCameraInfoPanel->Draw();
9029 _pCameraInfoPanel->Show();
9030 __setTimerInterval = false;
9032 _pCameraPresentationModel->SetIntervalTimerRun(false);
9035 AppLogDebug("EXIT");
9039 CamcorderForm::SetRecordEndReached(void)
9041 AppLogDebug("ENTER");
9042 result r = E_SUCCESS;
9046 _isRecording = false;
9048 __doRecording = false;
9050 _isRecordingPause = false;
9054 _pCameraInfoPanel->SetDrawIndicator(true);
9055 _pCameraInfoPanel->Invalidate(true);
9057 if (_pMakerFocusTimer)
9059 _pMakerFocusTimer->Cancel();
9062 _isRecording = false;
9064 _isRecordingPause = false;
9066 r = DrawRecord(false);
9067 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
9073 r = SetRecordButton(false);
9074 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
9078 if (_pIntervalValueTimer)
9080 _pIntervalValueTimer->Cancel();
9085 _pPopupTimer->Cancel();
9088 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9090 _pCameraInfoPanel->SetDrawPopupTimer(false);
9092 _pCameraInfoPanel->Invalidate(true);
9097 _pCameraPresentationModel->CloseRecord();
9098 AppLogDebug("EXIT");
9102 CamcorderForm::SetRecordErrorOccurred(void)
9104 AppLogDebug("ENTER");
9105 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9106 Rectangle clientRect = GetClientAreaBounds();
9107 Point currentPosition;
9108 result r = E_SUCCESS;
9110 AppLogDebug("SetRecordErrorOccurred.");
9114 _pCameraInfoPanel->SetDrawIndicator(true);
9115 _pCameraInfoPanel->Invalidate(true);
9117 if (_pMakerFocusTimer)
9119 _pMakerFocusTimer->Cancel();
9122 _isRecording = false;
9126 r = SetRecordButton(false);
9127 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
9131 if (_pIntervalValueTimer)
9133 _pIntervalValueTimer->Cancel();
9138 _pPopupTimer->Cancel();
9141 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9143 _pCameraInfoPanel->SetDrawPopupTimer(false);
9145 _pCameraInfoPanel->Invalidate(true);
9150 StartInitAppTimer();
9151 AppLogDebug("EXIT");
9155 CamcorderForm::HideUiAction(void)
9157 AppLogDebug("ENTER");
9160 _pPopupTimer->Cancel();
9163 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9165 _pCameraInfoPanel->SetDrawPopupTimer(false);
9167 _pCameraInfoPanel->Invalidate(true);
9170 if (_pExposureCloseTimer != null)
9172 _closeTimerValue = 0;
9174 _pExposureCloseTimer->Cancel();
9177 if (_pCameraInfoPanel->GetDrawExposure() == true)
9179 _pCameraInfoPanel->SetDrawExposure(false);
9184 if (_pMakerFocusTimer != null)
9186 _pMakerFocusTimer->Cancel();
9188 AppLogDebug("EXIT");
9192 CamcorderForm::HideUiSettingMenu(void)
9194 AppLogDebug("ENTER");
9195 if (_pCameraInfoPanel)
9197 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
9198 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
9199 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
9200 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
9203 if (_pListViewCameraTabSubMenu)
9205 if (_pCameraInfoSubPanel != null)
9207 _pCameraInfoSubPanel->SetShowState(false);
9209 _pListViewCameraTabSubMenu->SetShowState(false);
9212 if (_pListViewCameraTabMainMenu)
9214 _pListViewCameraTabMainMenu->SetShowState(false);
9217 if (_pListViewGeneralTabSubMenu)
9219 if (_pCameraInfoGeneralSubPanel != null)
9221 _pCameraInfoGeneralSubPanel->SetShowState(false);
9223 _pListViewGeneralTabSubMenu->SetShowState(false);
9226 if (_pListViewGeneralTabMainMenu)
9228 _pListViewGeneralTabMainMenu->SetShowState(false);
9231 if (_pListFlashMainMenu)
9233 _pListFlashMainMenu->SetShowState(false);
9236 if (_pListWbMainMenu)
9238 _pListWbMainMenu->SetShowState(false);
9240 AppLogDebug("EXIT");
9244 CamcorderForm::HideUiQuickMenu(void)
9246 AppLogDebug("ENTER");
9247 if (_pSelfShotButton != null)
9249 _pSelfShotButton->SetShowState(true);
9250 _pSelfShotButton->Invalidate(true);
9253 if (_pSettingButton != null)
9255 _pSettingButton->SetShowState(true);
9256 _pSettingButton->Invalidate(true);
9259 if (__pSettingLine != null)
9261 __pSettingLine->SetShowState(true);
9262 __pSettingLine->Invalidate(true);
9265 if (_pCameraInfoPanel != null)
9267 _pCameraInfoPanel->SetDrawIndicator(true);
9268 _pCameraInfoPanel->Invalidate(true);
9271 if (_pFlashButton != null)
9273 _pFlashButton->SetShowState(false);
9274 _pFlashButton->Invalidate(true);
9277 if (_pQuickSettingButton != null)
9279 _pQuickSettingButton->SetShowState(false);
9280 _pQuickSettingButton->Invalidate(true);
9283 if (_pWhiteBalanceButton != null)
9285 _pWhiteBalanceButton->SetShowState(false);
9286 _pWhiteBalanceButton->Invalidate(true);
9289 if (_pExposureValueButton != null)
9291 _pExposureValueButton->SetShowState(false);
9292 _pExposureValueButton->Invalidate(true);
9295 if (_pCloseButton != null)
9297 _pCloseButton->SetShowState(false);
9298 _pCloseButton->Invalidate(true);
9300 AppLogDebug("EXIT");
9304 CamcorderForm::ShowUiQuickMenu(void)
9306 AppLogDebug("ENTER");
9307 if (_pCameraInfoPanel)
9309 _pCameraInfoPanel->SetDrawIndicator(false);
9310 _pCameraInfoPanel->Invalidate(true);
9313 if (_pSelfShotButton)
9315 _pSelfShotButton->SetShowState(false);
9316 _pSelfShotButton->Invalidate(true);
9319 if (_pSettingButton)
9321 _pSettingButton->SetShowState(false);
9322 _pSettingButton->Invalidate(true);
9327 __pSettingLine->SetShowState(false);
9328 __pSettingLine->Invalidate(true);
9333 _pFlashButton->SetShowState(true);
9334 _pFlashButton->Invalidate(true);
9337 if (_pQuickSettingButton)
9339 _pQuickSettingButton->SetShowState(true);
9340 _pQuickSettingButton->Invalidate(true);
9343 if (_pWhiteBalanceButton)
9345 _pWhiteBalanceButton->SetShowState(true);
9346 _pWhiteBalanceButton->Invalidate(true);
9349 if (_pExposureValueButton)
9351 _pExposureValueButton->SetShowState(true);
9352 _pExposureValueButton->Invalidate(true);
9357 _pCloseButton->SetShowState(true);
9358 _pCloseButton->Invalidate(true);
9360 AppLogDebug("EXIT");
9364 CamcorderForm::HideUiModeChangedButton(void)
9366 AppLogDebug("ENTER");
9367 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9369 AppControlRequestHideButton();
9373 if (__pCameraIconLabel)
9375 __pCameraIconLabel->SetShowState(true);
9378 if (__pCamcoderIconLabel)
9380 __pCamcoderIconLabel->SetShowState(true);
9385 __pSwButton->SetShowState(true);
9390 AppLogDebug("EXIT");
9394 CamcorderForm::AppControlRequestHideButton(void)
9396 AppLogDebug("ENTER");
9397 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
9398 const IMap* pArguments = pApp->GetAppControlArguments();
9400 if (pArguments == null)
9402 AppLogDebug("pArguments is null");
9404 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
9406 AppLogDebug("Recording");
9407 if (__pCameraIconLabel)
9409 __pCameraIconLabel->SetShowState(false);
9412 if (__pCamcoderIconLabel)
9414 __pCamcoderIconLabel->SetShowState(false);
9419 __pSwButton->SetShowState(false);
9424 if (__pCameraIconLabel)
9426 __pCameraIconLabel->SetShowState(true);
9429 if (__pCamcoderIconLabel)
9431 __pCamcoderIconLabel->SetShowState(true);
9436 __pSwButton->SetShowState(true);
9442 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
9443 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
9445 AppLogDebug("ALLOW_SWITCH_TRUE");
9446 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
9448 AppLogDebug("Recording");
9450 if (__pCameraIconLabel)
9452 __pCameraIconLabel->SetShowState(false);
9455 if (__pCamcoderIconLabel)
9457 __pCamcoderIconLabel->SetShowState(false);
9462 __pSwButton->SetShowState(false);
9467 if (__pCameraIconLabel)
9469 __pCameraIconLabel->SetShowState(true);
9472 if (__pCamcoderIconLabel)
9474 __pCamcoderIconLabel->SetShowState(true);
9479 __pSwButton->SetShowState(true);
9485 AppLogDebug("ALLOW_SWITCH_FALSE");
9486 if (__pCameraIconLabel)
9488 __pCameraIconLabel->SetShowState(false);
9491 if (__pCamcoderIconLabel)
9493 __pCamcoderIconLabel->SetShowState(false);
9498 __pSwButton->SetShowState(false);
9502 AppLogDebug("EXIT");
9506 CamcorderForm::DoRecordHideUiPanel(void)
9508 AppLogDebug("ENTER");
9509 result r = E_SUCCESS;
9510 int timerIntervalVale = 0;
9512 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
9513 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9515 _pFlashButton->SetShowState(false);
9516 _pSelfShotButton->SetShowState(false);
9517 _pSettingButton->SetShowState(false);
9518 __pSettingLine->SetShowState(false);
9520 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && !__doRecording)
9522 AppControlRequestHideButton();
9526 __pCameraIconLabel->SetShowState(false);
9527 __pCamcoderIconLabel->SetShowState(false);
9528 __pSwButton->SetShowState(false);
9531 if (timerIntervalVale != INDEX_UNIT_ZERO)
9533 __pBackButton->SetShowState(false);
9534 __pRecordButton->SetShowState(false);
9538 if (!_isHwKeySupported)
9540 __pBackButton->SetShowState(true);
9542 __pRecordButton->SetShowState(true);
9545 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9547 __pThumbnailButton->SetShowState(false);
9548 _pThumbnailPanel->SetShowState(false);
9554 __pThumbnailButton->SetShowState(false);
9555 _pThumbnailPanel->SetShowState(false);
9559 __pThumbnailButton->SetShowState(true);
9560 _pThumbnailPanel->SetShowState(true);
9563 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9564 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9566 _pQuickSettingButton->SetShowState(false);
9567 _pWhiteBalanceButton->SetShowState(false);
9568 _pExposureValueButton->SetShowState(false);
9569 _pCloseButton->SetShowState(false);
9570 _pAutoFocus->SetShowState(false);
9572 if (__screenMode == SCREEN_MODE_FULL)
9581 AppLogDebug("EXIT");
9585 CamcorderForm::HideUiPanel(bool state)
9587 AppLogDebug("ENTER");
9590 _pFlashButton->SetShowState(false);
9591 _pSelfShotButton->SetShowState(false);
9592 _pSettingButton->SetShowState(false);
9593 __pSettingLine->SetShowState(false);
9595 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && !__doRecording)
9597 AppControlRequestHideButton();
9601 __pCameraIconLabel->SetShowState(false);
9602 __pCamcoderIconLabel->SetShowState(false);
9603 __pSwButton->SetShowState(false);
9606 if (!_isHwKeySupported)
9608 __pBackButton->SetShowState(true);
9610 __pRecordButton->SetShowState(true);
9612 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9614 __pThumbnailButton->SetShowState(false);
9615 _pThumbnailPanel->SetShowState(false);
9621 __pThumbnailButton->SetShowState(false);
9622 _pThumbnailPanel->SetShowState(false);
9626 __pThumbnailButton->SetShowState(true);
9627 _pThumbnailPanel->SetShowState(true);
9630 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9631 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9633 _pQuickSettingButton->SetShowState(false);
9634 _pWhiteBalanceButton->SetShowState(false);
9635 _pExposureValueButton->SetShowState(false);
9636 _pCloseButton->SetShowState(false);
9637 _pAutoFocus->SetShowState(false);
9641 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9643 if (__pThumbnailButton)
9645 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9647 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9648 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9652 if (_pThumbnailPanel)
9654 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9656 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9657 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9663 __pThumbnailButton->SetShowState(true);
9664 _pThumbnailPanel->SetShowState(true);
9666 _pFlashButton->SetShowState(false);
9667 _pSelfShotButton->SetShowState(true);
9668 _pSettingButton->SetShowState(true);
9669 __pSettingLine->SetShowState(true);
9670 _pQuickSettingButton->SetShowState(false);
9671 _pWhiteBalanceButton->SetShowState(false);
9672 _pExposureValueButton->SetShowState(false);
9673 _pCloseButton->SetShowState(false);
9674 _pAutoFocus->SetShowState(false);
9676 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9678 AppControlRequestHideButton();
9682 __pCameraIconLabel->SetShowState(true);
9683 __pCamcoderIconLabel->SetShowState(true);
9684 __pSwButton->SetShowState(true);
9687 if (!_isHwKeySupported)
9689 __pBackButton->SetShowState(true);
9691 __pRecordButton->SetShowState(true);
9693 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
9694 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
9697 if (__screenMode == SCREEN_MODE_FULL)
9706 AppLogDebug("EXIT");
9710 CamcorderForm::SetControlAlwaysOnTopPanel(void)
9712 AppLogDebug("ENTER");
9713 if (__pSettingPanel)
9715 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
9717 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
9718 SetControlAlwaysOnTop(*__pSettingPanel, true);
9724 if (IsControlAlwaysOnTop(__pActionPanel) == false)
9726 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
9727 SetControlAlwaysOnTop(*__pActionPanel, true);
9733 if (IsControlAlwaysOnTop(_pFlashButton) == false)
9735 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
9736 SetControlAlwaysOnTop(*_pFlashButton, true);
9740 if (_pSelfShotButton)
9742 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
9744 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
9745 SetControlAlwaysOnTop(*_pSelfShotButton, true);
9749 if (_pSettingButton)
9751 if (IsControlAlwaysOnTop(_pSettingButton) == false)
9753 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
9754 SetControlAlwaysOnTop(*_pSettingButton, true);
9760 if (IsControlAlwaysOnTop(__pSettingLine) == false)
9762 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
9763 SetControlAlwaysOnTop(*__pSettingLine, true);
9767 if (__pCameraIconLabel)
9769 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
9771 AppLogDebug("IsControlAlwaysOnTop __pCameraIconLabel");
9772 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
9776 if (__pCamcoderIconLabel)
9778 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
9780 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
9781 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
9785 if (_pQuickSettingButton)
9787 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
9789 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
9790 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
9794 if (_pWhiteBalanceButton)
9796 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
9798 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
9799 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
9803 if (_pExposureValueButton)
9805 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
9807 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
9808 SetControlAlwaysOnTop(*_pExposureValueButton, true);
9814 if (IsControlAlwaysOnTop(_pCloseButton) == false)
9816 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
9817 SetControlAlwaysOnTop(*_pCloseButton, true);
9823 if (IsControlAlwaysOnTop(_pAutoFocus) == false)
9825 AppLogDebug("IsControlAlwaysOnTop _pAutoFocus");
9826 SetControlAlwaysOnTop(*_pAutoFocus, true);
9830 if (__pBatteryState)
9832 if (IsControlAlwaysOnTop(__pBatteryState) == false)
9834 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
9835 SetControlAlwaysOnTop(*__pBatteryState, true);
9841 if (IsControlAlwaysOnTop(__pSwButton) == false)
9843 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
9844 SetControlAlwaysOnTop(*__pSwButton, true);
9848 if (__pRecordButton)
9850 if (IsControlAlwaysOnTop(__pRecordButton) == false)
9852 AppLogDebug("IsControlAlwaysOnTop __pRecordButton");
9853 SetControlAlwaysOnTop(*__pRecordButton, true);
9859 if (IsControlAlwaysOnTop(__pBackButton) == false)
9861 AppLogDebug("IsControlAlwaysOnTop __pBackButton");
9862 SetControlAlwaysOnTop(*__pBackButton, true);
9866 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9868 if (__pThumbnailButton)
9870 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9872 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9873 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9877 if (_pThumbnailPanel)
9879 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9881 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9882 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9888 if (__pThumbnailButton)
9890 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
9892 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9893 SetControlAlwaysOnTop(*__pThumbnailButton, true);
9897 if (_pThumbnailPanel)
9899 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
9901 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9902 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
9907 if (_pHelpGoToGallery)
9909 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
9911 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
9912 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
9916 if (_pHelpGoToGalleryText)
9918 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
9920 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
9921 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
9925 if (_pHelpSwitchCamera)
9927 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
9929 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
9930 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
9934 if (_pHelpSwitchCameraText)
9936 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
9938 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
9939 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
9943 if (_pHelpQuickSetting)
9945 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
9947 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
9948 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
9952 if (_pHelpQuickSettingText)
9954 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
9956 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
9957 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
9961 if (_pHelpRecordVideo)
9963 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
9965 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
9966 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
9970 if (_pHelpRecordVideoText)
9972 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
9974 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
9975 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
9981 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
9983 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
9984 SetControlAlwaysOnTop(*_pHelpShutter, true);
9988 if (_pHelpShutterText)
9990 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
9992 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
9993 SetControlAlwaysOnTop(*_pHelpShutterText, true);
9997 if (_pHelpGoToPreviousScreen)
9999 if (IsControlAlwaysOnTop(_pHelpGoToPreviousScreen) == false)
10001 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToPreviousScreen");
10002 SetControlAlwaysOnTop(*_pHelpGoToPreviousScreen, true);
10006 if (_pHelpGoToPreviousScreenText)
10008 if (IsControlAlwaysOnTop(_pHelpGoToPreviousScreenText) == false)
10010 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToPreviousScreenText");
10011 SetControlAlwaysOnTop(*_pHelpGoToPreviousScreenText, true);
10015 if (__pCamcoderSetting)
10017 if (IsControlAlwaysOnTop(__pCamcoderSetting) == false)
10019 AppLogDebug("IsControlAlwaysOnTop __pCamcoderSetting");
10020 SetControlAlwaysOnTop(*__pCamcoderSetting, true);
10024 if (__pCamcorderSettingLable)
10026 if (IsControlAlwaysOnTop(__pCamcorderSettingLable) == false)
10028 AppLogDebug("IsControlAlwaysOnTop __pCamcorderSettingLable");
10029 SetControlAlwaysOnTop(*__pCamcorderSettingLable, true);
10033 if (__pGeneralSetting)
10035 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
10037 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
10038 SetControlAlwaysOnTop(*__pGeneralSetting, true);
10042 if (__pGeneralSettingLable)
10044 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
10046 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
10047 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
10050 AppLogDebug("EXIT");
10054 CamcorderForm::HidePanel(bool isWideMode, bool isInvalidated)
10056 AppLogDebug("ENTER");
10057 result r = E_SUCCESS;
10059 SetControlAlwaysOnTopPanel();
10061 if (isWideMode == true)
10063 if (__pSettingPanel)
10065 r = __pSettingPanel->SetShowState(false);
10066 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10069 if (__pActionPanel)
10071 r = __pActionPanel->SetShowState(false);
10072 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10077 if (__pSettingPanel)
10079 r = __pSettingPanel->SetShowState(true);
10080 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10083 if (__pActionPanel)
10085 r = __pActionPanel->SetShowState(true);
10086 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10090 if (isInvalidated == true)
10099 AppLogDebug("EXIT");
10103 CamcorderForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
10105 AppLogDebug("ENTER");
10106 result r = E_SUCCESS;
10107 int selfPortraitEnable = 0;
10108 bool focusSupport = false;
10110 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10111 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
10113 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10115 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
10119 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
10122 if (focusSupport == true && r == E_SUCCESS)
10124 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
10125 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
10126 _pCameraInfoPanel->SetDrawMarkerFocus(true);
10127 _pCameraInfoPanel->Invalidate(true);
10131 _pCameraInfoPanel->SetDrawMarkerFocus(false);
10132 _pCameraInfoPanel->Invalidate(true);
10134 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
10135 AppLogDebug("EXIT");
10139 CamcorderForm::LaunchImageview(void)
10141 AppLogDebug("ENTER");
10142 const String* filePath = null;
10143 String listIndex = L"";
10144 String* temp = null;
10147 result r = E_SUCCESS;
10149 if (_pExposureCloseTimer)
10151 _pExposureCloseTimer->Cancel();
10157 _pPopupTimer->Cancel();
10162 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
10163 pExtraData->Construct();
10165 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
10166 pArrayList->Construct();
10168 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
10169 pContentPathList->Construct();
10171 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_RECORD);
10172 if (pContentPathList == null)
10176 AppLogDebug("EXIT - pContentPathList is null");
10180 loopCount = _pCameraPresentationModel->GetContentCount();
10181 for (index = 0; index < loopCount; ++index)
10183 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
10184 AppLogDebug("filePath = %ls", filePath->GetPointer());
10185 pArrayList->Add(new (std::nothrow) String(*filePath));
10188 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
10189 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
10191 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
10192 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
10195 SetMime(MIME_TYPE_VALUE_IMAGE);
10197 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
10198 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
10200 loopCount = pArrayList->GetCount();
10201 for (int i = 0; i < loopCount; ++i)
10203 temp = static_cast<String*>(pArrayList->GetAt(i));
10204 AppLog("print temp(%ls)", temp->GetPointer());
10206 AppLogDebug("EXIT");
10210 CamcorderForm::GetCameraToForeground(void)
10212 AppLogDebug("ENTER");
10213 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
10214 Rectangle clientRect = GetClientAreaBounds();
10216 Point currentPosition;
10217 result r = E_SUCCESS;
10218 int previewResolutionSize = 0;
10219 BufferInfo bufferinfo;
10221 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED happen");
10223 __isLockScreenMode = false;
10225 _pCameraPresentationModel->KeepScreenOnState(true, false);
10227 StartInitAppTimer();
10229 _batteryStatus = GetCurrentBatteryState();
10230 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
10232 StartInitChargingTimer();
10234 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
10235 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
10239 dim = _pCameraPresentationModel->GetPreviewResolution();
10240 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
10242 __previewResolutionWidth = dim.width;
10243 __previewResolutionHeight = dim.height;
10245 dim = _pCameraPresentationModel->GetRecordingResolution();
10246 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
10248 __pRecordingResolutionWidth = dim.width;
10249 __pRecordingResolutionHeight = dim.height;
10251 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED: __screenMode [%d]", __screenMode);
10253 r = SetScreenMode(__screenMode, false);
10254 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
10256 if (__dir == ORIENTATION_STATUS_PORTRAIT
10257 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10259 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
10263 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
10268 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
10269 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10271 _pCameraPresentationModel->StartPreview(&bufferinfo);
10273 _pCameraPresentationModel->SetContinuousAutoFocus();
10275 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
10277 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
10279 SetCamcorderSettingsDevice();
10280 AppLogDebug("EXIT");
10284 CamcorderForm::SendCameraToBackground(void)
10286 AppLogDebug("ENTER");
10287 result r = E_SUCCESS;
10290 StopInitAppTimer();
10291 StopInitChargingTimer();
10293 HideUiPanel(false);
10295 _pCameraInfoPanel->SetDrawIndicator(true);
10296 _pCameraInfoPanel->Invalidate(true);
10298 if (_pMakerFocusTimer)
10300 _pMakerFocusTimer->Cancel();
10303 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
10304 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED)
10306 _pCameraPresentationModel->StopRecord();
10308 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
10309 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
10311 if (flashMode == FLASH_MODE_ON)
10313 _pCameraPresentationModel->SetFlashMode(CAMERA_FLASH_MODE_ON);
10317 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
10318 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
10319 _pCameraInfoPanel->Invalidate(true);
10321 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
10323 _pCameraInfoPanel->SetDrawPopupTimer(false);
10324 _pCameraInfoPanel->Invalidate(true);
10328 _isRecording = false;
10329 __setTimerInterval = false;
10330 _pCameraPresentationModel->SetIntervalTimerRun(false);
10331 _isRecordingPause = false;
10332 r = SetRecordButton(false);
10333 AppLogDebug("SetRecordButton() fail[%s]", GetErrorMessage(r));
10335 if (_pIntervalValueTimer)
10337 _pIntervalValueTimer->Cancel();
10342 _pPopupTimer->Cancel();
10345 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
10347 _pCameraInfoPanel->SetDrawPopupTimer(false);
10348 _pCameraInfoPanel->Invalidate(true);
10351 if (_pChargingCompletedTimer != null)
10353 _chargingCount = 0;
10355 _pChargingCompletedTimer->Cancel();
10358 if (_pPreviewFailPopupTimer != null)
10360 _pPreviewFailPopupTimer->Cancel();
10363 _pCameraInfoPanel->SetDrawMarkerFocus(false);
10364 _pCameraInfoPanel->Invalidate(true);
10367 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
10368 _pCameraPresentationModel->StopCamera();
10369 _pCameraPresentationModel->KeepScreenOnState(false, true);
10371 AppLogDebug("EXIT");
10375 CamcorderForm::DrawThumbnail(void)
10377 AppLogDebug("ENTER");
10378 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
10380 if (__pThumbnailButton)
10382 __pThumbnailButton->SetShowState(false);
10383 __pThumbnailButton->Draw();
10384 __pThumbnailButton->Show();
10387 if (_pThumbnailPanel)
10389 _pThumbnailPanel->SetShowState(false);
10390 _pThumbnailPanel->Draw();
10391 _pThumbnailPanel->Show();
10396 if (__pThumbnailButton)
10398 __pThumbnailButton->SetShowState(false);
10399 __pThumbnailButton->Draw();
10400 __pThumbnailButton->Show();
10403 if (_pThumbnailPanel)
10405 _pThumbnailPanel->SetShowState(true);
10406 _pThumbnailPanel->Draw();
10407 _pThumbnailPanel->Show();
10410 AppLogDebug("EXIT");
10414 CamcorderForm::ShowCameraFailPopup(void)
10416 AppLogDebug("ENTER");
10417 int modalResult = 0;
10419 String tmpString = L"";
10420 result r = E_SUCCESS;
10421 AppResource* pAppResource = null;
10423 pAppResource = Application::GetInstance()->GetAppResource();
10424 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
10426 pAppResource->GetString(L"IDS_CAM_POP_CAMERA_FAILED", tmpString);
10428 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
10429 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
10430 msgBox.ShowAndWait(modalResult);
10432 switch (modalResult)
10434 case MSGBOX_RESULT_CLOSE:
10436 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
10438 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
10439 AppLogDebug("SetValue fail [%s]", GetErrorMessage(r));
10441 r = TerminateApp();
10442 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
10449 AppLogDebug("EXIT");
10453 CamcorderForm::ShowSavingPopup(void)
10455 AppLogDebug("ENTER");
10456 int modalResult = 0;
10459 AppResource* pAppResource = null;
10460 result r = E_SUCCESS;
10462 pAppResource = Application::GetInstance()->GetAppResource();
10463 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
10465 pAppResource->GetString(L"IDS_CAM_POP_SAVING", tmpString);
10467 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
10468 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
10470 msgBox.ShowAndWait(modalResult);
10471 AppLogDebug("EXIT");
10475 CamcorderForm::SetScreenOverlayHelpTimer(void)
10477 AppLogDebug("ENTER");
10478 result r = E_SUCCESS;
10479 int overlayHelpEnable = 0;
10481 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
10482 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10484 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
10486 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
10488 _pHelpCloseTimer = new (std::nothrow) Timer();
10489 _pHelpCloseTimer->Construct(*this);
10491 r = _pHelpCloseTimer->Start(MESSAGEBOX_DISPLAY_TIME_3_SEC);
10492 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
10495 AppLogDebug("EXIT");
10499 delete _pHelpCloseTimer;
10500 _pHelpCloseTimer = null;
10502 AppLogDebug("EXIT - CATCH");
10507 CamcorderForm::DrawScreenOverlayHelp(void)
10509 AppLogDebug("ENTER");
10510 Bitmap* pBitmap = null;
10511 result r = E_SUCCESS;
10512 int overlayHelpEnable = 0;
10513 //AppResource* pAppResource = null;
10514 String ovelayHelpStr = L"";
10516 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
10517 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
10518 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
10519 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
10520 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
10521 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
10522 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
10523 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
10524 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
10525 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
10526 TryCatch(_pHelpGoToPreviousScreen != null, r = E_FAILURE, "_pHelpGoToPreviousScreen is null");
10527 TryCatch(_pHelpGoToPreviousScreenText != null, r = E_FAILURE, "_pHelpGoToPreviousScreenText is null");
10529 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
10530 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10532 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
10534 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
10536 _pHelpGoToGallery->SetShowState(false);
10537 _pHelpGoToGalleryText->SetShowState(false);
10538 _pHelpSwitchCamera->SetShowState(false);
10539 _pHelpSwitchCameraText->SetShowState(false);
10540 _pHelpQuickSetting->SetShowState(false);
10541 _pHelpQuickSettingText->SetShowState(false);
10542 _pHelpRecordVideo->SetShowState(false);
10543 _pHelpRecordVideoText->SetShowState(false);
10544 _pHelpShutter->SetShowState(false);
10545 _pHelpShutterText->SetShowState(false);
10546 _pHelpGoToPreviousScreen->SetShowState(false);
10547 _pHelpGoToPreviousScreenText->SetShowState(false);
10551 //pAppResource = Application::GetInstance()->GetAppResource();
10552 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10554 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
10556 _pHelpGoToGallery->SetShowState(true);
10557 //pAppResource->GetString(L"IDS_HELP_GOTO_GALLERY", ovelayHelpStr);
10558 ovelayHelpStr = L"GO to Gallery";
10559 _pHelpGoToGalleryText->SetText(ovelayHelpStr);
10560 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10561 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10562 _pHelpGoToGalleryText->SetShowState(true);
10565 _pHelpSwitchCamera->SetShowState(true);
10566 //pAppResource->GetString(L"IDS_HELP_SWITCH_CAMERA", ovelayHelpStr);
10567 ovelayHelpStr = L"Switch camera";
10568 _pHelpSwitchCameraText->SetText(ovelayHelpStr);
10569 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10570 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10571 _pHelpSwitchCameraText->SetShowState(true);
10573 _pHelpQuickSetting->SetShowState(true);
10574 //pAppResource->GetString(L"IDS_HELP_QUICK_SETTINGT", ovelayHelpStr);
10575 ovelayHelpStr = L"Quick Settings";
10576 _pHelpQuickSettingText->SetText(ovelayHelpStr);
10577 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10578 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10579 _pHelpQuickSettingText->SetShowState(true);
10581 _pHelpRecordVideo->SetShowState(true);
10582 //pAppResource->GetString(L"IDS_HELP_RECORD_VIDEO", ovelayHelpStr);
10583 ovelayHelpStr = L"Record video";
10584 _pHelpRecordVideoText->SetText(ovelayHelpStr);
10585 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10586 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10587 _pHelpRecordVideoText->SetShowState(true);
10589 _pHelpShutter->SetShowState(true);
10590 //pAppResource->GetString(L"IDS_HELP_RECORDER", ovelayHelpStr);
10591 ovelayHelpStr = L"Recorder";
10592 _pHelpShutterText->SetText(ovelayHelpStr);
10593 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10594 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10595 _pHelpShutterText->SetShowState(true);
10597 if (!_isHwKeySupported)
10599 _pHelpGoToPreviousScreen->SetShowState(true);
10600 //pAppResource->GetString(L"IDS_HELP_GOTO_PREVIOUS_SCREEN", ovelayHelpStr);
10601 ovelayHelpStr = L"Go to Previous Screen";
10602 _pHelpGoToPreviousScreenText->SetText(ovelayHelpStr);
10603 _pHelpGoToPreviousScreenText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10604 _pHelpGoToPreviousScreenText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10605 _pHelpGoToPreviousScreenText->SetShowState(true);
10608 if (__dir == ORIENTATION_STATUS_PORTRAIT
10609 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10611 _pHelpGoToGalleryText->Invalidate(true);
10612 _pHelpSwitchCameraText->Invalidate(true);
10613 _pHelpQuickSettingText->Invalidate(true);
10614 _pHelpRecordVideoText->Invalidate(true);
10615 _pHelpShutterText->Invalidate(true);
10617 if (!_isHwKeySupported)
10619 _pHelpGoToPreviousScreenText->Invalidate(true);
10622 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
10623 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10625 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
10626 _pHelpGoToGallery->Invalidate(true);
10631 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
10632 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10634 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
10635 _pHelpSwitchCamera->Invalidate(true);
10640 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
10641 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10643 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
10644 _pHelpQuickSetting->Invalidate(true);
10649 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
10650 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10652 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
10653 _pHelpRecordVideo->Invalidate(true);
10658 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
10659 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10661 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
10662 _pHelpShutter->Invalidate(true);
10667 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
10668 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10670 _pHelpGoToPreviousScreen->SetBackgroundBitmap(*pBitmap);
10671 _pHelpGoToPreviousScreen->Invalidate(true);
10678 _pHelpGoToGalleryText->Invalidate(true);
10679 _pHelpSwitchCameraText->Invalidate(true);
10680 _pHelpQuickSettingText->Invalidate(true);
10681 _pHelpRecordVideoText->Invalidate(true);
10682 _pHelpShutterText->Invalidate(true);
10683 _pHelpGoToPreviousScreenText->Invalidate(true);
10685 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
10686 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10688 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
10689 _pHelpGoToGallery->Invalidate(true);
10694 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
10695 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10697 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
10698 _pHelpSwitchCamera->Invalidate(true);
10703 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
10704 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10706 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
10707 _pHelpQuickSetting->Invalidate(true);
10712 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
10713 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10715 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
10716 _pHelpRecordVideo->Invalidate(true);
10721 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
10722 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10724 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
10725 _pHelpShutter->Invalidate(true);
10730 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
10731 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10733 _pHelpGoToPreviousScreen->SetBackgroundBitmap(*pBitmap);
10734 _pHelpGoToPreviousScreen->Invalidate(true);
10741 AppLogDebug("EXIT");
10745 AppLogDebug("EXIT - CATCH");
10750 CamcorderForm::CheckCamcorderSettingLabel(void)
10752 AppLogDebug("ENTER");
10753 if (__pCamcorderSettingLable)
10755 result r = E_SUCCESS;
10757 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10758 _pAppTimer->Cancel();
10760 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
10761 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10763 if (_pListViewGeneralTabMainMenu)
10765 _pListViewGeneralTabMainMenu->SetShowState(false);
10768 if (_pListViewGeneralTabSubMenu)
10770 _pListViewGeneralTabSubMenu->SetShowState(false);
10773 MakeCamcoderTabSettingPopup();
10775 AppLogDebug("EXIT");
10779 CamcorderForm::CheckGeneralSettingLabel(void)
10781 AppLogDebug("ENTER");
10782 if(__pGeneralSettingLable)
10784 result r = E_SUCCESS;
10786 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10787 _pAppTimer->Cancel();
10789 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
10790 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10792 if (_pListViewCameraTabMainMenu)
10794 _pListViewCameraTabMainMenu->SetShowState(false);
10796 if (_pListViewCameraTabSubMenu)
10798 _pListViewCameraTabSubMenu->SetShowState(false);
10801 MakeGeneralTabSettingPopup();
10803 AppLogDebug("EXIT");
10807 CamcorderForm::DrawPauseRecord(void)
10809 AppLogDebug("ENTER");
10810 result r = E_SUCCESS;
10811 Bitmap* pBitmap = null;
10813 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_ICON_RECODING_PAUSE);
10814 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
10816 __pRecLabelRed->SetBackgroundBitmap(*pBitmap);
10818 __pRecLabelRed->SetShowState(true);
10819 __pRecLabelRed->Invalidate(true);
10821 __pRecLabelText->SetShowState(false);
10822 __pRecLabelText->Invalidate(true);
10827 AppLogDebug("EXIT");
10831 AppLogDebug("EXIT - CATCH");
10836 CamcorderForm::DrawRecord(bool isRecord)
10838 AppLogDebug("ENTER");
10839 result r = E_SUCCESS;
10840 Bitmap* pBitmap = null;
10843 TryCatch(__pRecLabelRed != null, r = E_SYSTEM, "__pRecLabelRed is null");
10844 TryCatch(__pRecLabelText != null, r = E_SYSTEM, "__pRecLabelText is null");
10845 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBatteryState is null");
10849 timeCnt = __recordTimeCount;
10851 if (_isRecording == true)
10853 if (IsControlAlwaysOnTop(__pRecLabelRed) == false)
10855 AppLogDebug("IsControlAlwaysOnTop __pRecLabelRed");
10856 SetControlAlwaysOnTop(*__pRecLabelRed, true);
10859 if (IsControlAlwaysOnTop(__pRecLabelText) == false)
10861 AppLogDebug("IsControlAlwaysOnTop __pRecLabelText");
10862 SetControlAlwaysOnTop(*__pRecLabelText, true);
10865 if (((++timeCnt) % FRAME_RATE) == INDEX_UNIT_ZERO)
10867 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_ICON_RECODING);
10868 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
10870 __pRecLabelRed->SetBackgroundBitmap(*pBitmap);
10871 __pRecLabelRed->SetShowState(true);
10872 __pRecLabelRed->Invalidate(true);
10879 __pRecLabelRed->SetShowState(false);
10880 __pRecLabelRed->Invalidate(true);
10883 __pRecLabelText->SetShowState(true);
10884 __pRecLabelText->Invalidate(true);
10886 __pBatteryState->SetShowState(false);
10887 __pBatteryState->Invalidate(true);
10892 __pRecLabelRed->SetShowState(false);
10893 __pRecLabelRed->Invalidate(true);
10895 __pRecLabelText->SetShowState(false);
10896 __pRecLabelText->Invalidate(true);
10898 __pBatteryState->SetShowState(true);
10899 __pBatteryState->Invalidate(true);
10902 AppLogDebug("EXIT");
10906 AppLogDebug("EXIT - CATCH");
10911 CamcorderForm::InitElapsedTimeLable(void)
10913 AppLogDebug("ENTER");
10914 result r = E_SUCCESS;
10916 String endTime = L"";
10917 String maxTime = L"";
10918 String recSize = L"";
10920 if (_isRecording == true || _isRecordingPause == true)
10922 TryCatch(__pElapsedTimeLable != null, r = E_FAILURE, "__pElapsedTimeLable is null");
10923 TryCatch(__pElapsedTimeMaxLable != null, r = E_FAILURE, "__pElapsedTimeMaxLable is null");
10924 TryCatch(__pElapsedRecordSizeLable != null, r = E_FAILURE, "__pElapsedRecordSizeLable is null");
10925 TryCatch(__pRecLabelRed != null, r = E_FAILURE, "__pRecLabelRed is null");
10926 TryCatch(__pRecLabelText != null, r = E_FAILURE, "__pRecLabelText is null");
10928 r = endTime.Append(INIT_REC_TIME);
10929 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10931 r = maxTime.Append(INIT_MAX_REC_TIME);
10932 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10934 r = recSize.Append(INIT_REC_SIZE);
10935 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10937 __pElapsedTimeLable->SetText(endTime);
10938 __pElapsedTimeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10940 __pElapsedTimeMaxLable->SetText(maxTime);
10941 __pElapsedTimeMaxLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10943 __pElapsedRecordSizeLable->SetText(recSize);
10944 __pElapsedRecordSizeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10946 __pElapsedTimeLable->SetShowState(false);
10947 __pElapsedTimeLable->Invalidate(true);
10949 __pElapsedTimeMaxLable->SetShowState(false);
10950 __pElapsedTimeMaxLable->Invalidate(true);
10952 __pElapsedRecordSizeLable->SetShowState(false);
10953 __pElapsedRecordSizeLable->Invalidate(true);
10955 __pRecLabelRed->SetShowState(false);
10956 __pRecLabelRed->Invalidate(true);
10958 __pRecLabelText->SetShowState(false);
10959 __pRecLabelText->Invalidate(true);
10962 AppLogDebug("EXIT");
10970 CamcorderForm::DrawRecordTimer(void)
10972 AppLogDebug("ENTER");
10973 result r = E_SUCCESS;
10974 String endTime = L"";
10975 String maxTime = L"";
10976 String recSize = L"";
10984 long recordedSize = 0;
10985 int recSizeMB = 0 ;
10987 TryCatch(__pElapsedTimeLable != null, r = E_SYSTEM, "__pElapsedTimeLable is null");
10988 TryCatch(__pElapsedTimeMaxLable != null, r = E_SYSTEM, "__pElapsedTimeMaxLable is null");
10989 TryCatch(__pElapsedRecordSizeLable != null, r = E_SYSTEM, "__pElapsedRecordSizeLable is null");
10991 timeCnt = __recordTimeCount;
10992 recordedSize = _pCameraPresentationModel->GetRecordingSize();
10993 recSizeMB = recordedSize / DIVIDE_THOUSAND;
10995 recMin = (timeCnt % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE;
10996 recSec = timeCnt % SECONDS_PER_MINUTE;
10998 if (__recordingMaxTime > INDEX_UNIT_ZERO)
11000 if (__isCapacityBelow)
11002 maxMin = UNIT_TWELVE;
11003 maxSec = UNIT_ZEROTOZERO;
11007 __recordingMaxTime = __recordingMaxTime / DIVIDE_THOUSAND;
11008 maxHour =__recordingMaxTime / SECONDS_PER_HOUR;
11009 maxMin = maxHour * SECONDS_PER_MINUTE;
11010 maxSec = __recordingMaxTime % SECONDS_PER_MINUTE;
11014 if (recMin < UNIT_TEN)
11016 endTime.Append(L"0");
11019 r = endTime.Append(recMin);
11020 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11022 r = endTime.Append(L"");
11023 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11025 r = endTime.Append(L":");
11026 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11028 if (recSec < UNIT_TEN)
11030 r = endTime.Append(L"0");
11031 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11034 r = endTime.Append(recSec);
11035 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11037 r = endTime.Append("");
11038 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11040 r = endTime.Append(L"/");
11041 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11043 r = maxTime.Append(maxMin);
11044 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11046 r = maxTime.Append(L"");
11047 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11049 r = maxTime.Append(L":");
11050 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11052 if (maxSec < UNIT_TEN)
11054 r = maxTime.Append(L"0");
11055 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11058 r = maxTime.Append(maxSec);
11059 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11061 if (recSizeMB < UNIT_TEN)
11063 r = recSize.Append(L"000");
11064 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11066 else if (recSizeMB < UNIT_HUNDRED)
11068 r = recSize.Append(L"00");
11069 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11071 else if (recSizeMB < UNIT_THOUSAND)
11073 r = recSize.Append(L"0");
11074 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11077 r = recSize.Append(recSizeMB);
11078 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11080 r = recSize.Append(L"M");
11081 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11083 __pElapsedTimeLable->SetText(endTime);
11084 __pElapsedTimeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
11085 __pElapsedTimeMaxLable->SetText(maxTime);
11086 __pElapsedTimeMaxLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
11087 __pElapsedRecordSizeLable->SetText(recSize);
11088 __pElapsedRecordSizeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
11090 if (_isRecording == true)
11092 if (IsControlAlwaysOnTop(__pElapsedTimeLable) == false)
11094 AppLogDebug("IsControlAlwaysOnTop __pElapsedTimeLable");
11095 SetControlAlwaysOnTop(*__pElapsedTimeLable, true);
11098 if (IsControlAlwaysOnTop(__pElapsedTimeMaxLable) == false)
11100 AppLogDebug("IsControlAlwaysOnTop __pElapsedTimeMaxLable");
11101 SetControlAlwaysOnTop(*__pElapsedTimeMaxLable, true);
11104 if (IsControlAlwaysOnTop(__pElapsedRecordSizeLable) == false)
11106 AppLogDebug("IsControlAlwaysOnTop __pElapsedRecordSizeLable");
11107 SetControlAlwaysOnTop(*__pElapsedRecordSizeLable, true);
11109 __pElapsedTimeLable->SetShowState(true);
11110 __pElapsedTimeMaxLable->SetShowState(true);
11111 __pElapsedRecordSizeLable->SetShowState(true);
11115 r = endTime.Append(INIT_REC_TIME);
11116 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11118 r = maxTime.Append(INIT_MAX_REC_TIME);
11119 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11121 r = recSize.Append(INIT_REC_SIZE);
11122 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11124 __pElapsedTimeLable->SetShowState(false);
11125 __pElapsedTimeMaxLable->SetShowState(false);
11126 __pElapsedRecordSizeLable->SetShowState(false);
11129 __pElapsedTimeLable->Invalidate(true);
11130 __pElapsedTimeMaxLable->Invalidate(true);
11131 __pElapsedRecordSizeLable->Invalidate(true);
11133 AppLogDebug("EXIT");
11141 CamcorderForm::DrawBatteryLevelFull(void)
11143 AppLogDebug("ENTER");
11144 Bitmap* pBitmap = null;
11145 result r = E_SUCCESS;
11147 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
11149 if (__dir == ORIENTATION_STATUS_PORTRAIT
11150 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
11152 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
11156 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
11159 _batteryStatus = BATTERY_STATE_20;
11161 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
11162 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
11164 __pBatteryState->SetBackgroundBitmap(*pBitmap);
11165 __pBatteryState->Invalidate(true);
11170 AppLogDebug("EXIT");
11174 AppLogDebug("EXIT - CATCH");
11179 CamcorderForm::CheckBatteryStatus(void)
11181 AppLogDebug("ENTER");
11182 Bitmap* pBitmap = null;
11183 result r = E_SUCCESS;
11184 int batteryLevel = 0;
11185 bool isCharging = false;
11187 Battery::IsCharging(isCharging);
11188 Battery::GetCurrentLevelInPercentage(batteryLevel);
11190 AppLogDebug("batteryLevel = %d", batteryLevel);
11192 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
11194 if (__dir == ORIENTATION_STATUS_PORTRAIT
11195 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
11197 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
11201 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
11206 _batteryStatus = GetCurrentBatteryState();
11207 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
11209 int batteryType = GetCurrentBatteryImage();
11211 AppLogDebug("batteryType = %d", batteryType);
11213 pBitmap = ResourceManager::GetBitmapN(batteryType);
11215 StartInitChargingTimer();
11217 if (__setTimerInterval)
11219 AppLogDebug("__setTimerInterval");
11220 CancelTimerIntervalRecord();
11225 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
11227 _batteryStatus = BATTERY_STATE_20;
11229 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
11231 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
11233 _batteryStatus = BATTERY_STATE_19;
11235 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
11237 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
11239 _batteryStatus = BATTERY_STATE_18;
11241 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
11243 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
11245 _batteryStatus = BATTERY_STATE_17;
11247 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
11249 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
11251 _batteryStatus = BATTERY_STATE_16;
11253 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
11255 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
11257 _batteryStatus = BATTERY_STATE_15;
11259 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
11261 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
11263 _batteryStatus = BATTERY_STATE_14;
11265 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
11267 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
11269 _batteryStatus = BATTERY_STATE_13;
11271 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
11273 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
11275 _batteryStatus = BATTERY_STATE_12;
11277 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
11279 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
11281 _batteryStatus = BATTERY_STATE_11;
11283 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
11285 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
11287 _batteryStatus = BATTERY_STATE_10;
11289 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
11291 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
11293 _batteryStatus = BATTERY_STATE_9;
11295 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
11297 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
11299 _batteryStatus = BATTERY_STATE_8;
11301 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
11303 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
11305 _batteryStatus = BATTERY_STATE_7;
11307 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
11309 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
11311 _batteryStatus = BATTERY_STATE_6;
11313 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
11315 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
11317 _batteryStatus = BATTERY_STATE_5;
11319 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
11321 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
11323 _batteryStatus = BATTERY_STATE_4;
11325 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
11327 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
11329 _batteryStatus = BATTERY_STATE_3;
11331 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
11333 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
11335 _batteryStatus = BATTERY_STATE_2;
11337 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
11339 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
11341 _batteryStatus = BATTERY_STATE_1;
11343 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
11345 else if (batteryLevel == BATT_LEVEL_VALUE_00)
11347 _batteryStatus = BATTERY_STATE_0;
11349 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
11352 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
11354 AppLogDebug("_batteryStatus = %d", _batteryStatus);
11356 __pBatteryState->SetBackgroundBitmap(*pBitmap);
11357 __pBatteryState->Invalidate(true);
11362 AppLogDebug("ENTER");
11370 CamcorderForm::MakeCamcoderTabMenuString(void)
11372 AppLogDebug("ENTER");
11375 result r = E_SUCCESS;
11376 AppResource* pAppResource = null;
11378 if (__pSettingMenuString == null)
11380 pAppResource = Application::GetInstance()->GetAppResource();
11381 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
11383 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
11385 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
11387 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
11389 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
11390 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
11393 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
11394 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
11396 pAppResource->GetString(IDS_RECORDING_MODE, tmpString);
11397 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_01] = tmpString;
11398 pAppResource->GetString(IDS_RECORDING_MODE_NORMAL, tmpString);
11399 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_02] = tmpString;
11400 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_03] = IDS_RECORDING_MODE_SHARING;
11403 AppLogDebug("EXIT");
11407 if (__pSettingMenuString)
11409 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
11411 if (__pSettingMenuString[idx])
11413 delete [] __pSettingMenuString[idx];
11414 __pSettingMenuString[idx] = null;
11422 delete __pSettingMenuString;
11423 __pSettingMenuString = null;
11430 CamcorderForm::RunStartPreviewThread(void)
11432 AppLogDebug("ENTER");
11433 result r = E_SUCCESS;
11435 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
11436 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
11438 __pCameraStarterThread = CameraStarterThread::GetInstance();
11439 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
11441 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
11442 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
11444 r = __pCameraStarterThread->Start();
11445 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
11447 AppLogDebug("EXIT");
11451 ShowCameraFailPopup();
11453 AppLogDebug("EXIT - CATCH");
11458 CamcorderForm::CreateCamcorderTabSubMenuItem(int index, int itemWidth)
11460 AppLogDebug("ENTER");
11461 CustomItem* pItem = null;
11462 result r = E_SUCCESS;
11464 Bitmap* pBitmap = null;
11465 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11466 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11467 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11468 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11469 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11470 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11471 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11472 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11475 pItem = new (std::nothrow) CustomItem();
11476 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11478 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11479 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11481 switch (GetCamcorderTabSettingSubMenuMode())
11483 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
11485 int selfPortraitEnable = 0;
11487 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11488 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11490 if (__pRecordingResolutionList)
11494 if (__pRecordingResolutionList->GetCount() > index)
11496 if (index == __pRecordingResolutionIndex)
11498 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11502 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11505 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11506 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11512 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_640X480);
11513 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11515 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11516 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11521 str = *(static_cast<String*>(__pRecordingResolutionList->GetAt(index)));
11524 r = pItem->AddElement(rectThreeTextItem, elementId, str, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11525 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11531 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
11540 AppLogDebug("EXIT");
11550 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11555 CamcorderForm::CreateCamcorderTabMainMenuItem(int index, int itemWidth)
11557 AppLogDebug("ENTER");
11558 CustomItem* pItem = null;
11559 result r = E_SUCCESS;
11563 int camcorderResolutionCount = 0;
11564 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11565 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11567 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11568 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11569 int selfPortraitEnable = 0;
11570 String strTmp = L"";
11572 String arrRegStringSupport[2] =
11574 RECORDING_RESOLUTION,
11578 pItem = new (std::nothrow) CustomItem();
11579 TryCatch(pItem != null,,"Failed to allocate memory for CustomItem");
11581 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11582 TryCatch(r == E_SUCCESS,,"Failed to construct CustomItem");
11584 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11585 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11587 elementId = (index * MENU_TWO_ELEMENT);
11588 strTmp = __pSettingMenuString[index][0];
11591 if (strTmp.GetLength())
11593 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11595 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11597 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
11598 if (r == E_SUCCESS)
11600 if (__pRecordingResolutionList != null)
11602 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11605 if (camcorderResolutionCount > 1)
11607 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11611 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11613 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11617 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11618 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11623 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11625 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11626 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11630 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11631 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11637 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11639 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
11640 if (r == E_SUCCESS)
11642 if (__pRecordingResolutionList != null)
11644 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11647 if (camcorderResolutionCount > 1)
11649 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11653 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11655 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11659 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11660 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11665 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11667 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11668 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11672 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11673 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11679 if (index < GetCamcorderTabSettingMainMenuCount() - INDEX_UNIT_ONE)
11681 int storageType = STORAGE_TYPE_PHONE;
11683 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11684 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11686 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11688 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11689 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11690 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11693 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11699 r = _pCameraPresentationModel->GetValue(arrRegStringSupport[index], regVal);
11700 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11703 AppLogDebug("Setting Main Menu");
11704 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11705 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11707 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11709 if (__pRecordingResolutionList)
11711 AppLogDebug("Setting GetCount = %d", __pRecordingResolutionList->GetCount());
11713 int idx = __pRecordingResolutionList->GetCount() - INDEX_UNIT_ONE;
11719 if (__pRecordingResolutionIndex == INDEX_UNIT_ONE)
11721 __pRecordingResolutionIndex = __pRecordingResolutionIndex - INDEX_UNIT_ONE;
11723 strTmp = *(static_cast<String*>(__pRecordingResolutionList->GetAt(__pRecordingResolutionIndex)));
11727 strTmp = *(static_cast<String*>(__pRecordingResolutionList->GetAt(__pRecordingResolutionIndex)));
11734 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11739 if (strTmp.GetLength())
11741 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11743 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11745 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
11746 if (r == E_SUCCESS)
11749 if (__pRecordingResolutionList != null)
11751 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11754 if (camcorderResolutionCount > 1)
11756 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11760 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11762 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11766 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11767 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11772 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11773 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11778 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11780 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
11781 if (r == E_SUCCESS)
11783 if (__pRecordingResolutionList != null)
11785 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11788 if (camcorderResolutionCount > 1)
11790 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11794 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11796 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11800 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11801 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11806 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11807 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11811 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11812 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11817 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11821 r = _pCameraPresentationModel->GetValue(RECORDING_MODE, regVal);
11822 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11824 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11828 if (strTmp.GetLength())
11830 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11831 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11833 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11834 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11839 AppLogDebug("EXIT");
11846 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11851 CamcorderForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11853 AppLogDebug("ENTER");
11854 CustomItem* pItem = null;
11855 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11856 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11857 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11858 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11859 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11860 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11861 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11862 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11864 result r = E_SUCCESS;
11867 String strTmp = L"";
11868 int selfPortraitEnable = 0;
11869 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11870 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11872 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11873 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11874 String arrRegStringSupporExposure[] =
11879 OVERLAY_HELP_ENABLE,
11882 pItem = new (std::nothrow) CustomItem();
11883 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11885 pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11886 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11888 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11889 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11891 elementId = (index * MENU_TWO_ELEMENT);
11892 strTmp = __pSettingGeneralMenuString[index][0];
11895 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11896 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11898 AppLogDebug("index = %d ", index);
11899 AppLogDebug("GetGeneralTabSettingMainMenuCount = %d ", GetGeneralTabSettingMainMenuCount());
11901 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11903 bool value = false;
11904 int storageType = STORAGE_TYPE_PHONE;
11906 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11908 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11910 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11911 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11912 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11915 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11917 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, value);
11921 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, value);
11924 if (value == true && r == E_SUCCESS)
11926 r = _pCameraPresentationModel->GetValue(arrRegStringSupporExposure[index], regVal);
11927 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11931 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11933 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, value);
11937 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, value);
11940 r = _pCameraPresentationModel->GetValue(arrRegStringSupporExposure[index], regVal);
11941 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11944 AppLogDebug("Setting Main Menu");
11945 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11946 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11948 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11952 if (strTmp.GetLength())
11954 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11956 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11957 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11961 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11962 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11965 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11966 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11970 AppLogDebug("EXIT");
11977 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11982 CamcorderForm::CreateFlashMainMenuItem(int index, int itemWidth)
11984 AppLogDebug("ENTER");
11985 CustomItem* pItem = null;
11986 result r = E_SUCCESS;
11989 Bitmap* pBitmap = null;
11990 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11991 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11992 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11993 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11995 String listName = L"";
11996 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11997 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11998 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11999 AppResource* pAppResource = null;
12000 String tmpString = L"";
12001 bool value = false;
12002 int selfPortraitEnable = 0;
12005 String arrString[] =
12012 pItem = new (std::nothrow) CustomItem();
12013 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12015 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12016 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12018 pAppResource = Application::GetInstance()->GetAppResource();
12019 TryCatch(pAppResource != null, , "pAppResource is null");
12021 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
12022 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
12024 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
12026 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12028 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
12029 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12031 if (flashMode != FLASH_MODE_OFF)
12033 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
12034 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
12039 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
12041 if (value == true && r == E_SUCCESS)
12043 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12047 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12049 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
12050 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12052 if (flashMode != FLASH_MODE_OFF)
12054 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
12055 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
12060 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
12061 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12065 case SUBMENU_MODE_OFF:
12067 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
12071 case SUBMENU_MODE_ON:
12073 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
12077 case SUBMENU_MODE_AUTO:
12079 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
12087 pAppResource->GetString(arrString[index], tmpString);
12089 if (index == regVal)
12091 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12095 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12097 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12099 elementId = (index * MENU_THREE_ELEMENT);
12102 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12103 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12109 pBitmap = ResourceManager::GetBitmapN(resId);
12110 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12112 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12113 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12120 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
12122 if (value == true && r == E_SUCCESS)
12124 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12125 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12129 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
12130 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12133 AppLogDebug("EXIT");
12143 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
12148 CamcorderForm::CreateWhiteBalanceItem(int index, int itemWidth)
12150 AppLogDebug("ENTER");
12151 CustomItem* pItem = null;
12152 Bitmap* pBitmap = null;
12153 Rectangle rectRadioIcon = Rectangle(X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
12154 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
12155 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
12156 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
12158 String listName = L"";
12159 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
12160 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
12162 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
12163 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
12165 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
12166 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
12167 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
12168 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
12169 AppResource* pAppResource = null;
12171 result r = E_SUCCESS;
12174 int selfPortraitEnable = 0;
12175 ResourceId resId = RESOURCE_ID_WB_AWB;
12177 String arrString[] =
12180 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
12181 IDS_CAM_BODY_FLUORESCENT,
12182 IDS_CAM_BODY_DAYLIGHT,
12183 IDS_CAM_BODY_CLOUDY,
12186 pItem = new (std::nothrow) CustomItem();
12187 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12189 pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12190 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12192 pAppResource = Application::GetInstance()->GetAppResource();
12193 TryCatch(pAppResource != null,,"pAppResource is null");
12195 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
12196 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
12198 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
12200 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
12202 if (r == E_SUCCESS)
12204 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12208 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12210 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, 0);
12211 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
12213 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
12214 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12218 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
12220 if (r == E_SUCCESS)
12222 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12226 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12228 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, 0);
12229 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
12231 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
12232 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12235 AppLogDebug("regVal = %d", regVal);
12241 resId = RESOURCE_ID_WB_AWB;
12245 case MODE_WHITEBALANCE_INCANDESCENT:
12247 resId = RESOURCE_ID_WB_DAYLIGHT;
12251 case MODE_FLUORESCENT:
12253 resId = RESOURCE_ID_WB_CLOUDY;
12257 case MODE_DAYLIGHT:
12259 resId = RESOURCE_ID_WB_FLUORESCENT_H;
12265 resId = RESOURCE_ID_WB_FLUORESCENT_L;
12273 pAppResource->GetString(arrString[index], tmpString);
12275 if (index == regVal)
12277 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12281 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12283 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12285 elementId = (index * MENU_THREE_ELEMENT);
12287 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12288 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12294 pBitmap = ResourceManager::GetBitmapN(resId);
12295 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12297 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12298 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12304 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12305 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12307 AppLogDebug("EXIT");
12317 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
12322 CamcorderForm::MakeSettingPopupTab(bool isShow)
12324 AppLogDebug("ENTER");
12327 if (__pCamcoderSetting)
12329 __pCamcoderSetting->SetShowState(true);
12330 __pCamcoderSetting->Invalidate(true);
12333 if (__pCamcorderSettingLable)
12335 __pCamcorderSettingLable->SetShowState(true);
12336 __pCamcorderSettingLable->Invalidate(true);
12339 if (__pGeneralSetting)
12341 __pGeneralSetting->SetShowState(true);
12342 __pGeneralSetting->Invalidate(true);
12345 if (__pGeneralSettingLable)
12347 __pGeneralSettingLable->SetShowState(true);
12348 __pGeneralSettingLable->Invalidate(true);
12353 if (__pCamcoderSetting)
12355 __pCamcoderSetting->SetShowState(false);
12356 __pCamcoderSetting->Invalidate(true);
12359 if (__pCamcorderSettingLable)
12361 __pCamcorderSettingLable->SetShowState(false);
12362 __pCamcorderSettingLable->Invalidate(true);
12365 if (__pGeneralSetting)
12367 __pGeneralSetting->SetShowState(false);
12368 __pGeneralSetting->Invalidate(true);
12371 if (__pGeneralSettingLable)
12373 __pGeneralSettingLable->SetShowState(false);
12374 __pGeneralSettingLable->Invalidate(true);
12377 AppLogDebug("EXIT");
12381 CamcorderForm::MakeCamcoderTabSettingPopup(void)
12383 AppLogDebug("ENTER");
12384 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
12385 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12388 MakeRecordingResolutionList(true);
12392 _pCameraInfoPanel->SetDrawExposure(false);
12394 if (__dir == ORIENTATION_STATUS_PORTRAIT
12395 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
12397 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
12398 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN);
12402 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
12403 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE - H_SETTING_MENU_LIST_MARGIN);
12406 MakeCamcoderTabMenuString();
12407 SetCamcorderTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
12408 MakeSettingPopupTab(true);
12410 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
12411 _pCameraInfoPanel->Invalidate(true);
12412 if (_pListViewCameraTabMainMenu == null)
12414 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
12415 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
12417 _pListViewCameraTabMainMenu->SetItemProvider(*this);
12418 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
12419 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
12423 _pListViewCameraTabMainMenu->SetShowState(true);
12424 _pListViewCameraTabMainMenu->SetBounds(rectList);
12426 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
12428 _pListViewCameraTabMainMenu->UpdateList();
12429 AppLogDebug("EXIT");
12433 CamcorderForm::MakeGeneralTabSettingPopup(void)
12435 AppLogDebug("ENTER");
12436 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
12437 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12440 _pCameraInfoPanel->SetDrawExposure(false);
12442 if (__dir == ORIENTATION_STATUS_PORTRAIT
12443 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
12445 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
12446 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT);
12450 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
12451 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12454 MakeGeneralTabMenuString();
12455 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
12456 MakeSettingPopupTab(true);
12458 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
12459 _pCameraInfoPanel->Invalidate(true);
12461 if (_pListViewGeneralTabMainMenu == null)
12463 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
12464 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
12466 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
12467 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
12468 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
12472 _pListViewGeneralTabMainMenu->SetShowState(true);
12473 _pListViewGeneralTabMainMenu->SetBounds(rectList);
12476 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
12477 _pListViewGeneralTabMainMenu->UpdateList();
12478 AppLogDebug("EXIT");
12482 CamcorderForm::MakeGeneralTabMenuString(void)
12484 AppLogDebug("ENTER");
12487 result r = E_SUCCESS;
12488 AppResource* pAppResource = null;
12490 if (__pSettingGeneralMenuString == null)
12492 pAppResource = Application::GetInstance()->GetAppResource();
12493 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
12495 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
12497 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
12499 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
12501 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
12502 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
12505 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
12506 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
12508 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
12509 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
12510 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
12511 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
12512 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
12513 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
12514 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
12515 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
12517 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
12518 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
12519 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
12520 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
12521 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
12522 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
12524 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
12525 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
12526 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
12527 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
12528 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
12529 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
12531 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
12532 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
12534 //pAppResource->GetString(IDS_CAM_OVERLAY_HELP_VALUE, tmpString);
12535 //__pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
12536 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
12539 AppLogDebug("EXIT");
12543 if (__pSettingGeneralMenuString)
12545 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
12547 if (__pSettingGeneralMenuString[idx])
12549 delete [] __pSettingGeneralMenuString[idx];
12550 __pSettingGeneralMenuString[idx] = null;
12558 delete __pSettingGeneralMenuString;
12559 __pSettingGeneralMenuString = null;
12566 CamcorderForm::GetGeneralTabSettingMainMenuCount(void) const
12568 AppLogDebug("ENTER");
12569 AppLogDebug("EXIT");
12570 return __generalTabMainMenuCount;
12574 CamcorderForm::SetGeneralTabSettingMainMenuCount(int count)
12576 AppLogDebug("ENTER");
12577 __generalTabMainMenuCount = count;
12578 AppLogDebug("EXIT");
12582 CamcorderForm::GetGeneralTabSettingSubMenuCount(void) const
12584 AppLogDebug("ENTER");
12585 AppLogDebug("EXIT");
12586 return __generalTabSubMenuCount;
12590 CamcorderForm::SetGeneralTabSettingSubMenuCount(int count)
12592 AppLogDebug("ENTER");
12593 __generalTabSubMenuCount = count;
12594 AppLogDebug("EXIT");
12597 inline CamcorderGeneralTabSubMenuContent
12598 CamcorderForm::GetGeneralTabSettingSubMenuMode(void) const
12600 AppLogDebug("ENTER");
12601 AppLogDebug("EXIT");
12602 return __generalTabSettingMode;
12606 CamcorderForm::SetSettingGenSubMenuMode(const CamcorderGeneralTabSubMenuContent mode)
12608 AppLogDebug("ENTER");
12609 AppLogDebug("EXIT");
12610 __generalTabSettingMode = mode;
12614 CamcorderForm::SetGeneralTabSubMenuListviewState(const int menuCount, const CamcorderGeneralTabSubMenuContent mode)
12616 AppLogDebug("ENTER");
12617 SetGeneralTabSettingSubMenuCount(menuCount);
12618 SetSettingGenSubMenuMode(mode);
12619 AppLogDebug("EXIT");
12623 CamcorderForm::GetCamcorderTabSettingMainMenuCount(void) const
12625 AppLogDebug("ENTER");
12626 AppLogDebug("EXIT");
12627 return __camcoderTabMainMenuCount;
12631 CamcorderForm::SetCamcorderTabSettingMainMenuCount(int count)
12633 AppLogDebug("ENTER");
12634 __camcoderTabMainMenuCount = count;
12635 AppLogDebug("EXIT");
12639 CamcorderForm::GetCamcorderTabSettingSubMenuCount(void) const
12641 AppLogDebug("ENTER");
12642 AppLogDebug("EXIT");
12643 return __camcoderTabSubMenuCount;
12647 CamcorderForm::SetCamcorderTabSettingSubMenuCount(int count)
12649 AppLogDebug("ENTER");
12650 __camcoderTabSubMenuCount = count;
12651 AppLogDebug("EXIT");
12654 inline CamcorderTabSubMenuContent
12655 CamcorderForm::GetCamcorderTabSettingSubMenuMode(void) const
12657 AppLogDebug("ENTER");
12658 AppLogDebug("EXIT");
12659 return __camcoderTabSettingMode;
12663 CamcorderForm::SetCamcorderTabSettingSubMenuMode(const CamcorderTabSubMenuContent mode)
12665 AppLogDebug("ENTER");
12666 AppLogDebug("EXIT");
12667 __camcoderTabSettingMode = mode;
12671 CamcorderForm::SetCamcorderTabSubMenuListviewState(const int menuCount, const CamcorderTabSubMenuContent mode)
12673 AppLogDebug("ENTER");
12674 SetCamcorderTabSettingSubMenuCount(menuCount);
12675 SetCamcorderTabSettingSubMenuMode(mode);
12676 AppLogDebug("EXIT");
12680 CamcorderForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
12682 AppLogDebug("ENTER");
12683 CustomItem* pItem = null;
12684 Bitmap* pBitmap = null;
12685 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
12686 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
12687 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
12688 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
12689 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
12690 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
12691 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
12692 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
12694 AppResource* pAppResource = null;
12696 result r = E_SUCCESS;
12700 CamcorderGeneralTabSubMenuContent idx = CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX;
12702 pItem = new (std::nothrow) CustomItem();
12703 TryCatch(pItem != null,,"Failed to allocate memory for CustomItem");
12705 pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12706 TryCatch(r == E_SUCCESS,,"Failed to construct CustomItem");
12708 pAppResource = Application::GetInstance()->GetAppResource();
12709 TryCatch(pAppResource != null,,"pAppResource is null");
12711 idx = GetGeneralTabSettingSubMenuMode();
12714 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
12716 ResourceId resId = RESOURCE_ID_TIMER_OFF;
12720 case SETTING_TIMER_RECORD_0_SEC:
12722 resId = RESOURCE_ID_TIMER_OFF;
12726 case SETTING_TIMER_RECORD_2_SEC:
12728 resId = RESOURCE_ID_TIMER_2SEC;
12732 case SETTING_TIMER_RECORD_5_SEC:
12734 resId = RESOURCE_ID_TIMER_5SEC;
12738 case SETTING_TIMER_RECORD_10_SEC:
12740 resId = RESOURCE_ID_TIMER_10SEC;
12748 String arrString[] =
12751 IDS_CAM_BODY_2_SEC,
12752 IDS_CAM_BODY_5_SEC,
12753 IDS_CAM_BODY_10_SEC,
12756 pAppResource->GetString(arrString[index], tmpString);
12758 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
12759 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12761 if (index == regVal)
12763 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12767 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12769 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12771 elementId = (index * MENU_TWO_ELEMENT);
12773 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12774 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12777 pBitmap = ResourceManager::GetBitmapN(resId);
12779 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12780 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12781 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12786 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12787 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12791 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
12793 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
12797 case SUBMENU_GUIDELINE_OFF:
12799 resId = RESOURCE_ID_GUIDELINE_OFF;
12803 case SUBMENU_GUIDELINE_ON:
12805 resId = RESOURCE_ID_GUIDELINE_ON;
12813 elementId = (index * MENU_TWO_ELEMENT);
12815 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
12816 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12818 if (index == regVal)
12820 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12824 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12826 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12828 if (index == SUBMENU_MODE_OFF)
12830 str = IDS_CAM_BODY_OFF;
12834 str = IDS_CAM_BODY_ON;
12837 pAppResource->GetString(str, tmpString);
12839 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12840 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12847 pBitmap = ResourceManager::GetBitmapN(resId);
12848 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12850 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12851 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12858 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12859 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12863 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
12865 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
12869 case SUBMENU_MODE_OFF:
12871 resId = RESOURCE_ID_STORAGE_PHONE;
12875 case SUBMENU_MODE_ON:
12877 resId = RESOURCE_ID_STORAGE_CARD;
12885 elementId = (index * MENU_TWO_ELEMENT);
12887 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
12888 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12890 if (index == regVal)
12892 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12896 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12898 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12900 if (index == STORAGE_TYPE_PHONE)
12902 str = IDS_CAM_BODY_PHONE;
12906 str = IDS_CAM_OPT_MEMORY_CARD;
12909 pAppResource->GetString(str, tmpString);
12911 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12912 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12918 pBitmap = ResourceManager::GetBitmapN(resId);
12919 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12921 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12922 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12929 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
12931 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
12933 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
12937 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12942 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_SUB_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12944 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12948 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
12957 AppLogDebug("EXIT");
12967 AppLogDebug("EXIT - CATCH : pItem is null or not CreateGeneralTabSubMenuItem");
12972 CamcorderForm::SetOverlayPanelChangeMode(bool isMode)
12974 AppLogDebug("ENTER");
12975 Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
12977 if (isMode == true)
12979 SetOverlayPanelWideMode(false);
12981 SetOverlayRendererRotation();
12983 __screenMode = SCREEN_MODE_FULL;
12985 HidePanel(true, false);
12987 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
12994 HidePanel(false, false);
12996 SetOverlayPanelWideMode(false);
12998 SetOverlayRendererRotation();
13000 __screenMode = SCREEN_MODE_NORMAL;
13002 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
13007 AppLogDebug("EXIT");
13011 CamcorderForm::InitializePopup(void)
13013 AppLogDebug("ENTER");
13014 AppResource* pAppResource = null;
13015 String strTitle = L"";
13016 String okString = L"";
13017 String cancelString = L"";
13018 result r = E_SUCCESS;
13019 Label* pTitleLabel = null;
13020 Button* pOkButton = null;
13021 Button* pCancelButton = null;
13023 if (__pCancelPopup == null)
13025 pAppResource = Application::GetInstance()->GetAppResource();
13026 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
13028 __pCancelPopup = new (std::nothrow) Popup();
13029 r = __pCancelPopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
13030 TryCatch(r == E_SUCCESS, , "__pCancelPopup::Construct() Failed:%s", GetErrorMessage(r));
13032 Rectangle popupClientBounds = __pCancelPopup->GetClientAreaBounds();
13033 pTitleLabel = new (std::nothrow) Label();
13034 pAppResource->GetString(L"IDS_CAM_BODY_CANCEL_RECORDING_Q", strTitle);
13036 r = pTitleLabel->Construct(Rectangle(X_BASE_POS, Y_BASE_POS, popupClientBounds.width, H_DELETE_LABEL), strTitle);
13037 TryCatch(r == E_SUCCESS, , "pTitleLabel::Construct() fail[%s]", GetErrorMessage(r));
13039 pTitleLabel->SetTextConfig(FONT_SIZE_CANCEL_CONFIRM, LABEL_TEXT_STYLE_NORMAL);
13040 pTitleLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
13041 pTitleLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
13043 pOkButton = new (std::nothrow) Button();
13044 pAppResource->GetString(L"IDS_COM_SK_OK", okString);
13045 r = pOkButton->Construct(Rectangle(X_BASE_POS, Y_DELETE_BUTTON, popupClientBounds.width / DIVIDE_BY_TWO - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), okString);
13046 TryCatch(r == E_SUCCESS, r = E_OUT_OF_MEMORY, "Unable to construct pOkButton button.\n");
13048 pOkButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_CANCEL_BUTTON_NORMAL);
13049 pOkButton->SetTextColor(COLOR_CANCEL_BUTTON_TEXT);
13050 pOkButton->SetTextSize(FONT_SIZE_CANCEL_BUTTON);
13051 pOkButton->SetActionId(IDA_BUTTON_RECORDING_POPUP_OK);
13052 pOkButton->AddActionEventListener(*this);
13054 pCancelButton = new (std::nothrow) Button();
13055 pAppResource->GetString(L"IDS_COM_POP_CANCEL", cancelString);
13056 r = pCancelButton->Construct(Rectangle(popupClientBounds.width / DIVIDE_BY_TWO + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON, popupClientBounds.width / DIVIDE_BY_TWO - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), cancelString);
13057 TryCatch(r == E_SUCCESS, r = E_OUT_OF_MEMORY, "Unable to construct pCancelButton button.\n");
13059 pCancelButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_CANCEL_BUTTON_NORMAL);
13060 pCancelButton->SetTextColor(COLOR_CANCEL_BUTTON_TEXT);
13061 pCancelButton->SetTextSize(FONT_SIZE_CANCEL_BUTTON);
13062 pCancelButton->SetActionId(IDA_BUTTON_RECORDING_POPUP_CANCEL);
13063 pCancelButton->AddActionEventListener(*this);
13065 __pCancelPopup->AddControl(pTitleLabel);
13066 __pCancelPopup->AddControl(pOkButton);
13067 __pCancelPopup->AddControl(pCancelButton);
13071 __pCancelPopup->SetShowState(true);
13072 __pCancelPopup->Show();
13074 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
13078 delete pTitleLabel;
13079 pTitleLabel = null;
13084 delete pCancelButton;
13085 pCancelButton = null;
13090 CamcorderForm::ReInitialise(void)
13092 result r = E_SUCCESS;
13093 BufferInfo bufferinfo;
13094 AppLogDebug("Camera State is %d",_pCameraPresentationModel->GetCameraState());
13095 AppLogDebug("Video State is %d",_pCameraPresentationModel->GetRecorderState());
13096 _pCameraPresentationModel->StopCamera();
13097 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
13099 if (pApp->GetAppUiState() == APP_UI_STATE_FOREGROUND)
13101 r = _pCameraPresentationModel->InitializeCamcorder();
13102 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
13103 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
13104 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
13106 _pCameraPresentationModel->StartPreview(&bufferinfo);
13107 _pCameraPresentationModel->SetContinuousAutoFocus();
13112 CamcorderForm::UpdatePopUp(void)
13114 bool doHidePopup = false;
13115 MakeSettingPopupTab(false);
13117 doHidePopup = OnTouchDoHidePopup();
13118 AppLogDebug("doHidePopup = %d", doHidePopup);
13126 CamcorderForm::OnKeyLongPressed(const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
13128 AppLogDebug("ENTER");
13129 AppLogDebug("EXIT");
13133 CamcorderForm::OnKeyPressed(const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
13135 AppLogDebug("ENTER");
13136 AppLogDebug("EXIT");
13140 CamcorderForm::OnKeyReleased(const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
13142 AppLogDebug("ENTER");
13143 AppLogDebug("source name is %ls",source.GetName().GetPointer());
13144 AppLogDebug("keyCode is %d",keyCode);
13145 result r = E_SUCCESS;
13146 int timerIntervalVale = 0;
13148 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
13149 AppLogDebug("Getvalue result is %s",GetErrorMessage(r));
13150 if (keyCode == KEY_CLEAR)
13152 AppLogDebug("timerIntervalVale is %d",timerIntervalVale);
13153 if (_timeCount == INDEX_UNIT_ZERO)
13155 BackButtonPerformed();
13158 AppLogDebug("EXIT");
13162 CamcorderForm::ShowMemoryFull(void)
13164 MessageBox messageBox;
13165 result r = E_SUCCESS;
13167 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
13168 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
13170 r = messageBox.ShowAndWait(result);