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 SCREEN_OVERLAY_HELP_ENABLE = 1;
289 static const int SCREEN_OVERLAY_HELP_DISABLE = 0;
291 static const int GAP_W_POPUP_ITEM = 5;
292 static const int W_DELETE_POPUP = 688;
293 static const int H_DELETE_POPUP = 204;
294 static const int H_DELETE_LABEL = 94;
295 static const int Y_DELETE_BUTTON = 114;
296 static const int H_DELETE_BUTTON = 74;
298 static const int SUPPORTED_CAMERA_NUM = 1;
300 static const int BRIGHTNESS_DIVIDER_PORTRAIT_MODE = 31;
302 static const wchar_t* IDS_MENU_SETTING_MAIN_MENU_NAME = L"SettingMainMenu";
303 static const wchar_t* IDS_MENU_SETTING_GEN_MAIN_MENU_NAME = L"SettingGenMainMenu";
304 static const wchar_t* IDS_GENERAL_SETTING_SUB_MENU= L"GeneralSettingsSubMenu";
305 static const wchar_t* IDS_CAMERA_SETTING_SUB_MENU= L"CameraSettingsSubMenu";
306 static const wchar_t* IDS_MENU_FLASH_MENU_NAME = L"FlashMenu";
307 static const wchar_t* IDS_MENU_WB_MENU_NAME = L"WBMenu";
308 static const wchar_t* IDS_WB_BUTTON_NAME = L"WhiteBalanceButton";
309 static const wchar_t* IDS_FLASH_BUTTON_NAME = L"FlashButton";
310 static const wchar_t* IDS_RECORDE_BUTTON_NAME = L"RecordButton";
311 static const wchar_t* IDS_THUMBNAIL_PANLE_NAME = L"ThumbnailPanel";
312 static const wchar_t* IDS_SETTING_UI_PANEL_NAME = L"SettingPanel";
313 static const wchar_t* IDS_ACTION_UI_PANEL_NAME = L"ActionPanel";
314 static const wchar_t* IDS_ACTION_UI_CAMCORDER_MODE = L"ActionCamcorderMode";
315 static const wchar_t* IDS_INIT_REG_KEY = L"NONE";
316 static const wchar_t* IDS_CAMERA_INFO_PANEL_NAME = L"CameraInfoPanel";
318 static const wchar_t* INIT_REC_TIME = L"00:00";
319 static const wchar_t* INIT_MAX_REC_TIME = L"00:00";
320 static const wchar_t* INIT_REC_SIZE = L"0000M";
322 CamcorderForm::CamcorderForm(void)
323 : __screenMode(SCREEN_MODE_NORMAL)
324 , __pOverlayPanel(null)
325 , __pRecordTimer(null)
326 , __camcoderTabMainMenuCount(MENU_MODE_DISABLE)
327 , __camcoderTabSubMenuCount(MENU_MODE_DISABLE)
328 , __camcoderTabSettingMode(CAMCORDER_SUB_MENU_CONTENT_MAX)
329 , __generalTabMainMenuCount(MENU_MODE_DISABLE)
330 , __generalTabSubMenuCount(MENU_MODE_DISABLE)
331 , __generalTabSettingMode(CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX)
332 , __settingIsoIndex(0)
333 , __settingWhiteBalance(0)
334 , __settingTimeInterval(0)
335 , __settingExposure(0)
336 , __recordTimeCount(0)
337 , __recordingMaxTime(0)
338 , _closeTimerValue(0)
339 , __previewResolutionWidth(0)
340 , __previewResolutionHeight(0)
341 , __pRecordingResolutionWidth(0)
342 , __pRecordingResolutionHeight(0)
343 , __pRecordingResolutionIndex(0)
344 , __lowMemoryCapacity(false)
345 , __isMemoryFull(false)
346 , __isLockScreenMode(false)
347 , __isOrientationChanged(false)
348 , __doRecording(false)
349 ,__recorderStopped(true)
350 , __pSettingPanel(null)
351 , __pActionPanel(null)
352 , __dir(ORIENTATION_STATUS_NONE)
353 , __pSettingLine(null)
354 , __pCameraIconLabel(null)
355 , __pCamcoderIconLabel(null)
356 , __pRecordButton(null)
357 , __pThumbnailButton(null)
358 , __pBatteryState(null)
359 , __pRecLabelRed(null)
360 , __pRecLabelText(null)
361 , __pElapsedTimeLable(null)
362 , __pElapsedTimeMaxLable(null)
363 , __pElapsedRecordSizeLable(null)
364 , __pButtonPoint(Point(0, 0))
365 , __pSettingMenuString(null)
366 , __pSettingGeneralMenuString(null)
367 , __pCameraStarterThread(null)
369 , __pRecordingResolutionList(null)
370 , __pCamcoderSetting(null)
371 , __pGeneralSetting(null)
372 , __pCamcorderSettingLable(null)
373 , __pGeneralSettingLable(null)
374 , __pFileEventManager(null)
377 , __isCapacityBelow(false)
378 , __pCancelPopup(null)
379 , __setTimerInterval(false)
380 , __pRecordPauseBitmap(null)
382 AppLogDebug("ENTER");
386 CamcorderForm::~CamcorderForm(void)
388 AppLogDebug("ENTER");
393 CamcorderForm::OnInitializing(void)
395 AppLogDebug("ENTER");
396 result r = E_SUCCESS;
397 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
398 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
399 int storageType = STORAGE_TYPE_PHONE;
400 int timerInterval = 0;
401 Point currentPosition;
402 String filePath = L"";
404 _appControlActionCompleted = false;
406 SetFormBackEventListener(this);
408 AddOrientationEventListener(*this);
409 SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
410 __dir = GetOrientationStatus();
412 _pCameraPresentationModel->SetOrientation(__dir);
415 InitPreviewFailPopupTimer();
418 InitChargingCompletedTimer();
419 _pCurrentSourceForm = SOURCE_FORM_CAMCORDER;
421 _pCameraInfoPanel = new (std::nothrow) CameraInfoPanel();
422 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
424 if (__dir == ORIENTATION_STATUS_PORTRAIT
425 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
427 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
428 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
429 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
433 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
434 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
435 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
438 if (__dir == ORIENTATION_STATUS_PORTRAIT
439 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
441 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
445 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
448 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
451 storageType = STORAGE_TYPE_PHONE;
454 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
456 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
457 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
458 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
461 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
462 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
464 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
465 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
467 r = _pCameraInfoPanel->Initialize(rect);
468 TryCatch(r == E_SUCCESS, , "_pCameraInfoPanel Initialize fail[%s]", GetErrorMessage(r));
471 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
472 _pCameraInfoPanel->SetDrawMarkerFocus(true);
473 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
474 _pCameraInfoPanel->SetCurrentMode(CameraPresentationModel::CAMERA_MODE_RECORD);
475 _pCameraInfoPanel->SetStorageType(storageType);
476 _pCameraInfoPanel->SetTimerType(timerInterval);
477 _pCameraInfoPanel->SetDrawIndicator(true);
478 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
479 _pCameraInfoPanel->AddTouchEventListener(*this);
480 _pCameraInfoPanel->SetName(IDS_CAMERA_INFO_PANEL_NAME);
481 AddOrientationEventListener(*_pCameraInfoPanel);
482 AddControl(_pCameraInfoPanel);
483 SetControlAlwaysOnTop(*_pCameraInfoPanel, true);
485 SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
486 r = InitSettingMenuPanel();
487 //TryCatch(r == E_SUCCESS, , "InitSettingMenuPanel() fail[%s]", GetErrorMessage(r));
489 r = InitActionMenuPanel();
490 TryCatch(r == E_SUCCESS, , "InitActionMenuPanel() fail[%s]", GetErrorMessage(r));
494 __pRecLabelRed->SetShowState(false);
495 __pRecLabelRed->Invalidate(true);
500 __pRecLabelText->SetShowState(false);
501 __pRecLabelText->Invalidate(true);
504 InitScreenOverlayHelp();
505 CheckBatteryStatus();
509 _pResetPopUp = new (std::nothrow) Popup();
510 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
511 ResetPopupRect = _pResetPopUp->GetBounds();
516 r = InitializePopup();
518 CancelPopupRect = __pCancelPopup->GetBounds();
520 AppLogDebug("InitializePopup()fail[%s]", GetErrorMessage(r));
522 __pFileEventManager = new (std::nothrow) FileEventManager();
523 r = __pFileEventManager->Construct(*this);
524 TryCatch(r == E_SUCCESS, , "Construct() fail[%s]", GetErrorMessage(r));
526 filePath = _pCameraPresentationModel->GetfilePath(storageType);
527 AppLogDebug("filePath %ls", filePath.GetPointer());
529 if (File::IsFileExist(filePath))
531 __pFileEventPath = filePath;
532 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MOVE_SELF);
533 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
540 delete _pCameraInfoPanel;
542 ShowCameraFailPopup();
544 AppLogDebug("EXIT - CATCH");
549 CamcorderForm::OnTerminating(void)
551 AppLogDebug("ENTER");
552 result r = E_SUCCESS;
554 _pCameraPresentationModel->KeepScreenOnState(false, true);
556 _pCameraPresentationModel->RemovePresentationChangedEventListener(null);
558 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
560 __lowMemoryCapacity = false;
562 __doRecording = false;
564 __setTimerInterval = false;
566 _pCameraPresentationModel->SetIntervalTimerRun(false);
568 __isCapacityBelow = false;
570 RemoveAllEventListener();
572 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
574 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
575 AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
577 if (__isLockScreenMode)
579 AppLogDebug("OnTerminating KEY_POWER_HOLD");
580 __isLockScreenMode = false;
583 __isOrientationChanged = false;
585 __screenMode = SCREEN_MODE_NORMAL;
587 _pCameraPresentationModel = null;
588 __pCameraStarterThread = null;
593 if (__pRecordPauseBitmap)
595 delete __pRecordPauseBitmap;
598 if (__pSettingMenuString)
601 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
603 delete [] __pSettingMenuString[idx];
605 delete __pSettingMenuString;
608 if (__pSettingGeneralMenuString)
611 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
613 delete [] __pSettingGeneralMenuString[idx];
615 delete __pSettingGeneralMenuString;
618 if (__pRecordingResolutionList)
620 __pRecordingResolutionList->RemoveAll(true);
621 delete __pRecordingResolutionList;
625 if (__pFileEventManager != null)
627 delete __pFileEventManager;
628 __pFileEventManager = null;
636 CamcorderForm::SetStartRecording(void)
638 AppLogDebug("ENTER");
639 result r = E_SUCCESS;
640 int timerInterval = 0;
642 timerInterval = GetTimerIntervalValue();
644 switch (timerInterval)
646 case SETTING_TIMER_RECORD_0_SEC:
648 if (_pIntervalValueTimer)
650 _pIntervalValueTimer->Cancel();
654 __setTimerInterval = false;
656 _pCameraPresentationModel->SetIntervalTimerRun(false);
658 _pCameraPresentationModel->StartRecord();
659 r = StartRecordTimer();
660 TryReturnVoid(r == E_SUCCESS, "StartRecordTimer() fail[%s]", GetErrorMessage(r));
662 r = SetRecordButton(true);
663 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
665 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
667 _pCameraInfoPanel->SetDrawPopupTimer(false);
669 _pCameraInfoPanel->Invalidate(true);
674 AutoFocusPerformed();
676 StartInitChargingTimer();
680 case SETTING_TIMER_RECORD_2_SEC:
682 case SETTING_TIMER_RECORD_5_SEC:
684 case SETTING_TIMER_RECORD_10_SEC:
686 if (__pRecordButton->GetShowState())
688 __pRecordButton->SetShowState(false);
691 r = SetRecordStartTimer(timerInterval);
692 TryReturnVoid(r == E_SUCCESS, "SetRecordStartTimer() fail[%s]", GetErrorMessage(r));
694 __setTimerInterval = true;
695 _pCameraPresentationModel->SetIntervalTimerRun(true);
699 r = DrawTimerPopup();
700 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
711 CamcorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
713 AppLogDebug("ENTER");
714 bool onVideoRecorderStopped = false;
715 result r = E_SUCCESS;
716 int selfPortraitEnable = 0;
717 int guideLineEnable = 0;
721 case IDA_BUTTON_CAMCORDER_FLASH:
723 int selfPortraitEnable = 0;
724 result r = E_SUCCESS;
726 bool isCharging = false;
727 BatteryLevel batteryLevel;
729 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
730 isCharging = _pCameraPresentationModel->IsCharging();
732 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
736 selfPortraitEnable = 0;
739 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
741 AppLogDebug("FLASEH OFF!!!");
745 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
747 if (value == true && r == E_SUCCESS)
749 if (batteryLevel == BATTERY_LOW && isCharging == false)
754 AppResource* pAppResource = null;
756 pAppResource = Application::GetInstance()->GetAppResource();
757 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
759 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
761 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
762 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
763 msgBox.ShowAndWait(result);
772 AppLogDebug("FLASEH OFF!!!");
778 case IDA_BUTTON_CAMCORDER_SETTING:
780 result r = E_SUCCESS;
782 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
783 _pAppTimer->Cancel();
785 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
786 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
792 case IDA_BUTTON_CLOSE_SETTING:
794 result r = E_SUCCESS;
796 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
797 _pAppTimer->Cancel();
799 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
800 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
806 case IDA_BUTTON_CAMCORDER_QUICK_SETTING:
808 result r = E_SUCCESS;
810 int selfPortraitEnable = 0;
813 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
814 _pAppTimer->Cancel();
816 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
817 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
819 MakeCamcoderTabSettingPopup();
821 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
823 if (_pListViewCameraTabMainMenu != null)
825 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
827 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
831 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
834 if (__pRecordingResolutionList != null)
836 if (!(__pRecordingResolutionList->GetCount()>1) || r != E_SUCCESS)
838 _pListViewCameraTabMainMenu->SetItemEnabled(0,false);
843 _pListViewCameraTabMainMenu->SetItemEnabled(0,false);
846 _pListViewCameraTabMainMenu->SetItemEnabled(1,false);
852 case IDA_BUTTON_SETTING_CAMCODER:
854 result r = E_SUCCESS;
856 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
857 _pAppTimer->Cancel();
859 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
860 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
862 if (_pListViewGeneralTabMainMenu)
864 _pListViewGeneralTabMainMenu->SetShowState(false);
867 if (_pListViewGeneralTabSubMenu)
869 _pListViewGeneralTabSubMenu->SetShowState(false);
872 MakeCamcoderTabSettingPopup();
876 case IDA_BUTTON_SETTING_GENERAL:
878 result r = E_SUCCESS;
880 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
881 _pAppTimer->Cancel();
883 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
884 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
886 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
888 if (_pListViewCameraTabMainMenu)
890 _pListViewCameraTabMainMenu->SetShowState(false);
892 if (_pListViewCameraTabSubMenu)
894 _pListViewCameraTabSubMenu->SetShowState(false);
897 MakeGeneralTabSettingPopup();
901 case IDA_BUTTON_CAMCORDER_SELF:
903 result r = E_SUCCESS;
906 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
908 AppLogDebug("Camera Preview is not");
912 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
913 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
914 if (cameraCount < SUPPORTED_CAMERA_NUM)
916 AppLogDebug("The physical direction of the camera is not exit");
920 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
922 MakeSettingPopupTab(false);
926 if (onVideoRecorderStopped == false)
929 MakeRecordingResolutionList(true);
938 case IDA_BUTTON_CAMERA_EV:
940 if (_pCameraInfoPanel->GetDrawExposure() == true)
942 AppLogDebug("Draw is Exposure status");
946 ExposureValuePerformed();
950 case IDA_BUTTON_CAMERA_WB:
952 result r = E_SUCCESS;
953 int selfPortraitEnable = 0;
955 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
956 _pAppTimer->Cancel();
958 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
959 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
961 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
962 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
964 if (_pCameraInfoPanel->GetDrawExposure() == true)
966 _closeTimerValue = 0;
968 if (_pExposureCloseTimer)
970 _pExposureCloseTimer->Cancel();
973 _pCameraInfoPanel->SetDrawExposure(false);
977 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
979 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
983 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
988 SetWhiteBalancePopop();
992 AppLogDebug("WB is not support");
997 case IDA_BUTTON_CAMCORDER_AUTO_FOCUS:
999 //AutoFocusPerformed();
1003 case IDA_BUTTON_CAMCORDER_THUMBNAIL:
1008 case IDA_BUTTON_RECORDING_POPUP_OK:
1010 result r = E_SUCCESS;
1011 AppLogDebug("IDA_BUTTON_RECORDING_POPUP_OK");
1013 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1014 _pAppTimer->Cancel();
1016 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
1017 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
1021 __pCancelPopup->SetShowState(false);
1022 __pCancelPopup->Invalidate(true);
1028 __recorderStopped = true;
1033 case IDA_BUTTON_RECORDING_POPUP_CANCEL:
1039 case IDA_BUTTON_CAMCORDER_BACK:
1041 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
1042 result r = E_SUCCESS;
1044 r = BackButtonPerformed();
1045 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
1051 AppLogDebug("ResetPopup : yes");
1052 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1054 _pResetPopUp->SetShowState(false);
1056 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
1057 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
1059 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
1061 r = DrawMarker(false);
1062 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
1064 SetGuideLine(REG_DEFAULT_VALUE_ZERO);
1067 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
1068 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
1070 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
1072 BufferInfo bufferinfo;
1074 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
1076 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
1077 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
1079 r = ToggleCameraDirection(CAMCORDER_FORM_PRIMARY_MODE);
1080 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
1082 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1083 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1085 _pCameraPresentationModel->StartPreview(&bufferinfo);
1087 _pCameraPresentationModel->SetContinuousAutoFocus();
1090 RestoreDefaultSetting();
1092 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1093 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
1095 MakeRecordingResolutionList(true);
1097 MakeSettingPopupTab(false);
1101 r = UpdateUiPanelIcon();
1102 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
1104 r = SetScreenOverlayHelpTimer();
1105 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
1107 r = DrawScreenOverlayHelp();
1108 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
1110 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
1111 _pFlashButton->Invalidate(true);
1118 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1120 _pResetPopUp->SetShowState(false);
1122 MakeSettingPopupTab(false);
1123 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
1128 case IDA_BUTTON_CAMCORDER_SHUTTER:
1130 result r = E_SUCCESS;
1132 r = _pCameraPresentationModel->SetFlashModeOnRecord(true);
1134 if (r == E_INVALID_STATE)
1136 AppLogDebug("Flash mode cannot be set: state invalid");
1140 MakeSettingPopupTab(false);
1141 if (_isRecording == false)
1143 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW
1144 && _pCameraPresentationModel->GetCameraState() != CAMERA_STATE_AUTO_FOCUSING
1147 AppLogDebug("It is trying to start the recording ");
1151 AppLogDebug("DoRecording");
1153 _pCameraPresentationModel->SetMemoryFullException(true);
1158 AppLogDebug("DoStopRecording");
1159 __recorderStopped = true;
1160 _pCameraPresentationModel->SetMemoryFullException(false);
1169 AppLogDebug("EXIT");
1173 CamcorderForm::SetUri(const Tizen::Base::String& uri)
1175 AppLogDebug("ENTER");
1176 AppLogDebug("[URI] %ls", uri.GetPointer());
1177 __uri = String(uri);
1178 AppLogDebug("EXIT");
1182 CamcorderForm::SetMime(const Tizen::Base::String& mime)
1184 AppLogDebug("ENTER");
1185 AppLogDebug("[MIME] %ls", mime.GetPointer());
1186 __mime = String(mime);
1187 AppLogDebug("EXIT");
1190 const Tizen::Base::String&
1191 CamcorderForm::GetUri(void) const
1193 AppLogDebug("ENTER");
1194 AppLogDebug("EXIT");
1198 const Tizen::Base::String&
1199 CamcorderForm::GetMime(void) const
1201 AppLogDebug("ENTER");
1202 AppLogDebug("EXIT");
1207 CamcorderForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
1209 AppLogDebug("ENTER");
1210 if (_appControlActionCompleted)
1212 AppLogDebug("EXIT - App Terminate");
1215 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
1216 AppLogDebug("EXIT");
1220 CamcorderForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
1222 AppLogDebug("ENTER");
1223 bool isExistThumbnail = false;
1224 Bitmap* pBitmap = null;
1225 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
1227 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
1229 if (isExistThumbnail == false)
1231 AppLogDebug("Thumbnail is not found");
1233 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
1235 _pThumbnailPanel->SetShowState(false);
1236 __pThumbnailButton->SetShowState(true);
1238 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1239 TryReturnVoid(pBitmap != null, "pBitmap is null");
1241 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
1246 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1247 TryReturnVoid(pBitmap != null, "pBitmap is null");
1249 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
1259 AppLogDebug("pThumbnailBitmap is not null");
1261 AppLogDebug("EXIT");
1265 CamcorderForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
1267 AppLogDebug("ENTER");
1268 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
1269 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
1270 Rectangle clientRect = GetClientAreaBounds();
1272 Point currentPosition;
1273 result r = E_SUCCESS;
1275 int previewResolutionSize = 0;
1276 int storageType = STORAGE_TYPE_PHONE;
1277 bool isRunStartPreviewThread = false;
1278 BufferInfo bufferinfo;
1279 bool isInitCameraStaus = false;
1280 _isRecording = false;
1282 _isRecordingPause = false;
1284 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1285 _pAppTimer->Cancel();
1286 _pCameraPresentationModel->SetCurrentSourceForm(SOURCE_FORM_CAMCORDER);
1288 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
1289 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
1291 _batteryStatus = GetCurrentBatteryState();
1292 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
1294 StartPreviewFailPopupTimer();
1296 StartInitChargingTimer();
1298 _pCameraPresentationModel->AddPresentationChangedEventListener(*this);
1300 _pCameraPresentationModel->KeepScreenOnState(true, false);
1302 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
1303 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
1307 dim = _pCameraPresentationModel->GetPreviewResolution();
1308 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
1310 __previewResolutionWidth = dim.width;
1311 __previewResolutionHeight = dim.height;
1313 dim = _pCameraPresentationModel->GetRecordingResolution();
1314 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
1316 __pRecordingResolutionWidth = dim.width;
1317 __pRecordingResolutionHeight = dim.height;
1321 __pCancelPopup->SetShowState(false);
1322 __pCancelPopup->Invalidate(true);
1325 AppLogDebug("__screenMode [%d]", __screenMode);
1327 r = SetScreenMode(__screenMode, true);
1328 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
1330 if (__dir == ORIENTATION_STATUS_PORTRAIT
1331 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1333 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
1337 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
1340 if (__dir == ORIENTATION_STATUS_PORTRAIT
1341 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1343 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
1347 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
1350 r = SetRecordButton(false);
1351 AppLogDebug("SetRecordButton fail[%s]", GetErrorMessage(r));
1353 _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1355 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
1356 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
1358 if (regVal == DISABLE_GUIDELINE)
1369 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1371 _pCameraInfoPanel->SetDrawPopupTimer(false);
1373 _pCameraInfoPanel->Invalidate(true);
1376 MakeSettingPopupTab(false);
1382 __pRecLabelRed->SetShowState(false);
1383 __pRecLabelRed->Invalidate(true);
1386 if (__pRecLabelText)
1388 __pRecLabelText->SetShowState(false);
1389 __pRecLabelText->Invalidate(true);
1392 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1393 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
1395 if (isInitCameraStaus)
1397 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
1398 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
1400 if (isRunStartPreviewThread)
1402 r = RunStartPreviewThread();
1403 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
1405 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
1409 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1410 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1412 _pCameraPresentationModel->StartPreview(&bufferinfo);
1415 _pCameraPresentationModel->SetContinuousAutoFocus();
1417 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
1419 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
1421 SetCamcorderSettingsDevice();
1423 AppLogDebug("OnSceneActivatedN");
1426 r = CheckBatteryStatus();
1427 TryLog(r == E_SUCCESS, "Checked batter level successfull");
1428 if ( CheckCallStatus() == false)
1429 AppLogDebug("Call status InActive!");
1431 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
1432 TryLog(r == E_SUCCESS, " Get value failed for Storage Type!");
1434 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
1436 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
1437 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
1439 AppLogDebug("EXIT");
1443 CamcorderForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
1445 AppLogDebug("ENTER");
1446 _pCameraPresentationModel->KeepScreenOnState(false, true);
1448 _isRecording = false;
1450 _isRecordingPause = false;
1452 __isOrientationChanged = false;
1456 __setTimerInterval = false;
1457 _pCameraPresentationModel->SetIntervalTimerRun(false);
1463 _pAppTimer->Cancel();
1466 if (_pIntervalValueTimer)
1468 _pIntervalValueTimer->Cancel();
1471 if (_pChargingTimer)
1473 _pChargingTimer->Cancel();
1476 if (_pHelpCloseTimer)
1478 _pHelpCloseTimer->Cancel();
1485 __pCancelPopup->SetShowState(false);
1486 __pCancelPopup->Invalidate(true);
1489 OnHelpCloseTimerExpired();
1495 MakeSettingPopupTab(false);
1497 HideUiSettingMenu();
1499 if (__pOverlayPanel)
1501 RemoveControl(*__pOverlayPanel);
1502 __pOverlayPanel = null;
1505 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
1506 AppLogDebug("EXIT");
1510 CamcorderForm::Update(bool isInvalidated)
1512 AppLogDebug("ENTER");
1513 result r = E_SUCCESS;
1514 Bitmap* pThumbnailBitmap = null;
1515 Bitmap* pRotateBitmap = null;
1516 Bitmap* pBitmap = null;
1518 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1520 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1524 __pSwButton->SetShowState(false);
1529 if (__pCameraIconLabel)
1531 __pCameraIconLabel->SetShowState(true);
1534 if (__pCamcoderIconLabel)
1536 __pCamcoderIconLabel->SetShowState(true);
1541 __pSwButton->SetShowState(true);
1546 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
1548 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
1550 if (pThumbnailBitmap == null)
1552 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
1554 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1556 __pThumbnailButton->SetShowState(false);
1557 _pThumbnailPanel->SetShowState(false);
1561 _pThumbnailPanel->SetShowState(true);
1576 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
1577 ImageRotationType rotationType = IMAGE_ROTATION_0;
1579 if (__setTimerInterval || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1581 __pThumbnailButton->SetShowState(false);
1582 _pThumbnailPanel->SetShowState(false);
1586 _pThumbnailPanel->SetShowState(true);
1589 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
1590 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1592 rotationType = IMAGE_ROTATION_270;
1596 rotationType = IMAGE_ROTATION_0;
1599 pRotateBitmap = RotationImageN(pThumbnailBitmap, rotationType);
1600 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
1602 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
1603 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
1605 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
1607 delete pRotateBitmap;
1608 pRotateBitmap = null;
1623 AppLogDebug("CameraForm::Update :: Not thummail");
1624 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
1626 AppControlRequestHideButton();
1628 _pThumbnailPanel->SetShowState(false);
1632 _pThumbnailPanel->Invalidate(true);
1636 _pThumbnailPanel->Draw();
1637 _pThumbnailPanel->Show();
1650 TryCatch(__pThumbnailButton != null, , "__pThumbnailButton is null");
1652 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1653 TryCatch(pBitmap != null, , "pBitmap is null");
1655 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
1659 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1660 TryCatch(pBitmap != null, , "pBitmap is null");
1662 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
1668 AppLogDebug("EXIT");
1672 delete pRotateBitmap;
1673 pRotateBitmap = null;
1679 CamcorderForm::OnCameraActionRecorderClosed(void)
1681 AppLogDebug("ENTER");
1682 result r = E_SUCCESS;
1683 Bitmap* pThumbnailBitmap = null;
1684 Bitmap* pRotateBitmap = null;
1685 ImageRotationType rotationType = IMAGE_ROTATION_0;
1687 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
1688 TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
1690 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
1691 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1693 rotationType = IMAGE_ROTATION_270;
1697 rotationType = IMAGE_ROTATION_0;
1700 pRotateBitmap = RotationImageN(pThumbnailBitmap, rotationType);
1701 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
1703 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
1704 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
1706 _pThumbnailPanel->SetShowState(true);
1707 _pThumbnailPanel->Invalidate(true);
1708 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
1709 _pThumbnailPanel->SetDrawSliderImg();
1711 delete pRotateBitmap;
1712 pRotateBitmap = null;
1714 AppLogDebug("EXIT");
1718 delete pRotateBitmap;
1719 pRotateBitmap = null;
1725 CamcorderForm::OnCameraActionPerformed(CameraActionEvent event)
1727 AppLogDebug("ENTER");
1728 result r = E_SUCCESS;
1729 __doRecording = false;
1731 if (event != CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED)
1735 if (_pIntervalValueTimer)
1737 _pIntervalValueTimer->Cancel();
1742 _pPopupTimer->Cancel();
1745 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1747 _pCameraInfoPanel->SetDrawPopupTimer(false);
1749 _pCameraInfoPanel->Invalidate(true);
1752 AppLogDebug("OnCameraActionPerformed - event %d", event);
1756 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1758 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1759 DrawFocus(CAMERA_FOCUS_READY);
1763 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1765 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1766 if (_pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING)
1768 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED : NOT STATE_RECORDING");
1769 DrawFocus(CAMERA_FOCUS_READY);
1773 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED : STATE_RECORDING");
1774 DrawFocus(CAMERA_FOCUS_READY);
1775 InitMakerFocusTimer();
1777 _pMakerFocusTimer->Cancel();
1778 r = _pMakerFocusTimer->Start(CAMCORDER_TIMER_ONE_SEC);
1779 TryLog(r == E_SUCCESS , "Marker focus timer could not be started!");
1784 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1786 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1787 DrawFocus(CAMERA_FOCUS_FAIL);
1791 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_CANCELED:
1793 AppLogDebug("VIDEO_RECORDER_CANCELED_LISTENER.");
1794 StartInitAppTimer();
1796 _isRecording = false;
1797 __doRecording = false;
1801 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_PREVIEWED:
1803 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_RECORDER_PREVIEWED.");
1807 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_CLOSED:
1809 AppLogDebug("VIDEO_RECORDER_CLOSED_LISTENER.");
1810 int requestType = 0;
1811 result r = E_SUCCESS;
1812 bool isCharging = false;
1813 BatteryLevel batteryLevel;
1815 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1821 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
1823 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
1825 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1827 AppLogDebug("Recrrder after TerminateApp");
1828 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1829 pCameraApp->SetFrameEnabled(false);
1833 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1837 StartInitAppTimer();
1839 r = OnCameraActionRecorderClosed();
1840 TryReturnVoid(r == E_SUCCESS, "OnCameraActionRecorderClosed Fail[%]", GetErrorMessage(r));
1845 if (_pCameraPresentationModel->GetMemoryFullExceptionStatus())
1847 __recorderStopped = true;
1854 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1855 isCharging = _pCameraPresentationModel->IsCharging();
1857 AppLogDebug("batteryLevel = %d", batteryLevel);
1858 AppLogDebug("isCharging = %d", isCharging);
1860 if (isCharging == false)
1862 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1866 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1870 AppLogDebug("GetCameraState : %ld", _pCameraPresentationModel->GetCameraState());
1872 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
1875 if (UiApp::GetInstance()->GetAppUiState()== APP_UI_STATE_FOREGROUND)
1877 _pCameraPresentationModel->SetStartPreviewException(false);
1884 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_END_REACHED:
1886 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_RECORDER_END_REACHED.");
1887 int requestType = 0;
1888 result r = E_SUCCESS;
1890 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1896 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
1898 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1900 AppLogDebug("RECORDER_END_REACHED after TerminateApp");
1902 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1903 pCameraApp->SetFrameEnabled(false);
1906 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1910 AppLogDebug("RECORDER_END_REACHED");
1912 StartInitAppTimer();
1914 SetRecordEndReached();
1916 r = OnCameraActionRecorderClosed();
1917 TryReturnVoid(r == E_SUCCESS, "OnCameraActionRecorderClosed Fail[%]", GetErrorMessage(r));
1924 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_ERROR_OCCURRED:
1926 AppLogDebug("VIDEO_RECORDER_ERROR_OCCURRED_LISTENER.");
1927 RecorderErrorReason recorderErrorStatus = _pCameraPresentationModel->GetRecorderErrorStatus();
1928 AppLogDebug("Recorder error status is %ld",recorderErrorStatus);
1930 if (__pBatteryState != null)
1932 __pBatteryState->SetShowState(true);
1933 __pBatteryState->Draw();
1934 __pBatteryState->Show();
1937 AppLogDebug("Camcorder State = %d ", _pCameraPresentationModel->GetRecorderState());
1938 AppLogDebug("Camera State = %d ", _pCameraPresentationModel->GetCameraState());
1940 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1942 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED)
1944 AppLogDebug("Reinitialising the camcorder");
1950 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_ERROR)
1952 __recorderStopped = true;
1962 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_PAUSED:
1964 AppLogDebug("VIDEO_RECORDER_PAUSED_LISTENER.");
1965 StartInitAppTimer();
1969 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_STARTED:
1971 AppLogDebug("VIDEO_RECORDER_STARTED_LISTENER.");
1976 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_STOPPED:
1978 AppLogDebug("VIDEO_RECORDER_STOPPED_LISTENER.");
1982 __pCancelPopup->SetShowState(false);
1983 __pCancelPopup->Invalidate(true);
1987 if (!__recorderStopped)
1994 __recorderStopped = false;
2000 AppLogDebug("camera state is %ld",_pCameraPresentationModel->GetCameraState());
2002 StartInitAppTimer();
2006 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
2008 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
2009 bool isEnabled = false;
2010 bool isInitCameraStaus = false;
2012 bool isCharging = false;
2013 long long int mem = 0;
2014 BatteryLevel batteryLevel;
2016 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
2017 isEnabled = pCameraApp->IsFrameEnabled();
2019 if (isEnabled == false)
2021 pCameraApp->SetFrameEnabled(true);
2024 if (!__pRecordButton->GetShowState())
2026 __pRecordButton->SetShowState(true);
2029 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
2030 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
2032 if (isInitCameraStaus == false)
2034 AppLogDebug("InitCamera is fail");
2040 __pCancelPopup->SetShowState(false);
2041 __pCancelPopup->Invalidate(true);
2044 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2046 if (_pCameraPresentationModel->IsCameraPoweredOn())
2048 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED && CameraPoweredOn");
2050 if (__pBatteryState != null)
2052 __pBatteryState->SetShowState(true);
2053 __pBatteryState->Draw();
2054 __pBatteryState->Show();
2058 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
2060 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED)
2066 if (_pCameraPresentationModel->GetStartPreviewException() &&
2067 _pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW )
2070 _pCameraPresentationModel->SetStartPreviewException(false);
2074 mem = CmUtility::GetAvailableMemory();
2075 AppLogDebug("Available memory is : %lld", mem);
2077 if(mem < MIN_MEMORY_NEEDED)
2079 ShowMemoryFullPopup();
2083 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2084 isCharging = _pCameraPresentationModel->IsCharging();
2086 AppLogDebug("batteryLevel = %d", batteryLevel);
2087 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2089 if (isCharging == false)
2091 ShowLowBatteryPopup();
2098 if (!CheckCallStatus())
2100 GetCameraToForeground();
2103 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2104 isCharging = _pCameraPresentationModel->IsCharging();
2106 AppLogDebug("batteryLevel = %d", batteryLevel);
2107 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2109 if (isCharging == false)
2111 ShowLowBatteryPopup();
2116 CheckBatteryStatus();
2119 HideUiModeChangedButton();
2121 if (_pThumbnailPanel != null)
2123 _pThumbnailPanel->DeleteOldBitmap();
2130 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
2132 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
2133 bool isInitCameraStaus = false;
2135 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
2136 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
2138 _pCameraPresentationModel->SetMemoryFullException(false);
2139 if (isInitCameraStaus == false)
2141 AppLogDebug("InitCamera is fail");
2145 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2149 __pCancelPopup->SetShowState(false);
2150 __pCancelPopup->Invalidate(true);
2153 MakeSettingPopupTab(false);
2155 HideUiModeChangedButton();
2157 if (_pThumbnailPanel != null)
2159 _pThumbnailPanel->DeleteOldBitmap();
2163 InitElapsedTimeLable();
2164 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
2166 _pResetPopUp->SetShowState(false);
2168 SendCameraToBackground();
2172 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
2174 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
2176 ShowCameraFailPopup();
2180 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
2182 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
2184 if (CheckCallStatus())
2189 if (_pCameraPresentationModel->GetStartPreviewException())
2191 ShowCameraFailPopup();
2196 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
2198 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
2199 bool isCharging = false;
2200 BatteryLevel batteryLevel;
2201 result r = E_SUCCESS;
2203 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2204 isCharging = _pCameraPresentationModel->IsCharging();
2206 AppLogDebug("batteryLevel = %d", batteryLevel);
2207 AppLogDebug("isCharging = %d", isCharging);
2210 if (isCharging == false)
2212 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2214 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
2216 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2218 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
2219 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
2222 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
2224 _pCameraPresentationModel->StopRecord();
2225 _pCameraPresentationModel->UpdateContentFile();
2231 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
2236 CheckBatteryStatus();
2241 CheckBatteryStatus();
2246 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
2248 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
2250 _batteryStatus = GetCurrentBatteryState();
2252 AppLogDebug("batteryStatus = %d", _batteryStatus);
2254 CheckBatteryStatus();
2258 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
2260 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
2261 bool doHidePopup = false;
2262 int requestType = 0;
2263 result r = E_SUCCESS;
2265 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
2267 _pCameraInfoPanel->Invalidate(true);
2269 requestType = _pCameraPresentationModel->GetAppControlRequestType();
2270 if (__pCancelPopup != null)
2272 __pCancelPopup->SetShowState(false);
2273 __pCancelPopup->Invalidate(true);
2275 _pCameraPresentationModel->SetCancelRecord(true);
2279 _pAppTimer->Cancel();
2280 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
2289 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
2291 AppLogDebug("Camera Captured after TerminateApp");
2294 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
2298 AppLogDebug("recorderstate is %d",_pCameraPresentationModel->GetRecorderState());
2299 AppLogDebug("_isRecording is %d",_isRecording);
2300 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING
2301 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STOPPING)
2305 AppLogDebug("_isRecording");
2307 __doRecording = false;
2309 _isRecordingPause = false;
2311 __setTimerInterval = false;
2313 _pCameraPresentationModel->SetIntervalTimerRun(false);
2315 __recorderStopped = true;
2318 if (__pElapsedTimeLable)
2320 __pElapsedTimeLable->SetShowState(false);
2321 __pElapsedTimeLable->Invalidate(true);
2324 if (__pElapsedTimeMaxLable)
2326 __pElapsedTimeMaxLable->SetShowState(false);
2327 __pElapsedTimeMaxLable->Invalidate(true);
2330 if (__pElapsedRecordSizeLable)
2332 __pElapsedRecordSizeLable->SetShowState(false);
2333 __pElapsedRecordSizeLable->Invalidate(true);
2336 __pRecLabelRed->SetShowState(false);
2337 __pRecLabelRed->Invalidate(true);
2339 __pRecLabelText->SetShowState(false);
2340 __pRecLabelText->Invalidate(true);
2347 if (__setTimerInterval)
2349 AppLogDebug("__setTimerInterval");
2350 CancelTimerIntervalRecord();
2354 if (_pListViewCameraTabMainMenu != null)
2356 if (_pListViewCameraTabMainMenu->GetShowState() == true)
2362 if (_pListViewCameraTabSubMenu != null)
2364 if (_pListViewCameraTabSubMenu->GetShowState() == true)
2370 if (_pListViewGeneralTabMainMenu != null)
2372 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
2378 if (_pListViewGeneralTabSubMenu != null)
2380 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
2386 if (doHidePopup == true)
2397 case CAMERA_ACTION_EVENT_VIDEO_MAX_RECORDER_TIME_REACHED:
2399 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_MAX_RECORDER_TIME_REACHED");
2400 __recorderStopped = true;
2401 __doRecording = false;
2402 _isRecordingPause = false;
2403 _isRecording = false;
2404 __setTimerInterval = false;
2405 _pCameraPresentationModel->SetMemoryFullException(false);
2408 SetRecordButton(false);
2409 _pCameraPresentationModel->SetIntervalTimerRun(false);
2412 OnCameraActionRecorderClosed();
2413 _pCameraPresentationModel->SetRecorderEndReached(false);
2420 AppLogDebug("EXIT");
2424 CamcorderForm::InitSettingMenuPanel(void)
2426 AppLogDebug("ENTER");
2427 result r = E_SUCCESS;
2428 int cameraCount = 0;
2430 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
2431 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
2433 __pSettingPanel->AddTouchEventListener(*this);
2434 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
2436 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
2437 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2439 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
2440 _pFlashButton->SetActionId(IDA_BUTTON_CAMCORDER_FLASH);
2441 _pFlashButton->AddActionEventListener(*this);
2442 _pFlashButton->AddTouchEventListener(*this);
2444 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
2445 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2447 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMCORDER_SELF);
2448 _pSelfShotButton->AddActionEventListener(*this);
2449 _pSelfShotButton->AddTouchEventListener(*this);
2451 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
2452 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2454 _pSettingButton->SetActionId(IDA_BUTTON_CAMCORDER_SETTING);
2455 _pSettingButton->AddActionEventListener(*this);
2456 _pSettingButton->AddTouchEventListener(*this);
2458 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
2459 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
2460 __pSettingLine->AddTouchEventListener(*this);
2462 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
2463 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
2465 _pQuickSettingButton->AddTouchEventListener(*this);
2466 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMCORDER_QUICK_SETTING);
2467 _pQuickSettingButton->AddActionEventListener(*this);
2469 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
2470 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2472 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
2473 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
2474 _pWhiteBalanceButton->AddTouchEventListener(*this);
2475 _pWhiteBalanceButton->AddActionEventListener(*this);
2477 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
2478 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2480 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
2481 _pExposureValueButton->AddTouchEventListener(*this);
2482 _pExposureValueButton->AddActionEventListener(*this);
2484 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
2485 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2487 _pCloseButton->AddTouchEventListener(*this);
2489 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2490 || __dir == ORIENTATION_STATUS_PORTRAIT)
2492 _pCloseButton->SetSize(X_CLOSE_BUTTON_PORTRAIT, Y_CLOSE_BUTTON_PORTRAIT);
2496 _pCloseButton->SetSize(X_CLOSE_BUTTON_LANDSCAPE, Y_CLOSE_BUTTON_LANDSCAPE);
2498 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
2499 _pCloseButton->AddActionEventListener(*this);
2501 _pAutoFocus = static_cast<Button*>(GetControl(L"IDC_AUTOFOCUS_BUTTON"));
2502 TryCatch(_pAutoFocus != null, r = E_SYSTEM, "_pAutoFocus is null");
2504 _pAutoFocus->SetActionId(IDA_BUTTON_CAMCORDER_AUTO_FOCUS);
2505 _pAutoFocus->AddTouchEventListener(*this);
2506 _pAutoFocus->AddActionEventListener(*this);
2508 r = UpdateUiPanelIcon();
2509 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
2511 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
2512 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
2513 if (cameraCount > SUPPORTED_CAMERA_NUM)
2515 _pSelfShotButton->SetEnabled(true);
2519 _pSelfShotButton->SetEnabled(false);
2522 AppLogDebug("EXIT");
2526 _pFlashButton = null;
2527 _pSelfShotButton = null;
2528 _pSettingButton = null;
2529 __pSettingLine = null;
2530 _pQuickSettingButton = null;
2531 _pWhiteBalanceButton = null;
2532 _pExposureValueButton = null;
2533 _pCloseButton = null;
2540 CamcorderForm::UpdateUiPanelIcon(void)
2542 AppLogDebug("ENTER");
2543 result r = E_SUCCESS;
2544 int selfPortraitEnable = 0;
2545 Bitmap* pBitmap = null;
2546 Bitmap* pBitmapRotate = null;
2549 ImageRotationType rotationType = IMAGE_ROTATION_0;
2551 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2552 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
2554 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2556 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2557 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2559 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2560 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2562 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2563 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2565 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2570 delete pBitmapRotate;
2571 pBitmapRotate = null;
2573 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2574 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2576 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2577 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2579 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2584 delete pBitmapRotate;
2585 pBitmapRotate = null;
2587 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2589 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2591 if (value == true && r == E_SUCCESS)
2593 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2594 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2598 case FLASH_MODE_OFF:
2600 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2601 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2603 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2604 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2606 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2611 delete pBitmapRotate;
2612 pBitmapRotate = null;
2614 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2615 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2617 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2618 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2620 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2625 delete pBitmapRotate;
2626 pBitmapRotate = null;
2632 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2633 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2635 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2636 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2638 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2643 delete pBitmapRotate;
2644 pBitmapRotate = null;
2646 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
2647 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2649 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2650 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2652 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2657 delete pBitmapRotate;
2658 pBitmapRotate = null;
2662 case FLASH_MODE_AUTO:
2664 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2665 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2667 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2668 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2670 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2675 delete pBitmapRotate;
2676 pBitmapRotate = null;
2678 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
2679 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2681 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2682 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2684 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2689 delete pBitmapRotate;
2690 pBitmapRotate = null;
2700 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2701 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2703 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2704 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2706 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2707 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2709 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2714 delete pBitmapRotate;
2715 pBitmapRotate = null;
2717 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2719 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2721 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2722 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2724 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2729 delete pBitmapRotate;
2730 pBitmapRotate = null;
2733 _pFlashButton->Invalidate(true);
2734 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2736 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2738 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2740 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2742 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2744 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2746 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2747 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2749 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2754 delete pBitmapRotate;
2755 pBitmapRotate = null;
2757 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2759 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2761 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2763 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2765 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2767 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2768 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2770 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2775 delete pBitmapRotate;
2776 pBitmapRotate = null;
2778 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2780 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2784 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2786 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2788 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2789 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2791 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2796 delete pBitmapRotate;
2797 pBitmapRotate = null;
2799 if (__dir == ORIENTATION_STATUS_PORTRAIT
2800 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2802 _pCloseButton->SetSize(X_CLOSE_BUTTON_PORTRAIT, Y_CLOSE_BUTTON_PORTRAIT);
2806 rotationType = IMAGE_ROTATION_270;
2807 _pCloseButton->SetSize(X_CLOSE_BUTTON_LANDSCAPE, Y_CLOSE_BUTTON_LANDSCAPE);
2810 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2811 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
2813 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2814 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingButton::pBitmapRotate is null");
2816 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2821 delete pBitmapRotate;
2822 pBitmapRotate = null;
2824 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2825 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
2827 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2828 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingButton::pBitmapRotate is null");
2830 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2835 delete pBitmapRotate;
2836 pBitmapRotate = null;
2838 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2840 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2841 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2843 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2844 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2846 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2851 delete pBitmapRotate;
2852 pBitmapRotate = null;
2854 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2855 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2856 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2858 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2863 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2864 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2866 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2871 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2873 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2875 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2879 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2884 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2885 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2887 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2892 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2893 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2895 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2902 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2903 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2905 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2910 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2911 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2913 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2919 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2921 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2922 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2924 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2926 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2927 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2929 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2934 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2936 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2937 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2939 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2940 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2942 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2943 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2948 delete pBitmapRotate;
2949 pBitmapRotate = null;
2951 AppLogDebug("EXIT");
2955 if (pBitmap != null)
2965 CamcorderForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPsition, const Tizen::Ui::TouchEventInfo& touchInfo)
2967 AppLogDebug("ENTER");
2968 result r = E_SUCCESS;
2969 String controlName = "L";
2971 if (_appControlActionCompleted)
2973 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
2977 controlName = source.GetName();
2979 StartInitAppTimer();
2981 if (_pCameraInfoPanel->GetDrawExposure() == true)
2983 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
2984 _pExposureCloseTimer->Cancel();
2986 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
2987 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
2989 AppLogDebug("EXIT");
2993 CamcorderForm::OnTouchModeSwitch(void)
2995 AppLogDebug("ENTER");
2996 bool onVideoRecorderStopped = false;
2997 result r = E_SUCCESS;
2999 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
3001 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
3003 AppLogDebug("Return Camera transform");
3008 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3009 AppLogDebug("pSceneManager->GoForward : onVideoRecorderStopped = %d", onVideoRecorderStopped);
3011 if (onVideoRecorderStopped == false)
3013 SceneManager* pSceneManager = SceneManager::GetInstance();
3014 AppAssert(pSceneManager);
3016 AppLogDebug("IDA_BUTTON_CAMCORDER_MODE");
3018 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
3019 TryReturnVoid(r == E_SUCCESS, "Reg setvalue fail[%s]", GetErrorMessage(r));
3023 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMERA));
3024 TryReturnVoid(r == E_SUCCESS, "SceneManager::GoForward fail[%s]", GetErrorMessage(r));
3034 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
3036 AppLogDebug("EXIT");
3040 CamcorderForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
3042 AppLogDebug("ENTER");
3043 result r = E_SUCCESS;
3045 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
3046 if (__dir == ORIENTATION_STATUS_PORTRAIT
3047 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3049 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
3050 _closeTimerValue = 0;
3052 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3053 _pExposureCloseTimer->Cancel();
3055 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
3056 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
3060 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
3061 _closeTimerValue = 0;
3063 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3064 _pExposureCloseTimer->Cancel();
3066 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
3067 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
3069 AppLogDebug("EXIT");
3073 CamcorderForm::OnTouchDoHidePopup(void)
3075 AppLogDebug("ENTER");
3076 bool doHidePopup = false;
3078 if (_pListViewCameraTabMainMenu != null)
3080 if (_pListViewCameraTabMainMenu->GetShowState() == true)
3086 if (_pListViewGeneralTabMainMenu != null)
3088 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
3094 if (_pListFlashMainMenu != null)
3096 if (_pListFlashMainMenu->GetShowState() == true)
3102 if (_pListViewCameraTabSubMenu != null)
3104 if (_pListViewCameraTabSubMenu->GetShowState() == true)
3110 if (_pListViewGeneralTabSubMenu != null)
3112 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
3118 if (_pListWbMainMenu != null)
3120 if (_pListWbMainMenu->GetShowState() == true)
3126 if (_pCameraInfoPanel->GetDrawExposure() == true)
3128 doHidePopup = false;
3131 AppLogDebug("EXIT");
3136 CamcorderForm::DoRecording(void)
3138 AppLogDebug("ENTER");
3139 bool onVideoRecorderStopped = false;
3143 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3144 _pCameraPresentationModel->SetCancelRecord(false);
3146 AppLogDebug("Camcorder State = %d ", _pCameraPresentationModel->GetRecorderState());
3148 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
3150 _pCameraPresentationModel->StopRecord();
3151 __doRecording = false;
3152 _isRecordingPause = false;
3153 __setTimerInterval = false;
3154 AppLogDebug("Recorder stopped");
3158 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED
3159 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_OPENED
3160 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
3161 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_CLOSED
3162 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STOPPED
3165 _pCameraPresentationModel->SetFocusMode(CAMERA_FOCUS_MODE_NONE);
3167 if (_pChargingTimer)
3169 _pChargingTimer->Cancel();
3172 __doRecording = true;
3174 _isRecordingPause = false;
3176 __pBatteryState->SetShowState(false);
3177 __pBatteryState->Draw();
3178 __pBatteryState->Show();
3180 _pCameraInfoPanel->SetDrawIndicator(false);
3181 _pCameraInfoPanel->Draw();
3182 _pCameraInfoPanel->Show();
3184 DoRecordHideUiPanel();
3188 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3190 if (onVideoRecorderStopped == false)
3201 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3203 if (onVideoRecorderStopped == true)
3208 AppLogDebug("EXIT");
3212 CamcorderForm::DoStopRecording(void)
3214 AppLogDebug("ENTER");
3217 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3220 __doRecording = false;
3222 _isRecordingPause = false;
3224 __setTimerInterval = false;
3226 _pCameraPresentationModel->SetIntervalTimerRun(false);
3234 StartInitChargingTimer();
3236 _pCameraPresentationModel->SetContinuousAutoFocus();
3237 AppLogDebug("EXIT");
3241 CamcorderForm::OnTouchLaunchImageview(void)
3243 AppLogDebug("ENTER");
3244 bool onVideoRecorderStopped = false;
3245 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
3246 String fullFileName = L"";
3248 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
3250 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3252 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
3253 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
3255 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
3256 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3258 if (onVideoRecorderStopped == false)
3260 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_RECORD);
3262 if (fullFileName == L"")
3264 AppLogDebug("file do not found");
3268 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
3276 AppLogDebug("LaunchImageview");
3277 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3279 if (onVideoRecorderStopped == false)
3281 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_RECORD);
3283 if (fullFileName == L"")
3285 AppLogDebug("file do not found");
3298 AppLogDebug("EXIT");
3302 CamcorderForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
3304 AppLogDebug("ENTER");
3305 String controlName = L"";
3306 int checkActivePanel = -1;
3307 bool doHidePopup = false;
3309 if (_appControlActionCompleted)
3311 AppLogDebug("OnTouchReleased >> TerminateApp Execution");
3315 controlName = source.GetName();
3317 if (_pCameraInfoPanel->GetDrawExposure() == true)
3319 if (source.Equals(*__pRecordButton) == true)
3321 _closeTimerValue = 0;
3323 if (_pExposureCloseTimer)
3325 _pExposureCloseTimer->Cancel();
3328 _pCameraInfoPanel->SetDrawExposure(false);
3333 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
3335 OnTouchDrawExposure(currentPosition);
3340 doHidePopup = OnTouchDoHidePopup();
3341 AppLogDebug("doHidePopup = %d", doHidePopup);
3343 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
3345 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
3347 DrawTouchAutoFocus(currentPosition);
3352 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
3353 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
3355 if (_pCameraInfoGeneralSubPanel != null)
3357 if (_pCameraInfoGeneralSubPanel->GetShowState())
3359 checkActivePanel = 0;
3362 if (_pCameraInfoSubPanel != null)
3364 if (_pCameraInfoSubPanel->GetShowState())
3366 checkActivePanel = 1;
3370 if (checkActivePanel != -1)
3372 if (checkActivePanel == 0)
3374 _pCameraInfoGeneralSubPanel->SetShowState(false);
3378 _pCameraInfoSubPanel->SetShowState(false);
3389 if (source.Equals(*__pCamcorderSettingLable) == true)
3391 CheckCamcorderSettingLabel();
3394 if (source.Equals(*__pGeneralSettingLable) == true)
3396 CheckGeneralSettingLabel();
3399 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
3400 && _pThumbnailPanel->GetShowState() == true
3401 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
3402 && _pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING
3405 if (source.Equals(*_pThumbnailPanel) == true)
3407 AppLogDebug("Touch Thumbnail button");
3408 OnTouchLaunchImageview();
3412 if (_pCameraInfoPanel->GetDrawExposure() == true)
3414 HideExposurePanel();
3416 AppLogDebug("EXIT");
3420 CamcorderForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
3422 AppLogDebug("ENTER");
3423 String controlName = L"";
3424 result r = E_SUCCESS;
3426 if (_appControlActionCompleted)
3428 AppLogDebug("OnTouchMoved >> TerminateApp Execution");
3432 controlName = source.GetName();
3434 if ((controlName.Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
3436 OnTouchModeSwitch();
3440 if (_pCameraInfoPanel->GetDrawExposure() == true)
3442 AppLogDebug("control name is %ls",controlName.GetPointer());
3444 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
3446 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
3447 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3448 _closeTimerValue = 0;
3450 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3451 _pExposureCloseTimer->Cancel();
3454 AppLogDebug("EXIT");
3458 CamcorderForm::OnAppTimerExpired(void)
3460 AppLogDebug("ENTER");
3461 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
3462 result r = E_SUCCESS;
3464 AppLogDebug("_pAppTimer expire");
3469 _isRecording = false;
3471 _pCameraPresentationModel->StopCamera();
3473 r = SendAppControlResult(pCameraApp->GetRequestId());
3474 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
3475 AppLogDebug("EXIT");
3479 CamcorderForm::OnSettingTimerExpired(void)
3481 AppLogDebug("ENTER");
3482 result r = E_SUCCESS;
3484 _pIntervalValueTimer->Cancel();
3486 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
3488 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
3490 _pCameraInfoPanel->Invalidate(true);
3492 _pCameraInfoPanel->SetDrawPopupTimer(false);
3494 _pCameraInfoPanel->Invalidate(true);
3496 _isRecording = true;
3498 __setTimerInterval = false;
3499 _pCameraPresentationModel->SetIntervalTimerRun(false);
3501 _pCameraPresentationModel->StartRecord();
3503 r = StartRecordTimer();
3504 TryReturnVoid(r == E_SUCCESS, "StartRecordTimer() fail[%s]", GetErrorMessage(r));
3506 r = SetRecordButton(true);
3507 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
3509 AutoFocusPerformed();
3510 AppLogDebug("EXIT");
3514 CamcorderForm::OnPopupTimerExpired(void)
3516 AppLogDebug("ENTER");
3517 if (_isRecording != true)
3521 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
3523 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
3525 _pCameraInfoPanel->Invalidate(true);
3527 AppLogDebug("_timeCount=%d", _timeCount);
3529 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
3534 AppLogDebug("EXIT");
3538 CamcorderForm::OnRecordTimerExpired(void)
3540 AppLogDebug("ENTER");
3541 result r = E_SUCCESS;
3543 if (_isRecording == true)
3545 __recordTimeCount++;
3547 AppLogDebug("__pRecordTimer expire");
3549 __recordingMaxTime = _pCameraPresentationModel->GetMaxRecordingTime();
3551 r = DrawRecord(true);
3552 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
3554 r = DrawRecordTimer();
3555 TryReturnVoid(r == E_SUCCESS, "DrawRecordTimer() fail[%s]", GetErrorMessage(r));
3557 AppLogDebug("EXIT");
3561 CamcorderForm::OnExposureCloseTimerExpired(void)
3563 AppLogDebug("ENTER");
3566 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
3568 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
3570 if (_pCameraInfoPanel->GetDrawExposure() == true)
3572 _pCameraInfoPanel->SetDrawExposure(false);
3578 _closeTimerValue = 0;
3580 _pExposureCloseTimer->Cancel();
3582 AppLogDebug("EXIT");
3586 CamcorderForm::OnPreviewFailPopupTimerExpired(void)
3588 AppLogDebug("ENTER");
3590 if (CheckCallStatus())
3595 ShowCameraFailPopup();
3596 AppLogDebug("EXIT");
3600 CamcorderForm::OnChargingCompletedTimerExpired(void)
3602 AppLogDebug("ENTER");
3603 Bitmap* pBitmap = null;
3604 result r = E_SUCCESS;
3606 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3608 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3610 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
3614 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
3619 if (_chargingCount % DIVIDE_BY_TWO)
3621 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
3625 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
3627 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
3629 if (_chargingCount >= BATTERY_STATE_20)
3631 _chargingCount = INDEX_UNIT_ZERO;
3635 __pBatteryState->SetBackgroundBitmap(*pBitmap);
3636 __pBatteryState->Invalidate(true);
3638 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3639 AppLogDebug("_chargingCount = %d", _chargingCount);
3640 AppLogDebug("_blinkCount = %d", _blinkCount);
3645 AppLogDebug("EXIT");
3649 AppLogDebug("EXIT - CATCH");
3654 CamcorderForm::OnChargingTimerExpired(void)
3656 AppLogDebug("ENTER");
3657 Bitmap* pBitmap = null;
3658 result r = E_SUCCESS;
3659 int maxChargingCnt = 0;
3660 int batteryLevel = 0;
3661 Battery::GetCurrentLevelInPercentage(batteryLevel);
3663 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3665 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3667 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
3671 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
3674 AppLogDebug("batteryLevel = %d", batteryLevel);
3678 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3679 AppLogDebug("_chargingCount = %d", _chargingCount);
3681 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
3683 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
3687 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
3689 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
3691 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
3693 AppLogDebug("maxCount = %d", maxChargingCnt);
3695 if (maxChargingCnt >= BATTERY_STATE_20)
3697 _chargingCount = INDEX_UNIT_ZERO;
3700 __pBatteryState->SetBackgroundBitmap(*pBitmap);
3701 __pBatteryState->Invalidate(true);
3706 AppLogDebug("EXIT");
3710 AppLogDebug("EXIT - CATCH");
3715 CamcorderForm::OnMakerFocusTimerExpired(void)
3717 AppLogDebug("ENTER");
3718 result r = E_SUCCESS;
3720 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3722 _pCameraInfoPanel->Invalidate(true);
3724 r = _pMakerFocusTimer->Cancel();
3726 delete _pMakerFocusTimer;
3727 _pMakerFocusTimer = null;
3728 AppLogDebug("EXIT");
3732 CamcorderForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
3734 AppLogDebug("ENTER");
3735 if (timer.Equals(*_pAppTimer))
3737 AppLogDebug("_pAppTimer");
3738 OnAppTimerExpired();
3740 else if (timer.Equals(*_pIntervalValueTimer))
3742 AppLogDebug("_pIntervalValueTimer");
3744 if (!__pRecordButton->GetShowState())
3746 __pRecordButton->SetShowState(true);
3749 OnSettingTimerExpired();
3750 StartInitChargingTimer();
3752 else if (timer.Equals(*_pPopupTimer))
3754 AppLogDebug("_pPopupTimer");
3755 OnPopupTimerExpired();
3757 else if (timer.Equals(*__pRecordTimer))
3759 AppLogDebug("__pRecordTimer");
3760 OnRecordTimerExpired();
3763 __pRecordButton->SetShowState(true);
3764 __pRecordButton->Invalidate(true);
3766 else if (timer.Equals(*_pExposureCloseTimer))
3768 AppLogDebug("_pExposureCloseTimer");
3769 OnExposureCloseTimerExpired();
3771 else if (timer.Equals(*_pMakerFocusTimer))
3773 AppLogDebug("_pMakerFocusTimer");
3774 OnMakerFocusTimerExpired();
3776 else if (timer.Equals(*_pHelpCloseTimer))
3778 AppLogDebug("__pHelpCloseTimer");
3779 OnHelpCloseTimerExpired();
3781 else if (timer.Equals(*_pChargingTimer))
3783 result r = E_SUCCESS;
3784 AppLogDebug("_pChargingTimer");
3785 bool isCharging = false;
3787 _batteryStatus = GetCurrentBatteryState();
3788 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3790 isCharging = _pCameraPresentationModel->IsCharging();
3794 if (_batteryStatus == BATTERY_STATE_20)
3796 _chargingCount = INDEX_UNIT_ZERO;
3798 _blinkCount = INDEX_UNIT_ZERO;
3800 _pChargingTimer->Cancel();
3802 StartInitChargingCompletedTimer();
3806 r = OnChargingTimerExpired();
3813 _blinkCount = INDEX_UNIT_ZERO;
3815 _pChargingTimer->Cancel();
3817 if (_batteryStatus == BATTERY_STATE_20)
3819 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
3821 StartInitChargingCompletedTimer();
3825 else if (timer.Equals(*_pChargingCompletedTimer))
3827 result r = E_SUCCESS;
3828 AppLogDebug("__pChargingCompletedTimer");
3829 bool isCharging = false;
3831 isCharging = _pCameraPresentationModel->IsCharging();
3833 _batteryStatus = GetCurrentBatteryState();
3834 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3836 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
3838 if (_blinkCount == INDEX_UNIT_TWENTY)
3840 AppLogDebug("__pChargingCompletedTimer cancel");
3842 _chargingCount = INDEX_UNIT_ZERO;
3844 _blinkCount = INDEX_UNIT_ZERO;
3846 _pChargingCompletedTimer->Cancel();
3848 CheckBatteryStatus();
3852 AppLogDebug("OnChargingCompletedTimerExpired");
3854 r = OnChargingCompletedTimerExpired();
3859 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
3861 _chargingCount = INDEX_UNIT_ZERO;
3863 _blinkCount = INDEX_UNIT_ZERO;
3865 _pChargingCompletedTimer->Cancel();
3867 CheckBatteryStatus();
3870 else if (timer.Equals(*_pPreviewFailPopupTimer))
3872 AppLogDebug("__pPreviewFailPopupTimer");
3873 _pPreviewFailPopupTimer->Cancel();
3875 if (_pCameraPresentationModel->GetStartPreviewException())
3877 OnPreviewFailPopupTimerExpired();
3882 AppLogDebug("Not expire");
3884 AppLogDebug("EXIT");
3888 CamcorderForm::InitActionMenuPanel(void)
3890 AppLogDebug("ENTER");
3891 result r = E_SUCCESS;
3892 Rectangle rectThumbnailButton;
3893 Rectangle rectAccessibility;
3894 Rectangle clientArea = GetClientAreaBounds();
3896 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
3897 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
3899 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
3901 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
3902 || __dir == ORIENTATION_STATUS_PORTRAIT)
3904 if (clientArea.height == DISPLAY_WVGA)
3906 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
3910 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
3915 if (clientArea.width == DISPLAY_WVGA)
3917 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
3921 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
3924 __pActionPanel->AddTouchEventListener(*this);
3926 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
3927 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3928 __pBatteryState->AddTouchEventListener(*this);
3930 __pCamcoderSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
3931 TryCatch(__pCamcoderSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
3932 __pCamcoderSetting->SetActionId(IDA_BUTTON_SETTING_CAMCODER);
3933 __pCamcoderSetting->AddActionEventListener(*this);
3934 __pCamcoderSetting->SetShowState(false);
3936 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
3937 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
3938 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
3939 __pGeneralSetting->AddActionEventListener(*this);
3940 __pGeneralSetting->SetShowState(false);
3942 __pCamcorderSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
3943 TryCatch(__pCamcorderSettingLable != null, r = E_SYSTEM, "__pCamcorderSettingLable is null");
3944 __pCamcorderSettingLable->AddTouchEventListener(*this);
3945 __pCamcorderSettingLable->SetShowState(false);
3947 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
3948 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
3949 __pGeneralSettingLable->AddTouchEventListener(*this);
3950 __pGeneralSettingLable->SetShowState(false);
3952 __pRecLabelRed = static_cast<Label*>(GetControl(L"IDC_REC_LABEL_RED"));
3953 TryCatch(__pRecLabelRed != null, r = E_SYSTEM, "__pRecLabelRed is null");
3954 __pRecLabelRed->AddTouchEventListener(*this);
3956 __pRecLabelText = static_cast<Label*>(GetControl(L"IDC_REC_LABEL_TEXT"));
3957 TryCatch(__pRecLabelText != null, r = E_SYSTEM, "__pRecLabelRed is null");
3958 __pRecLabelText->AddTouchEventListener(*this);
3960 __pElapsedTimeLable = static_cast< Label* >(GetControl(L"IDC_REC_TIME"));
3961 TryCatch(__pElapsedTimeLable != null, r = E_SYSTEM, "__pElapsedTimeLable is null");
3962 __pElapsedTimeLable->AddTouchEventListener(*this);
3964 __pElapsedTimeMaxLable = static_cast< Label* >(GetControl(L"IDC_REC_MAX_TIME"));
3965 TryCatch(__pElapsedTimeMaxLable != null, r = E_SYSTEM, "__pElapsedTimeMaxLable is null");
3966 __pElapsedTimeMaxLable->AddTouchEventListener(*this);
3968 __pElapsedRecordSizeLable = static_cast< Label* >(GetControl(L"IDC_REC_SIZE"));
3969 TryCatch(__pElapsedRecordSizeLable != null, r = E_SYSTEM, "__pElapsedRecordSizeLable is null");
3970 __pElapsedRecordSizeLable->AddTouchEventListener(*this);
3972 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
3973 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
3974 __pCameraIconLabel->AddTouchEventListener(*this);
3976 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
3977 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
3979 __pSwButton->SetName(IDS_ACTION_UI_CAMCORDER_MODE);
3980 __pSwButton->AddTouchEventListener(*this);
3981 __pSwButton->AddKeyEventListener(*this);
3982 __pSwButton->GetAccessibilityContainer()->AddAccessibilityListener(*this);
3984 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
3985 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
3986 __pCamcoderIconLabel->AddTouchEventListener(*this);
3990 __pRecordButton = static_cast<Button*>(GetControl(L"IDC_RECORD_BUTTON"));
3991 TryCatch(__pRecordButton != null, r = E_SYSTEM, "pRecodeButton is null");
3993 __pRecordButton->SetActionId(IDA_BUTTON_CAMCORDER_SHUTTER);
3994 __pRecordButton->AddActionEventListener(*this);
3996 __pRecordButton->SetName(IDS_RECORDE_BUTTON_NAME);
3997 __pRecordButton->AddTouchEventListener(*this);
3999 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
4001 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
4002 || __dir == ORIENTATION_STATUS_PORTRAIT)
4004 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
4005 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
4007 rectAccessibility = Rectangle(rectThumbnailButton.x - 25,rectThumbnailButton.y - 22,rectThumbnailButton.width - 7,
4008 rectThumbnailButton.height - 10);
4012 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
4013 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
4016 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
4017 TryCatch(_pThumbnailPanel != null, r = E_FAILURE, "_pThumbnailPanel is null");
4019 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
4020 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
4022 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
4023 _pThumbnailPanel->AddTouchEventListener(*this);
4024 _pThumbnailPanel->SetShowState(false);
4025 _pThumbnailPanel->AddKeyEventListener(*this);
4026 AddControl(_pThumbnailPanel);
4027 AddOrientationEventListener(*_pThumbnailPanel);
4029 //_pThumbnailPanel->SetUpdateListener(this);
4031 _pAccessibilityElement = new AccessibilityElement();
4032 r = _pAccessibilityElement->Construct(rectAccessibility, L"Thumbnail Panel");
4033 _pAccessibilityElement->SetLabel(L"Tizen Panel");
4034 _pAccessibilityElement->SetBounds(rectAccessibility);
4035 _pThumbnailPanel->GetAccessibilityContainer()->AddElement(*_pAccessibilityElement);
4037 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
4038 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
4039 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMCORDER_THUMBNAIL);
4040 __pThumbnailButton->AddActionEventListener(*this);
4041 __pThumbnailButton->SetShowState(false);
4042 __pThumbnailButton->AddTouchEventListener(*this);
4044 r = UpdateUiActionPanelIcon();
4045 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() fail");
4047 AppLogDebug("EXIT");
4051 __pCameraIconLabel = null;
4053 __pCamcoderIconLabel = null;
4054 __pRecordButton = null;
4055 __pThumbnailButton = null;
4056 __pCamcoderSetting = null;
4057 __pGeneralSetting = null;
4058 __pCamcorderSettingLable = null;
4059 __pGeneralSettingLable = null;
4061 delete _pThumbnailPanel;
4062 _pThumbnailPanel = null;
4068 CamcorderForm::UpdateUiActionPanelIcon(void)
4070 AppLogDebug("ENTER");
4071 result r = E_SUCCESS;
4072 Bitmap* pBitmap = null;
4073 Bitmap* pBitmapRotate = null;
4075 ImageRotationType rotationType = IMAGE_ROTATION_0;
4076 Point ptModeChangeButton;
4077 if (__dir == ORIENTATION_STATUS_PORTRAIT
4078 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4080 rotationType = IMAGE_ROTATION_90;
4081 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
4083 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
4084 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
4086 rotationType = IMAGE_ROTATION_0;
4087 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
4090 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
4092 if (__dir == ORIENTATION_STATUS_PORTRAIT
4093 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4095 rotationType = IMAGE_ROTATION_90;
4097 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
4098 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
4100 rotationType = IMAGE_ROTATION_0;
4103 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
4104 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4106 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
4111 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
4112 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4114 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4115 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ChangeMode::pBitmapRotate is null");
4117 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4118 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4122 delete pBitmapRotate;
4123 pBitmapRotate = null;
4125 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
4126 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4128 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
4132 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
4133 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4135 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
4140 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
4141 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4143 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4144 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4149 delete pBitmapRotate;
4150 pBitmapRotate = null;
4152 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
4153 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4155 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4156 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4162 delete pBitmapRotate;
4163 pBitmapRotate = null;
4165 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
4166 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4168 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4169 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4175 delete pBitmapRotate;
4176 pBitmapRotate = null;
4178 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
4179 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4181 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4182 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4184 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4188 delete pBitmapRotate;
4189 pBitmapRotate = null;
4191 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_PRESS);
4192 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4194 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4195 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4197 __pRecordButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4201 delete pBitmapRotate;
4202 pBitmapRotate = null;
4204 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
4205 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4207 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4208 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4210 __pRecordButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
4214 delete pBitmapRotate;
4215 pBitmapRotate = null;
4217 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
4218 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
4220 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
4224 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
4225 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
4227 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
4231 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMCODER);
4232 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderSetting::pBitmap is null");
4234 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4235 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CamcoderSetting::pBitmapRotate is null");
4237 __pCamcoderSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
4238 __pCamcoderSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
4243 delete pBitmapRotate;
4244 pBitmapRotate = null;
4246 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
4247 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
4249 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4250 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
4252 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
4253 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
4258 delete pBitmapRotate;
4259 pBitmapRotate = null;
4261 AppLogDebug("EXIT");
4265 if (pBitmap != null)
4275 CamcorderForm::Initialize(void)
4277 AppLogDebug("ENTER");
4278 result r = E_SUCCESS;
4280 Construct(L"IDL_CAMCORDER_FORM");
4282 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
4283 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
4285 AppLogDebug("EXIT");
4293 CamcorderForm::InitAppTimer(void)
4295 AppLogDebug("ENTER");
4296 _pAppTimer = new (std::nothrow) Timer();
4297 _pAppTimer->Construct(*this);
4298 AppLogDebug("EXIT");
4302 CamcorderForm::InitChargingTimer(void)
4304 AppLogDebug("ENTER");
4305 _pChargingTimer = new (std::nothrow) Timer();
4306 _pChargingTimer->Construct(*this);
4307 AppLogDebug("EXIT");
4311 CamcorderForm::InitChargingCompletedTimer(void)
4313 AppLogDebug("ENTER");
4314 _pChargingCompletedTimer = new (std::nothrow) Timer();
4315 _pChargingCompletedTimer->Construct(*this);
4316 AppLogDebug("EXIT");
4320 CamcorderForm::InitPreviewFailPopupTimer(void)
4322 AppLogDebug("ENTER");
4323 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
4324 _pPreviewFailPopupTimer->Construct(*this);
4325 AppLogDebug("EXIT");
4329 CamcorderForm::InitMakerFocusTimer(void)
4331 AppLogDebug("ENTER");
4332 _pMakerFocusTimer = new (std::nothrow) Timer();
4333 _pMakerFocusTimer->Construct(*this);
4334 AppLogDebug("EXIT");
4338 CamcorderForm::InitSettingTimer(void)
4340 AppLogDebug("ENTER");
4341 _pIntervalValueTimer = new (std::nothrow) Timer();
4342 _pIntervalValueTimer->Construct(*this);
4343 AppLogDebug("EXIT");
4347 CamcorderForm::StartInitChargingTimer(void)
4349 AppLogDebug("ENTER");
4350 result r = E_SUCCESS;
4351 bool isCharging = false;
4353 isCharging = _pCameraPresentationModel->IsCharging();
4359 if (_pChargingTimer)
4361 _pChargingTimer->Cancel();
4363 r = _pChargingTimer->StartAsRepeatable(CAMCORDER_CHARGING_TIMER);
4364 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4369 if (_pChargingTimer)
4371 _pChargingTimer->Cancel();
4374 AppLogDebug("EXIT");
4378 CamcorderForm::StartInitAppTimer(void)
4380 AppLogDebug("ENTER");
4381 result r = E_SUCCESS;
4383 TryReturnVoid(_pCameraPresentationModel != null, "_pCameraPresentationModel is null");
4384 if (_pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING)
4386 AppLogDebug("StartInitAppTimer : RecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
4388 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
4389 _pAppTimer->Cancel();
4391 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
4392 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
4394 AppLogDebug("EXIT");
4398 CamcorderForm::StartPreviewFailPopupTimer(void)
4400 AppLogDebug("ENTER");
4401 result r = E_SUCCESS;
4403 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
4405 _pPreviewFailPopupTimer->Cancel();
4407 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
4408 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
4409 AppLogDebug("EXIT");
4413 CamcorderForm::StartInitChargingCompletedTimer(void)
4415 AppLogDebug("ENTER");
4416 result r = E_SUCCESS;
4417 bool isCharging = false;
4419 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4421 isCharging = _pCameraPresentationModel->IsCharging();
4423 _batteryStatus = GetCurrentBatteryState();
4424 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4426 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4428 if (_pChargingCompletedTimer)
4430 _pChargingCompletedTimer->Cancel();
4437 r = DrawBatteryLevelFull();
4438 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4440 AppLogDebug("EXIT");
4443 _chargingCount = INDEX_UNIT_ZERO;
4445 if (_batteryStatus == BATTERY_STATE_20)
4447 if (_pChargingCompletedTimer)
4449 _pChargingCompletedTimer->Cancel();
4451 r = _pChargingCompletedTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
4452 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4457 if (_pChargingCompletedTimer)
4459 _pChargingCompletedTimer->Cancel();
4465 CheckBatteryStatus();
4467 AppLogDebug("EXIT");
4471 CamcorderForm::StopInitAppTimer(void)
4473 AppLogDebug("ENTER");
4476 _pAppTimer->Cancel();
4478 AppLogDebug("EXIT");
4482 CamcorderForm::StopInitChargingTimer(void)
4484 AppLogDebug("ENTER");
4487 if (_pChargingTimer)
4489 _pChargingTimer->Cancel();
4491 AppLogDebug("EXIT");
4495 CamcorderForm::UpdateUiIndicatorStorage(Canvas* pCanvas, const String& str)
4497 AppLogDebug("ENTER");
4502 result r = E_SUCCESS;
4505 int textClearWidth = 0;
4506 int textClearHeight= 0;
4510 listRect = pCanvas->GetBounds();
4512 pFnt = new (std::nothrow) Font();
4513 pFnt->Construct(FONT_STYLE_PLAIN, FONT_SIZE_INDICATOR_STORAGE_FREE_SPACE);
4515 r = pCanvas->SetFont(*pFnt);
4516 TryCatch(r == E_SUCCESS, , "Canvas::SetFont() fail[%s]", GetErrorMessage(r));
4518 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
4519 if (__dir == ORIENTATION_STATUS_PORTRAIT
4520 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4522 point.x = X_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT - (dim.width / DIVIDE_BY_TWO);
4523 point.y = Y_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT;
4525 textClearX = point.x;
4526 textClearY = point.y;
4527 textClearWidth = W_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT;
4528 textClearHeight = H_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT;
4532 point.x = X_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE - (dim.width / DIVIDE_BY_TWO);
4533 point.y = Y_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE;
4535 textClearX = point.x;
4536 textClearY = point.y;
4537 textClearWidth = W_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE;
4538 textClearHeight = H_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE;
4541 r = pCanvas->Clear(Rectangle(textClearX, textClearY, textClearWidth, textClearHeight));
4542 TryCatch(r == E_SUCCESS, , "Canvas Clear() fail[%s]", GetErrorMessage(r));
4544 r = pCanvas->DrawText(point, str);
4545 TryCatch(r == E_SUCCESS, , "Canvas::DrawText() fail[%s]", GetErrorMessage(r));
4551 AppLogDebug("EXIT");
4562 CamcorderForm::SetRecordStartTimer(int timeInterval)
4564 AppLogDebug("ENTER");
4565 result r = E_SUCCESS;
4567 AppLogDebug("timeInterval = %d", timeInterval);
4569 switch (timeInterval)
4571 case SET_RECORD_START_TIMER_0_SEC:
4576 case SET_RECORD_START_TIMER_2_SEC:
4578 _pIntervalValueTimer->Cancel();
4580 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_2_SEC);
4581 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4585 case SET_RECORD_START_TIMER_5_SEC:
4587 _pIntervalValueTimer->Cancel();
4589 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_5_SEC);
4590 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4594 case SET_RECORD_START_TIMER_10_SEC:
4596 _pIntervalValueTimer->Cancel();
4598 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_10_SEC);
4599 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4605 AppLogDebug("timmer Invail element id");
4610 AppLogDebug("EXIT");
4618 CamcorderForm::CancelTimer(void)
4620 AppLogDebug("ENTER");
4621 if (_pAppTimer != null)
4623 _pAppTimer->Cancel();
4626 if (_pIntervalValueTimer != null)
4628 _pIntervalValueTimer->Cancel();
4633 _pPopupTimer->Cancel();
4636 if (_pExposureCloseTimer)
4638 _pExposureCloseTimer->Cancel();
4641 if (_pHelpCloseTimer)
4643 _pHelpCloseTimer->Cancel();
4646 if (_pChargingCompletedTimer != null)
4650 _pChargingCompletedTimer->Cancel();
4653 if (_pPreviewFailPopupTimer != null)
4655 _pPreviewFailPopupTimer->Cancel();
4657 AppLogDebug("EXIT");
4661 CamcorderForm::MakeRecordingResolutionList(bool remakeList = false)
4663 AppLogDebug("ENTER");
4664 Dimension dimResolution;
4665 IList* pTempList = null;
4666 String* pItemString = null;
4668 result r = E_SUCCESS;
4671 Dimension dimension;
4672 Dimension tempDimention(RECORDING_RESOLOTION_WIDTH, RECORDING_RESOLOTION_HEIGHT);
4673 int recordingResolutionIdx = 0;
4677 if (__pRecordingResolutionList)
4679 __pRecordingResolutionList->RemoveAll(true);
4682 delete __pRecordingResolutionList;
4683 __pRecordingResolutionList = null;
4686 if (__pRecordingResolutionList == null)
4688 __pRecordingResolutionList = new (std::nothrow) ArrayList();
4689 r = __pRecordingResolutionList->Construct();
4690 TryCatch(r == E_SUCCESS, , "__pRecordingResolutionList construct fail[%s]", GetErrorMessage(r));
4692 pTempList = _pCameraPresentationModel->GetRecordingResolutionList();
4693 TryCatch(pTempList != null, , "GetRecordingResolutionList() return null");
4695 tot = pTempList->GetCount();
4699 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4701 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4703 AppLogDebug("GetRecordingResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4704 if (dimResolution == tempDimention)
4706 tempString.Format(32, L"%dX%d(60FPS)", dimResolution.width, dimResolution.height);
4707 pItemString = new (std::nothrow) String(tempString);
4708 TryCatch(pItemString != null, , "pItemString is null");
4710 __pRecordingResolutionList->Add(*pItemString);
4711 recordingResolutionIdx = idx;
4717 AppLogDebug("Not Support CaptureResolution");
4720 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(recordingResolutionIdx)));
4723 __pRecordingResolutionWidth = dimResolution.width;
4724 __pRecordingResolutionHeight = dimResolution.height;
4726 AppLogDebug("recordingResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4728 AppLogDebug("EXIT");
4732 if (__pRecordingResolutionList)
4734 __pRecordingResolutionList->RemoveAll(true);
4736 delete __pRecordingResolutionList;
4737 __pRecordingResolutionList = null;
4742 CamcorderForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4744 AppLogDebug("ENTER");
4745 AppLogDebug("EXIT");
4749 CamcorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4751 AppLogDebug("ENTER");
4752 result r = E_SUCCESS;
4754 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4756 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4758 _currentSettingsMenuIndex = index;
4759 r = ProcessCamcorderTabMainListPopup(index);
4760 TryReturnVoid(r == E_SUCCESS, "ProcessCamcorderTabMainListPopup() fail[%s]", GetErrorMessage(r));
4763 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4765 r = ProcessCamcorderTabSubListPopup(index);
4766 TryReturnVoid(r == E_SUCCESS, "ProcessCamcorderTabSubListPopup() fail[%s]", GetErrorMessage(r));
4768 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4770 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4772 _currentSettingsMenuIndex = index;
4773 r = ProcessGeneraTabMainListPopup(index);
4774 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4777 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4779 r = ProcessGeneraTabSubListPopup(index);
4780 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4782 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4784 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4786 r = ProcessFlashListPopup(index);
4787 UpdateUiPanelIcon();
4789 TryReturnVoid(r == E_SUCCESS, "ProcessFlashListPopup() fail[%s]", GetErrorMessage(r));
4791 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4793 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4795 r = SubListPopupWbMode(index);
4796 TryReturnVoid(r == E_SUCCESS, "SubListPopupWbMode() fail[%s]", GetErrorMessage(r));
4801 AppLogDebug("EXIT");
4805 CamcorderForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4807 AppLogDebug("ENTER");
4808 AppLogDebug("EXIT");
4812 CamcorderForm::OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment)
4814 AppLogDebug("ENTER");
4815 AppLogDebug("EXIT");
4819 CamcorderForm::OnSliderBarMoved(Tizen::Ui::Controls::Slider& source, int value)
4821 AppLogDebug("ENTER");
4822 AppLogDebug("EXIT");
4826 CamcorderForm::CreateItem(int index, int itemWidth)
4828 AppLogDebug("ENTER");
4829 CustomItem* pItem = null;
4830 bool createSubMenu = false;
4831 bool createGenSubMenu = false;
4833 if (_pListViewCameraTabSubMenu)
4835 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4837 createSubMenu = true;
4838 pItem = CreateCamcorderTabSubMenuItem(index, itemWidth);
4842 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4847 AppLogDebug("EXIT");
4853 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4855 if (createSubMenu == false)
4857 pItem = CreateCamcorderTabMainMenuItem(index, itemWidth);
4861 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4866 AppLogDebug("EXIT");
4872 if (_pListViewGeneralTabSubMenu)
4874 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4876 createGenSubMenu = true;
4877 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4881 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4886 AppLogDebug("EXIT");
4892 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4894 if (createGenSubMenu == false)
4896 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4900 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4905 AppLogDebug("EXIT");
4911 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4913 pItem = CreateFlashMainMenuItem(index, itemWidth);
4917 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListFlashMainMenu");
4922 AppLogDebug("EXIT");
4927 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4929 pItem = CreateWhiteBalanceItem(index, itemWidth);
4933 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListWbMainMenu");
4938 AppLogDebug("EXIT");
4943 AppLogDebug("EXIT");
4948 CamcorderForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4950 AppLogDebug("ENTER");
4954 AppLogDebug("EXIT");
4959 CamcorderForm::GetItemCount(void)
4961 AppLogDebug("ENTER");
4962 if (_pListViewCameraTabSubMenu)
4964 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4966 return GetCamcorderTabSettingSubMenuCount();
4970 if (_pListViewCameraTabMainMenu)
4972 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4974 return GetCamcorderTabSettingMainMenuCount();
4978 if (_pListViewGeneralTabSubMenu)
4980 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4982 return GetGeneralTabSettingSubMenuCount();
4986 if (_pListViewGeneralTabMainMenu)
4988 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4990 AppLogDebug("EXIT");
4991 return GetGeneralTabSettingMainMenuCount();
4995 if (_pListFlashMainMenu)
4997 return GetCamcorderTabSettingMainMenuCount();
5000 if (_pListWbMainMenu)
5002 AppLogDebug("EXIT");
5003 return GetCamcorderTabSettingMainMenuCount();
5006 AppLogDebug("EXIT");
5011 CamcorderForm::GetTimerIntervalValue(void) const
5013 AppLogDebug("ENTER");
5014 result r = E_SUCCESS;
5015 int timerInterval = 0;
5017 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
5018 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
5020 AppLogDebug("EXIT");
5021 return timerInterval;
5028 CamcorderForm::SetGuideLine(int guideLineEnable)
5030 AppLogDebug("ENTER");
5031 result r = E_SUCCESS;
5033 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
5034 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
5035 AppLogDebug("EXIT");
5039 CamcorderForm::RestoreDefaultSetting(void)
5041 AppLogDebug("ENTER");
5042 result r = E_SUCCESS;
5043 int selfPortraitEnable = 0;
5044 bool exposureValue = false;
5045 bool brighnesstValue = false;
5046 int adjustValue = 0;
5048 r = _pCameraPresentationModel->ResetCameraSettingsRegistry( );
5049 TryCatch(r == E_SUCCESS, , "ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
5051 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5052 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5054 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5056 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
5060 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
5063 if (exposureValue == true && r == E_SUCCESS)
5065 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
5066 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5068 AppLogDebug("adjustValue = %d", adjustValue);
5070 _pCameraPresentationModel->SetExposure(adjustValue);
5074 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5076 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5080 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5083 if (brighnesstValue == true && r == E_SUCCESS)
5085 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5086 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5088 AppLogDebug("adjustValue = %d", adjustValue);
5090 _pCameraPresentationModel->SetBrightness(adjustValue);
5094 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5096 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5099 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5100 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5105 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5108 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5109 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5115 AppLogDebug("adjustValue = %d", adjustValue);
5117 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5120 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5122 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_FLASH_MODE);
5126 r = _pCameraPresentationModel->SetFlashMode(CAMERA_FLASH_MODE_ON);
5127 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5132 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_FLASH_MODE);
5136 r = _pCameraPresentationModel->SetFlashMode(CameraFlashMode(CAMERA_FLASH_MODE_OFF));
5137 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5140 AppLogDebug("EXIT");
5144 AppLogDebug("EXIT - CATCH");
5149 CamcorderForm::DrawMarker(bool useGuidline)
5151 AppLogDebug("ENTER");
5152 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5153 result r = E_SUCCESS;
5155 if (__dir == ORIENTATION_STATUS_PORTRAIT
5156 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5158 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5162 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5167 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5171 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5174 _pCameraInfoPanel->Invalidate(true);
5176 AppLogDebug("EXIT");
5181 CamcorderForm::DrawFocus(int focusMode)
5183 AppLogDebug("ENTER");
5184 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5185 result r = E_SUCCESS;
5186 int selfPortraitEnable = 0;
5187 bool focusSupport = false;
5189 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5190 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5192 if (__dir == ORIENTATION_STATUS_PORTRAIT
5193 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5195 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5199 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5202 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5204 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5208 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5211 if (focusSupport == true && r == E_SUCCESS)
5213 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5215 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5217 _pCameraInfoPanel->Invalidate(true);
5221 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5223 _pCameraInfoPanel->Invalidate(true);
5226 AppLogDebug("EXIT");
5234 CamcorderForm::ToggleCameraDirection(int direction)
5236 AppLogDebug("ENTER");
5237 result r = E_SUCCESS;
5238 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5240 Point currentPosition;
5241 BufferInfo bufferinfo;
5242 bool isInitCameraStaus = false;
5244 if (_pAppTimer != null)
5246 _pAppTimer->Cancel();
5248 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
5249 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5252 if (direction == CAMCORDER_FORM_SECONDARY_MODE)
5254 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_RECORD, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
5256 else if (direction == CAMCORDER_FORM_PRIMARY_MODE)
5258 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_RECORD, CameraPresentationModel::CAMERA_DIRECTION_BACK);
5260 TryCatch(r == E_SUCCESS, , "_pCameraPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
5262 dim = _pCameraPresentationModel->GetPreviewResolution();
5263 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
5265 AppLogDebug("SelfPortraitMode __screenMode [%d]", __screenMode);
5267 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5269 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
5273 r = SetScreenMode(__screenMode, true);
5275 TryCatch(r == E_SUCCESS, , "SetScreenMode is fail[%s]", GetErrorMessage(r));
5277 if (__dir == ORIENTATION_STATUS_PORTRAIT
5278 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5280 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5284 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5287 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5288 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
5290 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
5291 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
5293 if (isInitCameraStaus)
5295 AppLogDebug("calling camcordersettings");
5296 _pCameraPresentationModel->StartPreview(&bufferinfo);
5298 _pCameraPresentationModel->SetContinuousAutoFocus();
5302 SetCamcorderSettingsDevice();
5306 AppLogDebug("not calling camcordersettings");
5309 AppLogDebug("EXIT");
5317 CamcorderForm::DrawTimerPopup(void)
5319 AppLogDebug("ENTER");
5320 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5321 result r = E_SUCCESS;
5323 if (__dir == ORIENTATION_STATUS_PORTRAIT
5324 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5326 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5330 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5333 _pCameraInfoPanel->SetDrawPopupTimer(true);
5337 _pCameraInfoPanel->Invalidate(true);
5339 AppLogDebug("EXIT");
5344 CamcorderForm::SetFlashPopop(void)
5346 AppLogDebug("ENTER");
5347 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);
5348 MakeSettingPopupTab(false);
5351 if (__dir == ORIENTATION_STATUS_PORTRAIT
5352 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5354 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5355 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5359 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5360 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5363 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5364 _pCameraInfoPanel->Invalidate(true);
5365 SetCamcorderTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5367 if (_pListFlashMainMenu == null)
5369 _pListFlashMainMenu = new (std::nothrow) ListView();
5370 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5372 _pListFlashMainMenu->SetItemProvider(*this);
5373 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5374 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5375 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5379 _pListFlashMainMenu->SetBounds(rectList);
5380 _pListFlashMainMenu->SetShowState(true);
5382 _pListFlashMainMenu->UpdateList();
5383 AppLogDebug("EXIT");
5387 CamcorderForm::SetWhiteBalancePopop(void)
5389 AppLogDebug("ENTER");
5390 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5391 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5392 MakeSettingPopupTab(false);
5395 if (__dir == ORIENTATION_STATUS_PORTRAIT
5396 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5398 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5399 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5403 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5404 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5407 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5408 _pCameraInfoPanel->Invalidate(true);
5409 SetCamcorderTabSettingMainMenuCount(SUBMENU_WB_COUNT);
5411 if (_pListWbMainMenu == null)
5413 _pListWbMainMenu = new (std::nothrow) ListView();
5414 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5416 _pListWbMainMenu->SetItemProvider(*this);
5417 _pListWbMainMenu->AddListViewItemEventListener(*this);
5418 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5422 _pListWbMainMenu->SetBounds(rectList);
5423 _pListWbMainMenu->SetShowState(true);
5425 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5427 _pListWbMainMenu->UpdateList();
5428 AppLogDebug("EXIT");
5433 CamcorderForm::ProcessCamcorderTabMainListPopup(int index)
5435 AppLogDebug("ENTER");
5436 Rectangle rectPanel;
5438 String strTitle = L"";
5439 String listName = L"";
5440 result r = E_SUCCESS;
5441 AppResource* pAppResource = null;
5442 bool drawPopup = true;
5444 pAppResource = Application::GetInstance()->GetAppResource();
5445 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
5447 listName = _pListViewCameraTabMainMenu->GetName();
5448 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5450 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5452 _pCameraInfoSubPanel->SetShowState(false);
5453 _pCameraInfoSubPanel->RemoveControl(*_pListViewCameraTabSubMenu);
5454 _pListViewCameraTabSubMenu = null;
5455 RemoveControl(*_pCameraInfoSubPanel);
5456 _pCameraInfoSubPanel = null;
5458 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5463 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
5465 if (__pRecordingResolutionList)
5467 int captrueResolutionCnt = __pRecordingResolutionList->GetCount();
5468 if (captrueResolutionCnt > 1)
5470 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5471 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL + Y_SUBMENU_WB_MODE_PANEL_MARGIN;
5472 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5473 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captrueResolutionCnt * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5475 int X_List = X_SUBMENU_WB_MODE_LIST;
5476 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5477 int W_List = W_SUBMENU_WB_MODE_LIST;
5478 int H_List = (captrueResolutionCnt * H_SUBMENU_WB_MODE_LIST);
5480 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5481 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5483 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5484 SetCamcorderTabSubMenuListviewState(captrueResolutionCnt, CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE);
5494 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
5501 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5502 AppLogDebug("Invaild index");
5510 if (__dir == ORIENTATION_STATUS_PORTRAIT
5511 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5513 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5514 rectPanel.y += Y_SUBMENU_PANEL_START_PORTRAIT;
5518 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5521 if (_pCameraInfoSubPanel == null)
5523 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5524 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5526 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5527 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5529 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5530 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5531 AddOrientationEventListener(*this);
5532 AddControl(_pCameraInfoSubPanel);
5533 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5536 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5537 _pCameraInfoPanel->Invalidate(true);
5538 _pCameraInfoSubPanel->Invalidate(true);
5540 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5541 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5543 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5544 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5545 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5547 _pListViewCameraTabSubMenu->UpdateList();
5551 AppLogDebug("EXIT");
5555 if (_pCameraInfoSubPanel)
5557 RemoveControl(*_pCameraInfoSubPanel);
5558 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5562 delete _pListViewCameraTabSubMenu;
5565 _pCameraInfoSubPanel = null;
5566 _pListViewCameraTabSubMenu = null;
5572 CamcorderForm::ProcessGeneraTabMainListPopup(int index)
5574 AppLogDebug("ENTER");
5575 Rectangle rectPanel;
5577 String strTitle = L"";
5578 String listName = L"";
5579 result r = E_SUCCESS;
5580 bool drawPopup = true;
5581 AppResource* pAppResource = null;
5583 pAppResource = Application::GetInstance()->GetAppResource();
5584 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
5586 listName = _pListViewGeneralTabMainMenu->GetName();
5587 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
5589 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
5591 _pCameraInfoGeneralSubPanel->SetShowState(false);
5592 _pCameraInfoGeneralSubPanel->RemoveControl(*_pListViewGeneralTabSubMenu);
5593 _pListViewGeneralTabSubMenu = null;
5594 RemoveControl(*_pCameraInfoGeneralSubPanel);
5595 _pCameraInfoGeneralSubPanel = null;
5597 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5602 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
5604 AppLogDebug("Set Timer");
5605 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
5606 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
5607 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL - 12);
5608 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
5609 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
5610 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
5614 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
5616 AppLogDebug("Set geo tag or guideline mode");
5618 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
5619 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
5621 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
5622 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL -8);
5623 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
5624 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
5628 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
5630 AppLogDebug("Set storage mode");
5632 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
5633 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
5634 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL -8);
5635 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
5636 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
5637 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
5641 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
5643 AppLogDebug("Camcorder Reset");
5646 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
5648 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
5651 if (_pResetPopUp == null)
5653 _pResetPopUp = new (std::nothrow) Popup();
5654 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
5656 _pResetPopUp->SetPropagatedKeyEventListener(this);
5657 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
5662 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
5663 TryCatch(_pYes != null, , "Reset Popup not created!");
5664 _pYes->SetActionId(IDA_BTN_YES);
5665 _pYes->AddActionEventListener(*this);
5666 _pYes->SetShowState(true);
5671 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
5672 TryCatch(_pNo != null, , "Reset Popup not created!");
5673 _pNo->SetActionId(IDA_BTN_NO);
5674 _pNo->AddActionEventListener(*this);
5675 _pNo->SetShowState(true);
5676 _pResetPopUp->Show();
5679 _pResetPopUp->SetShowState(true);
5680 _pResetPopUp->Invalidate(true);
5681 _pResetPopUp->Show();
5685 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
5687 result r = E_SUCCESS;
5689 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
5690 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
5692 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
5694 r = SetScreenOverlayHelpTimer();
5695 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
5697 r = DrawScreenOverlayHelp();
5698 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
5702 MakeSettingPopupTab(false);
5711 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5712 AppLogDebug("Invaild index");
5720 if (__dir == ORIENTATION_STATUS_PORTRAIT
5721 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5723 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5724 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5728 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5731 if (_pCameraInfoGeneralSubPanel == null)
5733 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
5734 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoGeneralSubPanel is null");
5736 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
5737 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
5739 if (index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
5740 index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
5741 index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
5743 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
5745 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
5746 AddOrientationEventListener(*this);
5747 AddControl(_pCameraInfoGeneralSubPanel);
5748 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
5751 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
5752 _pCameraInfoPanel->Invalidate(true);
5753 _pCameraInfoGeneralSubPanel->Invalidate(true);
5755 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
5756 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5758 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
5759 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
5760 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
5762 _pListViewGeneralTabSubMenu->UpdateList();
5766 AppLogDebug("EXIT");
5770 if (_pCameraInfoGeneralSubPanel)
5772 RemoveControl(*_pCameraInfoGeneralSubPanel);
5773 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5777 delete _pListViewGeneralTabSubMenu;
5780 _pCameraInfoGeneralSubPanel = null;
5781 _pListViewGeneralTabSubMenu = null;
5783 AppLogDebug("EXIT - CATCH");
5788 CamcorderForm::ProcessFlashListPopup(int index)
5790 AppLogDebug("ENTER");
5791 Rectangle rectPanel;
5793 String strTitle = L"";
5794 String listName = L"";
5795 Bitmap* pBitmapNormal = null;
5796 Bitmap* pBitmapPress = null;
5797 result r = E_SUCCESS;
5798 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5800 AppLogDebug("Sub Menu (%d)", index);
5803 int selfPortraitEnable = 0;
5805 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5806 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5808 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5809 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5811 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5813 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5814 regVal = SUBMENU_MODE_OFF;
5815 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5816 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5817 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5821 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5823 if (value == true && r == E_SUCCESS)
5825 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5829 case SUBMENU_MODE_OFF:
5831 regVal = SUBMENU_MODE_OFF;
5832 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5833 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5834 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5838 case SUBMENU_MODE_ON:
5840 regVal = SUBMENU_MODE_ON;
5841 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5842 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5843 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5847 case SUBMENU_MODE_AUTO:
5849 regVal = SUBMENU_MODE_AUTO;
5850 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5851 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5852 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5862 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5864 regVal = SUBMENU_MODE_OFF;
5865 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5866 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5867 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5871 r = _pCameraPresentationModel->SetFlashMode(cameraFlashMode);
5872 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5874 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5875 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
5877 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5879 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5881 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5882 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5884 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5886 delete pBitmapNormal;
5887 pBitmapNormal = null;
5889 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5890 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5892 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5894 delete pBitmapPress;
5895 pBitmapPress = null;
5900 SetCamcorderTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5901 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5903 AppLogDebug("EXIT");
5911 CamcorderForm::SubListPopupWbMode(int index)
5913 AppLogDebug("ENTER");
5914 result r = E_SUCCESS;
5916 int selfPortraitEnable = 0;
5918 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5919 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5921 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5923 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5927 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5928 AppLogDebug("result is %s",GetErrorMessage(r));
5933 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
5937 AppLogDebug("result is %s",GetErrorMessage(r));
5938 AppLogDebug("Target unsupport - white balance same");
5940 __settingWhiteBalance = index;
5941 regVal = __settingWhiteBalance;
5943 AppLogDebug("regVal = %d", regVal);
5944 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5946 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
5947 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5951 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
5952 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5955 AppLogDebug("EXIT");
5959 AppLogDebug("EXIT - CATCH");
5964 CamcorderForm::SubListPopupGuidelineMode(int index)
5966 AppLogDebug("ENTER");
5967 result r = E_SUCCESS;
5973 case SUBMENU_MODE_OFF:
5975 AppLogDebug("Setting - Guideline = off");
5976 guideLine = SUBMENU_MODE_OFF;
5977 SetGuideLine(guideLine);
5978 r = DrawMarker(false);
5979 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
5983 case SUBMENU_MODE_ON:
5985 AppLogDebug("Setting - Guideline = on");
5986 guideLine = SUBMENU_MODE_ON;
5987 SetGuideLine(guideLine);
5988 r = DrawMarker(true);
5989 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
5995 AppLogDebug("Setting - Guideline, Invail element id");
6002 AppLogDebug("Set vaule");
6004 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
6005 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
6007 AppLogDebug("EXIT");
6011 AppLogDebug("EXIT - CATCH");
6016 CamcorderForm::SubListPopupStorageTypeMode(int index)
6018 AppLogDebug("ENTER");
6019 int storage = STORAGE_TYPE_PHONE;
6020 String filePath = L"";
6021 result r = E_SUCCESS;
6025 case SUBMENU_STORAGE_TYPE_PHONE:
6027 AppLogDebug("Setting - Storage type = Phone");
6028 storage = STORAGE_TYPE_PHONE;
6029 SetStorageType(storage);
6033 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
6035 AppLogDebug("Setting - Storage type = card");
6036 storage = STORAGE_TYPE_MEMORYCARD;
6038 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
6040 SetStorageType(storage);
6044 AppLogDebug("Setting - don't draw t-flash icon");
6051 AppLogDebug("Setting - Storage, Invaild index id");
6056 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
6060 _pCameraInfoPanel->SetStorageType(storage);
6061 _pCameraInfoPanel->Invalidate(true);
6063 if (__pFileEventManager == null)
6065 __pFileEventManager = new (std::nothrow) FileEventManager();
6066 r = __pFileEventManager->Construct(*this);
6067 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
6070 filePath = _pCameraPresentationModel->GetfilePath(storage);
6071 AppLogDebug("filePath %ls", filePath.GetPointer());
6073 if (File::IsFileExist(__pFileEventPath))
6075 __pFileEventManager->RemovePath(__pFileEventPath);
6078 if (File::IsFileExist(filePath))
6080 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MOVE_SELF);
6081 __pFileEventPath = filePath;
6084 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
6085 AppLogDebug("EXIT");
6089 CamcorderForm::SubListPopupTimerMode(int index)
6091 AppLogDebug("ENTER");
6092 result r = E_SUCCESS;
6095 __settingTimeInterval = index;
6098 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
6099 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6101 AppLogDebug("EXIT");
6105 AppLogDebug("EXIT - CATCH");
6110 CamcorderForm::SubListPopupResolutionMode(int index)
6112 AppLogDebug("ENTER");
6113 IList* pList = _pCameraPresentationModel->GetRecordingResolutionList();
6114 int resolutionCnt = 0;
6115 result r = E_SUCCESS;
6116 int selfPortraitEnable = 0;
6118 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6119 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6123 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
6124 //Dimension dimResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
6125 Dimension dimResolution = _pCameraPresentationModel->GetRecordingResolution();
6126 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dimResolution.width, dimResolution.height);
6128 if ((__pRecordingResolutionWidth == dimResolution.width )&& (__pRecordingResolutionHeight == dimResolution.height))
6130 AppLogDebug("RESOLUTION Same");
6134 _pCameraPresentationModel->StopPreview();
6136 _pCameraPresentationModel->SetRecordingResolution(dimResolution);
6138 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
6140 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
6144 r = SetScreenMode(__screenMode, true);
6147 AppLogDebug("dimResolution(W:%d, H:%d)", dimResolution.width, dimResolution.height);
6151 __pRecordingResolutionIndex = index;
6153 AppLogDebug("EXIT");
6157 AppLogDebug("EXIT - CATCH");
6162 CamcorderForm::SubListPopupOverlayHelpMode(int index)
6164 AppLogDebug("ENTER");
6165 int value = SUBMENU_MODE_OFF;
6166 result r = E_SUCCESS;
6168 String strRegKey = IDS_INIT_REG_KEY;
6172 case SUBMENU_MODE_OFF:
6174 value = SUBMENU_MODE_OFF;
6179 case SUBMENU_MODE_ON:
6181 AppLogDebug("Setting - Guideline = on");
6182 value = SUBMENU_MODE_ON;
6193 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
6194 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6196 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
6198 r = SetScreenOverlayHelpTimer();
6199 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6201 r = DrawScreenOverlayHelp();
6202 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6204 AppLogDebug("EXIT");
6208 AppLogDebug("EXIT - CATCH");
6213 CamcorderForm::ProcessCamcorderTabSubListPopup(int index)
6215 AppLogDebug("ENTER");
6216 result r = E_SUCCESS;
6218 CamcorderTabSubMenuContent camSubMenuContent = CAMCORDER_SUB_MENU_CONTENT_MAX;
6220 camSubMenuContent = GetCamcorderTabSettingSubMenuMode();
6222 switch (camSubMenuContent)
6224 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
6226 r = SubListPopupResolutionMode(index);
6227 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
6231 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
6240 if (_pListViewCameraTabSubMenu)
6242 if (_pCameraInfoSubPanel != null)
6244 _pCameraInfoSubPanel->SetShowState(false);
6246 _pListViewCameraTabSubMenu->SetShowState(false);
6248 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6249 _pListViewCameraTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6252 _pCameraInfoPanel->Invalidate(true);
6254 AppLogDebug("EXIT");
6258 AppLogDebug("EXIT - CATCH");
6263 CamcorderForm::ProcessGeneraTabSubListPopup(int index)
6265 AppLogDebug("ENTER");
6266 String strRegKey = IDS_INIT_REG_KEY;
6267 result r = E_SUCCESS;
6268 int selfPortraitEnable = 0;
6269 CamcorderGeneralTabSubMenuContent idx = CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6271 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6272 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6274 idx = GetGeneralTabSettingSubMenuMode();
6278 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6280 r = SubListPopupTimerMode(index);
6281 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6285 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6287 r = SubListPopupGuidelineMode(index);
6288 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6292 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6294 SubListPopupStorageTypeMode(index);
6298 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6303 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6312 if (_pListViewGeneralTabSubMenu)
6314 if (_pCameraInfoGeneralSubPanel != null)
6316 _pCameraInfoGeneralSubPanel->SetShowState(false);
6318 _pListViewGeneralTabSubMenu->SetShowState(false);
6320 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6321 _pListViewGeneralTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6324 _pCameraInfoPanel->Invalidate(true);
6326 AppLogDebug("EXIT");
6330 MakeSettingPopupTab(false);
6333 AppLogDebug("EXIT - CATCH");
6338 CamcorderForm::StartRecordTimer(void)
6340 AppLogDebug("ENTER");
6341 result r = E_SUCCESS;
6342 if (__pRecordTimer == null)
6344 __recordTimeCount = 0;
6345 __recordingMaxTime = 0;
6347 __pRecordTimer = new (std::nothrow) Timer();
6348 __pRecordTimer->Construct(*this);
6350 r = __pRecordTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
6351 TryCatch(r == E_SUCCESS, , "Timer::StartAsRepeatable fail[%s]", GetErrorMessage(r));
6354 AppLogDebug("EXIT");
6358 delete __pRecordTimer;
6359 __pRecordTimer = null;
6361 AppLogDebug("EXIT - CATCH");
6366 CamcorderForm::EndRecordTimer(void)
6368 AppLogDebug("ENTER");
6371 __recordingMaxTime = 0;
6372 __pRecordTimer->Cancel();
6373 delete __pRecordTimer;
6374 __pRecordTimer = null;
6376 AppLogDebug("EXIT");
6380 CamcorderForm::StartPopupTimer(void)
6382 AppLogDebug("ENTER");
6383 result r = E_SUCCESS;
6384 int settingTimer = 0;
6388 _pPopupTimer = new (std::nothrow) Timer();
6389 _pPopupTimer->Construct(*this);
6391 r = _pPopupTimer->StartAsRepeatable(CAMCORDER_TIMER_1_SEC);
6392 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6394 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, settingTimer);
6395 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6397 if (settingTimer == SETTING_TIMER_RECORD_2_SEC)
6399 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6401 else if (settingTimer == SETTING_TIMER_RECORD_5_SEC)
6403 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6405 else if (settingTimer == SETTING_TIMER_RECORD_10_SEC)
6407 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6410 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6412 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6414 _pCameraInfoPanel->Invalidate(true);
6416 AppLogDebug("EXIT");
6420 delete _pPopupTimer;
6421 _pPopupTimer = null;
6427 CamcorderForm::StopPopupTimer(void)
6429 AppLogDebug("ENTER");
6430 result r = E_SUCCESS;
6431 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6433 r = _pPopupTimer->Cancel();
6435 delete _pPopupTimer;
6436 _pPopupTimer = null;
6438 AppLogDebug("EXIT");
6446 CamcorderForm::SetRecordPauseButton(bool start)
6448 AppLogDebug("ENTER");
6449 Bitmap* pBitmapRotate = null;
6450 result r = E_SUCCESS;
6452 ImageRotationType rotationType = IMAGE_ROTATION_0;
6453 Point ptModeChangeButton;
6455 TryCatch(__pRecordButton != null, r = E_SYSTEM, "__pRecordButton is null");
6456 TryCatch(__pRecordPauseBitmap != null, r = E_SYSTEM, "__pRecordPauseBitmap is null");
6458 if (__dir == ORIENTATION_STATUS_PORTRAIT
6459 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6461 rotationType = IMAGE_ROTATION_90;
6462 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
6464 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
6465 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
6467 rotationType = IMAGE_ROTATION_0;
6468 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
6471 pBitmapRotate = RotationImageN(__pRecordPauseBitmap, rotationType);
6472 TryCatch(pBitmapRotate != null, , "pBitmap is null");
6474 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
6475 __pRecordButton->Invalidate(true);
6477 delete pBitmapRotate;
6478 pBitmapRotate = null;
6480 AppLogDebug("EXIT");
6484 AppLogDebug("EXIT - CATCH");
6489 CamcorderForm::SetRecordButton(bool start)
6491 AppLogDebug("ENTER");
6492 Bitmap* pBitmap = null;
6493 Bitmap* pBitmapRotate = null;
6494 result r = E_SUCCESS;
6495 ImageRotationType rotationType = IMAGE_ROTATION_0;
6496 Point ptModeChangeButton;
6498 TryCatch(__pRecordButton != null, r = E_SYSTEM, "__pRecordButton is null");
6500 if (__dir == ORIENTATION_STATUS_PORTRAIT
6501 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6503 rotationType = IMAGE_ROTATION_90;
6504 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
6506 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
6507 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
6509 rotationType = IMAGE_ROTATION_0;
6510 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
6515 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_RECORDING_SHUTTER_NORMAL);
6519 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
6521 TryCatch(pBitmap != null, , "pBitmap is null");
6523 pBitmapRotate = RotationImageN(pBitmap, rotationType);
6524 TryCatch(pBitmapRotate != null, , "pBitmap is null");
6526 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
6527 __pRecordButton->Invalidate(true);
6532 delete pBitmapRotate;
6533 pBitmapRotate = null;
6535 AppLogDebug("EXIT");
6539 if (pBitmap != null)
6545 AppLogDebug("EXIT - CATCH");
6550 CamcorderForm::ExposureValuePerformed(void)
6552 AppLogDebug("ENTER");
6553 result r = E_SUCCESS;
6554 bool exposureValue = false;
6555 bool brighnesstValue = false;
6556 int selfPortraitEnable = 0;
6557 int adjustValue = 0;
6559 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
6560 _pAppTimer->Cancel();
6562 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
6563 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
6565 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6566 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6568 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6569 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6571 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6573 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6577 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6580 if (exposureValue == true && r == E_SUCCESS)
6582 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
6584 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
6585 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6587 AppLogDebug("adjustValue = %d", adjustValue);
6589 _pCameraPresentationModel->SetExposure(adjustValue);
6591 MakeSettingPopupTab(false);
6595 r = CreateExposureSlider();
6596 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
6598 r = DrawExposureSlider();
6599 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6603 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6605 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6609 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6612 if (brighnesstValue == true && r == E_SUCCESS)
6614 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
6616 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
6617 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6619 AppLogDebug("adjustValue = %d", adjustValue);
6621 _pCameraPresentationModel->SetBrightness(adjustValue);
6623 MakeSettingPopupTab(false);
6627 r = CreateExposureSlider();
6628 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
6630 r = DrawExposureSlider();
6631 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6635 AppLogDebug("Exposure do not support");
6638 AppLogDebug("EXIT");
6642 CamcorderForm::AutoFocusPerformed(void)
6644 AppLogDebug("ENTER");
6645 Point currentPosition;
6646 int selfPortraitEnable = 0;
6647 bool focusSupport = false;
6648 result r = E_SUCCESS;
6650 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
6652 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
6654 if (__dir == ORIENTATION_STATUS_PORTRAIT
6655 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6657 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
6658 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
6659 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
6663 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
6664 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
6665 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
6668 //if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
6670 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6671 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
6673 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6675 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
6679 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
6682 if (focusSupport == true && r == E_SUCCESS)
6684 AppLogDebug("focus is Support");
6686 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
6688 _pCameraInfoPanel->SetDrawMarkerFocus(true);
6690 DrawFocus(CAMERA_FOCUS_NOT_READY);
6694 _pCameraInfoPanel->SetDrawMarkerFocus(false);
6696 _pCameraInfoPanel->Invalidate(true);
6699 _pCameraPresentationModel->SetContinuousAutoFocus();
6702 AppLogDebug("EXIT");
6706 CamcorderForm::SetContinuousAutoFocusButton(void)
6708 AppLogDebug("ENTER");
6709 result r = E_SUCCESS;
6710 int selfPortraitEnable = 0;
6711 bool focusSupport = false;
6712 Bitmap* pBitmap = null;
6714 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6715 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
6717 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6719 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
6723 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
6726 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_AUTOFOCUS);
6727 TryReturnVoid(pBitmap != null, "pBitmap is null");
6729 _pAutoFocus->SetNormalBackgroundBitmap(*pBitmap);
6734 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_AUTOFOCUS_PRESS);
6735 TryReturnVoid(pBitmap != null, "pBitmap is null");
6737 _pAutoFocus->SetPressedBackgroundBitmap(*pBitmap);
6742 if (focusSupport == true && r == E_SUCCESS)
6744 _pAutoFocus->SetShowState(true);
6748 _pAutoFocus->SetShowState(false);
6750 _pAutoFocus->Invalidate(true);
6751 AppLogDebug("EXIT");
6755 CamcorderForm::BackButtonPerformed(void)
6757 AppLogDebug("ENTER");
6758 result r = E_SUCCESS;
6759 bool onVideoRecorderStopped = false;
6761 if (_pHelpGoToGallery->GetShowState() == true)
6763 OnHelpCloseTimerExpired();
6764 AppLogDebug("SCREEN OVERLAY HELP");
6768 if (_pCameraPresentationModel->GetPreviewState() == false)
6770 AppLogDebug("StartPreview do not call");
6774 AppLogDebug("RecorderState = %d", _pCameraPresentationModel->GetRecorderState());
6775 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
6777 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING)
6779 AppLogDebug("No RECORDER_STATE_RECORDING AND PAUSE");
6783 if (__pCancelPopup == null)
6785 r = InitializePopup();
6786 TryCatch(r == E_SUCCESS, , "InitializePopup fail[%s]", GetErrorMessage(r));
6788 __pCancelPopup->SetShowState(true);
6789 __pCancelPopup->Show();
6793 __pCancelPopup->SetShowState(true);
6794 __pCancelPopup->Show();
6798 TryCatch(r == E_SUCCESS, , "PauseRecord fail[%s]", GetErrorMessage(r));
6802 if (_isRecording == true)
6804 AppLogDebug("No RECORDER_STATE_RECORDING and _isRecording = true >> DO NOT APP TERMINATE");
6808 if (_pCameraInfoPanel->GetDrawExposure() == true)
6810 HideExposurePanel();
6814 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6816 r = PressBackButton();
6817 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
6821 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
6822 AppLogDebug("onVideoRecorderStopped = %d", onVideoRecorderStopped);
6824 if (onVideoRecorderStopped == false)
6826 if (__setTimerInterval)
6828 AppLogDebug("__setTimerInterval");
6829 CancelTimerIntervalRecord();
6834 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
6839 bool bIsCancelRecord = _pCameraPresentationModel->GetCancelRecord();
6840 AppLogDebug("isCancelRecord %d", bIsCancelRecord);
6841 if ( !bIsCancelRecord )
6849 AppLogDebug("EXIT");
6853 AppLogDebug("EXIT - CATCH");
6858 CamcorderForm::PressBackButton(void)
6860 AppLogDebug("ENTER");
6861 bool onVideoRecorderStopped = false;
6862 result r = E_SUCCESS;
6864 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
6866 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6868 AppLogDebug("PressBackButton >> Back to the App");
6869 if (onVideoRecorderStopped == false)
6871 if (_isRecording == false)
6873 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
6877 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
6885 AppLogDebug("EXIT");
6890 CamcorderForm::SetSelfModeButton(void)
6892 AppLogDebug("ENTER");
6893 int selfPortraitEnable = 0;
6894 result r = E_SUCCESS;
6897 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
6899 AppLogDebug("Return Camera transform");
6903 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6904 TryReturnVoid(r == E_SUCCESS, "Reg getvalue fail[%s]", GetErrorMessage(r));
6906 if (selfPortraitEnable == CAMCORDER_FORM_PRIMARY_MODE)
6908 AppLogDebug("PRIMARY -> SECONDARY");
6910 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
6911 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6913 r = ToggleCameraDirection(CAMCORDER_FORM_SECONDARY_MODE);
6914 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
6916 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
6917 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6919 r = UpdateUiPanelIcon();
6920 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
6922 else if (selfPortraitEnable == CAMCORDER_FORM_SECONDARY_MODE)
6924 AppLogDebug("SECONDARY -> PRIMARY");
6925 int primaryFlashValue = FLASH_MODE_OFF;
6927 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
6928 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6930 r = ToggleCameraDirection(CAMCORDER_FORM_PRIMARY_MODE);
6931 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
6933 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
6934 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
6936 if (value == true && r == E_SUCCESS)
6938 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
6939 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6943 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
6948 r = UpdateUiPanelIcon();
6949 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
6952 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
6953 _pFlashButton->Invalidate(true);
6955 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
6956 _pSelfShotButton->Invalidate(true);
6957 AppLogDebug("EXIT");
6961 CamcorderForm::SetCamcorderSettingsDevice(void)
6963 AppLogDebug("ENTER");
6968 result r = E_SUCCESS;
6969 bool exposureValue = false;
6970 bool brighnesstValue = false;
6971 int selfPortraitEnable = 0;
6973 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6974 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6976 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6978 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6982 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6985 if (exposureValue == true && r == E_SUCCESS)
6987 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6988 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6990 _pCameraPresentationModel->SetExposure(exposure);
6994 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6996 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7000 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7003 if (brighnesstValue == true && r == E_SUCCESS)
7005 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
7006 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
7008 _pCameraPresentationModel->SetBrightness(brightness);
7012 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7014 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
7018 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
7023 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
7024 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
7026 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)isoIndex);
7029 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7032 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
7035 AppLogDebug("primary mode wb is set");
7036 r =_pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
7037 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
7042 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
7045 AppLogDebug("secondary mode wb is set");
7046 r =_pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
7047 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
7051 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
7052 AppLogDebug("EXIT");
7056 CamcorderForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
7058 AppLogDebug("ENTER");
7059 Bitmap* pBitmap = null;
7060 ByteBuffer* pSrcByteBuff = null;
7061 ByteBuffer dstByteBuff;
7062 BufferInfo buffInfo;
7063 result r = E_SUCCESS;
7067 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
7069 if (rotationType == IMAGE_ROTATION_0)
7071 pBitmap = new (std::nothrow) Bitmap();
7072 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
7073 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
7075 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
7079 dim.width = pSrcBitmap->GetWidth();
7080 dim.height = pSrcBitmap->GetHeight();
7082 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
7084 r = dstByteBuff.Construct(size);
7085 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
7087 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
7088 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
7090 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
7091 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
7093 dim.width = buffInfo.width;
7094 dim.height = buffInfo.height;
7096 size = buffInfo.pitch * buffInfo.height;
7098 pSrcByteBuff = new (std::nothrow) ByteBuffer();
7099 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
7101 r = pSrcByteBuff->Construct(size);
7102 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
7104 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
7105 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
7107 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
7108 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
7110 r = pSrcBitmap->Unlock();
7111 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
7113 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
7114 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
7116 if (rotationType == IMAGE_ROTATION_90
7117 || rotationType == IMAGE_ROTATION_270)
7119 dim.width = buffInfo.height;
7120 dim.height = buffInfo.width;
7124 dim.width = buffInfo.width;
7125 dim.height = buffInfo.height;
7128 pBitmap = new (std::nothrow) Bitmap();
7129 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
7130 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
7132 delete pSrcByteBuff;
7133 pSrcByteBuff = null;
7135 AppLogDebug("EXIT");
7139 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
7140 if(pBitmap != null) //Prevent issue fix.
7145 if (pSrcByteBuff != null)
7147 delete pSrcByteBuff;
7148 pSrcByteBuff = null;
7155 CamcorderForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
7157 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
7158 result r = E_SUCCESS;
7159 int adjustEntryValue = 0;
7160 int currentEntryValue = 0;
7162 bool exposureValue = false;
7163 bool brighnesstValue = false;
7164 int selfPortraitEnable = 0;
7165 bool IsSliderAdjustValue = false;
7167 if (__dir == ORIENTATION_STATUS_PORTRAIT
7168 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7170 step = movableValidRect.width / maxEntryValue;
7171 if (currentPosition.x > movableValidRect.x)
7173 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
7175 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
7176 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
7178 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
7183 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
7186 IsSliderAdjustValue = true;
7190 IsSliderAdjustValue = false;
7195 step = movableValidRect.height / maxEntryValue;
7196 if (currentPosition.y > movableValidRect.y)
7198 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
7199 IsSliderAdjustValue = true;
7203 IsSliderAdjustValue = false;
7207 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7208 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7210 if (entryName.Equals(String(EXPOSURE_VALUE)))
7212 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7214 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7218 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7221 if (exposureValue == true && r == E_SUCCESS)
7223 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
7224 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7228 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7230 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7234 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7237 if (brighnesstValue == true && r == E_SUCCESS)
7239 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
7240 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7244 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
7246 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7248 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7252 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7255 if (exposureValue == true && r == E_SUCCESS)
7257 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
7258 TryCatch(r == E_SUCCESS, , "etValue() fail[%s]", GetErrorMessage(r));
7262 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7264 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7268 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7271 if (brighnesstValue == true && r == E_SUCCESS)
7273 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
7274 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
7278 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7280 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7284 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7287 if (exposureValue == true && r == E_SUCCESS)
7289 _pCameraPresentationModel->SetExposure(adjustEntryValue);
7293 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7295 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7299 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7302 if (brighnesstValue == true && r == E_SUCCESS)
7304 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
7308 AppLogDebug("SetBrightness do not support");
7314 AppLogDebug("EXIT");
7322 CamcorderForm::CreateExposureSlider(void)
7324 AppLogDebug("ENTER");
7325 result r = E_SUCCESS;
7327 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
7329 _closeTimerValue = 0;
7330 _pExposureCloseTimer = new (std::nothrow) Timer();
7331 _pExposureCloseTimer->Construct(*this);
7333 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
7334 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
7336 _pCameraInfoPanel->SetDrawExposure(true);
7337 _pCameraInfoPanel->Invalidate(true);
7339 AppLogDebug("EXIT");
7343 delete _pExposureCloseTimer;
7344 _pExposureCloseTimer = null;
7350 CamcorderForm::DrawExposureSlider(void)
7352 AppLogDebug("ENTER");
7353 Point buttonPosition;
7354 result r = E_SUCCESS;
7357 int selfPortraitEnable = 0;
7358 bool exposureValue = false;
7359 bool brighnesstValue = false;
7361 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7362 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7364 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7366 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7370 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7373 if (exposureValue == true && r == E_SUCCESS)
7375 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
7376 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7377 AppLogDebug("Exposure value %d", exposure);
7381 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7383 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7387 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7390 if (brighnesstValue == true && r == E_SUCCESS)
7392 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
7393 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7394 AppLogDebug("Exposure value %d",exposure);
7398 if (__dir == ORIENTATION_STATUS_PORTRAIT
7399 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7401 step = W_EXPOSURE_PANEL_SLIDER_PORTRAIT / MAX_CAMERA_EXPOSURE_VALUE;
7403 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7404 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7405 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
7409 step = H_EXPOSURE_PANEL_SLIDER_LANDSCAPE / MAX_CAMERA_EXPOSURE_VALUE;
7411 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7412 buttonPosition.y = (step * exposure) + Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7413 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
7416 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
7417 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7419 AppLogDebug("EXIT");
7427 CamcorderForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
7429 AppLogDebug("ENTER");
7430 result r = E_SUCCESS;
7431 Point buttonPosition;
7432 Rectangle rectSlider;
7433 float adjustedXvalue = 0;
7434 int adjustedXinInt = 0;
7436 bool isSliderRectValid = false;
7438 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
7440 if (__dir == ORIENTATION_STATUS_PORTRAIT
7441 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7445 case DRAW_INITIALIZED:
7447 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7448 buttonPosition.y = currentPosition.y;
7449 isSliderRectValid = true;
7455 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_PORTRAIT + W_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7457 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_PORTRAIT + H_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7459 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7460 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7461 isSliderRectValid = true;
7463 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
7465 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7466 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7468 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
7469 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
7471 if ((adjustedXvalue - adjustedXinInt) != 0)
7473 adjustedXinInt = adjustedXinInt+1;
7476 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
7478 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_PORTRAIT + adjustedXinInt;
7479 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
7480 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);
7481 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7485 isSliderRectValid = false;
7490 isSliderRectValid = false;
7497 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_PORTRAIT + W_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7499 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_PORTRAIT + H_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7501 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7502 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7503 isSliderRectValid = true;
7504 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);
7505 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7510 isSliderRectValid = false;
7513 if ((buttonPosition.y % FRAME_SKIP) != 0)
7515 isSliderRectValid = false;
7528 case DRAW_INITIALIZED:
7530 buttonPosition.x = currentPosition.x;
7531 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7532 isSliderRectValid = true;
7538 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_LANDSCAPE + W_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7540 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE + H_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7542 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7543 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7544 isSliderRectValid = true;
7545 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);
7546 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7551 isSliderRectValid = false;
7558 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_LANDSCAPE + W_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7560 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE + H_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7562 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7563 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7564 isSliderRectValid = true;
7565 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);
7566 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7571 isSliderRectValid = false;
7574 if ((buttonPosition.y % FRAME_SKIP) != 0)
7576 isSliderRectValid = false;
7586 if (isSliderRectValid)
7588 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
7589 _pCameraInfoPanel->Invalidate(true);
7592 AppLogDebug("EXIT");
7601 CamcorderForm::ShowExposureSlider(void)
7603 AppLogDebug("ENTER");
7604 result r = E_SUCCESS;
7605 int selfPortraitEnable = CAMCORDER_FORM_PRIMARY_MODE;
7606 bool exposureValue = false;
7607 bool brighnesstValue = false;
7609 if (_pExposureCloseTimer)
7611 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7612 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
7614 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
7618 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7620 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7624 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7627 if (exposureValue == true && r == E_SUCCESS)
7629 r = CreateExposureSlider();
7630 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7632 r = DrawExposureSlider();
7633 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7637 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7639 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7643 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7646 if (brighnesstValue == true && r == E_SUCCESS)
7648 r = CreateExposureSlider();
7649 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7651 r = DrawExposureSlider();
7652 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7657 AppLogDebug("EXIT");
7661 CamcorderForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7663 AppLogDebug("ENTER");
7664 result r = E_SUCCESS;
7665 bool modified = false;
7666 bool isValidRect = false;
7667 Dimension dimRendererSize;
7669 if (__screenMode == SCREEN_MODE_NORMAL)
7671 Dimension dim = Dimension(0, 0);
7672 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7673 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7674 Rectangle clientRect = GetClientAreaBounds();
7675 bool isToCompensated = false;
7677 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7678 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7680 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7682 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7683 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7687 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7688 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7693 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7695 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7696 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7700 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7701 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7705 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7707 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7708 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7710 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7711 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7713 if (modified == true)
7715 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7718 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7719 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7721 if (evaluateBoundsRect.height == rect.height)
7723 isToCompensated = false;
7727 isToCompensated = true;
7732 if (evaluateBoundsRect.width == rect.width)
7734 isToCompensated = false;
7738 isToCompensated = true;
7742 r = __pOverlayPanel->SetBounds(rect);
7743 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7744 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7746 if (isToCompensated == true)
7748 AppLogDebug("isToCompensated = true");
7750 rect = __pOverlayPanel->GetBounds();
7751 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7753 r = __pOverlayPanel->SetBounds(rect);
7754 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7755 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7758 dimRendererSize = __pOverlayPanel->GetSize();
7759 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7760 __pOverlayPanel->SetRenderSize(dimRendererSize);
7764 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7765 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7766 Rectangle clientRect = GetClientAreaBounds();
7767 bool isToCompensated = false;
7769 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7770 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7772 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7774 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7778 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7783 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7785 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7789 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7793 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7795 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7796 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7798 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7799 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7801 if (modified == true)
7803 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7806 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7807 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7809 if (evaluateBoundsRect.height == rect.height)
7811 isToCompensated = false;
7815 isToCompensated = true;
7820 if (evaluateBoundsRect.width == rect.width)
7822 isToCompensated = false;
7826 isToCompensated = true;
7830 r = __pOverlayPanel->SetBounds(rect);
7831 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7832 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7834 if (isToCompensated == true)
7836 rect = __pOverlayPanel->GetBounds();
7837 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7839 r = __pOverlayPanel->SetBounds(rect);
7840 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7841 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7844 dimRendererSize = __pOverlayPanel->GetSize();
7845 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7846 __pOverlayPanel->SetRenderSize(dimRendererSize);
7848 AppLogDebug("EXIT");
7852 CamcorderForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7854 AppLogDebug("ENTER");
7855 result r = E_SUCCESS;
7856 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7857 BufferInfo bufferinfo;
7858 int selfPortraitEnable = CAMCORDER_FORM_PRIMARY_MODE;
7859 int guideLineEnable = DISABLE_GUIDELINE;
7860 String listName = L"";
7862 if (_appControlActionCompleted)
7864 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7866 if (__dir != orientationStatus)
7868 __dir = orientationStatus;
7873 if (__dir != orientationStatus)
7875 __isOrientationChanged = true;
7877 if (_pAppTimer != null)
7879 _pAppTimer->Cancel();
7881 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
7884 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7885 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
7887 SetOverlayPanelOrientationChanged(orientationStatus);
7889 if (__pOverlayPanel)
7891 switch (orientationStatus)
7893 case ORIENTATION_STATUS_PORTRAIT:
7895 AppLogDebug("PORTRAIT");
7896 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7900 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7902 AppLogDebug("PORTRAIT REVERSE");
7903 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7907 case ORIENTATION_STATUS_LANDSCAPE:
7909 AppLogDebug("LANDSCAPE");
7910 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7914 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7916 AppLogDebug("LANDSCAPE REVERSE");
7917 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7926 __dir = orientationStatus;
7928 _pCameraPresentationModel->SetOrientation(__dir);
7930 if (__screenMode == SCREEN_MODE_FULL)
7932 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
7934 HidePanel(true, true);
7938 HidePanel(false, true);
7942 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7943 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7945 if (guideLineEnable == DISABLE_GUIDELINE)
7947 r = DrawMarker(false);
7951 r = DrawMarker(true);
7953 TryReturnVoid(r == E_SUCCESS, "DrawMarker fail[%s]", GetErrorMessage(r));
7955 UpdateUiPanelIcon();
7956 UpdateUiActionPanelIcon();
7957 OnHelpCloseTimerExpired();
7960 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
7962 if (_pHelpCloseTimer)
7964 _pHelpCloseTimer->Cancel();
7966 delete _pHelpCloseTimer;
7967 _pHelpCloseTimer = null;
7970 HideScreenOverlayHelp();
7972 _pCameraInfoPanel->SetDrawIndicator(false);
7973 _pCameraInfoPanel->Invalidate(true);
7976 if (_pListViewCameraTabMainMenu != null)
7978 listName = _pListViewCameraTabMainMenu->GetName();
7979 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
7985 if (_pListViewGeneralTabMainMenu != null)
7987 listName = _pListViewGeneralTabMainMenu->GetName();
7988 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
7994 if (_pListFlashMainMenu != null)
7996 listName = _pListFlashMainMenu->GetName();
7998 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)) && _pListFlashMainMenu->GetShowState() == true)
8004 if (_pListWbMainMenu != null)
8006 listName = _pListWbMainMenu->GetName();
8008 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME)) && _pListWbMainMenu->GetShowState() == true)
8014 if (_pListViewCameraTabSubMenu != null)
8016 if (_pListViewCameraTabSubMenu->GetShowState() == true)
8022 if (_pListViewGeneralTabSubMenu != null)
8024 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
8030 MakeSettingPopupTab(false);
8033 if (_pCameraInfoPanel->GetDrawExposure() == true)
8035 _pCameraInfoPanel->SetDrawExposure(false);
8038 __isOrientationChanged = false;
8040 /*if ( _pResetPopUp !=null || _pResetPopUp->IsVisible())
8042 //_pResetPopUp->SetBounds(ResetPopupRect);
8043 //_pResetPopUp->Invalidate(true);
8046 if ( __pCancelPopup !=null && __pCancelPopup->IsVisible())
8048 //__pCancelPopup->SetBounds(CancelPopupRect);
8049 //__pCancelPopup->Invalidate(true);
8052 AppLogDebug("EXIT");
8056 CamcorderForm::HidePopup(void)
8058 AppLogDebug("ENTER");
8059 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
8061 if (_pListViewCameraTabSubMenu)
8063 if (_pCameraInfoSubPanel != null)
8065 _pCameraInfoSubPanel->SetShowState(false);
8067 _pListViewCameraTabSubMenu->SetShowState(false);
8070 if (_pListViewCameraTabMainMenu)
8072 _pListViewCameraTabMainMenu->SetShowState(false);
8075 if (_pListViewGeneralTabSubMenu)
8077 if (_pCameraInfoGeneralSubPanel != null)
8079 _pCameraInfoGeneralSubPanel->SetShowState(false);
8081 _pListViewGeneralTabSubMenu->SetShowState(false);
8084 if (_pListViewGeneralTabMainMenu)
8086 _pListViewGeneralTabMainMenu->SetShowState(false);
8089 if (_pListFlashMainMenu)
8091 _pListFlashMainMenu->SetShowState(false);
8094 if (_pListWbMainMenu)
8096 _pListWbMainMenu->SetShowState(false);
8099 _pCameraInfoPanel->SetDrawExposure(false);
8100 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
8101 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
8102 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
8103 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
8105 if (__isOrientationChanged)
8107 __isOrientationChanged = false;
8109 _pCameraInfoPanel->Invalidate(true);
8113 _pCameraInfoPanel->Draw();
8114 _pCameraInfoPanel->Show();
8116 AppLogDebug("EXIT");
8120 CamcorderForm::CheckStorageInfo(void)
8122 AppLogDebug("ENTER");
8123 result r = E_SUCCESS;
8124 MessageBox messageBox;
8126 String strTemp = L"";
8127 int remainedNum = 0;
8128 int remainedNumOfTwenty = 0;
8130 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
8131 AppLogDebug("<<<< remainedNum = %d", remainedNum);
8133 remainedNum = remainedNum * UNIT_HUNDRED;
8134 AppLogDebug(">>>> remainedNum = %d", remainedNum);
8136 remainedNumOfTwenty = (remainedNum * UNIT_TWENTY) / UNIT_HUNDRED;
8137 AppLogDebug(">>>> remainedNumOfTwenty ( 20% ) = %d", remainedNumOfTwenty);
8139 if (remainedNum > remainedNumOfTwenty)
8141 AppLogDebug("capacity is over 20%");
8142 __isCapacityBelow = false;
8146 AppLogDebug("capacity is below 20%");
8147 __isCapacityBelow = true;
8150 if (remainedNum == STORAGE_VALUE_ZERO)
8152 if (__lowMemoryCapacity == false)
8154 __lowMemoryCapacity = true;
8155 __isMemoryFull = false;
8156 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);
8158 else if (__lowMemoryCapacity == true)
8160 __isMemoryFull = true;
8161 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
8163 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
8165 r = messageBox.ShowAndWait(result);
8166 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
8170 case MSGBOX_RESULT_OK:
8172 if (__lowMemoryCapacity == true)
8174 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
8175 _pCameraInfoPanel->SetStorageTitle(strTemp);
8176 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
8177 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
8178 _pCameraInfoPanel->Invalidate(true);
8181 if (__isMemoryFull == true)
8183 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
8184 _pCameraInfoPanel->SetStorageTitle(strTemp);
8185 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
8186 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
8187 _pCameraInfoPanel->Invalidate(true);
8196 //r = TerminateApp();
8197 //TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
8202 if (_isRecording == false)
8204 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
8206 _pCameraInfoPanel->SetStorageTitle(strTemp);
8207 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
8208 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
8209 _pCameraInfoPanel->Invalidate(true);
8212 SetStartRecording();
8216 AppLogDebug("_isRecording = true");
8221 AppLogDebug("EXIT");*/
8225 CamcorderForm::SetOverlayRendererRotation(void)
8227 AppLogDebug("ENTER");
8229 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8233 case ORIENTATION_STATUS_PORTRAIT:
8235 AppLogDebug("PORTRAIT");
8236 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8240 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8242 AppLogDebug("PORTRAIT REVERSE");
8243 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8247 case ORIENTATION_STATUS_LANDSCAPE:
8249 AppLogDebug("LANDSCAPE");
8250 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8254 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8256 AppLogDebug("LANDSCAPE REVERSE");
8257 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8264 AppLogDebug("EXIT");
8268 CamcorderForm::CreateOverlayRegion(Rectangle rect)
8270 AppLogDebug("ENTER");
8271 result r = E_SUCCESS;
8273 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8274 r = __pOverlayPanel->Construct(rect);
8275 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8276 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8278 r = AddControl(__pOverlayPanel);
8279 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8280 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8282 __pOverlayPanel->AddTouchEventListener(*this);
8284 AppLogDebug("EXIT");
8288 RemoveControl(*__pOverlayPanel);
8289 __pOverlayPanel = null;
8290 AppLogDebug("EXIT - CATCH");
8295 CamcorderForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8297 AppLogDebug("ENTER");
8298 result r = E_SUCCESS;
8299 bool modified = false;
8300 bool isValidRect = false;
8301 bool isToCompensated = false;
8302 Dimension dimRendererSize;
8304 if (destroyOverlay == true)
8306 if (__pOverlayPanel)
8308 __pOverlayPanel->RemoveTouchEventListener(*this);
8309 RemoveControl(*__pOverlayPanel);
8310 __pOverlayPanel = null;
8313 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8314 AppLogDebug("Input bounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8316 if (isWideMode == false)
8318 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8322 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8324 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8326 if (modified == true)
8328 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8331 if (__dir == ORIENTATION_STATUS_PORTRAIT
8332 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8334 if (evaluateBoundsRect.height == rect.height)
8336 isToCompensated = false;
8340 isToCompensated = true;
8345 if (evaluateBoundsRect.width == rect.width)
8347 isToCompensated = false;
8351 isToCompensated = true;
8355 r = CreateOverlayRegion(rect);
8356 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8358 if (isToCompensated == true)
8360 AppLogDebug("isToCompensated = true");
8362 rect = __pOverlayPanel->GetBounds();
8363 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8365 r = __pOverlayPanel->SetBounds(rect);
8366 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8367 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8370 dimRendererSize = __pOverlayPanel->GetSize();
8371 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8372 __pOverlayPanel->SetRenderSize(dimRendererSize);
8376 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8378 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8379 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8381 if (isWideMode == false)
8383 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8387 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8389 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8391 if (modified == true)
8393 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8396 if (__dir == ORIENTATION_STATUS_PORTRAIT
8397 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8399 if (evaluateBoundsRect.height == rect.height)
8401 isToCompensated = false;
8405 isToCompensated = true;
8410 if (evaluateBoundsRect.width == rect.width)
8412 isToCompensated = false;
8416 isToCompensated = true;
8420 r = __pOverlayPanel->SetBounds(rect);
8421 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8422 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8424 if (isToCompensated == true)
8426 rect = __pOverlayPanel->GetBounds();
8427 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8429 r = __pOverlayPanel->SetBounds(rect);
8430 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8431 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8434 dimRendererSize = __pOverlayPanel->GetSize();
8435 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8436 __pOverlayPanel->SetRenderSize(dimRendererSize);
8438 AppLogDebug("EXIT");
8442 RemoveControl(*__pOverlayPanel);
8443 __pOverlayPanel = null;
8444 AppLogDebug("EXIT - CATCH");
8449 CamcorderForm::SetOverlayPanelWideMode(bool isRemoved)
8451 AppLogDebug("ENTER");
8452 result r = E_SUCCESS;
8453 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8454 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8455 Rectangle clientRect = GetClientAreaBounds();
8457 if (__dir == ORIENTATION_STATUS_PORTRAIT
8458 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8460 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8462 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8466 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8471 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8473 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8477 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8481 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8482 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8483 AppLogDebug("EXIT");
8487 CamcorderForm::SetOverlayPanelNormalMode(bool isRemoved)
8489 AppLogDebug("ENTER");
8490 result r = E_SUCCESS;
8491 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8492 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8493 Rectangle clientRect = GetClientAreaBounds();
8495 if (__dir == ORIENTATION_STATUS_PORTRAIT
8496 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8498 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8500 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8501 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8505 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8506 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8511 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8513 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8514 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8518 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8519 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8523 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8524 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8525 AppLogDebug("EXIT");
8529 CamcorderForm::SetCamcorderMode(void)
8531 AppLogDebug("ENTER");
8532 result r = E_SUCCESS;
8533 int previewResolutionSize = 0;
8535 BufferInfo bufferinfo;
8537 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
8538 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8540 dim = _pCameraPresentationModel->GetPreviewResolution();
8541 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
8543 __previewResolutionWidth = dim.width;
8544 __previewResolutionHeight = dim.height;
8546 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8547 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
8549 _pCameraPresentationModel->StartPreview(&bufferinfo);
8551 _pCameraPresentationModel->SetContinuousAutoFocus();
8553 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8555 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8556 AppLogDebug("EXIT");
8560 CamcorderForm::SetScreenMode(const ScreenMode mode, bool destory)
8562 AppLogDebug("ENTER");
8563 result r = E_SUCCESS;
8566 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8570 case SCREEN_MODE_NORMAL:
8572 if (destory == true)
8574 if (__screenMode != mode)
8576 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8577 _pAppTimer->Cancel();
8579 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
8580 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8582 _pCameraPresentationModel->KeepScreenOnState(true, false);
8584 _pCameraPresentationModel->StopCamera();
8587 SetOverlayPanelNormalMode(true);
8589 SetOverlayRendererRotation();
8591 if (__screenMode != mode)
8597 AppLogDebug("__screenMode = mode");
8599 __screenMode = SCREEN_MODE_NORMAL;
8603 SetOverlayPanelNormalMode(false);
8605 SetOverlayRendererRotation();
8607 __screenMode = SCREEN_MODE_NORMAL;
8610 HidePanel(false, false);
8612 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8616 case SCREEN_MODE_FULL:
8618 Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
8620 if (destory == true)
8622 if (__screenMode != mode)
8624 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8625 _pAppTimer->Cancel();
8627 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
8628 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8630 _pCameraPresentationModel->KeepScreenOnState(true, false);
8632 _pCameraPresentationModel->StopCamera();
8635 SetOverlayPanelWideMode(true);
8637 SetOverlayRendererRotation();
8639 if (__screenMode != mode)
8645 AppLogDebug("__screenMode = mode");
8647 __screenMode = SCREEN_MODE_FULL;
8651 SetOverlayPanelWideMode(false);
8653 SetOverlayRendererRotation();
8655 __screenMode = SCREEN_MODE_FULL;
8658 HidePanel(true, false);
8660 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8671 AppLogDebug("EXIT");
8675 __screenMode = SCREEN_MODE_NORMAL;
8676 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8682 CamcorderForm::InDrawFocus(void)
8684 AppLogDebug("ENTER");
8685 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8686 Rectangle clientRect = GetClientAreaBounds();
8687 Point currentPosition;
8688 int selfPortraitEnable = 0;
8689 result r = E_SUCCESS;
8690 bool focusSupport = false;
8692 if (__dir == ORIENTATION_STATUS_PORTRAIT
8693 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8695 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
8696 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
8700 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
8701 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
8704 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8705 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
8707 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8709 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
8713 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
8716 if (focusSupport == true && r == E_SUCCESS)
8718 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
8719 _pCameraInfoPanel->SetDrawMarkerFocus(true);
8720 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
8724 _pCameraInfoPanel->SetDrawMarkerFocus(false);
8725 _pCameraInfoPanel->Draw();
8726 _pCameraInfoPanel->Show();
8728 AppLogDebug("EXIT");
8732 CamcorderForm::StartRecord(void)
8734 AppLogDebug("ENTER");
8735 result r = E_SUCCESS;
8736 int timerIntervalVale = 0;
8737 int remainingPhoto = 0;
8739 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
8740 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
8742 InitMakerFocusTimer();
8744 _pCameraInfoPanel->SetDrawMarkerFocus(false);
8746 _pCameraInfoPanel->SetDrawIndicator(false);
8748 _pCameraInfoPanel->Invalidate(true);
8750 r = _pMakerFocusTimer->Cancel();
8751 TryLog(r == E_SUCCESS, "Marker focus can't be cancled!");
8753 r = _pMakerFocusTimer->Start(CAMCORDER_TIMER_ONE_SEC);
8754 TryLog(r == E_SUCCESS, "Marker focus timer could not be started!");
8756 remainingPhoto = _pCameraInfoPanel->CheckAvailableStorageSpace();
8757 TryLog(remainingPhoto >-1, "Remaining photo count is nonnegative!");
8761 if (__pThumbnailButton)
8763 __pThumbnailButton->SetShowState(false);
8764 __pThumbnailButton->Invalidate(true);
8769 if (_pThumbnailPanel)
8771 _pThumbnailPanel->SetShowState(false);
8772 _pThumbnailPanel->Invalidate(true);
8774 AppLogDebug("EXIT");
8778 CamcorderForm::StopRecord(void)
8780 AppLogDebug("ENTER");
8781 result r = E_SUCCESS;
8785 _pCameraInfoPanel->SetDrawIndicator(true);
8786 _pCameraInfoPanel->Invalidate(true);
8788 if (_pMakerFocusTimer)
8790 _pMakerFocusTimer->Cancel();
8793 _isRecording = false;
8795 _isRecordingPause = false;
8797 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
8798 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
8799 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
8800 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING
8801 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSING
8804 r = _pCameraPresentationModel->StopRecord();
8805 TryCatch(r == E_SUCCESS, , "Stop record failed [%s]",GetErrorMessage(r));
8808 r = DrawRecord(false);
8809 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8815 r = SetRecordButton(false);
8816 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8820 if (_pIntervalValueTimer)
8822 _pIntervalValueTimer->Cancel();
8827 _pPopupTimer->Cancel();
8830 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8832 _pCameraInfoPanel->SetDrawPopupTimer(false);
8834 _pCameraInfoPanel->Invalidate(true);
8836 AppLogDebug("EXIT");
8839 AppLogDebug("Caught record stop exception. Terminating app");
8840 _pCameraPresentationModel->SetRecordStopException(true);
8841 _pCameraPresentationModel->CancelRecord();
8846 CamcorderForm::HideRecLabe(void)
8848 AppLogDebug("ENTER");
8849 if (__pElapsedTimeLable)
8851 __pElapsedTimeLable->SetShowState(false);
8852 __pElapsedTimeLable->Invalidate(true);
8855 if (__pElapsedTimeMaxLable)
8857 __pElapsedTimeMaxLable->SetShowState(false);
8858 __pElapsedTimeMaxLable->Invalidate(true);
8861 if (__pElapsedRecordSizeLable)
8863 __pElapsedRecordSizeLable->SetShowState(false);
8864 __pElapsedRecordSizeLable->Invalidate(true);
8869 __pRecLabelRed->SetShowState(false);
8870 __pRecLabelRed->Invalidate(true);
8873 if (__pRecLabelText)
8875 __pRecLabelText->SetShowState(false);
8876 __pRecLabelText->Invalidate(true);
8878 AppLogDebug("EXIT");
8882 CamcorderForm::SetRecordPauseBitmap(bool start)
8884 AppLogDebug("ENTER");
8887 __pRecordPauseBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_RECORDING_SHUTTER_NORMAL);
8891 __pRecordPauseBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
8893 TryCatch(__pRecordPauseBitmap != null, , "__pRecordPauseBitmap is null");
8895 AppLogDebug("EXIT");
8899 delete __pRecordPauseBitmap;
8900 __pRecordPauseBitmap = null;
8902 AppLogDebug("EXIT - CATCH");
8907 CamcorderForm::PauseRecord(void)
8909 AppLogDebug("ENTER");
8910 result r = E_SUCCESS;
8912 r = SetRecordPauseBitmap(true);
8913 //TryCatch(r == E_SUCCESS, , "SetRecordPauseBitmap start fail[%s]", GetErrorMessage(r));
8914 AppLogDebug("SetRecordPauseBitmap() fail[%s]", GetErrorMessage(r));
8916 r = SetRecordPauseButton(true);
8917 TryCatch(r == E_SUCCESS, , "SetRecordPauseButton start fail[%s]", GetErrorMessage(r));
8919 _isRecording = false;
8921 _isRecordingPause = true;
8923 _pCameraPresentationModel->PauseRecord();
8925 __pRecordTimer->Cancel();
8929 r = DrawPauseRecord();
8930 TryCatch(r == E_SUCCESS, , "DrawPauseRecord start fail[%s]", GetErrorMessage(r));
8932 AppLogDebug("EXIT");
8936 AppLogDebug("EXIT - CATCH");
8941 CamcorderForm::CancelRecord(void)
8943 AppLogDebug("ENTER");
8944 result r = E_SUCCESS;
8948 _pCameraInfoPanel->SetDrawIndicator(true);
8949 _pCameraInfoPanel->Invalidate(true);
8951 if (_pMakerFocusTimer)
8953 _pMakerFocusTimer->Cancel();
8956 _isRecording = false;
8958 _pCameraPresentationModel->SetCancelRecord(true);
8960 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
8961 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
8962 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
8963 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING
8964 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSING
8967 _pCameraPresentationModel->StopRecord();
8970 r = DrawRecord(false);
8971 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8977 r = SetRecordButton(false);
8978 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8982 _pIntervalValueTimer->Cancel();
8986 _pPopupTimer->Cancel();
8989 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8991 _pCameraInfoPanel->SetDrawPopupTimer(false);
8993 _pCameraInfoPanel->Invalidate(true);
8995 AppLogDebug("EXIT");
8999 CamcorderForm::CancelTimerIntervalRecord(void)
9001 AppLogDebug("ENTER");
9002 if (_pIntervalValueTimer)
9004 _pIntervalValueTimer->Cancel();
9007 __doRecording = false;
9011 __pBatteryState->SetShowState(true);
9012 __pBatteryState->Draw();
9014 _pCameraInfoPanel->SetDrawIndicator(true);
9015 _pCameraInfoPanel->Invalidate(true);
9017 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
9018 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
9019 _pCameraInfoPanel->Draw();
9020 _pCameraInfoPanel->Show();
9022 _pCameraInfoPanel->SetDrawPopupTimer(false);
9023 _pCameraInfoPanel->Draw();
9024 _pCameraInfoPanel->Show();
9025 __setTimerInterval = false;
9027 _pCameraPresentationModel->SetIntervalTimerRun(false);
9030 AppLogDebug("EXIT");
9034 CamcorderForm::SetRecordEndReached(void)
9036 AppLogDebug("ENTER");
9037 result r = E_SUCCESS;
9041 _isRecording = false;
9043 __doRecording = false;
9045 _isRecordingPause = false;
9049 _pCameraInfoPanel->SetDrawIndicator(true);
9050 _pCameraInfoPanel->Invalidate(true);
9052 if (_pMakerFocusTimer)
9054 _pMakerFocusTimer->Cancel();
9057 _isRecording = false;
9059 _isRecordingPause = false;
9061 r = DrawRecord(false);
9062 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
9068 r = SetRecordButton(false);
9069 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
9073 if (_pIntervalValueTimer)
9075 _pIntervalValueTimer->Cancel();
9080 _pPopupTimer->Cancel();
9083 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9085 _pCameraInfoPanel->SetDrawPopupTimer(false);
9087 _pCameraInfoPanel->Invalidate(true);
9092 _pCameraPresentationModel->CloseRecord();
9093 AppLogDebug("EXIT");
9097 CamcorderForm::SetRecordErrorOccurred(void)
9099 AppLogDebug("ENTER");
9100 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
9101 Rectangle clientRect = GetClientAreaBounds();
9102 Point currentPosition;
9103 result r = E_SUCCESS;
9105 AppLogDebug("SetRecordErrorOccurred.");
9109 _pCameraInfoPanel->SetDrawIndicator(true);
9110 _pCameraInfoPanel->Invalidate(true);
9112 if (_pMakerFocusTimer)
9114 _pMakerFocusTimer->Cancel();
9117 _isRecording = false;
9121 r = SetRecordButton(false);
9122 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
9126 if (_pIntervalValueTimer)
9128 _pIntervalValueTimer->Cancel();
9133 _pPopupTimer->Cancel();
9136 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9138 _pCameraInfoPanel->SetDrawPopupTimer(false);
9140 _pCameraInfoPanel->Invalidate(true);
9145 StartInitAppTimer();
9146 AppLogDebug("EXIT");
9150 CamcorderForm::HideUiAction(void)
9152 AppLogDebug("ENTER");
9155 _pPopupTimer->Cancel();
9158 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9160 _pCameraInfoPanel->SetDrawPopupTimer(false);
9162 _pCameraInfoPanel->Invalidate(true);
9165 if (_pExposureCloseTimer != null)
9167 _closeTimerValue = 0;
9169 _pExposureCloseTimer->Cancel();
9172 if (_pCameraInfoPanel->GetDrawExposure() == true)
9174 _pCameraInfoPanel->SetDrawExposure(false);
9179 if (_pMakerFocusTimer != null)
9181 _pMakerFocusTimer->Cancel();
9183 AppLogDebug("EXIT");
9187 CamcorderForm::HideUiSettingMenu(void)
9189 AppLogDebug("ENTER");
9190 if (_pCameraInfoPanel)
9192 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
9193 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
9194 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
9195 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
9198 if (_pListViewCameraTabSubMenu)
9200 if (_pCameraInfoSubPanel != null)
9202 _pCameraInfoSubPanel->SetShowState(false);
9204 _pListViewCameraTabSubMenu->SetShowState(false);
9207 if (_pListViewCameraTabMainMenu)
9209 _pListViewCameraTabMainMenu->SetShowState(false);
9212 if (_pListViewGeneralTabSubMenu)
9214 if (_pCameraInfoGeneralSubPanel != null)
9216 _pCameraInfoGeneralSubPanel->SetShowState(false);
9218 _pListViewGeneralTabSubMenu->SetShowState(false);
9221 if (_pListViewGeneralTabMainMenu)
9223 _pListViewGeneralTabMainMenu->SetShowState(false);
9226 if (_pListFlashMainMenu)
9228 _pListFlashMainMenu->SetShowState(false);
9231 if (_pListWbMainMenu)
9233 _pListWbMainMenu->SetShowState(false);
9235 AppLogDebug("EXIT");
9239 CamcorderForm::HideUiQuickMenu(void)
9241 AppLogDebug("ENTER");
9242 if (_pSelfShotButton != null)
9244 _pSelfShotButton->SetShowState(true);
9245 _pSelfShotButton->Invalidate(true);
9248 if (_pSettingButton != null)
9250 _pSettingButton->SetShowState(true);
9251 _pSettingButton->Invalidate(true);
9254 if (__pSettingLine != null)
9256 __pSettingLine->SetShowState(true);
9257 __pSettingLine->Invalidate(true);
9260 if (_pCameraInfoPanel != null)
9262 _pCameraInfoPanel->SetDrawIndicator(true);
9263 _pCameraInfoPanel->Invalidate(true);
9266 if (_pFlashButton != null)
9268 _pFlashButton->SetShowState(false);
9269 _pFlashButton->Invalidate(true);
9272 if (_pQuickSettingButton != null)
9274 _pQuickSettingButton->SetShowState(false);
9275 _pQuickSettingButton->Invalidate(true);
9278 if (_pWhiteBalanceButton != null)
9280 _pWhiteBalanceButton->SetShowState(false);
9281 _pWhiteBalanceButton->Invalidate(true);
9284 if (_pExposureValueButton != null)
9286 _pExposureValueButton->SetShowState(false);
9287 _pExposureValueButton->Invalidate(true);
9290 if (_pCloseButton != null)
9292 _pCloseButton->SetShowState(false);
9293 _pCloseButton->Invalidate(true);
9295 AppLogDebug("EXIT");
9299 CamcorderForm::ShowUiQuickMenu(void)
9301 AppLogDebug("ENTER");
9302 if (_pCameraInfoPanel)
9304 _pCameraInfoPanel->SetDrawIndicator(false);
9305 _pCameraInfoPanel->Invalidate(true);
9308 if (_pSelfShotButton)
9310 _pSelfShotButton->SetShowState(false);
9311 _pSelfShotButton->Invalidate(true);
9314 if (_pSettingButton)
9316 _pSettingButton->SetShowState(false);
9317 _pSettingButton->Invalidate(true);
9322 __pSettingLine->SetShowState(false);
9323 __pSettingLine->Invalidate(true);
9328 _pFlashButton->SetShowState(true);
9329 _pFlashButton->Invalidate(true);
9332 if (_pQuickSettingButton)
9334 _pQuickSettingButton->SetShowState(true);
9335 _pQuickSettingButton->Invalidate(true);
9338 if (_pWhiteBalanceButton)
9340 _pWhiteBalanceButton->SetShowState(true);
9341 _pWhiteBalanceButton->Invalidate(true);
9344 if (_pExposureValueButton)
9346 _pExposureValueButton->SetShowState(true);
9347 _pExposureValueButton->Invalidate(true);
9352 _pCloseButton->SetShowState(true);
9353 _pCloseButton->Invalidate(true);
9355 AppLogDebug("EXIT");
9359 CamcorderForm::HideUiModeChangedButton(void)
9361 AppLogDebug("ENTER");
9362 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9364 AppControlRequestHideButton();
9368 if (__pCameraIconLabel)
9370 __pCameraIconLabel->SetShowState(true);
9373 if (__pCamcoderIconLabel)
9375 __pCamcoderIconLabel->SetShowState(true);
9380 __pSwButton->SetShowState(true);
9385 AppLogDebug("EXIT");
9389 CamcorderForm::AppControlRequestHideButton(void)
9391 AppLogDebug("ENTER");
9392 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
9393 const IMap* pArguments = pApp->GetAppControlArguments();
9395 if (pArguments == null)
9397 AppLogDebug("pArguments is null");
9399 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
9401 AppLogDebug("Recording");
9402 if (__pCameraIconLabel)
9404 __pCameraIconLabel->SetShowState(false);
9407 if (__pCamcoderIconLabel)
9409 __pCamcoderIconLabel->SetShowState(false);
9414 __pSwButton->SetShowState(false);
9419 if (__pCameraIconLabel)
9421 __pCameraIconLabel->SetShowState(true);
9424 if (__pCamcoderIconLabel)
9426 __pCamcoderIconLabel->SetShowState(true);
9431 __pSwButton->SetShowState(true);
9437 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
9438 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
9440 AppLogDebug("ALLOW_SWITCH_TRUE");
9441 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
9443 AppLogDebug("Recording");
9445 if (__pCameraIconLabel)
9447 __pCameraIconLabel->SetShowState(false);
9450 if (__pCamcoderIconLabel)
9452 __pCamcoderIconLabel->SetShowState(false);
9457 __pSwButton->SetShowState(false);
9462 if (__pCameraIconLabel)
9464 __pCameraIconLabel->SetShowState(true);
9467 if (__pCamcoderIconLabel)
9469 __pCamcoderIconLabel->SetShowState(true);
9474 __pSwButton->SetShowState(true);
9480 AppLogDebug("ALLOW_SWITCH_FALSE");
9481 if (__pCameraIconLabel)
9483 __pCameraIconLabel->SetShowState(false);
9486 if (__pCamcoderIconLabel)
9488 __pCamcoderIconLabel->SetShowState(false);
9493 __pSwButton->SetShowState(false);
9497 AppLogDebug("EXIT");
9501 CamcorderForm::DoRecordHideUiPanel(void)
9503 AppLogDebug("ENTER");
9504 result r = E_SUCCESS;
9505 int timerIntervalVale = 0;
9507 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
9508 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9510 _pFlashButton->SetShowState(false);
9511 _pSelfShotButton->SetShowState(false);
9512 _pSettingButton->SetShowState(false);
9513 __pSettingLine->SetShowState(false);
9515 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && !__doRecording)
9517 AppControlRequestHideButton();
9521 __pCameraIconLabel->SetShowState(false);
9522 __pCamcoderIconLabel->SetShowState(false);
9523 __pSwButton->SetShowState(false);
9526 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9528 __pThumbnailButton->SetShowState(false);
9529 _pThumbnailPanel->SetShowState(false);
9535 __pThumbnailButton->SetShowState(false);
9536 _pThumbnailPanel->SetShowState(false);
9540 __pThumbnailButton->SetShowState(true);
9541 _pThumbnailPanel->SetShowState(true);
9544 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9545 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9547 _pQuickSettingButton->SetShowState(false);
9548 _pWhiteBalanceButton->SetShowState(false);
9549 _pExposureValueButton->SetShowState(false);
9550 _pCloseButton->SetShowState(false);
9551 _pAutoFocus->SetShowState(false);
9553 if (__screenMode == SCREEN_MODE_FULL)
9562 AppLogDebug("EXIT");
9566 CamcorderForm::HideUiPanel(bool state)
9568 AppLogDebug("ENTER");
9571 _pFlashButton->SetShowState(false);
9572 _pSelfShotButton->SetShowState(false);
9573 _pSettingButton->SetShowState(false);
9574 __pSettingLine->SetShowState(false);
9576 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && !__doRecording)
9578 AppControlRequestHideButton();
9582 __pCameraIconLabel->SetShowState(false);
9583 __pCamcoderIconLabel->SetShowState(false);
9584 __pSwButton->SetShowState(false);
9587 __pRecordButton->SetShowState(true);
9589 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9591 __pThumbnailButton->SetShowState(false);
9592 _pThumbnailPanel->SetShowState(false);
9598 __pThumbnailButton->SetShowState(false);
9599 _pThumbnailPanel->SetShowState(false);
9603 __pThumbnailButton->SetShowState(true);
9604 _pThumbnailPanel->SetShowState(true);
9607 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9608 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9610 _pQuickSettingButton->SetShowState(false);
9611 _pWhiteBalanceButton->SetShowState(false);
9612 _pExposureValueButton->SetShowState(false);
9613 _pCloseButton->SetShowState(false);
9614 _pAutoFocus->SetShowState(false);
9618 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9620 if (__pThumbnailButton)
9622 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9624 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9625 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9629 if (_pThumbnailPanel)
9631 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9633 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9634 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9640 __pThumbnailButton->SetShowState(true);
9641 _pThumbnailPanel->SetShowState(true);
9643 _pFlashButton->SetShowState(false);
9644 _pSelfShotButton->SetShowState(true);
9645 _pSettingButton->SetShowState(true);
9646 __pSettingLine->SetShowState(true);
9647 _pQuickSettingButton->SetShowState(false);
9648 _pWhiteBalanceButton->SetShowState(false);
9649 _pExposureValueButton->SetShowState(false);
9650 _pCloseButton->SetShowState(false);
9651 _pAutoFocus->SetShowState(false);
9653 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9655 AppControlRequestHideButton();
9659 __pCameraIconLabel->SetShowState(true);
9660 __pCamcoderIconLabel->SetShowState(true);
9661 __pSwButton->SetShowState(true);
9664 __pRecordButton->SetShowState(true);
9666 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
9667 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
9670 if (__screenMode == SCREEN_MODE_FULL)
9679 AppLogDebug("EXIT");
9683 CamcorderForm::SetControlAlwaysOnTopPanel(void)
9685 AppLogDebug("ENTER");
9686 if (__pSettingPanel)
9688 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
9690 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
9691 SetControlAlwaysOnTop(*__pSettingPanel, true);
9697 if (IsControlAlwaysOnTop(__pActionPanel) == false)
9699 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
9700 SetControlAlwaysOnTop(*__pActionPanel, true);
9706 if (IsControlAlwaysOnTop(_pFlashButton) == false)
9708 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
9709 SetControlAlwaysOnTop(*_pFlashButton, true);
9713 if (_pSelfShotButton)
9715 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
9717 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
9718 SetControlAlwaysOnTop(*_pSelfShotButton, true);
9722 if (_pSettingButton)
9724 if (IsControlAlwaysOnTop(_pSettingButton) == false)
9726 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
9727 SetControlAlwaysOnTop(*_pSettingButton, true);
9733 if (IsControlAlwaysOnTop(__pSettingLine) == false)
9735 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
9736 SetControlAlwaysOnTop(*__pSettingLine, true);
9740 if (__pCameraIconLabel)
9742 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
9744 AppLogDebug("IsControlAlwaysOnTop __pCameraIconLabel");
9745 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
9749 if (__pCamcoderIconLabel)
9751 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
9753 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
9754 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
9758 if (_pQuickSettingButton)
9760 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
9762 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
9763 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
9767 if (_pWhiteBalanceButton)
9769 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
9771 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
9772 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
9776 if (_pExposureValueButton)
9778 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
9780 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
9781 SetControlAlwaysOnTop(*_pExposureValueButton, true);
9787 if (IsControlAlwaysOnTop(_pCloseButton) == false)
9789 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
9790 SetControlAlwaysOnTop(*_pCloseButton, true);
9796 if (IsControlAlwaysOnTop(_pAutoFocus) == false)
9798 AppLogDebug("IsControlAlwaysOnTop _pAutoFocus");
9799 SetControlAlwaysOnTop(*_pAutoFocus, true);
9803 if (__pBatteryState)
9805 if (IsControlAlwaysOnTop(__pBatteryState) == false)
9807 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
9808 SetControlAlwaysOnTop(*__pBatteryState, true);
9814 if (IsControlAlwaysOnTop(__pSwButton) == false)
9816 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
9817 SetControlAlwaysOnTop(*__pSwButton, true);
9821 if (__pRecordButton)
9823 if (IsControlAlwaysOnTop(__pRecordButton) == false)
9825 AppLogDebug("IsControlAlwaysOnTop __pRecordButton");
9826 SetControlAlwaysOnTop(*__pRecordButton, true);
9830 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9832 if (__pThumbnailButton)
9834 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9836 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9837 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9841 if (_pThumbnailPanel)
9843 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9845 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9846 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9852 if (__pThumbnailButton)
9854 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
9856 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9857 SetControlAlwaysOnTop(*__pThumbnailButton, true);
9861 if (_pThumbnailPanel)
9863 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
9865 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9866 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
9871 if (_pHelpGoToGallery)
9873 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
9875 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
9876 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
9880 if (_pHelpGoToGalleryText)
9882 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
9884 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
9885 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
9889 if (_pHelpSwitchCamera)
9891 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
9893 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
9894 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
9898 if (_pHelpSwitchCameraText)
9900 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
9902 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
9903 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
9907 if (_pHelpQuickSetting)
9909 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
9911 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
9912 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
9916 if (_pHelpQuickSettingText)
9918 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
9920 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
9921 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
9925 if (_pHelpRecordVideo)
9927 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
9929 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
9930 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
9934 if (_pHelpRecordVideoText)
9936 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
9938 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
9939 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
9945 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
9947 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
9948 SetControlAlwaysOnTop(*_pHelpShutter, true);
9952 if (_pHelpShutterText)
9954 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
9956 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
9957 SetControlAlwaysOnTop(*_pHelpShutterText, true);
9961 if (__pCamcoderSetting)
9963 if (IsControlAlwaysOnTop(__pCamcoderSetting) == false)
9965 AppLogDebug("IsControlAlwaysOnTop __pCamcoderSetting");
9966 SetControlAlwaysOnTop(*__pCamcoderSetting, true);
9970 if (__pCamcorderSettingLable)
9972 if (IsControlAlwaysOnTop(__pCamcorderSettingLable) == false)
9974 AppLogDebug("IsControlAlwaysOnTop __pCamcorderSettingLable");
9975 SetControlAlwaysOnTop(*__pCamcorderSettingLable, true);
9979 if (__pGeneralSetting)
9981 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
9983 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
9984 SetControlAlwaysOnTop(*__pGeneralSetting, true);
9988 if (__pGeneralSettingLable)
9990 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
9992 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
9993 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
9996 AppLogDebug("EXIT");
10000 CamcorderForm::HidePanel(bool isWideMode, bool isInvalidated)
10002 AppLogDebug("ENTER");
10003 result r = E_SUCCESS;
10005 SetControlAlwaysOnTopPanel();
10007 if (isWideMode == true)
10009 if (__pSettingPanel)
10011 r = __pSettingPanel->SetShowState(false);
10012 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10015 if (__pActionPanel)
10017 r = __pActionPanel->SetShowState(false);
10018 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10023 if (__pSettingPanel)
10025 r = __pSettingPanel->SetShowState(true);
10026 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10029 if (__pActionPanel)
10031 r = __pActionPanel->SetShowState(true);
10032 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
10036 if (isInvalidated == true)
10045 AppLogDebug("EXIT");
10049 CamcorderForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
10051 AppLogDebug("ENTER");
10052 result r = E_SUCCESS;
10053 int selfPortraitEnable = 0;
10054 bool focusSupport = false;
10056 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
10057 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
10059 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
10061 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
10065 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
10068 if (focusSupport == true && r == E_SUCCESS)
10070 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
10071 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
10072 _pCameraInfoPanel->SetDrawMarkerFocus(true);
10073 _pCameraInfoPanel->Invalidate(true);
10077 _pCameraInfoPanel->SetDrawMarkerFocus(false);
10078 _pCameraInfoPanel->Invalidate(true);
10080 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
10081 AppLogDebug("EXIT");
10085 CamcorderForm::LaunchImageview(void)
10087 AppLogDebug("ENTER");
10088 const String* filePath = null;
10089 String listIndex = L"";
10090 String* temp = null;
10093 result r = E_SUCCESS;
10095 if (_pExposureCloseTimer)
10097 _pExposureCloseTimer->Cancel();
10103 _pPopupTimer->Cancel();
10108 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
10109 pExtraData->Construct();
10111 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
10112 pArrayList->Construct();
10114 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
10115 pContentPathList->Construct();
10117 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_RECORD);
10118 if (pContentPathList == null)
10122 AppLogDebug("EXIT - pContentPathList is null");
10126 loopCount = _pCameraPresentationModel->GetContentCount();
10127 for (index = 0; index < loopCount; ++index)
10129 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
10130 AppLogDebug("filePath = %ls", filePath->GetPointer());
10131 pArrayList->Add(new (std::nothrow) String(*filePath));
10134 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
10135 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
10137 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
10138 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
10141 SetMime(MIME_TYPE_VALUE_IMAGE);
10143 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
10144 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
10146 loopCount = pArrayList->GetCount();
10147 for (int i = 0; i < loopCount; ++i)
10149 temp = static_cast<String*>(pArrayList->GetAt(i));
10150 AppLog("print temp(%ls)", temp->GetPointer());
10152 AppLogDebug("EXIT");
10156 CamcorderForm::GetCameraToForeground(void)
10158 AppLogDebug("ENTER");
10159 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
10160 Rectangle clientRect = GetClientAreaBounds();
10162 Point currentPosition;
10163 result r = E_SUCCESS;
10164 int previewResolutionSize = 0;
10165 BufferInfo bufferinfo;
10167 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED happen");
10169 __isLockScreenMode = false;
10171 _pCameraPresentationModel->KeepScreenOnState(true, false);
10173 StartInitAppTimer();
10175 _batteryStatus = GetCurrentBatteryState();
10176 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
10178 StartInitChargingTimer();
10180 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
10181 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
10185 dim = _pCameraPresentationModel->GetPreviewResolution();
10186 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
10188 __previewResolutionWidth = dim.width;
10189 __previewResolutionHeight = dim.height;
10191 dim = _pCameraPresentationModel->GetRecordingResolution();
10192 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
10194 __pRecordingResolutionWidth = dim.width;
10195 __pRecordingResolutionHeight = dim.height;
10197 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED: __screenMode [%d]", __screenMode);
10199 r = SetScreenMode(__screenMode, false);
10200 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
10202 if (__dir == ORIENTATION_STATUS_PORTRAIT
10203 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10205 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
10209 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
10214 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
10215 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10217 _pCameraPresentationModel->StartPreview(&bufferinfo);
10219 _pCameraPresentationModel->SetContinuousAutoFocus();
10221 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
10223 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
10225 SetCamcorderSettingsDevice();
10226 AppLogDebug("EXIT");
10230 CamcorderForm::SendCameraToBackground(void)
10232 AppLogDebug("ENTER");
10233 result r = E_SUCCESS;
10236 StopInitAppTimer();
10237 StopInitChargingTimer();
10239 HideUiPanel(false);
10241 _pCameraInfoPanel->SetDrawIndicator(true);
10242 _pCameraInfoPanel->Invalidate(true);
10244 if (_pMakerFocusTimer)
10246 _pMakerFocusTimer->Cancel();
10249 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
10250 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED)
10252 __recorderStopped = true;
10253 _pCameraPresentationModel->StopRecord();
10255 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
10256 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
10258 if (flashMode == FLASH_MODE_ON)
10260 _pCameraPresentationModel->SetFlashMode(CAMERA_FLASH_MODE_ON);
10264 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
10265 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
10266 _pCameraInfoPanel->Invalidate(true);
10268 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
10270 _pCameraInfoPanel->SetDrawPopupTimer(false);
10271 _pCameraInfoPanel->Invalidate(true);
10275 _isRecording = false;
10276 __setTimerInterval = false;
10277 _pCameraPresentationModel->SetIntervalTimerRun(false);
10278 _isRecordingPause = false;
10279 r = SetRecordButton(false);
10280 AppLogDebug("SetRecordButton() fail[%s]", GetErrorMessage(r));
10282 if (_pIntervalValueTimer)
10284 _pIntervalValueTimer->Cancel();
10289 _pPopupTimer->Cancel();
10292 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
10294 _pCameraInfoPanel->SetDrawPopupTimer(false);
10295 _pCameraInfoPanel->Invalidate(true);
10298 if (_pChargingCompletedTimer != null)
10300 _chargingCount = 0;
10302 _pChargingCompletedTimer->Cancel();
10305 if (_pPreviewFailPopupTimer != null)
10307 _pPreviewFailPopupTimer->Cancel();
10310 _pCameraInfoPanel->SetDrawMarkerFocus(false);
10311 _pCameraInfoPanel->Invalidate(true);
10314 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
10315 _pCameraPresentationModel->StopCamera();
10316 _pCameraPresentationModel->KeepScreenOnState(false, true);
10318 AppLogDebug("EXIT");
10322 CamcorderForm::DrawThumbnail(void)
10324 AppLogDebug("ENTER");
10325 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
10327 if (__pThumbnailButton)
10329 __pThumbnailButton->SetShowState(false);
10330 __pThumbnailButton->Draw();
10331 __pThumbnailButton->Show();
10334 if (_pThumbnailPanel)
10336 _pThumbnailPanel->SetShowState(false);
10337 _pThumbnailPanel->Draw();
10338 _pThumbnailPanel->Show();
10343 if (__pThumbnailButton)
10345 __pThumbnailButton->SetShowState(false);
10346 __pThumbnailButton->Draw();
10347 __pThumbnailButton->Show();
10350 if (_pThumbnailPanel)
10352 _pThumbnailPanel->SetShowState(true);
10353 _pThumbnailPanel->Draw();
10354 _pThumbnailPanel->Show();
10357 AppLogDebug("EXIT");
10361 CamcorderForm::ShowCameraFailPopup(void)
10363 AppLogDebug("ENTER");
10364 int modalResult = 0;
10366 String tmpString = L"";
10367 result r = E_SUCCESS;
10368 AppResource* pAppResource = null;
10370 pAppResource = Application::GetInstance()->GetAppResource();
10371 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
10373 pAppResource->GetString(L"IDS_CAM_POP_CAMERA_FAILED", tmpString);
10375 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
10376 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
10377 msgBox.ShowAndWait(modalResult);
10379 switch (modalResult)
10381 case MSGBOX_RESULT_CLOSE:
10383 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
10385 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
10386 AppLogDebug("SetValue fail [%s]", GetErrorMessage(r));
10388 r = TerminateApp();
10389 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
10396 AppLogDebug("EXIT");
10400 CamcorderForm::ShowSavingPopup(void)
10402 AppLogDebug("ENTER");
10403 int modalResult = 0;
10406 AppResource* pAppResource = null;
10407 result r = E_SUCCESS;
10409 pAppResource = Application::GetInstance()->GetAppResource();
10410 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
10412 pAppResource->GetString(L"IDS_CAM_POP_SAVING", tmpString);
10414 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
10415 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
10417 msgBox.ShowAndWait(modalResult);
10418 AppLogDebug("EXIT");
10422 CamcorderForm::SetScreenOverlayHelpTimer(void)
10424 AppLogDebug("ENTER");
10425 result r = E_SUCCESS;
10426 int overlayHelpEnable = 0;
10428 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
10429 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10431 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
10433 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
10435 _pHelpCloseTimer = new (std::nothrow) Timer();
10436 _pHelpCloseTimer->Construct(*this);
10438 r = _pHelpCloseTimer->Start(MESSAGEBOX_DISPLAY_TIME_3_SEC);
10439 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
10442 AppLogDebug("EXIT");
10446 delete _pHelpCloseTimer;
10447 _pHelpCloseTimer = null;
10449 AppLogDebug("EXIT - CATCH");
10454 CamcorderForm::DrawScreenOverlayHelp(void)
10456 AppLogDebug("ENTER");
10457 Bitmap* pBitmap = null;
10458 result r = E_SUCCESS;
10459 int overlayHelpEnable = 0;
10460 //AppResource* pAppResource = null;
10461 String ovelayHelpStr = L"";
10463 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
10464 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
10465 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
10466 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
10467 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
10468 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
10469 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
10470 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
10471 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
10472 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
10474 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
10475 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10477 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
10479 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
10481 _pHelpGoToGallery->SetShowState(false);
10482 _pHelpGoToGalleryText->SetShowState(false);
10483 _pHelpSwitchCamera->SetShowState(false);
10484 _pHelpSwitchCameraText->SetShowState(false);
10485 _pHelpQuickSetting->SetShowState(false);
10486 _pHelpQuickSettingText->SetShowState(false);
10487 _pHelpRecordVideo->SetShowState(false);
10488 _pHelpRecordVideoText->SetShowState(false);
10489 _pHelpShutter->SetShowState(false);
10490 _pHelpShutterText->SetShowState(false);
10494 //pAppResource = Application::GetInstance()->GetAppResource();
10495 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10497 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
10499 _pHelpGoToGallery->SetShowState(true);
10500 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10501 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10502 _pHelpGoToGalleryText->SetShowState(true);
10505 _pHelpSwitchCamera->SetShowState(true);
10506 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10507 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10508 _pHelpSwitchCameraText->SetShowState(true);
10510 _pHelpQuickSetting->SetShowState(true);
10511 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10512 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10513 _pHelpQuickSettingText->SetShowState(true);
10515 _pHelpRecordVideo->SetShowState(true);
10516 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10517 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10518 _pHelpRecordVideoText->SetShowState(true);
10520 _pHelpShutter->SetShowState(true);
10521 //pAppResource->GetString(L"IDS_HELP_RECORDER", ovelayHelpStr);
10522 ovelayHelpStr = L"Recorder";
10523 _pHelpShutterText->SetText(ovelayHelpStr);
10524 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10525 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10526 _pHelpShutterText->SetShowState(true);
10528 if (__dir == ORIENTATION_STATUS_PORTRAIT
10529 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10531 _pHelpGoToGalleryText->Invalidate(true);
10532 _pHelpSwitchCameraText->Invalidate(true);
10533 _pHelpQuickSettingText->Invalidate(true);
10534 _pHelpRecordVideoText->Invalidate(true);
10535 _pHelpShutterText->Invalidate(true);
10538 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
10539 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10541 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
10542 _pHelpGoToGallery->Invalidate(true);
10547 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
10548 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10550 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
10551 _pHelpSwitchCamera->Invalidate(true);
10556 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
10557 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10559 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
10560 _pHelpQuickSetting->Invalidate(true);
10565 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
10566 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10568 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
10569 _pHelpRecordVideo->Invalidate(true);
10574 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
10575 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10577 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
10578 _pHelpShutter->Invalidate(true);
10583 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
10584 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10591 _pHelpGoToGalleryText->Invalidate(true);
10592 _pHelpSwitchCameraText->Invalidate(true);
10593 _pHelpQuickSettingText->Invalidate(true);
10594 _pHelpRecordVideoText->Invalidate(true);
10595 _pHelpShutterText->Invalidate(true);
10597 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
10598 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10600 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
10601 _pHelpGoToGallery->Invalidate(true);
10606 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
10607 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10609 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
10610 _pHelpSwitchCamera->Invalidate(true);
10615 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
10616 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10618 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
10619 _pHelpQuickSetting->Invalidate(true);
10624 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
10625 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10627 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
10628 _pHelpRecordVideo->Invalidate(true);
10633 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
10634 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10636 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
10637 _pHelpShutter->Invalidate(true);
10642 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
10643 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10650 AppLogDebug("EXIT");
10654 AppLogDebug("EXIT - CATCH");
10659 CamcorderForm::CheckCamcorderSettingLabel(void)
10661 AppLogDebug("ENTER");
10662 if (__pCamcorderSettingLable)
10664 result r = E_SUCCESS;
10666 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10667 _pAppTimer->Cancel();
10669 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
10670 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10672 if (_pListViewGeneralTabMainMenu)
10674 _pListViewGeneralTabMainMenu->SetShowState(false);
10677 if (_pListViewGeneralTabSubMenu)
10679 _pListViewGeneralTabSubMenu->SetShowState(false);
10682 MakeCamcoderTabSettingPopup();
10684 AppLogDebug("EXIT");
10688 CamcorderForm::CheckGeneralSettingLabel(void)
10690 AppLogDebug("ENTER");
10691 if(__pGeneralSettingLable)
10693 result r = E_SUCCESS;
10695 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10696 _pAppTimer->Cancel();
10698 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
10699 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10701 if (_pListViewCameraTabMainMenu)
10703 _pListViewCameraTabMainMenu->SetShowState(false);
10705 if (_pListViewCameraTabSubMenu)
10707 _pListViewCameraTabSubMenu->SetShowState(false);
10710 MakeGeneralTabSettingPopup();
10712 AppLogDebug("EXIT");
10716 CamcorderForm::DrawPauseRecord(void)
10718 AppLogDebug("ENTER");
10719 result r = E_SUCCESS;
10720 Bitmap* pBitmap = null;
10722 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_ICON_RECODING_PAUSE);
10723 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
10725 __pRecLabelRed->SetBackgroundBitmap(*pBitmap);
10727 __pRecLabelRed->SetShowState(true);
10728 __pRecLabelRed->Invalidate(true);
10730 __pRecLabelText->SetShowState(false);
10731 __pRecLabelText->Invalidate(true);
10736 AppLogDebug("EXIT");
10740 AppLogDebug("EXIT - CATCH");
10745 CamcorderForm::DrawRecord(bool isRecord)
10747 AppLogDebug("ENTER");
10748 result r = E_SUCCESS;
10749 Bitmap* pBitmap = null;
10752 TryCatch(__pRecLabelRed != null, r = E_SYSTEM, "__pRecLabelRed is null");
10753 TryCatch(__pRecLabelText != null, r = E_SYSTEM, "__pRecLabelText is null");
10754 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBatteryState is null");
10758 timeCnt = __recordTimeCount;
10760 if (_isRecording == true)
10762 if (IsControlAlwaysOnTop(__pRecLabelRed) == false)
10764 AppLogDebug("IsControlAlwaysOnTop __pRecLabelRed");
10765 SetControlAlwaysOnTop(*__pRecLabelRed, true);
10768 if (IsControlAlwaysOnTop(__pRecLabelText) == false)
10770 AppLogDebug("IsControlAlwaysOnTop __pRecLabelText");
10771 SetControlAlwaysOnTop(*__pRecLabelText, true);
10774 if (((++timeCnt) % FRAME_RATE) == INDEX_UNIT_ZERO)
10776 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_ICON_RECODING);
10777 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
10779 __pRecLabelRed->SetBackgroundBitmap(*pBitmap);
10780 __pRecLabelRed->SetShowState(true);
10781 __pRecLabelRed->Invalidate(true);
10788 __pRecLabelRed->SetShowState(false);
10789 __pRecLabelRed->Invalidate(true);
10792 __pRecLabelText->SetShowState(true);
10793 __pRecLabelText->Invalidate(true);
10795 __pBatteryState->SetShowState(false);
10796 __pBatteryState->Invalidate(true);
10801 __pRecLabelRed->SetShowState(false);
10802 __pRecLabelRed->Invalidate(true);
10804 __pRecLabelText->SetShowState(false);
10805 __pRecLabelText->Invalidate(true);
10807 __pBatteryState->SetShowState(true);
10808 __pBatteryState->Invalidate(true);
10811 AppLogDebug("EXIT");
10815 AppLogDebug("EXIT - CATCH");
10820 CamcorderForm::InitElapsedTimeLable(void)
10822 AppLogDebug("ENTER");
10823 result r = E_SUCCESS;
10825 String endTime = L"";
10826 String maxTime = L"";
10827 String recSize = L"";
10829 if (_isRecording == true || _isRecordingPause == true)
10831 TryCatch(__pElapsedTimeLable != null, r = E_FAILURE, "__pElapsedTimeLable is null");
10832 TryCatch(__pElapsedTimeMaxLable != null, r = E_FAILURE, "__pElapsedTimeMaxLable is null");
10833 TryCatch(__pElapsedRecordSizeLable != null, r = E_FAILURE, "__pElapsedRecordSizeLable is null");
10834 TryCatch(__pRecLabelRed != null, r = E_FAILURE, "__pRecLabelRed is null");
10835 TryCatch(__pRecLabelText != null, r = E_FAILURE, "__pRecLabelText is null");
10837 r = endTime.Append(INIT_REC_TIME);
10838 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10840 r = maxTime.Append(INIT_MAX_REC_TIME);
10841 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10843 r = recSize.Append(INIT_REC_SIZE);
10844 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10846 __pElapsedTimeLable->SetText(endTime);
10847 __pElapsedTimeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10849 __pElapsedTimeMaxLable->SetText(maxTime);
10850 __pElapsedTimeMaxLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10852 __pElapsedRecordSizeLable->SetText(recSize);
10853 __pElapsedRecordSizeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10855 __pElapsedTimeLable->SetShowState(false);
10856 __pElapsedTimeLable->Invalidate(true);
10858 __pElapsedTimeMaxLable->SetShowState(false);
10859 __pElapsedTimeMaxLable->Invalidate(true);
10861 __pElapsedRecordSizeLable->SetShowState(false);
10862 __pElapsedRecordSizeLable->Invalidate(true);
10864 __pRecLabelRed->SetShowState(false);
10865 __pRecLabelRed->Invalidate(true);
10867 __pRecLabelText->SetShowState(false);
10868 __pRecLabelText->Invalidate(true);
10871 AppLogDebug("EXIT");
10879 CamcorderForm::DrawRecordTimer(void)
10881 AppLogDebug("ENTER");
10882 result r = E_SUCCESS;
10883 String endTime = L"";
10884 String maxTime = L"";
10885 String recSize = L"";
10893 long recordedSize = 0;
10894 int recSizeMB = 0 ;
10896 TryCatch(__pElapsedTimeLable != null, r = E_SYSTEM, "__pElapsedTimeLable is null");
10897 TryCatch(__pElapsedTimeMaxLable != null, r = E_SYSTEM, "__pElapsedTimeMaxLable is null");
10898 TryCatch(__pElapsedRecordSizeLable != null, r = E_SYSTEM, "__pElapsedRecordSizeLable is null");
10900 timeCnt = __recordTimeCount;
10901 recordedSize = _pCameraPresentationModel->GetRecordingSize();
10902 recSizeMB = recordedSize / DIVIDE_THOUSAND;
10904 recMin = (timeCnt % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE;
10905 recSec = timeCnt % SECONDS_PER_MINUTE;
10907 if (__recordingMaxTime > INDEX_UNIT_ZERO)
10909 if (__isCapacityBelow)
10911 maxMin = UNIT_TWELVE;
10912 maxSec = UNIT_ZEROTOZERO;
10916 __recordingMaxTime = __recordingMaxTime / DIVIDE_THOUSAND;
10917 maxHour =__recordingMaxTime / SECONDS_PER_HOUR;
10918 maxMin = maxHour * SECONDS_PER_MINUTE;
10919 maxSec = __recordingMaxTime % SECONDS_PER_MINUTE;
10923 if (recMin < UNIT_TEN)
10925 r = endTime.Append(L"0");
10926 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10929 r = endTime.Append(recMin);
10930 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10932 r = endTime.Append(L"");
10933 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10935 r = endTime.Append(L":");
10936 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10938 if (recSec < UNIT_TEN)
10940 r = endTime.Append(L"0");
10941 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10944 r = endTime.Append(recSec);
10945 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10947 r = endTime.Append("");
10948 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10950 r = endTime.Append(L"/");
10951 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10953 r = maxTime.Append(maxMin);
10954 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10956 r = maxTime.Append(L"");
10957 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10959 r = maxTime.Append(L":");
10960 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10962 if (maxSec < UNIT_TEN)
10964 r = maxTime.Append(L"0");
10965 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10968 r = maxTime.Append(maxSec);
10969 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10971 if (recSizeMB < UNIT_TEN)
10973 r = recSize.Append(L"000");
10974 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10976 else if (recSizeMB < UNIT_HUNDRED)
10978 r = recSize.Append(L"00");
10979 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10981 else if (recSizeMB < UNIT_THOUSAND)
10983 r = recSize.Append(L"0");
10984 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10987 r = recSize.Append(recSizeMB);
10988 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10990 r = recSize.Append(L"M");
10991 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10993 __pElapsedTimeLable->SetText(endTime);
10994 __pElapsedTimeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10995 __pElapsedTimeMaxLable->SetText(maxTime);
10996 __pElapsedTimeMaxLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10997 __pElapsedRecordSizeLable->SetText(recSize);
10998 __pElapsedRecordSizeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
11000 if (_isRecording == true)
11002 if (IsControlAlwaysOnTop(__pElapsedTimeLable) == false)
11004 AppLogDebug("IsControlAlwaysOnTop __pElapsedTimeLable");
11005 SetControlAlwaysOnTop(*__pElapsedTimeLable, true);
11008 if (IsControlAlwaysOnTop(__pElapsedTimeMaxLable) == false)
11010 AppLogDebug("IsControlAlwaysOnTop __pElapsedTimeMaxLable");
11011 SetControlAlwaysOnTop(*__pElapsedTimeMaxLable, true);
11014 if (IsControlAlwaysOnTop(__pElapsedRecordSizeLable) == false)
11016 AppLogDebug("IsControlAlwaysOnTop __pElapsedRecordSizeLable");
11017 SetControlAlwaysOnTop(*__pElapsedRecordSizeLable, true);
11019 __pElapsedTimeLable->SetShowState(true);
11020 __pElapsedTimeMaxLable->SetShowState(true);
11021 __pElapsedRecordSizeLable->SetShowState(true);
11025 r = endTime.Append(INIT_REC_TIME);
11026 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
11028 r = maxTime.Append(INIT_MAX_REC_TIME);
11029 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
11031 r = recSize.Append(INIT_REC_SIZE);
11032 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
11034 __pElapsedTimeLable->SetShowState(false);
11035 __pElapsedTimeMaxLable->SetShowState(false);
11036 __pElapsedRecordSizeLable->SetShowState(false);
11039 __pElapsedTimeLable->Invalidate(true);
11040 __pElapsedTimeMaxLable->Invalidate(true);
11041 __pElapsedRecordSizeLable->Invalidate(true);
11043 AppLogDebug("EXIT");
11051 CamcorderForm::DrawBatteryLevelFull(void)
11053 AppLogDebug("ENTER");
11054 Bitmap* pBitmap = null;
11055 result r = E_SUCCESS;
11057 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
11059 if (__dir == ORIENTATION_STATUS_PORTRAIT
11060 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
11062 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
11066 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
11069 _batteryStatus = BATTERY_STATE_20;
11071 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
11072 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
11074 __pBatteryState->SetBackgroundBitmap(*pBitmap);
11075 __pBatteryState->Invalidate(true);
11080 AppLogDebug("EXIT");
11084 AppLogDebug("EXIT - CATCH");
11089 CamcorderForm::CheckBatteryStatus(void)
11091 AppLogDebug("ENTER");
11092 Bitmap* pBitmap = null;
11093 result r = E_SUCCESS;
11094 int batteryLevel = 0;
11095 bool isCharging = false;
11096 BatteryLevel currentBatteryLevel;
11098 Battery::IsCharging(isCharging);
11099 Battery::GetCurrentLevelInPercentage(batteryLevel);
11100 currentBatteryLevel = _pCameraPresentationModel->GetBatteryLevel();
11102 AppLogDebug("batteryLevel = %d", batteryLevel);
11104 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
11106 if (__dir == ORIENTATION_STATUS_PORTRAIT
11107 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
11109 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
11113 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
11118 _batteryStatus = GetCurrentBatteryState();
11119 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
11121 int batteryType = GetCurrentBatteryImage();
11123 AppLogDebug("batteryType = %d", batteryType);
11125 pBitmap = ResourceManager::GetBitmapN(batteryType);
11127 StartInitChargingTimer();
11132 if (currentBatteryLevel == BATTERY_CRITICAL)
11134 if (__setTimerInterval)
11136 CancelTimerIntervalRecord();
11140 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
11142 _batteryStatus = BATTERY_STATE_20;
11144 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
11146 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
11148 _batteryStatus = BATTERY_STATE_19;
11150 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
11152 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
11154 _batteryStatus = BATTERY_STATE_18;
11156 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
11158 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
11160 _batteryStatus = BATTERY_STATE_17;
11162 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
11164 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
11166 _batteryStatus = BATTERY_STATE_16;
11168 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
11170 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
11172 _batteryStatus = BATTERY_STATE_15;
11174 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
11176 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
11178 _batteryStatus = BATTERY_STATE_14;
11180 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
11182 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
11184 _batteryStatus = BATTERY_STATE_13;
11186 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
11188 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
11190 _batteryStatus = BATTERY_STATE_12;
11192 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
11194 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
11196 _batteryStatus = BATTERY_STATE_11;
11198 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
11200 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
11202 _batteryStatus = BATTERY_STATE_10;
11204 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
11206 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
11208 _batteryStatus = BATTERY_STATE_9;
11210 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
11212 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
11214 _batteryStatus = BATTERY_STATE_8;
11216 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
11218 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
11220 _batteryStatus = BATTERY_STATE_7;
11222 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
11224 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
11226 _batteryStatus = BATTERY_STATE_6;
11228 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
11230 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
11232 _batteryStatus = BATTERY_STATE_5;
11234 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
11236 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
11238 _batteryStatus = BATTERY_STATE_4;
11240 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
11242 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
11244 _batteryStatus = BATTERY_STATE_3;
11246 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
11248 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
11250 _batteryStatus = BATTERY_STATE_2;
11252 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
11254 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
11256 _batteryStatus = BATTERY_STATE_1;
11258 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
11260 else if (batteryLevel == BATT_LEVEL_VALUE_00)
11262 _batteryStatus = BATTERY_STATE_0;
11264 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
11267 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
11269 AppLogDebug("_batteryStatus = %d", _batteryStatus);
11271 __pBatteryState->SetBackgroundBitmap(*pBitmap);
11272 __pBatteryState->Invalidate(true);
11277 AppLogDebug("ENTER");
11285 CamcorderForm::MakeCamcoderTabMenuString(void)
11287 AppLogDebug("ENTER");
11290 result r = E_SUCCESS;
11291 AppResource* pAppResource = null;
11293 if (__pSettingMenuString == null)
11295 pAppResource = Application::GetInstance()->GetAppResource();
11296 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
11298 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
11300 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
11302 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
11304 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
11305 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
11308 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
11309 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
11311 pAppResource->GetString(IDS_RECORDING_MODE, tmpString);
11312 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_01] = tmpString;
11313 pAppResource->GetString(IDS_RECORDING_MODE_NORMAL, tmpString);
11314 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_02] = tmpString;
11315 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_03] = IDS_RECORDING_MODE_SHARING;
11318 AppLogDebug("EXIT");
11322 if (__pSettingMenuString)
11324 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
11326 if (__pSettingMenuString[idx])
11328 delete [] __pSettingMenuString[idx];
11329 __pSettingMenuString[idx] = null;
11337 delete __pSettingMenuString;
11338 __pSettingMenuString = null;
11345 CamcorderForm::RunStartPreviewThread(void)
11347 AppLogDebug("ENTER");
11348 result r = E_SUCCESS;
11350 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
11351 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
11353 __pCameraStarterThread = CameraStarterThread::GetInstance();
11354 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
11356 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
11357 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
11359 r = __pCameraStarterThread->Start();
11360 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
11362 AppLogDebug("EXIT");
11366 ShowCameraFailPopup();
11368 AppLogDebug("EXIT - CATCH");
11373 CamcorderForm::CreateCamcorderTabSubMenuItem(int index, int itemWidth)
11375 AppLogDebug("ENTER");
11376 CustomItem* pItem = null;
11377 result r = E_SUCCESS;
11379 Bitmap* pBitmap = null;
11380 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11381 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11382 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11383 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11384 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11385 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11386 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11387 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11390 pItem = new (std::nothrow) CustomItem();
11391 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11393 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11394 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11396 switch (GetCamcorderTabSettingSubMenuMode())
11398 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
11400 int selfPortraitEnable = 0;
11402 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11403 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11405 if (__pRecordingResolutionList)
11409 if (__pRecordingResolutionList->GetCount() > index)
11411 if (index == __pRecordingResolutionIndex)
11413 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11417 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11420 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11421 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11427 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_640X480);
11428 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11430 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11431 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11436 str = *(static_cast<String*>(__pRecordingResolutionList->GetAt(index)));
11439 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);
11440 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11446 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
11455 AppLogDebug("EXIT");
11465 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11470 CamcorderForm::CreateCamcorderTabMainMenuItem(int index, int itemWidth)
11472 AppLogDebug("ENTER");
11473 CustomItem* pItem = null;
11474 result r = E_SUCCESS;
11478 int camcorderResolutionCount = 0;
11479 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11480 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11482 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11483 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11484 int selfPortraitEnable = 0;
11485 String strTmp = L"";
11487 String arrRegStringSupport[2] =
11489 RECORDING_RESOLUTION,
11493 pItem = new (std::nothrow) CustomItem();
11494 TryCatch(pItem != null,,"Failed to allocate memory for CustomItem");
11496 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11497 TryCatch(r == E_SUCCESS,,"Failed to construct CustomItem");
11499 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11500 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11502 elementId = (index * MENU_TWO_ELEMENT);
11503 strTmp = __pSettingMenuString[index][0];
11506 if (strTmp.GetLength())
11508 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11510 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11512 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
11513 if (r == E_SUCCESS)
11515 if (__pRecordingResolutionList != null)
11517 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11520 if (camcorderResolutionCount > 1)
11522 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11532 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
11533 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11538 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);
11539 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11544 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11552 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
11553 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11557 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11558 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11564 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11566 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
11567 if (r == E_SUCCESS)
11569 if (__pRecordingResolutionList != null)
11571 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11574 if (camcorderResolutionCount > 1)
11576 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11586 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
11587 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11592 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);
11593 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11598 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11607 pItem = GetEnrichedTextCustomItem(elementId,itemWidth,strTmp);
11608 TryCatch(pItem != null, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11612 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11613 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11619 if (index < GetCamcorderTabSettingMainMenuCount() - INDEX_UNIT_ONE)
11621 int storageType = STORAGE_TYPE_PHONE;
11623 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11624 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11626 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11628 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11629 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11630 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11633 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11639 r = _pCameraPresentationModel->GetValue(arrRegStringSupport[index], regVal);
11640 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11643 AppLogDebug("Setting Main Menu");
11644 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11645 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11647 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11649 if (__pRecordingResolutionList)
11651 AppLogDebug("Setting GetCount = %d", __pRecordingResolutionList->GetCount());
11653 int idx = __pRecordingResolutionList->GetCount() - INDEX_UNIT_ONE;
11659 if (__pRecordingResolutionIndex == INDEX_UNIT_ONE)
11661 __pRecordingResolutionIndex = __pRecordingResolutionIndex - INDEX_UNIT_ONE;
11663 strTmp = *(static_cast<String*>(__pRecordingResolutionList->GetAt(__pRecordingResolutionIndex)));
11667 strTmp = *(static_cast<String*>(__pRecordingResolutionList->GetAt(__pRecordingResolutionIndex)));
11674 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11679 if (strTmp.GetLength())
11681 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11683 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11685 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
11686 if (r == E_SUCCESS)
11689 if (__pRecordingResolutionList != null)
11691 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11694 if (camcorderResolutionCount > 1)
11696 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11700 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11705 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);
11706 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11711 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11712 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11717 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11719 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
11720 if (r == E_SUCCESS)
11722 if (__pRecordingResolutionList != null)
11724 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11727 if (camcorderResolutionCount > 1)
11729 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11733 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11738 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);
11739 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11744 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11745 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11749 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11750 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11755 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11759 r = _pCameraPresentationModel->GetValue(RECORDING_MODE, regVal);
11760 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11762 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11766 if (strTmp.GetLength())
11768 AddEnrichTextCustomItem(pItem,elementId,itemWidth,strTmp);
11769 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11770 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11775 AppLogDebug("EXIT");
11782 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11787 CamcorderForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11789 AppLogDebug("ENTER");
11790 CustomItem* pItem = null;
11791 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11792 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11793 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11794 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11795 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11796 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11797 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11798 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11800 result r = E_SUCCESS;
11803 String strTmp = L"";
11804 int selfPortraitEnable = 0;
11805 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11806 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11808 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11809 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11810 String arrRegStringSupporExposure[] =
11815 OVERLAY_HELP_ENABLE,
11818 pItem = new (std::nothrow) CustomItem();
11819 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11821 pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11822 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11824 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11825 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11827 elementId = (index * MENU_TWO_ELEMENT);
11828 strTmp = __pSettingGeneralMenuString[index][0];
11831 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11832 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11834 AppLogDebug("index = %d ", index);
11835 AppLogDebug("GetGeneralTabSettingMainMenuCount = %d ", GetGeneralTabSettingMainMenuCount());
11837 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11839 bool value = false;
11840 int storageType = STORAGE_TYPE_PHONE;
11842 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11843 TryCatch(r == E_SUCCESS, , "GetValue for registry for storage type failed!");
11845 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11847 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11848 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11849 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11852 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11854 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, value);
11858 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, value);
11861 if (value == true && r == E_SUCCESS)
11863 r = _pCameraPresentationModel->GetValue(arrRegStringSupporExposure[index], regVal);
11864 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11868 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11870 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, value);
11874 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, value);
11877 r = _pCameraPresentationModel->GetValue(arrRegStringSupporExposure[index], regVal);
11878 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11881 AppLogDebug("Setting Main Menu");
11882 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11883 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11885 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11889 if (strTmp.GetLength())
11891 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11893 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11894 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11898 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11899 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11902 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11903 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11907 AppLogDebug("EXIT");
11914 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11919 CamcorderForm::CreateFlashMainMenuItem(int index, int itemWidth)
11921 AppLogDebug("ENTER");
11922 CustomItem* pItem = null;
11923 result r = E_SUCCESS;
11926 Bitmap* pBitmap = null;
11927 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11928 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11929 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11930 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11932 String listName = L"";
11933 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11934 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11935 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11936 AppResource* pAppResource = null;
11937 String tmpString = L"";
11938 bool value = false;
11939 int selfPortraitEnable = 0;
11942 String arrString[] =
11949 pItem = new (std::nothrow) CustomItem();
11950 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11952 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11953 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11955 pAppResource = Application::GetInstance()->GetAppResource();
11956 TryCatch(pAppResource != null, , "pAppResource is null");
11958 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11959 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11961 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11963 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11965 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
11966 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11968 if (flashMode != FLASH_MODE_OFF)
11970 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
11971 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11976 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11978 if (value == true && r == E_SUCCESS)
11980 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
11984 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11986 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
11987 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11989 if (flashMode != FLASH_MODE_OFF)
11991 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
11992 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11997 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
11998 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12002 case SUBMENU_MODE_OFF:
12004 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
12008 case SUBMENU_MODE_ON:
12010 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
12014 case SUBMENU_MODE_AUTO:
12016 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
12024 pAppResource->GetString(arrString[index], tmpString);
12026 if (index == regVal)
12028 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12032 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12034 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12036 elementId = (index * MENU_THREE_ELEMENT);
12039 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12040 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12046 pBitmap = ResourceManager::GetBitmapN(resId);
12047 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12049 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12050 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12057 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
12059 if (value == true && r == E_SUCCESS)
12061 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
12062 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12066 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);
12067 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12070 AppLogDebug("EXIT");
12080 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
12085 CamcorderForm::CreateWhiteBalanceItem(int index, int itemWidth)
12087 AppLogDebug("ENTER");
12088 CustomItem* pItem = null;
12089 Bitmap* pBitmap = null;
12090 Rectangle rectRadioIcon = Rectangle(X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
12091 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
12092 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
12093 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
12095 String listName = L"";
12096 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
12097 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
12099 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
12100 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
12102 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
12103 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
12104 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
12105 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
12106 AppResource* pAppResource = null;
12108 result r = E_SUCCESS;
12111 int selfPortraitEnable = 0;
12112 ResourceId resId = RESOURCE_ID_WB_AWB;
12114 String arrString[] =
12117 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
12118 IDS_CAM_BODY_FLUORESCENT,
12119 IDS_CAM_BODY_DAYLIGHT,
12120 IDS_CAM_BODY_CLOUDY,
12123 pItem = new (std::nothrow) CustomItem();
12124 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12126 pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12127 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12129 pAppResource = Application::GetInstance()->GetAppResource();
12130 TryCatch(pAppResource != null,,"pAppResource is null");
12132 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
12133 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
12135 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
12137 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
12139 if (r == E_SUCCESS)
12141 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12145 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12147 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, 0);
12148 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
12150 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
12151 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12155 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
12157 if (r == E_SUCCESS)
12159 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12163 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12165 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, 0);
12166 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
12168 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
12169 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12172 AppLogDebug("regVal = %d", regVal);
12178 resId = RESOURCE_ID_WB_AWB;
12182 case MODE_WHITEBALANCE_INCANDESCENT:
12184 resId = RESOURCE_ID_WB_DAYLIGHT;
12188 case MODE_FLUORESCENT:
12190 resId = RESOURCE_ID_WB_CLOUDY;
12194 case MODE_DAYLIGHT:
12196 resId = RESOURCE_ID_WB_FLUORESCENT_H;
12202 resId = RESOURCE_ID_WB_FLUORESCENT_L;
12210 pAppResource->GetString(arrString[index], tmpString);
12212 if (index == regVal)
12214 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12218 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12220 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12222 elementId = (index * MENU_THREE_ELEMENT);
12224 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12225 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12231 pBitmap = ResourceManager::GetBitmapN(resId);
12232 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12234 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12235 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12241 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);
12242 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12244 AppLogDebug("EXIT");
12254 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
12259 CamcorderForm::MakeSettingPopupTab(bool isShow)
12261 AppLogDebug("ENTER");
12264 if (__pCamcoderSetting)
12266 __pCamcoderSetting->SetShowState(true);
12267 __pCamcoderSetting->Invalidate(true);
12270 if (__pCamcorderSettingLable)
12272 __pCamcorderSettingLable->SetShowState(true);
12273 __pCamcorderSettingLable->Invalidate(true);
12276 if (__pGeneralSetting)
12278 __pGeneralSetting->SetShowState(true);
12279 __pGeneralSetting->Invalidate(true);
12282 if (__pGeneralSettingLable)
12284 __pGeneralSettingLable->SetShowState(true);
12285 __pGeneralSettingLable->Invalidate(true);
12290 if (__pCamcoderSetting)
12292 __pCamcoderSetting->SetShowState(false);
12293 __pCamcoderSetting->Invalidate(true);
12296 if (__pCamcorderSettingLable)
12298 __pCamcorderSettingLable->SetShowState(false);
12299 __pCamcorderSettingLable->Invalidate(true);
12302 if (__pGeneralSetting)
12304 __pGeneralSetting->SetShowState(false);
12305 __pGeneralSetting->Invalidate(true);
12308 if (__pGeneralSettingLable)
12310 __pGeneralSettingLable->SetShowState(false);
12311 __pGeneralSettingLable->Invalidate(true);
12314 AppLogDebug("EXIT");
12318 CamcorderForm::MakeCamcoderTabSettingPopup(void)
12320 AppLogDebug("ENTER");
12321 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
12322 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12325 MakeRecordingResolutionList(true);
12329 _pCameraInfoPanel->SetDrawExposure(false);
12331 if (__dir == ORIENTATION_STATUS_PORTRAIT
12332 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
12334 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
12335 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN);
12339 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
12340 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE - H_SETTING_MENU_LIST_MARGIN);
12343 MakeCamcoderTabMenuString();
12344 SetCamcorderTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
12345 MakeSettingPopupTab(true);
12347 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
12348 _pCameraInfoPanel->Invalidate(true);
12349 if (_pListViewCameraTabMainMenu == null)
12351 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
12352 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
12354 _pListViewCameraTabMainMenu->SetItemProvider(*this);
12355 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
12356 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
12360 _pListViewCameraTabMainMenu->SetShowState(true);
12361 _pListViewCameraTabMainMenu->SetBounds(rectList);
12363 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
12365 _pListViewCameraTabMainMenu->UpdateList();
12366 AppLogDebug("EXIT");
12370 CamcorderForm::MakeGeneralTabSettingPopup(void)
12372 AppLogDebug("ENTER");
12373 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
12374 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12377 _pCameraInfoPanel->SetDrawExposure(false);
12379 if (__dir == ORIENTATION_STATUS_PORTRAIT
12380 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
12382 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
12383 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT);
12387 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
12388 W_SETTING_MENU_LIST_LANDSCAPE + 3, H_SETTING_MENU_LIST_LANDSCAPE);
12391 MakeGeneralTabMenuString();
12392 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
12393 MakeSettingPopupTab(true);
12395 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
12396 _pCameraInfoPanel->Invalidate(true);
12398 if (_pListViewGeneralTabMainMenu == null)
12400 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
12401 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
12403 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
12404 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
12405 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
12409 _pListViewGeneralTabMainMenu->SetShowState(true);
12410 _pListViewGeneralTabMainMenu->SetBounds(rectList);
12413 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
12414 _pListViewGeneralTabMainMenu->UpdateList();
12415 AppLogDebug("EXIT");
12419 CamcorderForm::MakeGeneralTabMenuString(void)
12421 AppLogDebug("ENTER");
12424 result r = E_SUCCESS;
12425 AppResource* pAppResource = null;
12427 if (__pSettingGeneralMenuString == null)
12429 pAppResource = Application::GetInstance()->GetAppResource();
12430 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
12432 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
12434 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
12436 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
12438 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
12439 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
12442 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
12443 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
12445 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
12446 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
12447 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
12448 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
12449 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
12450 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
12451 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
12452 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
12454 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
12455 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
12456 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
12457 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
12458 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
12459 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
12461 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
12462 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
12463 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
12464 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
12465 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
12466 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
12468 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
12469 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
12471 pAppResource->GetString(IDS_MENU_OVERLAY_HELP_VALUE, tmpString);
12472 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
12473 //__pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
12476 AppLogDebug("EXIT");
12480 if (__pSettingGeneralMenuString)
12482 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
12484 if (__pSettingGeneralMenuString[idx])
12486 delete [] __pSettingGeneralMenuString[idx];
12487 __pSettingGeneralMenuString[idx] = null;
12495 delete __pSettingGeneralMenuString;
12496 __pSettingGeneralMenuString = null;
12503 CamcorderForm::GetGeneralTabSettingMainMenuCount(void) const
12505 AppLogDebug("ENTER");
12506 AppLogDebug("EXIT");
12507 return __generalTabMainMenuCount;
12511 CamcorderForm::SetGeneralTabSettingMainMenuCount(int count)
12513 AppLogDebug("ENTER");
12514 __generalTabMainMenuCount = count;
12515 AppLogDebug("EXIT");
12519 CamcorderForm::GetGeneralTabSettingSubMenuCount(void) const
12521 AppLogDebug("ENTER");
12522 AppLogDebug("EXIT");
12523 return __generalTabSubMenuCount;
12527 CamcorderForm::SetGeneralTabSettingSubMenuCount(int count)
12529 AppLogDebug("ENTER");
12530 __generalTabSubMenuCount = count;
12531 AppLogDebug("EXIT");
12534 inline CamcorderGeneralTabSubMenuContent
12535 CamcorderForm::GetGeneralTabSettingSubMenuMode(void) const
12537 AppLogDebug("ENTER");
12538 AppLogDebug("EXIT");
12539 return __generalTabSettingMode;
12543 CamcorderForm::SetSettingGenSubMenuMode(const CamcorderGeneralTabSubMenuContent mode)
12545 AppLogDebug("ENTER");
12546 AppLogDebug("EXIT");
12547 __generalTabSettingMode = mode;
12551 CamcorderForm::SetGeneralTabSubMenuListviewState(const int menuCount, const CamcorderGeneralTabSubMenuContent mode)
12553 AppLogDebug("ENTER");
12554 SetGeneralTabSettingSubMenuCount(menuCount);
12555 SetSettingGenSubMenuMode(mode);
12556 AppLogDebug("EXIT");
12560 CamcorderForm::GetCamcorderTabSettingMainMenuCount(void) const
12562 AppLogDebug("ENTER");
12563 AppLogDebug("EXIT");
12564 return __camcoderTabMainMenuCount;
12568 CamcorderForm::SetCamcorderTabSettingMainMenuCount(int count)
12570 AppLogDebug("ENTER");
12571 __camcoderTabMainMenuCount = count;
12572 AppLogDebug("EXIT");
12576 CamcorderForm::GetCamcorderTabSettingSubMenuCount(void) const
12578 AppLogDebug("ENTER");
12579 AppLogDebug("EXIT");
12580 return __camcoderTabSubMenuCount;
12584 CamcorderForm::SetCamcorderTabSettingSubMenuCount(int count)
12586 AppLogDebug("ENTER");
12587 __camcoderTabSubMenuCount = count;
12588 AppLogDebug("EXIT");
12591 inline CamcorderTabSubMenuContent
12592 CamcorderForm::GetCamcorderTabSettingSubMenuMode(void) const
12594 AppLogDebug("ENTER");
12595 AppLogDebug("EXIT");
12596 return __camcoderTabSettingMode;
12600 CamcorderForm::SetCamcorderTabSettingSubMenuMode(const CamcorderTabSubMenuContent mode)
12602 AppLogDebug("ENTER");
12603 AppLogDebug("EXIT");
12604 __camcoderTabSettingMode = mode;
12608 CamcorderForm::SetCamcorderTabSubMenuListviewState(const int menuCount, const CamcorderTabSubMenuContent mode)
12610 AppLogDebug("ENTER");
12611 SetCamcorderTabSettingSubMenuCount(menuCount);
12612 SetCamcorderTabSettingSubMenuMode(mode);
12613 AppLogDebug("EXIT");
12617 CamcorderForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
12619 AppLogDebug("ENTER");
12620 CustomItem* pItem = null;
12621 Bitmap* pBitmap = null;
12622 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
12623 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
12624 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
12625 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
12626 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
12627 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
12628 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
12629 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
12631 AppResource* pAppResource = null;
12633 result r = E_SUCCESS;
12637 CamcorderGeneralTabSubMenuContent idx = CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX;
12639 pItem = new (std::nothrow) CustomItem();
12640 TryCatch(pItem != null,,"Failed to allocate memory for CustomItem");
12642 pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12643 TryCatch(r == E_SUCCESS,,"Failed to construct CustomItem");
12645 pAppResource = Application::GetInstance()->GetAppResource();
12646 TryCatch(pAppResource != null,,"pAppResource is null");
12648 idx = GetGeneralTabSettingSubMenuMode();
12651 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
12653 ResourceId resId = RESOURCE_ID_TIMER_OFF;
12657 case SETTING_TIMER_RECORD_0_SEC:
12659 resId = RESOURCE_ID_TIMER_OFF;
12663 case SETTING_TIMER_RECORD_2_SEC:
12665 resId = RESOURCE_ID_TIMER_2SEC;
12669 case SETTING_TIMER_RECORD_5_SEC:
12671 resId = RESOURCE_ID_TIMER_5SEC;
12675 case SETTING_TIMER_RECORD_10_SEC:
12677 resId = RESOURCE_ID_TIMER_10SEC;
12685 String arrString[] =
12688 IDS_CAM_BODY_2_SEC,
12689 IDS_CAM_BODY_5_SEC,
12690 IDS_CAM_BODY_10_SEC,
12693 pAppResource->GetString(arrString[index], tmpString);
12695 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
12696 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12698 if (index == regVal)
12700 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12704 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12706 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12708 elementId = (index * MENU_TWO_ELEMENT);
12710 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12711 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12714 pBitmap = ResourceManager::GetBitmapN(resId);
12716 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12717 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12718 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12723 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);
12724 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12728 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
12730 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
12734 case SUBMENU_GUIDELINE_OFF:
12736 resId = RESOURCE_ID_GUIDELINE_OFF;
12740 case SUBMENU_GUIDELINE_ON:
12742 resId = RESOURCE_ID_GUIDELINE_ON;
12750 elementId = (index * MENU_TWO_ELEMENT);
12752 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
12753 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12755 if (index == regVal)
12757 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12761 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12763 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12765 if (index == SUBMENU_MODE_OFF)
12767 str = IDS_CAM_BODY_OFF;
12771 str = IDS_CAM_BODY_ON;
12774 pAppResource->GetString(str, tmpString);
12776 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12777 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12784 pBitmap = ResourceManager::GetBitmapN(resId);
12785 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12787 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12788 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12795 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);
12796 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12800 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
12802 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
12806 case SUBMENU_MODE_OFF:
12808 resId = RESOURCE_ID_STORAGE_PHONE;
12812 case SUBMENU_MODE_ON:
12814 resId = RESOURCE_ID_STORAGE_CARD;
12822 elementId = (index * MENU_TWO_ELEMENT);
12824 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
12825 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12827 if (index == regVal)
12829 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12833 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12835 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12837 if (index == STORAGE_TYPE_PHONE)
12839 str = IDS_CAM_BODY_PHONE;
12843 str = IDS_CAM_OPT_MEMORY_CARD;
12846 pAppResource->GetString(str, tmpString);
12848 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12849 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12855 pBitmap = ResourceManager::GetBitmapN(resId);
12856 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12858 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12859 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12866 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
12868 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
12870 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);
12874 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);
12879 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);
12881 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12885 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
12894 AppLogDebug("EXIT");
12904 AppLogDebug("EXIT - CATCH : pItem is null or not CreateGeneralTabSubMenuItem");
12909 CamcorderForm::SetOverlayPanelChangeMode(bool isMode)
12911 AppLogDebug("ENTER");
12912 Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
12914 if (isMode == true)
12916 SetOverlayPanelWideMode(false);
12918 SetOverlayRendererRotation();
12920 __screenMode = SCREEN_MODE_FULL;
12922 HidePanel(true, false);
12924 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
12931 HidePanel(false, false);
12933 SetOverlayPanelWideMode(false);
12935 SetOverlayRendererRotation();
12937 __screenMode = SCREEN_MODE_NORMAL;
12939 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
12944 AppLogDebug("EXIT");
12948 CamcorderForm::InitializePopup(void)
12950 AppLogDebug("ENTER");
12951 Button* pOkButton = null;
12952 Button* pCancelButton = null;
12953 Rectangle popupRect;
12955 if (__pCancelPopup == null)
12957 __pCancelPopup = new (std::nothrow) Popup();
12958 __pCancelPopup->Construct(L"IDL_CANCEL_POPUP");
12959 TryCatch(__pCancelPopup != null, , "Cancel Recording popup not created!");
12961 popupRect = __pCancelPopup->GetBounds();
12962 __pCancelPopup->SetBounds(popupRect);
12964 pOkButton = static_cast< Button*>(__pCancelPopup->GetControl(L"IDC_RECORDING_BUTTON_OK", true));
12965 TryCatch(pOkButton != null, , "Ok Button not added to the popup!");
12966 pOkButton->SetActionId(IDA_BUTTON_RECORDING_POPUP_OK);
12967 pOkButton->AddActionEventListener(*this);
12968 pOkButton->SetShowState(true);
12970 pCancelButton = static_cast< Button* >(__pCancelPopup->GetControl(L"IDC_RECORDING_BUTTON_CANCEL", true));
12971 TryCatch(pCancelButton != null, , "Cancel button not added to popup!");
12972 pCancelButton->SetActionId(IDA_BUTTON_RECORDING_POPUP_CANCEL);
12973 pCancelButton->AddActionEventListener(*this);
12974 pCancelButton->SetShowState(true);
12976 __pCancelPopup->SetPropagatedKeyEventListener(this);
12980 __pCancelPopup->SetShowState(true);
12981 __pCancelPopup->Show();
12983 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
12991 CamcorderForm::ReInitialise(void)
12993 result r = E_SUCCESS;
12994 BufferInfo bufferinfo;
12995 AppLogDebug("Camera State is %d",_pCameraPresentationModel->GetCameraState());
12996 AppLogDebug("Video State is %d",_pCameraPresentationModel->GetRecorderState());
12997 _pCameraPresentationModel->StopCamera();
12998 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
13000 if (pApp->GetAppUiState() == APP_UI_STATE_FOREGROUND)
13002 r = _pCameraPresentationModel->InitializeCamcorder();
13003 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
13004 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
13005 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
13007 _pCameraPresentationModel->StartPreview(&bufferinfo);
13008 _pCameraPresentationModel->SetContinuousAutoFocus();
13013 CamcorderForm::UpdatePopUp(void)
13015 bool doHidePopup = false;
13016 MakeSettingPopupTab(false);
13018 doHidePopup = OnTouchDoHidePopup();
13019 AppLogDebug("doHidePopup = %d", doHidePopup);
13027 CamcorderForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
13029 AppLogDebug("ENTER");
13030 int checkActivePanel = -1;
13032 if (_timeCount == INDEX_UNIT_ZERO)
13034 if ((_pListViewCameraTabMainMenu!= null && _pListViewCameraTabMainMenu->GetShowState()) ||
13035 (_pListViewGeneralTabMainMenu!= null && _pListViewGeneralTabMainMenu->GetShowState()) )
13037 checkActivePanel = 0;
13040 if (_pListFlashMainMenu != null && _pListFlashMainMenu->GetShowState())
13042 checkActivePanel = 1;
13045 if (_pListWbMainMenu != null && _pListWbMainMenu->GetShowState())
13047 checkActivePanel = 2;
13050 if (_pCameraInfoSubPanel!=null && _pCameraInfoSubPanel->GetShowState())
13052 checkActivePanel = 3;
13055 if (_pCameraInfoGeneralSubPanel!=null && _pCameraInfoGeneralSubPanel->GetShowState())
13057 checkActivePanel = 4;
13060 if (checkActivePanel != -1)
13062 switch (checkActivePanel)
13070 _pCameraInfoSubPanel->SetShowState(false);
13073 _pCameraInfoGeneralSubPanel->SetShowState(false);
13081 BackButtonPerformed();
13085 AppLogDebug("EXIT");
13089 CamcorderForm::ShowMemoryFull(void)
13091 MessageBox messageBox;
13092 result r = E_SUCCESS;
13094 r = messageBox.Construct(L"", L"Memory Full. Terminating App", MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
13095 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
13097 r = messageBox.ShowAndWait(result);
13101 CamcorderForm::OnKeyLongPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
13103 //Empty Implementation
13107 CamcorderForm::OnKeyPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
13112 if ((source.GetName().Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
13114 OnTouchModeSwitch();
13124 CamcorderForm::OnKeyReleased (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
13126 //Empty Implementation
13130 if ((source.GetName().Equals(String(IDS_THUMBNAIL_PANLE_NAME))))
13132 OnTouchLaunchImageview();
13144 CamcorderForm::OnAccessibilityActionPerformed (const Control &control, const AccessibilityElement &element)
13146 AppLogDebug("Enter");
13147 AppLogDebug("control name is %ls",control.GetName().GetPointer());
13149 if ((control.GetName().Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
13151 OnTouchModeSwitch();
13154 AppLogDebug("Exit");
13158 CamcorderForm::OnAccessibilityFocusIn (const Control &control, const AccessibilityElement &element)
13160 AppLogDebug("Enter");
13161 AppLogDebug("Exit");
13165 CamcorderForm::OnAccessibilityFocusOut (const Control &control, const AccessibilityElement &element)
13167 AppLogDebug("Enter");
13168 AppLogDebug("Exit");
13172 CamcorderForm::OnAccessibilityScreenReaderStatusChanged (const Control &control, const AccessibilityElement &element, AccessibilityScreenReaderStatus status)
13174 AppLogDebug("Enter");
13175 AppLogDebug("Exit");
13179 CamcorderForm::OnKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
13185 CamcorderForm::OnKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
13187 AppLogDebug("Enter");
13188 AppLogDebug("Source name is %ls",source.GetName().GetPointer());
13189 KeyCode currentKeyCode = keyEventInfo.GetKeyCode();
13191 switch (currentKeyCode)
13196 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
13198 _pResetPopUp->SetShowState(false);
13201 if (__pCancelPopup != null && __pCancelPopup->IsVisible())
13215 CamcorderForm::OnPreviewKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
13221 CamcorderForm::OnPreviewKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
13227 CamcorderForm::HideCancelPopup()
13229 AppLogDebug("IDA_BUTTON_RECORDING_POPUP_CANCEL");
13230 result r = E_SUCCESS;
13232 if (__pCancelPopup)
13234 __pCancelPopup->SetShowState(false);
13235 __pCancelPopup->Invalidate(true);
13238 _isRecording = true;
13240 _pCameraPresentationModel->SetCancelRecord(false);
13242 r = SetRecordPauseBitmap(false);
13243 //TryCatch(r == E_SUCCESS, , "SetRecordPauseBitmap start fail[%s]", GetErrorMessage(r));
13244 AppLogDebug("SetRecordPauseBitmap() fail[%s]", GetErrorMessage(r));
13246 r = SetRecordPauseButton(false);
13247 TryReturnVoid(r == E_SUCCESS, "SetRecordPauseButton fail[%s]", GetErrorMessage(r));
13249 _pCameraPresentationModel->StartRecord();
13251 r = __pRecordTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
13252 TryLog(r == E_SUCCESS ,"Repeatable timer for Record failed to start!");
13256 Tizen::Ui::Controls::CustomItem*
13257 CamcorderForm::GetEnrichedTextCustomItem(int elementId,int itemWidth,const Tizen::Base::String& strTmp)
13259 EnrichedText* pCurrentEnrichedText = null;
13260 TextElement* pCurrentTextElement = null;
13261 CustomItem* pItem = null;
13263 result r = E_SUCCESS;
13265 Rectangle disabledTitle = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS + 13,W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
13267 AppLogDebug("string is %ls",strTmp.GetPointer());
13268 pItem = new (std::nothrow) CustomItem();
13269 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
13271 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
13272 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
13274 pCurrentEnrichedText = new EnrichedText();
13275 TryCatch(pCurrentEnrichedText != null, , "Failed to allocate memory for CustomItem");
13277 r = pCurrentEnrichedText->Construct(Dimension(200, 200));
13278 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
13280 pCurrentTextElement = new TextElement();
13281 TryCatch(pCurrentTextElement != null, , "Failed to allocate memory for CustomItem");
13283 r = pCurrentTextElement->Construct(strTmp);
13284 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
13286 pCurrentTextElement->SetTextColor(Color::GetColor(COLOR_ID_GREY));
13287 currentFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_SETTING_MENU_ITEM);
13288 pCurrentTextElement->SetFont(currentFont);
13290 pCurrentEnrichedText->Add(*pCurrentTextElement);
13292 r = pItem->AddElement(disabledTitle,elementId, *pCurrentEnrichedText);
13293 AppLogDebug("Add element is %s",GetErrorMessage(r));
13295 pCurrentEnrichedText->RemoveAll(true);
13296 delete pCurrentEnrichedText;
13297 AppLogDebug("Exit");
13306 if (pCurrentEnrichedText != null)
13308 pCurrentEnrichedText->RemoveAll(true);
13309 delete pCurrentEnrichedText;
13312 if (pCurrentTextElement != null)
13314 delete pCurrentTextElement;
13320 CamcorderForm::AddEnrichTextCustomItem(Tizen::Ui::Controls::CustomItem* pItem, int elementId,int itemWidth,const Tizen::Base::String& strTmp)
13322 Rectangle disabledDescrition = Rectangle(X_SETTING_MENU_CONTENTS_VALUE -15, Y_SETTING_MENU_CONTENTS_VALUE+13,W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
13324 EnrichedText* pCurrentEnrichedText = null;
13325 TextElement* pCurrentTextElement = null;
13327 result r = E_SUCCESS;
13329 AppLogDebug("string is %ls",strTmp.GetPointer());
13331 pCurrentEnrichedText = new EnrichedText();
13332 TryCatch(pCurrentEnrichedText != null, , "Failed to allocate memory for CustomItem");
13334 r = pCurrentEnrichedText->Construct(Dimension(200, 200));
13335 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
13337 pCurrentTextElement = new TextElement();
13338 TryCatch(pCurrentTextElement != null, , "Failed to allocate memory for CustomItem");
13340 r = pCurrentTextElement->Construct(strTmp);
13341 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
13343 pCurrentTextElement->SetTextColor(Color::GetColor(COLOR_ID_GREY));
13344 currentFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_SETTING_MENU_ITEM);
13345 pCurrentTextElement->SetFont(currentFont);
13346 pCurrentEnrichedText->Add(*pCurrentTextElement);
13348 r = pItem->AddElement(disabledDescrition,elementId, *pCurrentEnrichedText);
13351 pCurrentEnrichedText->RemoveAll(true);
13352 delete pCurrentEnrichedText;
13356 if (pCurrentEnrichedText != null)
13358 pCurrentEnrichedText->RemoveAll(true);
13359 delete pCurrentEnrichedText;
13362 if (pCurrentTextElement != null)
13364 delete pCurrentTextElement;
13368 CamcorderForm::OnUpdateView()
13370 OnTouchLaunchImageview();