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();
508 r = InitializePopup();
509 AppLogDebug("InitializePopup()fail[%s]", GetErrorMessage(r));
511 __pFileEventManager = new (std::nothrow) FileEventManager();
512 r = __pFileEventManager->Construct(*this);
513 TryCatch(r == E_SUCCESS, , "Construct() fail[%s]", GetErrorMessage(r));
515 filePath = _pCameraPresentationModel->GetfilePath(storageType);
516 AppLogDebug("filePath %ls", filePath.GetPointer());
518 if (File::IsFileExist(filePath))
520 __pFileEventPath = filePath;
521 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MOVE_SELF);
522 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
529 delete _pCameraInfoPanel;
531 ShowCameraFailPopup();
533 AppLogDebug("EXIT - CATCH");
538 CamcorderForm::OnTerminating(void)
540 AppLogDebug("ENTER");
541 result r = E_SUCCESS;
543 _pCameraPresentationModel->KeepScreenOnState(false, true);
545 _pCameraPresentationModel->RemovePresentationChangedEventListener(null);
547 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
549 __lowMemoryCapacity = false;
551 __doRecording = false;
553 __setTimerInterval = false;
555 _pCameraPresentationModel->SetIntervalTimerRun(false);
557 __isCapacityBelow = false;
559 RemoveAllEventListener();
561 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
563 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_DISABLE);
564 AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
566 if (__isLockScreenMode)
568 AppLogDebug("OnTerminating KEY_POWER_HOLD");
569 __isLockScreenMode = false;
572 __isOrientationChanged = false;
574 __screenMode = SCREEN_MODE_NORMAL;
576 _pCameraPresentationModel = null;
577 __pCameraStarterThread = null;
582 if (__pRecordPauseBitmap)
584 delete __pRecordPauseBitmap;
587 if (__pSettingMenuString)
590 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
592 delete [] __pSettingMenuString[idx];
594 delete __pSettingMenuString;
597 if (__pSettingGeneralMenuString)
600 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
602 delete [] __pSettingGeneralMenuString[idx];
604 delete __pSettingGeneralMenuString;
607 if (__pRecordingResolutionList)
609 __pRecordingResolutionList->RemoveAll(true);
610 delete __pRecordingResolutionList;
614 if (__pFileEventManager != null)
616 delete __pFileEventManager;
617 __pFileEventManager = null;
625 CamcorderForm::SetStartRecording(void)
627 AppLogDebug("ENTER");
628 result r = E_SUCCESS;
629 int timerInterval = 0;
631 timerInterval = GetTimerIntervalValue();
633 switch (timerInterval)
635 case SETTING_TIMER_RECORD_0_SEC:
637 if (_pIntervalValueTimer)
639 _pIntervalValueTimer->Cancel();
643 __setTimerInterval = false;
645 _pCameraPresentationModel->SetIntervalTimerRun(false);
647 _pCameraPresentationModel->StartRecord();
648 r = StartRecordTimer();
649 TryReturnVoid(r == E_SUCCESS, "StartRecordTimer() fail[%s]", GetErrorMessage(r));
651 r = SetRecordButton(true);
652 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
654 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
656 _pCameraInfoPanel->SetDrawPopupTimer(false);
658 _pCameraInfoPanel->Invalidate(true);
663 AutoFocusPerformed();
665 StartInitChargingTimer();
669 case SETTING_TIMER_RECORD_2_SEC:
671 case SETTING_TIMER_RECORD_5_SEC:
673 case SETTING_TIMER_RECORD_10_SEC:
675 if (__pRecordButton->GetShowState())
677 __pRecordButton->SetShowState(false);
680 r = SetRecordStartTimer(timerInterval);
681 TryReturnVoid(r == E_SUCCESS, "SetRecordStartTimer() fail[%s]", GetErrorMessage(r));
683 __setTimerInterval = true;
684 _pCameraPresentationModel->SetIntervalTimerRun(true);
688 r = DrawTimerPopup();
689 TryReturnVoid(r == E_SUCCESS, "DrawTimerPopup() fail[%s]", GetErrorMessage(r));
700 CamcorderForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
702 AppLogDebug("ENTER");
703 bool onVideoRecorderStopped = false;
704 result r = E_SUCCESS;
705 int selfPortraitEnable = 0;
706 int guideLineEnable = 0;
710 case IDA_BUTTON_CAMCORDER_FLASH:
712 int selfPortraitEnable = 0;
713 result r = E_SUCCESS;
715 bool isCharging = false;
716 BatteryLevel batteryLevel;
718 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
719 isCharging = _pCameraPresentationModel->IsCharging();
721 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
725 selfPortraitEnable = 0;
728 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
730 AppLogDebug("FLASEH OFF!!!");
734 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
736 if (value == true && r == E_SUCCESS)
738 if (batteryLevel == BATTERY_LOW && isCharging == false)
743 AppResource* pAppResource = null;
745 pAppResource = Application::GetInstance()->GetAppResource();
746 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
748 pAppResource->GetString(L"IDS_COM_BODY_LOW_BATTERY", tmpString);
750 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
751 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
752 msgBox.ShowAndWait(result);
761 AppLogDebug("FLASEH OFF!!!");
767 case IDA_BUTTON_CAMCORDER_SETTING:
769 result r = E_SUCCESS;
771 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
772 _pAppTimer->Cancel();
774 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
775 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
781 case IDA_BUTTON_CLOSE_SETTING:
783 result r = E_SUCCESS;
785 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
786 _pAppTimer->Cancel();
788 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
789 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
795 case IDA_BUTTON_CAMCORDER_QUICK_SETTING:
797 result r = E_SUCCESS;
799 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
800 _pAppTimer->Cancel();
802 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
803 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
805 MakeCamcoderTabSettingPopup();
809 case IDA_BUTTON_SETTING_CAMCODER:
811 result r = E_SUCCESS;
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 if (_pListViewGeneralTabMainMenu)
821 _pListViewGeneralTabMainMenu->SetShowState(false);
824 if (_pListViewGeneralTabSubMenu)
826 _pListViewGeneralTabSubMenu->SetShowState(false);
829 MakeCamcoderTabSettingPopup();
833 case IDA_BUTTON_SETTING_GENERAL:
835 result r = E_SUCCESS;
837 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
838 _pAppTimer->Cancel();
840 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
841 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
843 AppLogDebug("IDA_BUTTON_SETTING_GENERAL");
845 if (_pListViewCameraTabMainMenu)
847 _pListViewCameraTabMainMenu->SetShowState(false);
849 if (_pListViewCameraTabSubMenu)
851 _pListViewCameraTabSubMenu->SetShowState(false);
854 MakeGeneralTabSettingPopup();
858 case IDA_BUTTON_CAMCORDER_SELF:
860 result r = E_SUCCESS;
863 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
865 AppLogDebug("Camera Preview is not");
869 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
870 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
871 if (cameraCount < SUPPORTED_CAMERA_NUM)
873 AppLogDebug("The physical direction of the camera is not exit");
877 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
879 MakeSettingPopupTab(false);
883 if (onVideoRecorderStopped == false)
886 MakeRecordingResolutionList(true);
895 case IDA_BUTTON_CAMERA_EV:
897 if (_pCameraInfoPanel->GetDrawExposure() == true)
899 AppLogDebug("Draw is Exposure status");
903 ExposureValuePerformed();
907 case IDA_BUTTON_CAMERA_WB:
909 result r = E_SUCCESS;
910 int selfPortraitEnable = 0;
912 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
913 _pAppTimer->Cancel();
915 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
916 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
918 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
919 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
921 if (_pCameraInfoPanel->GetDrawExposure() == true)
923 _closeTimerValue = 0;
925 if (_pExposureCloseTimer)
927 _pExposureCloseTimer->Cancel();
930 _pCameraInfoPanel->SetDrawExposure(false);
934 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
936 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
940 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
945 SetWhiteBalancePopop();
949 AppLogDebug("WB is not support");
954 case IDA_BUTTON_CAMCORDER_AUTO_FOCUS:
956 //AutoFocusPerformed();
960 case IDA_BUTTON_CAMCORDER_THUMBNAIL:
965 case IDA_BUTTON_RECORDING_POPUP_OK:
967 result r = E_SUCCESS;
968 AppLogDebug("IDA_BUTTON_RECORDING_POPUP_OK");
970 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
971 _pAppTimer->Cancel();
973 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
974 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
978 __pCancelPopup->SetShowState(false);
979 __pCancelPopup->Invalidate(true);
985 __recorderStopped = true;
990 case IDA_BUTTON_RECORDING_POPUP_CANCEL:
992 AppLogDebug("IDA_BUTTON_RECORDING_POPUP_CANCEL");
993 result r = E_SUCCESS;
997 __pCancelPopup->SetShowState(false);
998 __pCancelPopup->Invalidate(true);
1001 _isRecording = true;
1003 _pCameraPresentationModel->SetCancelRecord(false);
1005 r = SetRecordPauseBitmap(false);
1006 //TryCatch(r == E_SUCCESS, , "SetRecordPauseBitmap start fail[%s]", GetErrorMessage(r));
1007 AppLogDebug("SetRecordPauseBitmap() fail[%s]", GetErrorMessage(r));
1009 r = SetRecordPauseButton(false);
1010 TryReturnVoid(r == E_SUCCESS, "SetRecordPauseButton fail[%s]", GetErrorMessage(r));
1012 _pCameraPresentationModel->StartRecord();
1014 __pRecordTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
1018 case IDA_BUTTON_CAMCORDER_BACK:
1020 AppLogDebug("IDA_BUTTON_CAMCORDER_BACK");
1021 result r = E_SUCCESS;
1023 r = BackButtonPerformed();
1024 AppLogDebug("BackButtonPerformed fail [%s]", GetErrorMessage(r));
1030 AppLogDebug("ResetPopup : yes");
1031 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1033 _pResetPopUp->SetShowState(false);
1035 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
1036 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
1038 if (guideLineEnable == CAMERA_GUIDELINE_ENABLE)
1040 r = DrawMarker(false);
1041 TryReturnVoid(r == E_SUCCESS, "DrawMarker() fail(%s)", GetErrorMessage(r));
1043 SetGuideLine(REG_DEFAULT_VALUE_ZERO);
1046 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
1047 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
1049 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
1051 BufferInfo bufferinfo;
1053 AppLogDebug("SUBMENU_RESET_MODE : CAMERA_FORM_SECONDARY_MODE");
1055 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
1056 TryReturnVoid(r == E_SUCCESS, "SetValue() fail(%s)", GetErrorMessage(r));
1058 r = ToggleCameraDirection(CAMCORDER_FORM_PRIMARY_MODE);
1059 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
1061 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1062 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
1064 _pCameraPresentationModel->StartPreview(&bufferinfo);
1066 _pCameraPresentationModel->SetContinuousAutoFocus();
1069 RestoreDefaultSetting();
1071 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1072 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
1074 MakeRecordingResolutionList(true);
1076 MakeSettingPopupTab(false);
1080 r = UpdateUiPanelIcon();
1081 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail(%s)", GetErrorMessage(r));
1083 r = SetScreenOverlayHelpTimer();
1084 TryReturnVoid(r == E_SUCCESS, "SetScreenOverlayHelpTimer() fail(%s)", GetErrorMessage(r));
1086 r = DrawScreenOverlayHelp();
1087 TryReturnVoid(r == E_SUCCESS, "DrawScreenOverlayHelp() fail(%s)", GetErrorMessage(r));
1089 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
1090 _pFlashButton->Invalidate(true);
1097 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
1099 _pResetPopUp->SetShowState(false);
1101 MakeSettingPopupTab(false);
1102 AppLogDebug("ResetPopup : MSGBOX_RESULT_NO");
1107 case IDA_BUTTON_CAMCORDER_SHUTTER:
1109 MakeSettingPopupTab(false);
1110 if (_isRecording == false)
1112 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW
1113 && _pCameraPresentationModel->GetCameraState() != CAMERA_STATE_AUTO_FOCUSING
1116 AppLogDebug("It is trying to start the recording ");
1120 AppLogDebug("DoRecording");
1122 _pCameraPresentationModel->SetMemoryFullException(true);
1127 AppLogDebug("DoStopRecording");
1128 __recorderStopped = true;
1129 _pCameraPresentationModel->SetMemoryFullException(false);
1138 AppLogDebug("EXIT");
1142 CamcorderForm::SetUri(const Tizen::Base::String& uri)
1144 AppLogDebug("ENTER");
1145 AppLogDebug("[URI] %ls", uri.GetPointer());
1146 __uri = String(uri);
1147 AppLogDebug("EXIT");
1151 CamcorderForm::SetMime(const Tizen::Base::String& mime)
1153 AppLogDebug("ENTER");
1154 AppLogDebug("[MIME] %ls", mime.GetPointer());
1155 __mime = String(mime);
1156 AppLogDebug("EXIT");
1159 const Tizen::Base::String&
1160 CamcorderForm::GetUri(void) const
1162 AppLogDebug("ENTER");
1163 AppLogDebug("EXIT");
1167 const Tizen::Base::String&
1168 CamcorderForm::GetMime(void) const
1170 AppLogDebug("ENTER");
1171 AppLogDebug("EXIT");
1176 CamcorderForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
1178 AppLogDebug("ENTER");
1179 if (_appControlActionCompleted)
1181 AppLogDebug("EXIT - App Terminate");
1184 OnCameraActionPerformed(static_cast<CameraActionEvent>(requestId));
1185 AppLogDebug("EXIT");
1189 CamcorderForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String& path, const unsigned int eventId)
1191 AppLogDebug("ENTER");
1192 bool isExistThumbnail = false;
1193 Bitmap* pBitmap = null;
1194 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
1196 isExistThumbnail = _pCameraPresentationModel->IsExistThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
1198 if (isExistThumbnail == false)
1200 AppLogDebug("Thumbnail is not found");
1202 TryReturnVoid(_pThumbnailPanel != null, "_pThumbnailPanel is null");
1204 _pThumbnailPanel->SetShowState(false);
1205 _pThumbnailPanel->Draw();
1206 _pThumbnailPanel->Show();
1208 __pThumbnailButton->SetShowState(true);
1210 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1211 TryReturnVoid(pBitmap != null, "pBitmap is null");
1213 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
1218 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1219 TryReturnVoid(pBitmap != null, "pBitmap is null");
1221 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
1226 __pThumbnailButton->Draw();
1227 __pThumbnailButton->Show();
1234 AppLogDebug("pThumbnailBitmap is not null");
1236 AppLogDebug("EXIT");
1240 CamcorderForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
1242 AppLogDebug("ENTER");
1243 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
1244 Rectangle rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
1245 Rectangle clientRect = GetClientAreaBounds();
1247 Point currentPosition;
1248 result r = E_SUCCESS;
1250 int previewResolutionSize = 0;
1251 int storageType = STORAGE_TYPE_PHONE;
1252 bool isRunStartPreviewThread = false;
1253 BufferInfo bufferinfo;
1254 bool isInitCameraStaus = false;
1255 bool isCharging = false;
1256 BatteryLevel batteryLevel;
1258 _isRecording = false;
1260 _isRecordingPause = false;
1262 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
1263 _pAppTimer->Cancel();
1264 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
1265 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
1267 _batteryStatus = GetCurrentBatteryState();
1268 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
1270 StartPreviewFailPopupTimer();
1272 StartInitChargingTimer();
1274 _pCameraPresentationModel->AddPresentationChangedEventListener(*this);
1276 _pCameraPresentationModel->KeepScreenOnState(true, false);
1278 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
1279 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
1283 dim = _pCameraPresentationModel->GetPreviewResolution();
1284 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
1286 __previewResolutionWidth = dim.width;
1287 __previewResolutionHeight = dim.height;
1289 dim = _pCameraPresentationModel->GetRecordingResolution();
1290 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
1292 __pRecordingResolutionWidth = dim.width;
1293 __pRecordingResolutionHeight = dim.height;
1295 if (__pCancelPopup != null)
1297 delete __pCancelPopup;
1298 __pCancelPopup = null;
1301 AppLogDebug("__screenMode [%d]", __screenMode);
1303 r = SetScreenMode(__screenMode, true);
1304 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
1306 if (__dir == ORIENTATION_STATUS_PORTRAIT
1307 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1309 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
1313 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
1316 if (__dir == ORIENTATION_STATUS_PORTRAIT
1317 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1319 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_PORTRAIT, X_PREVIEW_OVERLAY_LANDSCAPE);
1323 rectPanel = Rectangle(0, 0, W_FULL_PREVIEW_OVERLAY_LANDSCAPE, X_PREVIEW_OVERLAY_LANDSCAPE);
1326 r = SetRecordButton(false);
1327 AppLogDebug("SetRecordButton fail[%s]", GetErrorMessage(r));
1329 _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_RECORD);
1331 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
1332 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
1334 if (regVal == DISABLE_GUIDELINE)
1345 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1347 _pCameraInfoPanel->SetDrawPopupTimer(false);
1349 _pCameraInfoPanel->Invalidate(true);
1352 MakeSettingPopupTab(false);
1358 __pRecLabelRed->SetShowState(false);
1359 __pRecLabelRed->Invalidate(true);
1362 if (__pRecLabelText)
1364 __pRecLabelText->SetShowState(false);
1365 __pRecLabelText->Invalidate(true);
1368 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
1369 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
1371 if (isInitCameraStaus)
1373 isRunStartPreviewThread = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetUsedRunStartPreviewThread();
1374 AppLogDebug("isRunStartPreviewThread [%d]", isRunStartPreviewThread);
1376 if (isRunStartPreviewThread)
1378 r = RunStartPreviewThread();
1379 TryReturnVoid(r == E_SUCCESS, "RunStartPreviewThread fail[%s]", GetErrorMessage(r));
1381 (static_cast<CameraApp*>(UiApp::GetInstance()))->SetUsedRunStartPreviewThread(false);
1385 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
1386 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
1388 _pCameraPresentationModel->StartPreview(&bufferinfo);
1391 _pCameraPresentationModel->SetContinuousAutoFocus();
1393 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
1395 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
1397 SetCamcorderSettingsDevice();
1399 AppLogDebug("OnSceneActivatedN");
1402 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1403 isCharging = _pCameraPresentationModel->IsCharging();
1405 AppLogDebug("batteryLevel = %d", batteryLevel);
1406 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1408 if (isCharging == false)
1414 CheckBatteryStatus();
1418 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
1420 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
1422 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
1423 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
1425 AppLogDebug("EXIT");
1429 CamcorderForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
1431 AppLogDebug("ENTER");
1432 _pCameraPresentationModel->KeepScreenOnState(false, true);
1434 _isRecording = false;
1436 _isRecordingPause = false;
1438 __isOrientationChanged = false;
1442 __setTimerInterval = false;
1443 _pCameraPresentationModel->SetIntervalTimerRun(false);
1449 _pAppTimer->Cancel();
1452 if (_pIntervalValueTimer)
1454 _pIntervalValueTimer->Cancel();
1457 if (_pChargingTimer)
1459 _pChargingTimer->Cancel();
1462 if (_pHelpCloseTimer)
1464 _pHelpCloseTimer->Cancel();
1469 if (__pCancelPopup != null)
1471 delete __pCancelPopup;
1472 __pCancelPopup = null;
1475 OnHelpCloseTimerExpired();
1481 MakeSettingPopupTab(false);
1483 HideUiSettingMenu();
1485 if (__pOverlayPanel)
1487 RemoveControl(*__pOverlayPanel);
1488 __pOverlayPanel = null;
1491 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
1492 AppLogDebug("EXIT");
1496 CamcorderForm::Update(bool isInvalidated)
1498 AppLogDebug("ENTER");
1499 result r = E_SUCCESS;
1500 Bitmap* pThumbnailBitmap = null;
1501 Bitmap* pRotateBitmap = null;
1502 Bitmap* pBitmap = null;
1504 if (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
1506 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1510 __pSwButton->SetShowState(false);
1515 if (__pCameraIconLabel)
1517 __pCameraIconLabel->SetShowState(true);
1520 if (__pCamcoderIconLabel)
1522 __pCamcoderIconLabel->SetShowState(true);
1527 __pSwButton->SetShowState(true);
1532 TryCatch(_pThumbnailPanel != null, , "_pThumbnailPanel is null");
1534 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
1536 if (pThumbnailBitmap == null)
1538 AppLogDebug("CameraForm::Update :: pThumbnailBitmap = null");
1540 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1542 __pThumbnailButton->SetShowState(false);
1543 _pThumbnailPanel->SetShowState(false);
1547 _pThumbnailPanel->SetShowState(true);
1562 AppLogDebug("CameraForm::Update :: pThumbnailBitmap is not null");
1563 ImageRotationType rotationType = IMAGE_ROTATION_0;
1565 if (__setTimerInterval || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
1567 __pThumbnailButton->SetShowState(false);
1568 _pThumbnailPanel->SetShowState(false);
1572 _pThumbnailPanel->SetShowState(true);
1575 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
1576 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1578 rotationType = IMAGE_ROTATION_270;
1582 rotationType = IMAGE_ROTATION_0;
1585 pRotateBitmap = RotationImageN(pThumbnailBitmap, rotationType);
1586 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
1588 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
1589 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
1591 _pThumbnailPanel->SetOldBitmap(pRotateBitmap);
1593 delete pRotateBitmap;
1594 pRotateBitmap = null;
1609 AppLogDebug("CameraForm::Update :: Not thummail");
1610 Point ptThumbnailImg = Point(X_THUMBNAIL_BUTTON_IMG, Y_THUMBNAIL_BUTTON_IMG);
1612 AppControlRequestHideButton();
1614 _pThumbnailPanel->SetShowState(false);
1618 _pThumbnailPanel->Invalidate(true);
1622 _pThumbnailPanel->Draw();
1623 _pThumbnailPanel->Show();
1636 TryCatch(__pThumbnailButton != null, , "__pThumbnailButton is null");
1638 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1639 TryCatch(pBitmap != null, , "pBitmap is null");
1641 __pThumbnailButton->SetNormalBitmap(ptThumbnailImg, *pBitmap);
1645 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
1646 TryCatch(pBitmap != null, , "pBitmap is null");
1648 __pThumbnailButton->SetPressedBitmap(ptThumbnailImg, *pBitmap);
1654 AppLogDebug("EXIT");
1658 delete pRotateBitmap;
1659 pRotateBitmap = null;
1665 CamcorderForm::OnCameraActionRecorderClosed(void)
1667 AppLogDebug("ENTER");
1668 result r = E_SUCCESS;
1669 Bitmap* pThumbnailBitmap = null;
1670 Bitmap* pRotateBitmap = null;
1671 ImageRotationType rotationType = IMAGE_ROTATION_0;
1673 pThumbnailBitmap = _pCameraPresentationModel->GetLatestThumbnail();
1674 TryCatch(pThumbnailBitmap != null, , "pThumbnailBitmap is null");
1676 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
1677 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1679 rotationType = IMAGE_ROTATION_270;
1683 rotationType = IMAGE_ROTATION_0;
1686 pRotateBitmap = RotationImageN(pThumbnailBitmap, rotationType);
1687 TryCatch(pRotateBitmap != null, , "pRotateBitmap is null");
1689 r = pRotateBitmap->Scale(Dimension(W_THUMBNAIL_SCALE_SIZE, H_THUMBNAIL_SCALE_SIZE));
1690 TryCatch(r == E_SUCCESS, , "Bitmap::Scale() fail[%s]", GetErrorMessage(r));
1692 _pThumbnailPanel->SetShowState(true);
1693 _pThumbnailPanel->Invalidate(true);
1694 _pThumbnailPanel->SetNewBitmap(pRotateBitmap);
1695 _pThumbnailPanel->SetDrawSliderImg();
1697 delete pRotateBitmap;
1698 pRotateBitmap = null;
1700 AppLogDebug("EXIT");
1704 delete pRotateBitmap;
1705 pRotateBitmap = null;
1711 CamcorderForm::OnCameraActionPerformed(CameraActionEvent event)
1713 AppLogDebug("ENTER");
1714 __doRecording = false;
1716 if (event != CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED)
1720 if (_pIntervalValueTimer)
1722 _pIntervalValueTimer->Cancel();
1727 _pPopupTimer->Cancel();
1730 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
1732 _pCameraInfoPanel->SetDrawPopupTimer(false);
1734 _pCameraInfoPanel->Invalidate(true);
1737 AppLogDebug("OnCameraActionPerformed - event %d", event);
1741 case CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED:
1743 AppLogDebug("CAMERA_ACTION_EVENT_TOUCH_AUTO_FOCUSED");
1744 DrawFocus(CAMERA_FOCUS_READY);
1748 case CAMERA_ACTION_EVENT_AUTO_FOCUSED:
1750 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED");
1751 if (_pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING)
1753 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED : NOT STATE_RECORDING");
1754 DrawFocus(CAMERA_FOCUS_READY);
1758 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUSED : STATE_RECORDING");
1759 DrawFocus(CAMERA_FOCUS_READY);
1760 InitMakerFocusTimer();
1762 _pMakerFocusTimer->Cancel();
1763 _pMakerFocusTimer->Start(CAMCORDER_TIMER_ONE_SEC);
1768 case CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED:
1770 AppLogDebug("CAMERA_ACTION_EVENT_AUTO_FOCUS_FAILED");
1771 DrawFocus(CAMERA_FOCUS_FAIL);
1775 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_CANCELED:
1777 AppLogDebug("VIDEO_RECORDER_CANCELED_LISTENER.");
1778 StartInitAppTimer();
1780 _isRecording = false;
1781 __doRecording = false;
1785 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_PREVIEWED:
1787 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_RECORDER_PREVIEWED.");
1791 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_CLOSED:
1793 AppLogDebug("VIDEO_RECORDER_CLOSED_LISTENER.");
1794 int requestType = 0;
1795 result r = E_SUCCESS;
1796 bool isCharging = false;
1797 BatteryLevel batteryLevel;
1799 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1805 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
1807 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
1809 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1811 AppLogDebug("Recrrder after TerminateApp");
1812 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1813 pCameraApp->SetFrameEnabled(false);
1817 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1821 StartInitAppTimer();
1823 r = OnCameraActionRecorderClosed();
1824 TryReturnVoid(r == E_SUCCESS, "OnCameraActionRecorderClosed Fail[%]", GetErrorMessage(r));
1829 if (_pCameraPresentationModel->GetMemoryFullExceptionStatus())
1831 __recorderStopped = true;
1838 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
1839 isCharging = _pCameraPresentationModel->IsCharging();
1841 AppLogDebug("batteryLevel = %d", batteryLevel);
1842 AppLogDebug("isCharging = %d", isCharging);
1844 if (isCharging == false)
1846 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
1850 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1854 AppLogDebug("GetCameraState : %ld", _pCameraPresentationModel->GetCameraState());
1856 if (_pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW)
1859 if (UiApp::GetInstance()->GetAppUiState()== APP_UI_STATE_FOREGROUND)
1861 _pCameraPresentationModel->SetStartPreviewException(false);
1868 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_END_REACHED:
1870 AppLogDebug("CAMERA_ACTION_EVENT_VIDEO_RECORDER_END_REACHED.");
1871 int requestType = 0;
1872 result r = E_SUCCESS;
1874 requestType = _pCameraPresentationModel->GetAppControlRequestType();
1880 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
1882 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_SUCCEEDED)
1884 AppLogDebug("RECORDER_END_REACHED after TerminateApp");
1886 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
1887 pCameraApp->SetFrameEnabled(false);
1890 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
1894 AppLogDebug("RECORDER_END_REACHED");
1896 StartInitAppTimer();
1898 SetRecordEndReached();
1900 r = OnCameraActionRecorderClosed();
1901 TryReturnVoid(r == E_SUCCESS, "OnCameraActionRecorderClosed Fail[%]", GetErrorMessage(r));
1908 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_ERROR_OCCURRED:
1910 AppLogDebug("VIDEO_RECORDER_ERROR_OCCURRED_LISTENER.");
1911 RecorderErrorReason recorderErrorStatus = _pCameraPresentationModel->GetRecorderErrorStatus();
1912 AppLogDebug("Recorder error status is %ld",recorderErrorStatus);
1914 if (__pBatteryState != null)
1916 __pBatteryState->SetShowState(true);
1917 __pBatteryState->Draw();
1918 __pBatteryState->Show();
1921 AppLogDebug("Camcorder State = %d ", _pCameraPresentationModel->GetRecorderState());
1922 AppLogDebug("Camera State = %d ", _pCameraPresentationModel->GetCameraState());
1924 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
1926 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED)
1928 AppLogDebug("Reinitialising the camcorder");
1934 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_ERROR)
1936 __recorderStopped = true;
1946 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_PAUSED:
1948 AppLogDebug("VIDEO_RECORDER_PAUSED_LISTENER.");
1949 StartInitAppTimer();
1953 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_STARTED:
1955 AppLogDebug("VIDEO_RECORDER_STARTED_LISTENER.");
1960 case CAMERA_ACTION_EVENT_VIDEO_RECORDER_STOPPED:
1962 AppLogDebug("VIDEO_RECORDER_STOPPED_LISTENER.");
1964 if (__pCancelPopup != null)
1966 delete __pCancelPopup;
1967 __pCancelPopup = null;
1971 if (!__recorderStopped)
1978 __recorderStopped = false;
1984 AppLogDebug("camera state is %ld",_pCameraPresentationModel->GetCameraState());
1986 StartInitAppTimer();
1990 case CAMERA_ACTION_EVENT_FRAME_ACTIVATED:
1992 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED.");
1993 bool isEnabled = false;
1994 bool isInitCameraStaus = false;
1996 bool isCharging = false;
1998 BatteryLevel batteryLevel;
2000 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
2001 isEnabled = pCameraApp->IsFrameEnabled();
2003 if (isEnabled == false)
2005 pCameraApp->SetFrameEnabled(true);
2008 if (!__pRecordButton->GetShowState())
2010 __pRecordButton->SetShowState(true);
2013 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
2014 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
2016 if (isInitCameraStaus == false)
2018 AppLogDebug("InitCamera is fail");
2022 if (__pCancelPopup != null)
2024 delete __pCancelPopup;
2025 __pCancelPopup = null;
2028 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2030 if (_pCameraPresentationModel->IsCameraPoweredOn())
2032 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED && CameraPoweredOn");
2034 if (__pBatteryState != null)
2036 __pBatteryState->SetShowState(true);
2037 __pBatteryState->Draw();
2038 __pBatteryState->Show();
2042 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_ERROR)
2044 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED)
2050 if (_pCameraPresentationModel->GetStartPreviewException() &&
2051 _pCameraPresentationModel->GetCameraState() != CAMERA_STATE_PREVIEW )
2054 _pCameraPresentationModel->SetStartPreviewException(false);
2057 if(mem < MIN_MEMORY_NEEDED)
2059 ShowMemoryFullPopup();
2063 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2064 isCharging = _pCameraPresentationModel->IsCharging();
2066 AppLogDebug("batteryLevel = %d", batteryLevel);
2067 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2069 if (isCharging == false)
2071 ShowLowBatteryPopup();
2078 if (!CheckCallStatus())
2080 GetCameraToForeground();
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();
2096 CheckBatteryStatus();
2099 HideUiModeChangedButton();
2101 if (_pThumbnailPanel != null)
2103 _pThumbnailPanel->DeleteOldBitmap();
2110 case CAMERA_ACTION_EVENT_FRAME_DEACTIVATED:
2112 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_DEACTIVATED");
2113 bool isInitCameraStaus = false;
2115 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
2116 AppLogDebug("isInitCameraStaus = %d", isInitCameraStaus);
2118 _pCameraPresentationModel->SetMemoryFullException(false);
2119 if (isInitCameraStaus == false)
2121 AppLogDebug("InitCamera is fail");
2125 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2127 if (__pCancelPopup != null)
2129 delete __pCancelPopup;
2130 __pCancelPopup = null;
2133 MakeSettingPopupTab(false);
2135 HideUiModeChangedButton();
2137 if (_pThumbnailPanel != null)
2139 _pThumbnailPanel->DeleteOldBitmap();
2143 InitElapsedTimeLable();
2144 if (_pResetPopUp != null && _pResetPopUp->IsVisible())
2146 _pResetPopUp->SetShowState(false);
2148 SendCameraToBackground();
2152 case CAMERA_ACTION_EVENT_INITIALIZE_FAILED:
2154 AppLogDebug("CAMERA_ACTION_EVENT_INITIALIZE_FAILED");
2156 ShowCameraFailPopup();
2160 case CAMERA_ACTION_EVENT_PREVIEW_START_FAILED:
2162 AppLogDebug("CAMERA_ACTION_EVENT_PREVIEW_START_FAILED");
2164 if (CheckCallStatus())
2169 if (_pCameraPresentationModel->GetStartPreviewException())
2171 ShowCameraFailPopup();
2176 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED:
2178 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHANGED");
2179 bool isCharging = false;
2180 BatteryLevel batteryLevel;
2181 result r = E_SUCCESS;
2183 batteryLevel = _pCameraPresentationModel->GetBatteryLevel();
2184 isCharging = _pCameraPresentationModel->IsCharging();
2186 AppLogDebug("batteryLevel = %d", batteryLevel);
2187 AppLogDebug("isCharging = %d", isCharging);
2190 if (isCharging == false)
2192 if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
2194 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
2196 _pCameraPresentationModel->SetOnVideoRecorderStopped(false);
2198 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
2199 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
2202 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
2204 _pCameraPresentationModel->StopRecord();
2205 _pCameraPresentationModel->UpdateContentFile();
2211 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
2216 CheckBatteryStatus();
2221 CheckBatteryStatus();
2226 case CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING:
2228 AppLogDebug("CAMERA_ACTION_EVENT_BATTERY_LEVEL_CHARGING");
2230 _batteryStatus = GetCurrentBatteryState();
2232 AppLogDebug("batteryStatus = %d", _batteryStatus);
2234 CheckBatteryStatus();
2238 case CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT:
2240 AppLogDebug("CAMERA_ACTION_EVENT_STORAGE_CARD_UNMOUNT");
2241 bool doHidePopup = false;
2242 int requestType = 0;
2243 result r = E_SUCCESS;
2245 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
2247 _pCameraInfoPanel->Invalidate(true);
2249 requestType = _pCameraPresentationModel->GetAppControlRequestType();
2250 if (__pCancelPopup != null)
2252 delete __pCancelPopup;
2253 __pCancelPopup = null;
2254 _pCameraPresentationModel->SetCancelRecord(true);
2258 _pAppTimer->Cancel();
2259 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
2267 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && requestType == CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED)
2269 AppLogDebug("Camera Captured after TerminateApp");
2272 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
2276 AppLogDebug("recorderstate is %d",_pCameraPresentationModel->GetRecorderState());
2277 AppLogDebug("_isRecording is %d",_isRecording);
2278 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING
2279 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STOPPING)
2283 AppLogDebug("_isRecording");
2285 __doRecording = false;
2287 _isRecordingPause = false;
2289 __setTimerInterval = false;
2291 _pCameraPresentationModel->SetIntervalTimerRun(false);
2293 __recorderStopped = true;
2296 if (__pElapsedTimeLable)
2298 __pElapsedTimeLable->SetShowState(false);
2299 __pElapsedTimeLable->Invalidate(true);
2302 if (__pElapsedTimeMaxLable)
2304 __pElapsedTimeMaxLable->SetShowState(false);
2305 __pElapsedTimeMaxLable->Invalidate(true);
2308 if (__pElapsedRecordSizeLable)
2310 __pElapsedRecordSizeLable->SetShowState(false);
2311 __pElapsedRecordSizeLable->Invalidate(true);
2314 __pRecLabelRed->SetShowState(false);
2315 __pRecLabelRed->Invalidate(true);
2317 __pRecLabelText->SetShowState(false);
2318 __pRecLabelText->Invalidate(true);
2324 if (__setTimerInterval)
2326 AppLogDebug("__setTimerInterval");
2327 CancelTimerIntervalRecord();
2331 if (_pListViewCameraTabMainMenu != null)
2333 if (_pListViewCameraTabMainMenu->GetShowState() == true)
2339 if (_pListViewCameraTabSubMenu != null)
2341 if (_pListViewCameraTabSubMenu->GetShowState() == true)
2347 if (_pListViewGeneralTabMainMenu != null)
2349 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
2355 if (_pListViewGeneralTabSubMenu != null)
2357 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
2363 if (doHidePopup == true)
2374 AppLogDebug("EXIT");
2378 CamcorderForm::InitSettingMenuPanel(void)
2380 AppLogDebug("ENTER");
2381 result r = E_SUCCESS;
2382 int cameraCount = 0;
2384 __pSettingPanel = static_cast<Panel*>(GetControl(L"IDC_SETTING_PANEL"));
2385 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null, Make panel fail!!!");
2387 __pSettingPanel->AddTouchEventListener(*this);
2388 __pSettingPanel->SetName(IDS_SETTING_UI_PANEL_NAME);
2390 _pFlashButton = static_cast<Button*>(GetControl(L"IDC_SET_FLASH_BUTTON"));
2391 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
2393 _pFlashButton->SetName(IDS_FLASH_BUTTON_NAME);
2394 _pFlashButton->SetActionId(IDA_BUTTON_CAMCORDER_FLASH);
2395 _pFlashButton->AddActionEventListener(*this);
2396 _pFlashButton->AddTouchEventListener(*this);
2398 _pSelfShotButton = static_cast<Button*>(GetControl(L"IDC_SELF_SHOT_BUTTON"));
2399 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2401 _pSelfShotButton->SetActionId(IDA_BUTTON_CAMCORDER_SELF);
2402 _pSelfShotButton->AddActionEventListener(*this);
2403 _pSelfShotButton->AddTouchEventListener(*this);
2405 _pSettingButton = static_cast<Button*>(GetControl(L"IDC_SETTING_BUTTON"));
2406 TryCatch(_pSettingButton != null, r = E_SYSTEM, "_pSettingButton is null");
2408 _pSettingButton->SetActionId(IDA_BUTTON_CAMCORDER_SETTING);
2409 _pSettingButton->AddActionEventListener(*this);
2410 _pSettingButton->AddTouchEventListener(*this);
2412 __pSettingLine = static_cast<Label*>(GetControl(L"IDC_SETTING_LINE"));
2413 TryCatch(__pSettingLine != null, r = E_SYSTEM, "pSettingButton is null");
2414 __pSettingLine->AddTouchEventListener(*this);
2416 _pQuickSettingButton = static_cast<Button*>(GetControl(L"IDC_QUICK_SETTING_BUTTON"));
2417 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "pQuickSettingButton is null");
2419 _pQuickSettingButton->AddTouchEventListener(*this);
2420 _pQuickSettingButton->SetActionId(IDA_BUTTON_CAMCORDER_QUICK_SETTING);
2421 _pQuickSettingButton->AddActionEventListener(*this);
2423 _pWhiteBalanceButton = static_cast<Button*>(GetControl(L"IDC_WB_BUTTON"));
2424 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2426 _pWhiteBalanceButton->SetActionId(IDA_BUTTON_CAMERA_WB);
2427 _pWhiteBalanceButton->SetName(IDS_WB_BUTTON_NAME);
2428 _pWhiteBalanceButton->AddTouchEventListener(*this);
2429 _pWhiteBalanceButton->AddActionEventListener(*this);
2431 _pExposureValueButton = static_cast<Button*>(GetControl(L"IDC_EV_BUTTON"));
2432 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2434 _pExposureValueButton->SetActionId(IDA_BUTTON_CAMERA_EV);
2435 _pExposureValueButton->AddTouchEventListener(*this);
2436 _pExposureValueButton->AddActionEventListener(*this);
2438 _pCloseButton = static_cast<Button*>(GetControl(L"IDC_CLOSE_BUTTON"));
2439 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2441 _pCloseButton->AddTouchEventListener(*this);
2443 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
2444 || __dir == ORIENTATION_STATUS_PORTRAIT)
2446 _pCloseButton->SetSize(X_CLOSE_BUTTON_PORTRAIT, Y_CLOSE_BUTTON_PORTRAIT);
2450 _pCloseButton->SetSize(X_CLOSE_BUTTON_LANDSCAPE, Y_CLOSE_BUTTON_LANDSCAPE);
2452 _pCloseButton->SetActionId(IDA_BUTTON_CLOSE_SETTING);
2453 _pCloseButton->AddActionEventListener(*this);
2455 _pAutoFocus = static_cast<Button*>(GetControl(L"IDC_AUTOFOCUS_BUTTON"));
2456 TryCatch(_pAutoFocus != null, r = E_SYSTEM, "_pAutoFocus is null");
2458 _pAutoFocus->SetActionId(IDA_BUTTON_CAMCORDER_AUTO_FOCUS);
2459 _pAutoFocus->AddTouchEventListener(*this);
2460 _pAutoFocus->AddActionEventListener(*this);
2462 r = UpdateUiPanelIcon();
2463 //TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
2465 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_COUNT, cameraCount);
2466 AppLogDebug("GetMediaCapability [%s]", GetErrorMessage(r));
2467 if (cameraCount > SUPPORTED_CAMERA_NUM)
2469 _pSelfShotButton->SetEnabled(true);
2473 _pSelfShotButton->SetEnabled(false);
2476 AppLogDebug("EXIT");
2480 _pFlashButton = null;
2481 _pSelfShotButton = null;
2482 _pSettingButton = null;
2483 __pSettingLine = null;
2484 _pQuickSettingButton = null;
2485 _pWhiteBalanceButton = null;
2486 _pExposureValueButton = null;
2487 _pCloseButton = null;
2494 CamcorderForm::UpdateUiPanelIcon(void)
2496 AppLogDebug("ENTER");
2497 result r = E_SUCCESS;
2498 int selfPortraitEnable = 0;
2499 Bitmap* pBitmap = null;
2500 Bitmap* pBitmapRotate = null;
2503 ImageRotationType rotationType = IMAGE_ROTATION_0;
2505 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
2506 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
2508 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2510 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
2511 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2513 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2514 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2516 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2517 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2519 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2524 delete pBitmapRotate;
2525 pBitmapRotate = null;
2527 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2528 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2530 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2531 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2533 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2538 delete pBitmapRotate;
2539 pBitmapRotate = null;
2541 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2543 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
2545 if (value == true && r == E_SUCCESS)
2547 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
2548 TryCatch(r == E_SUCCESS, , "Read Reg Fail[%s]", GetErrorMessage(r));
2552 case FLASH_MODE_OFF:
2554 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR);
2555 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2557 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2558 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2560 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2565 delete pBitmapRotate;
2566 pBitmapRotate = null;
2568 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS);
2569 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2571 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2572 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2574 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2579 delete pBitmapRotate;
2580 pBitmapRotate = null;
2586 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR);
2587 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2589 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2590 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2592 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2597 delete pBitmapRotate;
2598 pBitmapRotate = null;
2600 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS);
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->SetPressedBackgroundBitmap(*pBitmapRotate);
2611 delete pBitmapRotate;
2612 pBitmapRotate = null;
2616 case FLASH_MODE_AUTO:
2618 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR);
2619 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2621 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2622 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2624 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2629 delete pBitmapRotate;
2630 pBitmapRotate = null;
2632 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS);
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->SetPressedBackgroundBitmap(*pBitmapRotate);
2643 delete pBitmapRotate;
2644 pBitmapRotate = null;
2654 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
2655 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
2657 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2658 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2660 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2661 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2663 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2668 delete pBitmapRotate;
2669 pBitmapRotate = null;
2671 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS_DIM);
2673 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
2675 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2676 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2678 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2683 delete pBitmapRotate;
2684 pBitmapRotate = null;
2687 _pFlashButton->Invalidate(true);
2688 TryCatch(_pSelfShotButton != null, r = E_SYSTEM, "_pSelfShotButton is null");
2690 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2692 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2694 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2696 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2698 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2700 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2701 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2703 _pSelfShotButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2708 delete pBitmapRotate;
2709 pBitmapRotate = null;
2711 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2713 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK_PRESS);
2715 else if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
2717 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT_PRESS);
2719 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2721 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2722 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2724 _pSelfShotButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2729 delete pBitmapRotate;
2730 pBitmapRotate = null;
2732 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2734 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BACK);
2738 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_FRONT);
2740 TryCatch(pBitmap != null, r = E_SYSTEM, "SelfShot::pBitmap is null");
2742 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2743 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2745 _pSelfShotButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
2750 delete pBitmapRotate;
2751 pBitmapRotate = null;
2753 if (__dir == ORIENTATION_STATUS_PORTRAIT
2754 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
2756 _pCloseButton->SetSize(X_CLOSE_BUTTON_PORTRAIT, Y_CLOSE_BUTTON_PORTRAIT);
2760 rotationType = IMAGE_ROTATION_270;
2761 _pCloseButton->SetSize(X_CLOSE_BUTTON_LANDSCAPE, Y_CLOSE_BUTTON_LANDSCAPE);
2764 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_NOR);
2765 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
2767 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2768 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingButton::pBitmapRotate is null");
2770 _pSettingButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2775 delete pBitmapRotate;
2776 pBitmapRotate = null;
2778 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_PRESS);
2779 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
2781 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2782 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingButton::pBitmapRotate is null");
2784 _pSettingButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2789 delete pBitmapRotate;
2790 pBitmapRotate = null;
2792 TryCatch(__pSettingLine != null, r = E_SYSTEM, "__pSettingLine is null");
2794 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_SETTING_LINE);
2795 TryCatch(pBitmap != null, r = E_SYSTEM, "SettingLine::pBitmap is null");
2797 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2798 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SettingLine::pBitmapRotate is null");
2800 __pSettingLine->SetBackgroundBitmap(*pBitmapRotate);
2805 delete pBitmapRotate;
2806 pBitmapRotate = null;
2808 TryCatch(_pQuickSettingButton != null, r = E_SYSTEM, "_pQuickSettingButton is null");
2809 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_NOR);
2810 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2812 _pQuickSettingButton->SetNormalBackgroundBitmap(*pBitmap);
2817 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_QUICK_SETTING_PRESS);
2818 TryCatch(pBitmap != null, r = E_SYSTEM, "QuickSetting::pBitmap is null");
2820 _pQuickSettingButton->SetPressedBackgroundBitmap(*pBitmap);
2825 TryCatch(_pWhiteBalanceButton != null, r = E_SYSTEM, "_pWhiteBalanceButton is null");
2827 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
2829 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
2833 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
2838 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE);
2839 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2841 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2846 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_PRESS);
2847 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2849 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2856 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2857 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2859 _pWhiteBalanceButton->SetNormalBackgroundBitmap(*pBitmap);
2864 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_WHITEBALANCE_DIM_PRESS);
2865 TryCatch(pBitmap != null, r = E_SYSTEM, "WhiteBalance::pBitmap is null");
2867 _pWhiteBalanceButton->SetPressedBackgroundBitmap(*pBitmap);
2873 TryCatch(_pExposureValueButton != null, r = E_SYSTEM, "_pExposureValueButton is null");
2875 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE);
2876 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2878 _pExposureValueButton->SetNormalBackgroundBitmap(*pBitmap);
2880 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_EXPOSURE_PRESS);
2881 TryCatch(pBitmap != null, r = E_SYSTEM, "ExposureValue::pBitmap is null");
2883 _pExposureValueButton->SetPressedBackgroundBitmap(*pBitmap);
2888 TryCatch(_pCloseButton != null, r = E_SYSTEM, "_pCloseButton is null");
2890 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_CLOSE);
2891 TryCatch(pBitmap != null, r = E_SYSTEM, "Close::pBitmap is null");
2893 pBitmapRotate = RotationImageN(pBitmap, rotationType);
2894 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "SwButton::pBitmapRotate is null");
2896 _pCloseButton->SetNormalBackgroundBitmap(*pBitmapRotate);
2897 _pCloseButton->SetPressedBackgroundBitmap(*pBitmapRotate);
2902 delete pBitmapRotate;
2903 pBitmapRotate = null;
2905 AppLogDebug("EXIT");
2909 if (pBitmap != null)
2919 CamcorderForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPsition, const Tizen::Ui::TouchEventInfo& touchInfo)
2921 AppLogDebug("ENTER");
2922 result r = E_SUCCESS;
2923 String controlName = "L";
2925 if (_appControlActionCompleted)
2927 AppLogDebug("OnTouchPressed >> TerminateApp Execution");
2931 controlName = source.GetName();
2933 StartInitAppTimer();
2935 if (_pCameraInfoPanel->GetDrawExposure() == true)
2937 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
2938 _pExposureCloseTimer->Cancel();
2940 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
2941 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
2943 AppLogDebug("EXIT");
2947 CamcorderForm::OnTouchModeSwitch(void)
2949 AppLogDebug("ENTER");
2950 bool onVideoRecorderStopped = false;
2951 result r = E_SUCCESS;
2953 if (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW)
2955 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
2957 AppLogDebug("Return Camera transform");
2962 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
2963 AppLogDebug("pSceneManager->GoForward : onVideoRecorderStopped = %d", onVideoRecorderStopped);
2965 if (onVideoRecorderStopped == false)
2967 SceneManager* pSceneManager = SceneManager::GetInstance();
2968 AppAssert(pSceneManager);
2970 AppLogDebug("IDA_BUTTON_CAMCORDER_MODE");
2972 r = _pCameraPresentationModel->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
2973 TryReturnVoid(r == E_SUCCESS, "Reg setvalue fail[%s]", GetErrorMessage(r));
2977 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CAMERA));
2978 TryReturnVoid(r == E_SUCCESS, "SceneManager::GoForward fail[%s]", GetErrorMessage(r));
2988 AppLogDebug("Prohibit to GoForward IDSCN_CAMCORDER!!!");
2990 AppLogDebug("EXIT");
2994 CamcorderForm::OnTouchDrawExposure(const Tizen::Graphics::Point& currentPosition)
2996 AppLogDebug("ENTER");
2997 result r = E_SUCCESS;
2999 AppLogDebug("X = %d Y = %d", currentPosition.x, currentPosition.y);
3000 if (__dir == ORIENTATION_STATUS_PORTRAIT
3001 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3003 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
3004 _closeTimerValue = 0;
3006 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3007 _pExposureCloseTimer->Cancel();
3009 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
3010 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
3014 r = DrawExposureSlider(currentPosition, DRAW_RELEASED);
3015 _closeTimerValue = 0;
3017 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3018 _pExposureCloseTimer->Cancel();
3020 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
3021 TryReturnVoid(r == E_SUCCESS, "_pExposureCloseTimer start fail[%s]", GetErrorMessage(r));
3023 AppLogDebug("EXIT");
3027 CamcorderForm::OnTouchDoHidePopup(void)
3029 AppLogDebug("ENTER");
3030 bool doHidePopup = false;
3032 if (_pListViewCameraTabMainMenu != null)
3034 if (_pListViewCameraTabMainMenu->GetShowState() == true)
3040 if (_pListViewGeneralTabMainMenu != null)
3042 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
3048 if (_pListFlashMainMenu != null)
3050 if (_pListFlashMainMenu->GetShowState() == true)
3056 if (_pListViewCameraTabSubMenu != null)
3058 if (_pListViewCameraTabSubMenu->GetShowState() == true)
3064 if (_pListViewGeneralTabSubMenu != null)
3066 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
3072 if (_pListWbMainMenu != null)
3074 if (_pListWbMainMenu->GetShowState() == true)
3080 if (_pCameraInfoPanel->GetDrawExposure() == true)
3082 doHidePopup = false;
3085 AppLogDebug("EXIT");
3090 CamcorderForm::DoRecording(void)
3092 AppLogDebug("ENTER");
3093 bool onVideoRecorderStopped = false;
3097 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3099 AppLogDebug("Camcorder State = %d ", _pCameraPresentationModel->GetRecorderState());
3101 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_INITIALIZED
3102 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_OPENED
3103 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
3104 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_CLOSED
3105 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STOPPED
3108 _pCameraPresentationModel->SetFocusMode(CAMERA_FOCUS_MODE_NONE);
3110 if (_pChargingTimer)
3112 _pChargingTimer->Cancel();
3115 __doRecording = true;
3117 _isRecordingPause = false;
3119 __pBatteryState->SetShowState(false);
3120 __pBatteryState->Draw();
3121 __pBatteryState->Show();
3123 _pCameraInfoPanel->SetDrawIndicator(false);
3124 _pCameraInfoPanel->Draw();
3125 _pCameraInfoPanel->Show();
3127 DoRecordHideUiPanel();
3131 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3133 if (onVideoRecorderStopped == false)
3144 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3146 if (onVideoRecorderStopped == true)
3151 AppLogDebug("EXIT");
3155 CamcorderForm::DoStopRecording(void)
3157 AppLogDebug("ENTER");
3160 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3162 __doRecording = false;
3164 _isRecordingPause = false;
3166 __setTimerInterval = false;
3168 _pCameraPresentationModel->SetIntervalTimerRun(false);
3176 StartInitChargingTimer();
3178 _pCameraPresentationModel->SetContinuousAutoFocus();
3179 AppLogDebug("EXIT");
3183 CamcorderForm::OnTouchLaunchImageview(void)
3185 AppLogDebug("ENTER");
3186 bool onVideoRecorderStopped = false;
3187 int storageCardChageState = CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN;
3188 String fullFileName = L"";
3190 if (_pCameraPresentationModel->GetLatestThumbnail() != null)
3192 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
3194 storageCardChageState = _pCameraPresentationModel->GetStorageCardChageState();
3195 if (storageCardChageState == CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_MOUNT_TO_UNMOUNT)
3197 AppLogDebug("MOUNT_TO_UNMOUNT : Don't LaunchImageview");
3198 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3200 if (onVideoRecorderStopped == false)
3202 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_RECORD);
3204 if (fullFileName == L"")
3206 AppLogDebug("file do not found");
3210 AppLogDebug("LaunchImageview : MOUNT_TO_UNMOUNT");
3218 AppLogDebug("LaunchImageview");
3219 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
3221 if (onVideoRecorderStopped == false)
3223 fullFileName = _pCameraPresentationModel->GetContentFilePath(CameraPresentationModel::CAMERA_MODE_RECORD);
3225 if (fullFileName == L"")
3227 AppLogDebug("file do not found");
3240 AppLogDebug("EXIT");
3244 CamcorderForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
3246 AppLogDebug("ENTER");
3247 String controlName = L"";
3248 int checkActivePanel = -1;
3249 bool doHidePopup = false;
3251 if (_appControlActionCompleted)
3253 AppLogDebug("OnTouchReleased >> TerminateApp Execution");
3257 controlName = source.GetName();
3259 if (_pCameraInfoPanel->GetDrawExposure() == true)
3261 if (source.Equals(*__pRecordButton) == true)
3263 _closeTimerValue = 0;
3265 if (_pExposureCloseTimer)
3267 _pExposureCloseTimer->Cancel();
3270 _pCameraInfoPanel->SetDrawExposure(false);
3275 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
3277 OnTouchDrawExposure(currentPosition);
3282 doHidePopup = OnTouchDoHidePopup();
3283 AppLogDebug("doHidePopup = %d", doHidePopup);
3285 if ((doHidePopup == false) && (_pCameraInfoPanel->GetDrawExposure() == false))
3287 if ((controlName.Equals(String(IDS_CAMERA_INFO_PANEL_NAME))) && (_pCameraPresentationModel->GetCameraState() == CAMERA_STATE_PREVIEW))
3289 DrawTouchAutoFocus(currentPosition);
3294 if (!controlName.Equals(String(IDS_GENERAL_SETTING_SUB_MENU))
3295 && !controlName.Equals(String(IDS_CAMERA_SETTING_SUB_MENU)))
3297 if (_pCameraInfoGeneralSubPanel != null)
3299 if (_pCameraInfoGeneralSubPanel->GetShowState())
3301 checkActivePanel = 0;
3304 if (_pCameraInfoSubPanel != null)
3306 if (_pCameraInfoSubPanel->GetShowState())
3308 checkActivePanel = 1;
3312 if (checkActivePanel != -1)
3314 if (checkActivePanel == 0)
3316 _pCameraInfoGeneralSubPanel->SetShowState(false);
3320 _pCameraInfoSubPanel->SetShowState(false);
3331 if (source.Equals(*__pCamcorderSettingLable) == true)
3333 CheckCamcorderSettingLabel();
3336 if (source.Equals(*__pGeneralSettingLable) == true)
3338 CheckGeneralSettingLabel();
3341 if (controlName.Equals(String(IDS_THUMBNAIL_PANLE_NAME))
3342 && _pThumbnailPanel->GetShowState() == true
3343 && (GetAppLaunchType() != APP_LAUNCH_TYPE_REQUESET)
3344 && _pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING
3347 if (source.Equals(*_pThumbnailPanel) == true)
3349 AppLogDebug("Touch Thumbnail button");
3350 OnTouchLaunchImageview();
3353 AppLogDebug("EXIT");
3357 CamcorderForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
3359 AppLogDebug("ENTER");
3360 String controlName = L"";
3361 result r = E_SUCCESS;
3363 if (_appControlActionCompleted)
3365 AppLogDebug("OnTouchMoved >> TerminateApp Execution");
3369 controlName = source.GetName();
3371 if ((controlName.Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
3373 OnTouchModeSwitch();
3377 if (_pCameraInfoPanel->GetDrawExposure() == true)
3379 AppLogDebug("control name is %ls",controlName.GetPointer());
3381 if (controlName.CompareTo(IDS_SETTING_UI_PANEL_NAME) != 0)
3383 r = DrawExposureSlider(currentPosition, DRAW_MOVED);
3384 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
3385 _closeTimerValue = 0;
3387 TryReturnVoid(_pExposureCloseTimer != null, "_pExposureCloseTimer is null");
3388 _pExposureCloseTimer->Cancel();
3391 AppLogDebug("EXIT");
3395 CamcorderForm::OnAppTimerExpired(void)
3397 AppLogDebug("ENTER");
3398 CameraApp* pCameraApp = static_cast<CameraApp*>(CameraApp::GetInstance());
3399 result r = E_SUCCESS;
3401 AppLogDebug("_pAppTimer expire");
3406 _isRecording = false;
3408 _pCameraPresentationModel->StopCamera();
3410 r = SendAppControlResult(pCameraApp->GetRequestId());
3411 TryReturnVoid(r == E_SUCCESS, "SendAppControlResult [%s]", GetErrorMessage(r));
3412 AppLogDebug("EXIT");
3416 CamcorderForm::OnSettingTimerExpired(void)
3418 AppLogDebug("ENTER");
3419 result r = E_SUCCESS;
3421 _pIntervalValueTimer->Cancel();
3423 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
3425 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
3427 _pCameraInfoPanel->Invalidate(true);
3429 _pCameraInfoPanel->SetDrawPopupTimer(false);
3431 _pCameraInfoPanel->Invalidate(true);
3433 _isRecording = true;
3435 __setTimerInterval = false;
3436 _pCameraPresentationModel->SetIntervalTimerRun(false);
3438 _pCameraPresentationModel->StartRecord();
3440 r = StartRecordTimer();
3441 TryReturnVoid(r == E_SUCCESS, "StartRecordTimer() fail[%s]", GetErrorMessage(r));
3443 r = SetRecordButton(true);
3444 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
3446 AutoFocusPerformed();
3447 AppLogDebug("EXIT");
3451 CamcorderForm::OnPopupTimerExpired(void)
3453 AppLogDebug("ENTER");
3454 if (_isRecording != true)
3458 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
3460 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
3462 _pCameraInfoPanel->Invalidate(true);
3464 AppLogDebug("_timeCount=%d", _timeCount);
3466 if (_timeCount == INDEX_UNIT_ZERO || _timeCount == INDEX_UNIT_ONE)
3471 AppLogDebug("EXIT");
3475 CamcorderForm::OnRecordTimerExpired(void)
3477 AppLogDebug("ENTER");
3478 result r = E_SUCCESS;
3480 if (_isRecording == true)
3482 __recordTimeCount++;
3484 AppLogDebug("__pRecordTimer expire");
3486 __recordingMaxTime = _pCameraPresentationModel->GetMaxRecordingTime();
3488 r = DrawRecord(true);
3489 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
3491 r = DrawRecordTimer();
3492 TryReturnVoid(r == E_SUCCESS, "DrawRecordTimer() fail[%s]", GetErrorMessage(r));
3494 AppLogDebug("EXIT");
3498 CamcorderForm::OnExposureCloseTimerExpired(void)
3500 AppLogDebug("ENTER");
3503 AppLogDebug("_closeTimerValue expire %d", _closeTimerValue);
3505 if (_closeTimerValue == EXPOSURE_TIMER_IS_ALIVE)
3507 if (_pCameraInfoPanel->GetDrawExposure() == true)
3509 _pCameraInfoPanel->SetDrawExposure(false);
3515 _closeTimerValue = 0;
3517 _pExposureCloseTimer->Cancel();
3519 AppLogDebug("EXIT");
3523 CamcorderForm::OnPreviewFailPopupTimerExpired(void)
3525 AppLogDebug("ENTER");
3527 if (CheckCallStatus())
3532 ShowCameraFailPopup();
3533 AppLogDebug("EXIT");
3537 CamcorderForm::OnChargingCompletedTimerExpired(void)
3539 AppLogDebug("ENTER");
3540 Bitmap* pBitmap = null;
3541 result r = E_SUCCESS;
3543 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3545 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3547 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
3551 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
3556 if (_chargingCount % DIVIDE_BY_TWO)
3558 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
3562 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_GLOW);
3564 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
3566 if (_chargingCount >= BATTERY_STATE_20)
3568 _chargingCount = INDEX_UNIT_ZERO;
3572 __pBatteryState->SetBackgroundBitmap(*pBitmap);
3573 __pBatteryState->Invalidate(true);
3575 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3576 AppLogDebug("_chargingCount = %d", _chargingCount);
3577 AppLogDebug("_blinkCount = %d", _blinkCount);
3582 AppLogDebug("EXIT");
3586 AppLogDebug("EXIT - CATCH");
3591 CamcorderForm::OnChargingTimerExpired(void)
3593 AppLogDebug("ENTER");
3594 Bitmap* pBitmap = null;
3595 result r = E_SUCCESS;
3596 int maxChargingCnt = 0;
3597 int batteryLevel = 0;
3598 Battery::GetCurrentLevelInPercentage(batteryLevel);
3600 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3602 if (__dir == ORIENTATION_STATUS_PORTRAIT || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
3604 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
3608 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
3611 AppLogDebug("batteryLevel = %d", batteryLevel);
3615 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3616 AppLogDebug("_chargingCount = %d", _chargingCount);
3618 if ((_batteryStatus == BATTERY_STATE_0 || _batteryStatus == BATTERY_STATE_1) && _chargingCount == INDEX_UNIT_ONE)
3620 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_LOW);
3624 pBitmap = ResourceManager::GetBitmapN(_batteryStatus + _chargingCount);
3626 TryCatch(pBitmap != null, r = E_SYSTEM, "FlashButton::pBitmap is null");
3628 maxChargingCnt = (static_cast<int>(_batteryStatus)) + _chargingCount;
3630 AppLogDebug("maxCount = %d", maxChargingCnt);
3632 if (maxChargingCnt >= BATTERY_STATE_20)
3634 _chargingCount = INDEX_UNIT_ZERO;
3637 __pBatteryState->SetBackgroundBitmap(*pBitmap);
3638 __pBatteryState->Invalidate(true);
3643 AppLogDebug("EXIT");
3647 AppLogDebug("EXIT - CATCH");
3652 CamcorderForm::OnMakerFocusTimerExpired(void)
3654 AppLogDebug("ENTER");
3655 result r = E_SUCCESS;
3657 _pCameraInfoPanel->SetDrawMarkerFocus(false);
3659 _pCameraInfoPanel->Invalidate(true);
3661 r = _pMakerFocusTimer->Cancel();
3663 delete _pMakerFocusTimer;
3664 _pMakerFocusTimer = null;
3665 AppLogDebug("EXIT");
3669 CamcorderForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
3671 AppLogDebug("ENTER");
3672 if (timer.Equals(*_pAppTimer))
3674 AppLogDebug("_pAppTimer");
3675 OnAppTimerExpired();
3677 else if (timer.Equals(*_pIntervalValueTimer))
3679 AppLogDebug("_pIntervalValueTimer");
3681 if (!__pRecordButton->GetShowState())
3683 __pRecordButton->SetShowState(true);
3686 OnSettingTimerExpired();
3687 StartInitChargingTimer();
3689 else if (timer.Equals(*_pPopupTimer))
3691 AppLogDebug("_pPopupTimer");
3692 OnPopupTimerExpired();
3694 else if (timer.Equals(*__pRecordTimer))
3696 AppLogDebug("__pRecordTimer");
3697 OnRecordTimerExpired();
3700 __pRecordButton->SetShowState(true);
3701 __pRecordButton->Invalidate(true);
3703 else if (timer.Equals(*_pExposureCloseTimer))
3705 AppLogDebug("_pExposureCloseTimer");
3706 OnExposureCloseTimerExpired();
3708 else if (timer.Equals(*_pMakerFocusTimer))
3710 AppLogDebug("_pMakerFocusTimer");
3711 OnMakerFocusTimerExpired();
3713 else if (timer.Equals(*_pHelpCloseTimer))
3715 AppLogDebug("__pHelpCloseTimer");
3716 OnHelpCloseTimerExpired();
3718 else if (timer.Equals(*_pChargingTimer))
3720 result r = E_SUCCESS;
3721 AppLogDebug("_pChargingTimer");
3722 bool isCharging = false;
3724 _batteryStatus = GetCurrentBatteryState();
3725 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3727 isCharging = _pCameraPresentationModel->IsCharging();
3731 if (_batteryStatus == BATTERY_STATE_20)
3733 _chargingCount = INDEX_UNIT_ZERO;
3735 _blinkCount = INDEX_UNIT_ZERO;
3737 _pChargingTimer->Cancel();
3739 StartInitChargingCompletedTimer();
3743 r = OnChargingTimerExpired();
3750 _blinkCount = INDEX_UNIT_ZERO;
3752 _pChargingTimer->Cancel();
3754 if (_batteryStatus == BATTERY_STATE_20)
3756 AppLogDebug("_pChargingTimer -> __pChargingCompletedTimer");
3758 StartInitChargingCompletedTimer();
3762 else if (timer.Equals(*_pChargingCompletedTimer))
3764 result r = E_SUCCESS;
3765 AppLogDebug("__pChargingCompletedTimer");
3766 bool isCharging = false;
3768 isCharging = _pCameraPresentationModel->IsCharging();
3770 _batteryStatus = GetCurrentBatteryState();
3771 AppLogDebug("_batteryStatus = %d", _batteryStatus);
3773 if (isCharging == false && _batteryStatus == BATTERY_STATE_20)
3775 if (_blinkCount == INDEX_UNIT_TWENTY)
3777 AppLogDebug("__pChargingCompletedTimer cancel");
3779 _chargingCount = INDEX_UNIT_ZERO;
3781 _blinkCount = INDEX_UNIT_ZERO;
3783 _pChargingCompletedTimer->Cancel();
3785 CheckBatteryStatus();
3789 AppLogDebug("OnChargingCompletedTimerExpired");
3791 r = OnChargingCompletedTimerExpired();
3796 AppLogDebug("isCharging = true >> __pChargingCompletedTimer cancel");
3798 _chargingCount = INDEX_UNIT_ZERO;
3800 _blinkCount = INDEX_UNIT_ZERO;
3802 _pChargingCompletedTimer->Cancel();
3804 CheckBatteryStatus();
3807 else if (timer.Equals(*_pPreviewFailPopupTimer))
3809 AppLogDebug("__pPreviewFailPopupTimer");
3810 _pPreviewFailPopupTimer->Cancel();
3812 if (_pCameraPresentationModel->GetStartPreviewException())
3814 OnPreviewFailPopupTimerExpired();
3819 AppLogDebug("Not expire");
3821 AppLogDebug("EXIT");
3825 CamcorderForm::InitActionMenuPanel(void)
3827 AppLogDebug("ENTER");
3828 result r = E_SUCCESS;
3829 Rectangle rectThumbnailButton;
3830 Rectangle clientArea = GetClientAreaBounds();
3832 __pActionPanel = static_cast<Panel*>(GetControl(L"IDC_ACTION_PANEL"));
3833 TryCatch(__pActionPanel != null, r = E_SYSTEM, "__pActionPanel is null, Make panel fail!!!");
3835 __pActionPanel->SetName(IDS_ACTION_UI_PANEL_NAME);
3837 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
3838 || __dir == ORIENTATION_STATUS_PORTRAIT)
3840 if (clientArea.height == DISPLAY_WVGA)
3842 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
3846 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
3851 if (clientArea.width == DISPLAY_WVGA)
3853 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_WVGA);
3857 _pCameraPresentationModel->SetDisplayResolutionType(CameraPresentationModel::DISPLAY_RESOLUTION_HD);
3860 __pActionPanel->AddTouchEventListener(*this);
3862 __pBatteryState = static_cast<Label*>(GetControl(L"IDC_BATTERY_STATE"));
3863 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBattery is null");
3864 __pBatteryState->AddTouchEventListener(*this);
3866 __pCamcoderSetting = static_cast<Button*>(GetControl(L"IDC_CAMERA_SETTING_POPUP"));
3867 TryCatch(__pCamcoderSetting != null, r = E_SYSTEM, "__pCameraSetting is null");
3868 __pCamcoderSetting->SetActionId(IDA_BUTTON_SETTING_CAMCODER);
3869 __pCamcoderSetting->AddActionEventListener(*this);
3870 __pCamcoderSetting->SetShowState(false);
3872 __pGeneralSetting = static_cast<Button*>(GetControl(L"IDC_GENERAL_SETTING_POPUP"));
3873 TryCatch(__pGeneralSetting != null, r = E_SYSTEM, "__pGeneralSetting is null");
3874 __pGeneralSetting->SetActionId(IDA_BUTTON_SETTING_GENERAL);
3875 __pGeneralSetting->AddActionEventListener(*this);
3876 __pGeneralSetting->SetShowState(false);
3878 __pCamcorderSettingLable = static_cast<Label*>(GetControl(L"IDC_CAMERA_SETTING_LABEL"));
3879 TryCatch(__pCamcorderSettingLable != null, r = E_SYSTEM, "__pCamcorderSettingLable is null");
3880 __pCamcorderSettingLable->AddTouchEventListener(*this);
3881 __pCamcorderSettingLable->SetShowState(false);
3883 __pGeneralSettingLable = static_cast<Label*>(GetControl(L"IDC_GENERAL_SETTING_LABEL"));
3884 TryCatch(__pGeneralSettingLable != null, r = E_SYSTEM, "__pGeneralSettingLable is null");
3885 __pGeneralSettingLable->AddTouchEventListener(*this);
3886 __pGeneralSettingLable->SetShowState(false);
3888 __pRecLabelRed = static_cast<Label*>(GetControl(L"IDC_REC_LABEL_RED"));
3889 TryCatch(__pRecLabelRed != null, r = E_SYSTEM, "__pRecLabelRed is null");
3890 __pRecLabelRed->AddTouchEventListener(*this);
3892 __pRecLabelText = static_cast<Label*>(GetControl(L"IDC_REC_LABEL_TEXT"));
3893 TryCatch(__pRecLabelText != null, r = E_SYSTEM, "__pRecLabelRed is null");
3894 __pRecLabelText->AddTouchEventListener(*this);
3896 __pElapsedTimeLable = static_cast< Label* >(GetControl(L"IDC_REC_TIME"));
3897 TryCatch(__pElapsedTimeLable != null, r = E_SYSTEM, "__pElapsedTimeLable is null");
3898 __pElapsedTimeLable->AddTouchEventListener(*this);
3900 __pElapsedTimeMaxLable = static_cast< Label* >(GetControl(L"IDC_REC_MAX_TIME"));
3901 TryCatch(__pElapsedTimeMaxLable != null, r = E_SYSTEM, "__pElapsedTimeMaxLable is null");
3902 __pElapsedTimeMaxLable->AddTouchEventListener(*this);
3904 __pElapsedRecordSizeLable = static_cast< Label* >(GetControl(L"IDC_REC_SIZE"));
3905 TryCatch(__pElapsedRecordSizeLable != null, r = E_SYSTEM, "__pElapsedRecordSizeLable is null");
3906 __pElapsedRecordSizeLable->AddTouchEventListener(*this);
3908 __pCameraIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMERA_ICON_LABEL"));
3909 TryCatch(__pCameraIconLabel != null, r = E_SYSTEM, "__pCameraIconLabel is null");
3910 __pCameraIconLabel->AddTouchEventListener(*this);
3912 __pSwButton = static_cast<Button*>(GetControl(L"IDC_MODE_CHANGE_MODE_BUTTON"));
3913 TryCatch(__pSwButton != null, r = E_SYSTEM, "__pSwButton is null");
3915 __pSwButton->SetName(IDS_ACTION_UI_CAMCORDER_MODE);
3916 __pSwButton->AddTouchEventListener(*this);
3917 __pSwButton->AddKeyEventListener(*this);
3918 __pSwButton->GetAccessibilityContainer()->AddAccessibilityListener(*this);
3920 __pCamcoderIconLabel = static_cast<Label*>(GetControl(L"IDC_CAMCORDER_ICON_LABEL"));
3921 TryCatch(__pCamcoderIconLabel != null, r = E_SYSTEM, "__pCamcoderIconLabel is null");
3922 __pCamcoderIconLabel->AddTouchEventListener(*this);
3926 __pRecordButton = static_cast<Button*>(GetControl(L"IDC_RECORD_BUTTON"));
3927 TryCatch(__pRecordButton != null, r = E_SYSTEM, "pRecodeButton is null");
3929 __pRecordButton->SetActionId(IDA_BUTTON_CAMCORDER_SHUTTER);
3930 __pRecordButton->AddActionEventListener(*this);
3932 __pRecordButton->SetName(IDS_RECORDE_BUTTON_NAME);
3933 __pRecordButton->AddTouchEventListener(*this);
3935 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
3937 if (__dir == ORIENTATION_STATUS_PORTRAIT_REVERSE
3938 || __dir == ORIENTATION_STATUS_PORTRAIT)
3940 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_PORTRAIT, Y_THUMBNAIL_IMG_PANEL_PORTRAIT,
3941 W_THUMBNAIL_IMG_PANEL_PORTRAIT, H_THUMBNAIL_IMG_PANEL_PORTRAIT);
3945 rectThumbnailButton = Rectangle(X_THUMBNAIL_IMG_PANEL_LANDSCAPE, Y_THUMBNAIL_IMG_PANEL_LANDSCAPE,
3946 W_THUMBNAIL_IMG_PANEL_LANDSCAPE, H_THUMBNAIL_IMG_PANEL_LANDSCAPE);
3949 _pThumbnailPanel = new (std::nothrow) CameraThumbnailPanel();
3950 TryCatch(_pThumbnailPanel != null, r = E_FAILURE, "_pThumbnailPanel is null");
3952 r = _pThumbnailPanel->Initialize(rectThumbnailButton);
3953 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "_pThumbnailPanel Create fail[%s]", GetErrorMessage(r));
3955 _pThumbnailPanel->SetName(IDS_THUMBNAIL_PANLE_NAME);
3956 _pThumbnailPanel->AddTouchEventListener(*this);
3957 _pThumbnailPanel->SetShowState(false);
3958 AddControl(_pThumbnailPanel);
3959 AddOrientationEventListener(*_pThumbnailPanel);
3961 __pThumbnailButton = static_cast<Button*>(GetControl(L"IDC_BACK_BUTTON"));
3962 TryCatch(__pThumbnailButton != null, r = E_SYSTEM, "__pThumbnailButton is null");
3963 __pThumbnailButton->SetActionId(IDA_BUTTON_CAMCORDER_THUMBNAIL);
3964 __pThumbnailButton->AddActionEventListener(*this);
3965 __pThumbnailButton->SetShowState(false);
3966 __pThumbnailButton->AddTouchEventListener(*this);
3968 r = UpdateUiActionPanelIcon();
3969 TryCatch(r == E_SUCCESS, r = E_SYSTEM, "UpdateUiActionPanelIcon() fail");
3971 AppLogDebug("EXIT");
3975 __pCameraIconLabel = null;
3977 __pCamcoderIconLabel = null;
3978 __pRecordButton = null;
3979 __pThumbnailButton = null;
3980 __pCamcoderSetting = null;
3981 __pGeneralSetting = null;
3982 __pCamcorderSettingLable = null;
3983 __pGeneralSettingLable = null;
3985 delete _pThumbnailPanel;
3986 _pThumbnailPanel = null;
3992 CamcorderForm::UpdateUiActionPanelIcon(void)
3994 AppLogDebug("ENTER");
3995 result r = E_SUCCESS;
3996 Bitmap* pBitmap = null;
3997 Bitmap* pBitmapRotate = null;
3999 ImageRotationType rotationType = IMAGE_ROTATION_0;
4000 Point ptModeChangeButton;
4001 if (__dir == ORIENTATION_STATUS_PORTRAIT
4002 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4004 rotationType = IMAGE_ROTATION_90;
4005 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
4007 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
4008 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
4010 rotationType = IMAGE_ROTATION_0;
4011 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
4014 AppLogDebug("GetDisplayResolutionType = %d", _pCameraPresentationModel->GetDisplayResolutionType());
4016 if (__dir == ORIENTATION_STATUS_PORTRAIT
4017 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4019 rotationType = IMAGE_ROTATION_90;
4021 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
4022 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
4024 rotationType = IMAGE_ROTATION_0;
4027 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMERA_ON);
4028 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4030 __pCameraIconLabel->SetBackgroundBitmap(*pBitmap);
4035 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BG);
4036 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4038 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4039 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "ChangeMode::pBitmapRotate is null");
4041 __pSwButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4042 __pSwButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4046 delete pBitmapRotate;
4047 pBitmapRotate = null;
4049 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_BUTTON_VER);
4050 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4052 __pSwButton->SetNormalBitmap(ptModeChangeButton, *pBitmap);
4056 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_CAMCORDER_ON);
4057 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4059 __pCamcoderIconLabel->SetBackgroundBitmap(*pBitmap);
4064 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
4065 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4067 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4068 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4073 delete pBitmapRotate;
4074 pBitmapRotate = null;
4076 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK_PRESS);
4077 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4079 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4080 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4086 delete pBitmapRotate;
4087 pBitmapRotate = null;
4089 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_BTN_BACK);
4090 TryCatch(pBitmap != null, r = E_SYSTEM, "Back::pBitmap is null");
4092 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4093 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "Back::pBitmapRotate is null");
4099 delete pBitmapRotate;
4100 pBitmapRotate = null;
4102 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
4103 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4105 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4106 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4108 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
4112 delete pBitmapRotate;
4113 pBitmapRotate = null;
4115 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_PRESS);
4116 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4118 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4119 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4121 __pRecordButton->SetPressedBackgroundBitmap(*pBitmapRotate);
4125 delete pBitmapRotate;
4126 pBitmapRotate = null;
4128 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
4129 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
4131 pBitmapRotate = RotationImageN(pBitmap, rotationType);
4132 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "RecordButton::pBitmapRotate is null");
4134 __pRecordButton->SetDisabledBackgroundBitmap(*pBitmapRotate);
4138 delete pBitmapRotate;
4139 pBitmapRotate = null;
4141 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG);
4142 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
4144 __pThumbnailButton->SetNormalBackgroundBitmap(*pBitmap);
4148 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_MODE_THUMBNAIL_BG_PRESS);
4149 TryCatch(pBitmap != null, r = E_SYSTEM, "ThumbnailButton::pBitmap is null");
4151 __pThumbnailButton->SetPressedBackgroundBitmap(*pBitmap);
4155 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_CAMCODER);
4156 TryCatch(pBitmap != null, r = E_SYSTEM, "CamcoderSetting::pBitmap is null");
4158 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4159 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "CamcoderSetting::pBitmapRotate is null");
4161 __pCamcoderSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
4162 __pCamcoderSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
4167 delete pBitmapRotate;
4168 pBitmapRotate = null;
4170 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_SETTING_POPUP_GENERAL);
4171 TryCatch(pBitmap != null, r = E_SYSTEM, "GeneralSetting::pBitmap is null");
4173 pBitmapRotate = RotationImageN(pBitmap, IMAGE_ROTATION_0);
4174 TryCatch(pBitmapRotate != null, r = E_SYSTEM, "GeneralSetting::pBitmapRotate is null");
4176 __pGeneralSetting->SetNormalBackgroundBitmap(*pBitmapRotate);
4177 __pGeneralSetting->SetPressedBackgroundBitmap(*pBitmapRotate);
4182 delete pBitmapRotate;
4183 pBitmapRotate = null;
4185 AppLogDebug("EXIT");
4189 if (pBitmap != null)
4199 CamcorderForm::Initialize(void)
4201 AppLogDebug("ENTER");
4202 result r = E_SUCCESS;
4204 Construct(L"IDL_CAMCORDER_FORM");
4206 _pCameraPresentationModel = CameraPresentationModel::GetInstance();
4207 TryCatch(_pCameraPresentationModel != null, r = E_SYSTEM, "_pCameraPresentationModel is null");
4209 AppLogDebug("EXIT");
4217 CamcorderForm::InitAppTimer(void)
4219 AppLogDebug("ENTER");
4220 _pAppTimer = new (std::nothrow) Timer();
4221 _pAppTimer->Construct(*this);
4222 AppLogDebug("EXIT");
4226 CamcorderForm::InitChargingTimer(void)
4228 AppLogDebug("ENTER");
4229 _pChargingTimer = new (std::nothrow) Timer();
4230 _pChargingTimer->Construct(*this);
4231 AppLogDebug("EXIT");
4235 CamcorderForm::InitChargingCompletedTimer(void)
4237 AppLogDebug("ENTER");
4238 _pChargingCompletedTimer = new (std::nothrow) Timer();
4239 _pChargingCompletedTimer->Construct(*this);
4240 AppLogDebug("EXIT");
4244 CamcorderForm::InitPreviewFailPopupTimer(void)
4246 AppLogDebug("ENTER");
4247 _pPreviewFailPopupTimer = new (std::nothrow) Timer();
4248 _pPreviewFailPopupTimer->Construct(*this);
4249 AppLogDebug("EXIT");
4253 CamcorderForm::InitMakerFocusTimer(void)
4255 AppLogDebug("ENTER");
4256 _pMakerFocusTimer = new (std::nothrow) Timer();
4257 _pMakerFocusTimer->Construct(*this);
4258 AppLogDebug("EXIT");
4262 CamcorderForm::InitSettingTimer(void)
4264 AppLogDebug("ENTER");
4265 _pIntervalValueTimer = new (std::nothrow) Timer();
4266 _pIntervalValueTimer->Construct(*this);
4267 AppLogDebug("EXIT");
4271 CamcorderForm::StartInitChargingTimer(void)
4273 AppLogDebug("ENTER");
4274 result r = E_SUCCESS;
4275 bool isCharging = false;
4277 isCharging = _pCameraPresentationModel->IsCharging();
4283 if (_pChargingTimer)
4285 _pChargingTimer->Cancel();
4287 r = _pChargingTimer->StartAsRepeatable(CAMCORDER_CHARGING_TIMER);
4288 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4293 if (_pChargingTimer)
4295 _pChargingTimer->Cancel();
4298 AppLogDebug("EXIT");
4302 CamcorderForm::StartInitAppTimer(void)
4304 AppLogDebug("ENTER");
4305 result r = E_SUCCESS;
4307 TryReturnVoid(_pCameraPresentationModel != null, "_pCameraPresentationModel is null");
4308 if (_pCameraPresentationModel->GetRecorderState() != RECORDER_STATE_RECORDING)
4310 AppLogDebug("StartInitAppTimer : RecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
4312 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
4313 _pAppTimer->Cancel();
4315 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
4316 TryReturnVoid(r == E_SUCCESS, "Timer::Start() fail[%s]", GetErrorMessage(r));
4318 AppLogDebug("EXIT");
4322 CamcorderForm::StartPreviewFailPopupTimer(void)
4324 AppLogDebug("ENTER");
4325 result r = E_SUCCESS;
4327 TryReturnVoid(_pPreviewFailPopupTimer != null, "__pPreviewFailPopupTimer is null");
4329 _pPreviewFailPopupTimer->Cancel();
4331 r = _pPreviewFailPopupTimer->Start(PREVIEW_FAIL_TIMER);
4332 TryReturnVoid(r == E_SUCCESS, "__pPreviewFailPopupTimer::Start() fail[%s]", GetErrorMessage(r));
4333 AppLogDebug("EXIT");
4337 CamcorderForm::StartInitChargingCompletedTimer(void)
4339 AppLogDebug("ENTER");
4340 result r = E_SUCCESS;
4341 bool isCharging = false;
4343 TryReturnVoid(_pChargingCompletedTimer != null, "__pChargingCompletedTimer is null");
4345 isCharging = _pCameraPresentationModel->IsCharging();
4347 _batteryStatus = GetCurrentBatteryState();
4348 AppLogDebug("_batteryStatus = %d" , _batteryStatus);
4350 if (isCharging && _batteryStatus == BATTERY_STATE_20)
4352 if (_pChargingCompletedTimer)
4354 _pChargingCompletedTimer->Cancel();
4361 r = DrawBatteryLevelFull();
4362 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4364 AppLogDebug("EXIT");
4367 _chargingCount = INDEX_UNIT_ZERO;
4369 if (_batteryStatus == BATTERY_STATE_20)
4371 if (_pChargingCompletedTimer)
4373 _pChargingCompletedTimer->Cancel();
4375 r = _pChargingCompletedTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
4376 TryReturnVoid(r == E_SUCCESS, "_pChargingTimer::Start() fail[%s]", GetErrorMessage(r));
4381 if (_pChargingCompletedTimer)
4383 _pChargingCompletedTimer->Cancel();
4389 CheckBatteryStatus();
4391 AppLogDebug("EXIT");
4395 CamcorderForm::StopInitAppTimer(void)
4397 AppLogDebug("ENTER");
4400 _pAppTimer->Cancel();
4402 AppLogDebug("EXIT");
4406 CamcorderForm::StopInitChargingTimer(void)
4408 AppLogDebug("ENTER");
4411 if (_pChargingTimer)
4413 _pChargingTimer->Cancel();
4415 AppLogDebug("EXIT");
4419 CamcorderForm::UpdateUiIndicatorStorage(Canvas* pCanvas, const String& str)
4421 AppLogDebug("ENTER");
4426 result r = E_SUCCESS;
4429 int textClearWidth = 0;
4430 int textClearHeight= 0;
4434 listRect = pCanvas->GetBounds();
4436 pFnt = new (std::nothrow) Font();
4437 pFnt->Construct(FONT_STYLE_PLAIN, FONT_SIZE_INDICATOR_STORAGE_FREE_SPACE);
4439 r = pCanvas->SetFont(*pFnt);
4440 TryCatch(r == E_SUCCESS, , "Canvas::SetFont() fail[%s]", GetErrorMessage(r));
4442 pCanvas->SetForegroundColor(COLOR_SETTING_MENU_TITLE);
4443 if (__dir == ORIENTATION_STATUS_PORTRAIT
4444 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
4446 point.x = X_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT - (dim.width / DIVIDE_BY_TWO);
4447 point.y = Y_INDICATOR_STORAGE_FREE_SPACE_PORTRAIT;
4449 textClearX = point.x;
4450 textClearY = point.y;
4451 textClearWidth = W_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT;
4452 textClearHeight = H_INDICATOR_STORAGE_CLEAR_AREA_PORTRAIT;
4456 point.x = X_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE - (dim.width / DIVIDE_BY_TWO);
4457 point.y = Y_INDICATOR_STORAGE_FREE_SPACE_LANDSCAPE;
4459 textClearX = point.x;
4460 textClearY = point.y;
4461 textClearWidth = W_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE;
4462 textClearHeight = H_INDICATOR_STORAGE_CLEAR_AREA_LANDSCAPE;
4465 r = pCanvas->Clear(Rectangle(textClearX, textClearY, textClearWidth, textClearHeight));
4466 TryCatch(r == E_SUCCESS, , "Canvas Clear() fail[%s]", GetErrorMessage(r));
4468 r = pCanvas->DrawText(point, str);
4469 TryCatch(r == E_SUCCESS, , "Canvas::DrawText() fail[%s]", GetErrorMessage(r));
4475 AppLogDebug("EXIT");
4486 CamcorderForm::SetRecordStartTimer(int timeInterval)
4488 AppLogDebug("ENTER");
4489 result r = E_SUCCESS;
4491 AppLogDebug("timeInterval = %d", timeInterval);
4493 switch (timeInterval)
4495 case SET_RECORD_START_TIMER_0_SEC:
4500 case SET_RECORD_START_TIMER_2_SEC:
4502 _pIntervalValueTimer->Cancel();
4504 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_2_SEC);
4505 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4509 case SET_RECORD_START_TIMER_5_SEC:
4511 _pIntervalValueTimer->Cancel();
4513 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_5_SEC);
4514 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4518 case SET_RECORD_START_TIMER_10_SEC:
4520 _pIntervalValueTimer->Cancel();
4522 r = _pIntervalValueTimer->Start(CAMCORDER_TIMER_10_SEC);
4523 TryCatch(r == E_SUCCESS, , "_pIntervalValueTimer start fail[%s]", GetErrorMessage(r));
4529 AppLogDebug("timmer Invail element id");
4534 AppLogDebug("EXIT");
4542 CamcorderForm::CancelTimer(void)
4544 AppLogDebug("ENTER");
4545 if (_pAppTimer != null)
4547 _pAppTimer->Cancel();
4550 if (_pIntervalValueTimer != null)
4552 _pIntervalValueTimer->Cancel();
4557 _pPopupTimer->Cancel();
4560 if (_pExposureCloseTimer)
4562 _pExposureCloseTimer->Cancel();
4565 if (_pHelpCloseTimer)
4567 _pHelpCloseTimer->Cancel();
4570 if (_pChargingCompletedTimer != null)
4574 _pChargingCompletedTimer->Cancel();
4577 if (_pPreviewFailPopupTimer != null)
4579 _pPreviewFailPopupTimer->Cancel();
4581 AppLogDebug("EXIT");
4585 CamcorderForm::MakeRecordingResolutionList(bool remakeList = false)
4587 AppLogDebug("ENTER");
4588 Dimension dimResolution;
4589 IList* pTempList = null;
4590 String* pItemString = null;
4592 result r = E_SUCCESS;
4595 Dimension dimension;
4596 Dimension tempDimention(RECORDING_RESOLOTION_WIDTH, RECORDING_RESOLOTION_HEIGHT);
4597 int recordingResolutionIdx = 0;
4601 if (__pRecordingResolutionList)
4603 __pRecordingResolutionList->RemoveAll(true);
4606 delete __pRecordingResolutionList;
4607 __pRecordingResolutionList = null;
4610 if (__pRecordingResolutionList == null)
4612 __pRecordingResolutionList = new (std::nothrow) ArrayList();
4613 r = __pRecordingResolutionList->Construct();
4614 TryCatch(r == E_SUCCESS, , "__pRecordingResolutionList construct fail[%s]", GetErrorMessage(r));
4616 pTempList = _pCameraPresentationModel->GetRecordingResolutionList();
4617 TryCatch(pTempList != null, , "GetRecordingResolutionList() return null");
4619 tot = pTempList->GetCount();
4623 for (idx = tot - INDEX_UNIT_ONE; idx >= 0; idx--)
4625 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(idx)));
4627 AppLogDebug("GetRecordingResolutionList w:%d,h:%d", dimResolution.width, dimResolution.height);
4628 if (dimResolution == tempDimention)
4630 tempString.Format(32, L"%dX%d(60FPS)", dimResolution.width, dimResolution.height);
4631 pItemString = new (std::nothrow) String(tempString);
4632 TryCatch(pItemString != null, , "pItemString is null");
4634 __pRecordingResolutionList->Add(*pItemString);
4635 recordingResolutionIdx = idx;
4641 AppLogDebug("Not Support CaptureResolution");
4644 dimResolution = *(static_cast<Dimension*>(pTempList->GetAt(recordingResolutionIdx)));
4647 __pRecordingResolutionWidth = dimResolution.width;
4648 __pRecordingResolutionHeight = dimResolution.height;
4650 AppLogDebug("recordingResolution w:%d,h:%d", dimResolution.width, dimResolution.height);
4652 AppLogDebug("EXIT");
4656 if (__pRecordingResolutionList)
4658 __pRecordingResolutionList->RemoveAll(true);
4660 delete __pRecordingResolutionList;
4661 __pRecordingResolutionList = null;
4666 CamcorderForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
4668 AppLogDebug("ENTER");
4669 AppLogDebug("EXIT");
4673 CamcorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
4675 AppLogDebug("ENTER");
4676 result r = E_SUCCESS;
4678 if (_pListViewCameraTabMainMenu != null && listView.Equals(*_pListViewCameraTabMainMenu))
4680 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4682 _currentSettingsMenuIndex = index;
4683 r = ProcessCamcorderTabMainListPopup(index);
4684 TryReturnVoid(r == E_SUCCESS, "ProcessCamcorderTabMainListPopup() fail[%s]", GetErrorMessage(r));
4687 else if (_pListViewCameraTabSubMenu != null && listView.Equals(*_pListViewCameraTabSubMenu))
4689 r = ProcessCamcorderTabSubListPopup(index);
4690 TryReturnVoid(r == E_SUCCESS, "ProcessCamcorderTabSubListPopup() fail[%s]", GetErrorMessage(r));
4692 else if (_pListViewGeneralTabMainMenu != null && listView.Equals(*_pListViewGeneralTabMainMenu))
4694 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4696 _currentSettingsMenuIndex = index;
4697 r = ProcessGeneraTabMainListPopup(index);
4698 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabMainListPopup() fail[%s]", GetErrorMessage(r));
4701 else if (_pListViewGeneralTabSubMenu != null && listView.Equals(*_pListViewGeneralTabSubMenu))
4703 r = ProcessGeneraTabSubListPopup(index);
4704 TryReturnVoid(r == E_SUCCESS, "ProcessGeneraTabSubListPopup() fail[%s]", GetErrorMessage(r));
4706 else if (_pListFlashMainMenu != null && listView.Equals(*_pListFlashMainMenu))
4708 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4710 r = ProcessFlashListPopup(index);
4711 UpdateUiPanelIcon();
4713 TryReturnVoid(r == E_SUCCESS, "ProcessFlashListPopup() fail[%s]", GetErrorMessage(r));
4715 else if (_pListWbMainMenu != null && listView.Equals(*_pListWbMainMenu))
4717 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4719 r = SubListPopupWbMode(index);
4720 TryReturnVoid(r == E_SUCCESS, "SubListPopupWbMode() fail[%s]", GetErrorMessage(r));
4725 AppLogDebug("EXIT");
4729 CamcorderForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
4731 AppLogDebug("ENTER");
4732 AppLogDebug("EXIT");
4736 CamcorderForm::OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment)
4738 AppLogDebug("ENTER");
4739 AppLogDebug("EXIT");
4743 CamcorderForm::OnSliderBarMoved(Tizen::Ui::Controls::Slider& source, int value)
4745 AppLogDebug("ENTER");
4746 AppLogDebug("EXIT");
4750 CamcorderForm::CreateItem(int index, int itemWidth)
4752 AppLogDebug("ENTER");
4753 CustomItem* pItem = null;
4754 bool createSubMenu = false;
4755 bool createGenSubMenu = false;
4757 if (_pListViewCameraTabSubMenu)
4759 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4761 createSubMenu = true;
4762 pItem = CreateCamcorderTabSubMenuItem(index, itemWidth);
4766 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewCameraTabSubMenu");
4771 AppLogDebug("EXIT");
4777 if (_pListViewCameraTabMainMenu && _pListViewCameraTabMainMenu->GetShowState() == true)
4779 if (createSubMenu == false)
4781 pItem = CreateCamcorderTabMainMenuItem(index, itemWidth);
4785 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewCameraTabMainMenu");
4790 AppLogDebug("EXIT");
4796 if (_pListViewGeneralTabSubMenu)
4798 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4800 createGenSubMenu = true;
4801 pItem = CreateGeneralTabSubMenuItem(index, itemWidth);
4805 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewGeneralTabSubMenu");
4810 AppLogDebug("EXIT");
4816 if (_pListViewGeneralTabMainMenu && _pListViewGeneralTabMainMenu->GetShowState() == true)
4818 if (createGenSubMenu == false)
4820 pItem = CreateGeneralTabMainMenuItem(index, itemWidth);
4824 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListViewGeneralTabMainMenu");
4829 AppLogDebug("EXIT");
4835 if (_pListFlashMainMenu && _pListFlashMainMenu->GetShowState() == true)
4837 pItem = CreateFlashMainMenuItem(index, itemWidth);
4841 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListFlashMainMenu");
4846 AppLogDebug("EXIT");
4851 if (_pListWbMainMenu && _pListWbMainMenu->GetShowState() == true)
4853 pItem = CreateWhiteBalanceItem(index, itemWidth);
4857 AppLogDebug("CreateCamcorderTabSubMenuItem of pItem is null - _pListWbMainMenu");
4862 AppLogDebug("EXIT");
4867 AppLogDebug("EXIT");
4872 CamcorderForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
4874 AppLogDebug("ENTER");
4878 AppLogDebug("EXIT");
4883 CamcorderForm::GetItemCount(void)
4885 AppLogDebug("ENTER");
4886 if (_pListViewCameraTabSubMenu)
4888 if (_pListViewCameraTabSubMenu->GetShowState() == true)
4890 return GetCamcorderTabSettingSubMenuCount();
4894 if (_pListViewCameraTabMainMenu)
4896 if (_pListViewCameraTabMainMenu->GetShowState() == true)
4898 return GetCamcorderTabSettingMainMenuCount();
4902 if (_pListViewGeneralTabSubMenu)
4904 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
4906 return GetGeneralTabSettingSubMenuCount();
4910 if (_pListViewGeneralTabMainMenu)
4912 if (_pListViewGeneralTabMainMenu->GetShowState() == true)
4914 AppLogDebug("EXIT");
4915 return GetGeneralTabSettingMainMenuCount();
4919 if (_pListFlashMainMenu)
4921 return GetCamcorderTabSettingMainMenuCount();
4924 if (_pListWbMainMenu)
4926 AppLogDebug("EXIT");
4927 return GetCamcorderTabSettingMainMenuCount();
4930 AppLogDebug("EXIT");
4935 CamcorderForm::GetTimerIntervalValue(void) const
4937 AppLogDebug("ENTER");
4938 result r = E_SUCCESS;
4939 int timerInterval = 0;
4941 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerInterval);
4942 TryCatch(r == E_SUCCESS, , "Faled to get value to registry");
4944 AppLogDebug("EXIT");
4945 return timerInterval;
4952 CamcorderForm::SetGuideLine(int guideLineEnable)
4954 AppLogDebug("ENTER");
4955 result r = E_SUCCESS;
4957 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, guideLineEnable);
4958 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
4959 AppLogDebug("EXIT");
4963 CamcorderForm::RestoreDefaultSetting(void)
4965 AppLogDebug("ENTER");
4966 result r = E_SUCCESS;
4967 int selfPortraitEnable = 0;
4968 bool exposureValue = false;
4969 bool brighnesstValue = false;
4970 int adjustValue = 0;
4972 r = _pCameraPresentationModel->ResetCameraSettingsRegistry( );
4973 TryCatch(r == E_SUCCESS, , "ResetCameraSettingsRegistry() fail[%s]", GetErrorMessage(r));
4975 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
4976 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
4978 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
4980 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
4984 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
4987 if (exposureValue == true && r == E_SUCCESS)
4989 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
4990 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
4992 AppLogDebug("adjustValue = %d", adjustValue);
4994 _pCameraPresentationModel->SetExposure(adjustValue);
4998 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5000 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5004 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
5007 if (brighnesstValue == true && r == E_SUCCESS)
5009 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
5010 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5012 AppLogDebug("adjustValue = %d", adjustValue);
5014 _pCameraPresentationModel->SetBrightness(adjustValue);
5018 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5020 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5023 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, adjustValue);
5024 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5029 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5032 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, adjustValue);
5033 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5039 AppLogDebug("adjustValue = %d", adjustValue);
5041 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)adjustValue);
5044 AppLogDebug("EXIT");
5048 AppLogDebug("EXIT - CATCH");
5053 CamcorderForm::DrawMarker(bool useGuidline)
5055 AppLogDebug("ENTER");
5056 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5057 result r = E_SUCCESS;
5059 if (__dir == ORIENTATION_STATUS_PORTRAIT
5060 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5062 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5066 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5071 _pCameraInfoPanel->SetDrawMarkerGuideline(true);
5075 _pCameraInfoPanel->SetDrawMarkerGuideline(false);
5078 _pCameraInfoPanel->Invalidate(true);
5080 AppLogDebug("EXIT");
5085 CamcorderForm::DrawFocus(int focusMode)
5087 AppLogDebug("ENTER");
5088 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5089 result r = E_SUCCESS;
5090 int selfPortraitEnable = 0;
5091 bool focusSupport = false;
5093 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5094 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5096 if (__dir == ORIENTATION_STATUS_PORTRAIT
5097 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5099 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5103 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5106 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5108 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5112 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
5115 if (focusSupport == true && r == E_SUCCESS)
5117 _pCameraInfoPanel->SetDrawMarkerFocus(true);
5119 _pCameraInfoPanel->SetDrawMarkerFocusType(focusMode);
5121 _pCameraInfoPanel->Invalidate(true);
5125 _pCameraInfoPanel->SetDrawMarkerFocus(false);
5127 _pCameraInfoPanel->Invalidate(true);
5130 AppLogDebug("EXIT");
5138 CamcorderForm::ToggleCameraDirection(int direction)
5140 AppLogDebug("ENTER");
5141 result r = E_SUCCESS;
5142 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5144 Point currentPosition;
5145 BufferInfo bufferinfo;
5146 bool isInitCameraStaus = false;
5148 if (_pAppTimer != null)
5150 _pAppTimer->Cancel();
5152 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
5153 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
5156 if (direction == CAMCORDER_FORM_SECONDARY_MODE)
5158 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_RECORD, CameraPresentationModel::CAMERA_DIRECTION_FRONT);
5160 else if (direction == CAMCORDER_FORM_PRIMARY_MODE)
5162 r = _pCameraPresentationModel->ToggleCameraDirection(CameraPresentationModel::CAMERA_MODE_RECORD, CameraPresentationModel::CAMERA_DIRECTION_BACK);
5164 TryCatch(r == E_SUCCESS, , "_pCameraPresentationModel->ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
5166 dim = _pCameraPresentationModel->GetPreviewResolution();
5167 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
5169 AppLogDebug("SelfPortraitMode __screenMode [%d]", __screenMode);
5171 if (direction == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5173 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
5177 r = SetScreenMode(__screenMode, true);
5179 TryCatch(r == E_SUCCESS, , "SetScreenMode is fail[%s]", GetErrorMessage(r));
5181 if (__dir == ORIENTATION_STATUS_PORTRAIT
5182 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5184 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5188 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5191 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
5192 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
5194 isInitCameraStaus = _pCameraPresentationModel->GetInitCameraStatus();
5195 AppLogDebug("isInitCameraStaus [%d]", isInitCameraStaus);
5197 if (isInitCameraStaus)
5199 AppLogDebug("calling camcordersettings");
5200 _pCameraPresentationModel->StartPreview(&bufferinfo);
5202 _pCameraPresentationModel->SetContinuousAutoFocus();
5206 SetCamcorderSettingsDevice();
5210 AppLogDebug("not calling camcordersettings");
5213 AppLogDebug("EXIT");
5221 CamcorderForm::DrawTimerPopup(void)
5223 AppLogDebug("ENTER");
5224 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5225 result r = E_SUCCESS;
5227 if (__dir == ORIENTATION_STATUS_PORTRAIT
5228 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5230 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
5234 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
5237 _pCameraInfoPanel->SetDrawPopupTimer(true);
5241 _pCameraInfoPanel->Invalidate(true);
5243 AppLogDebug("EXIT");
5248 CamcorderForm::SetFlashPopop(void)
5250 AppLogDebug("ENTER");
5251 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);
5252 MakeSettingPopupTab(false);
5255 if (__dir == ORIENTATION_STATUS_PORTRAIT
5256 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5258 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5259 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT);
5263 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5264 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5267 _pCameraInfoPanel->SetDrawFlashMenuBackground(true);
5268 _pCameraInfoPanel->Invalidate(true);
5269 SetCamcorderTabSettingMainMenuCount(MAX_FLASH_MENU_COUNT);
5271 if (_pListFlashMainMenu == null)
5273 _pListFlashMainMenu = new (std::nothrow) ListView();
5274 _pListFlashMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5276 _pListFlashMainMenu->SetItemProvider(*this);
5277 _pListFlashMainMenu->AddListViewItemEventListener(*this);
5278 _pListFlashMainMenu->SetName(IDS_MENU_FLASH_MENU_NAME);
5279 _pCameraInfoPanel->AddControl(_pListFlashMainMenu);
5283 _pListFlashMainMenu->SetBounds(rectList);
5284 _pListFlashMainMenu->SetShowState(true);
5286 _pListFlashMainMenu->UpdateList();
5287 AppLogDebug("EXIT");
5291 CamcorderForm::SetWhiteBalancePopop(void)
5293 AppLogDebug("ENTER");
5294 Rectangle rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE,
5295 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE);
5296 MakeSettingPopupTab(false);
5299 if (__dir == ORIENTATION_STATUS_PORTRAIT
5300 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5302 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_PORTRAIT, Y_FLASH_MODE_SETTING_LIST_PORTRAIT + Y_FLASH_MODE_SETTING_LIST_PORTRAIT_MARGIN,
5303 W_FLASH_MODE_SETTING_LIST_PORTRAIT, H_FLASH_MODE_SETTING_LIST_PORTRAIT + H_WHITE_BALANC_SETTING_LIST_PORTRAIT_MARGIN);
5307 rectList = Rectangle(X_FLASH_MODE_SETTING_LIST_LANDSCAPE, Y_FLASH_MODE_SETTING_LIST_LANDSCAPE + Y_FLASH_MODE_SETTING_LIST_LANDSCAPE_MARGIN,
5308 W_FLASH_MODE_SETTING_LIST_LANDSCAPE, H_FLASH_MODE_SETTING_LIST_LANDSCAPE + H_WHITE_BALANC_SETTING_LIST_LANDSCAPE_MARGIN);
5311 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(true);
5312 _pCameraInfoPanel->Invalidate(true);
5313 SetCamcorderTabSettingMainMenuCount(SUBMENU_WB_COUNT);
5315 if (_pListWbMainMenu == null)
5317 _pListWbMainMenu = new (std::nothrow) ListView();
5318 _pListWbMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5320 _pListWbMainMenu->SetItemProvider(*this);
5321 _pListWbMainMenu->AddListViewItemEventListener(*this);
5322 _pListWbMainMenu->SetName(IDS_MENU_WB_MENU_NAME);
5326 _pListWbMainMenu->SetBounds(rectList);
5327 _pListWbMainMenu->SetShowState(true);
5329 _pCameraInfoPanel->AddControl(_pListWbMainMenu);
5331 _pListWbMainMenu->UpdateList();
5332 AppLogDebug("EXIT");
5337 CamcorderForm::ProcessCamcorderTabMainListPopup(int index)
5339 AppLogDebug("ENTER");
5340 Rectangle rectPanel;
5342 String strTitle = L"";
5343 String listName = L"";
5344 result r = E_SUCCESS;
5345 AppResource* pAppResource = null;
5346 bool drawPopup = true;
5348 pAppResource = Application::GetInstance()->GetAppResource();
5349 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
5351 listName = _pListViewCameraTabMainMenu->GetName();
5352 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)))
5354 if (_pCameraInfoSubPanel && _pListViewCameraTabSubMenu)
5356 _pCameraInfoSubPanel->SetShowState(false);
5357 _pCameraInfoSubPanel->RemoveControl(*_pListViewCameraTabSubMenu);
5358 _pListViewCameraTabSubMenu = null;
5359 RemoveControl(*_pCameraInfoSubPanel);
5360 _pCameraInfoSubPanel = null;
5362 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5367 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
5369 if (__pRecordingResolutionList)
5371 int captrueResolutionCnt = __pRecordingResolutionList->GetCount();
5372 if (captrueResolutionCnt > 1)
5374 int X_Panel = X_SUBMENU_WB_MODE_PANEL;
5375 int Y_Panel = Y_SUBMENU_WB_MODE_PANEL + Y_SUBMENU_WB_MODE_PANEL_MARGIN;
5376 int W_Panel = W_SUBMENU_WB_MODE_PANEL;
5377 int H_Panel = H_SUBMENU_WB_MODE_LIST + (captrueResolutionCnt * H_SUBMENU_WB_MODE_PANEL_MARGIN);
5379 int X_List = X_SUBMENU_WB_MODE_LIST;
5380 int Y_List = Y_SUBMENU_WB_MODE_LIST;
5381 int W_List = W_SUBMENU_WB_MODE_LIST;
5382 int H_List = (captrueResolutionCnt * H_SUBMENU_WB_MODE_LIST);
5384 rectPanel = Rectangle(X_Panel, Y_Panel, W_Panel, H_Panel);
5385 rectList = Rectangle(X_List, Y_List, W_List, H_List);
5387 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, strTitle);
5388 SetCamcorderTabSubMenuListviewState(captrueResolutionCnt, CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE);
5398 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
5405 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5406 AppLogDebug("Invaild index");
5414 if (__dir == ORIENTATION_STATUS_PORTRAIT
5415 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5417 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5418 rectPanel.y += Y_SUBMENU_PANEL_START_PORTRAIT;
5422 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5425 if (_pCameraInfoSubPanel == null)
5427 _pCameraInfoSubPanel = new (std::nothrow) CameraInfoSubPanel();
5428 TryCatch(_pCameraInfoSubPanel != null, r = E_FAILURE, "_pCameraInfoSubPanel is null");
5430 r = _pCameraInfoSubPanel->Initialize(rectPanel);
5431 TryCatch(r == E_SUCCESS, , "_pCameraInfoSubPanel Initialize fail[%s]", GetErrorMessage(r));
5433 _pCameraInfoSubPanel->SetName(IDS_CAMERA_SETTING_SUB_MENU);
5434 _pCameraInfoSubPanel->AddTouchEventListener(*this);
5435 AddOrientationEventListener(*this);
5436 AddControl(_pCameraInfoSubPanel);
5437 SetControlAlwaysOnTop(*_pCameraInfoSubPanel, true);
5440 _pCameraInfoSubPanel->SetMenuTitle(strTitle);
5441 _pCameraInfoPanel->Invalidate(true);
5442 _pCameraInfoSubPanel->Invalidate(true);
5444 _pListViewCameraTabSubMenu = new (std::nothrow) ListView();
5445 _pListViewCameraTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5447 _pListViewCameraTabSubMenu->SetItemProvider(*this);
5448 _pListViewCameraTabSubMenu->AddListViewItemEventListener(*this);
5449 _pCameraInfoSubPanel->AddControl(_pListViewCameraTabSubMenu);
5451 _pListViewCameraTabSubMenu->UpdateList();
5455 AppLogDebug("EXIT");
5459 if (_pCameraInfoSubPanel)
5461 RemoveControl(*_pCameraInfoSubPanel);
5462 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5466 delete _pListViewCameraTabSubMenu;
5469 _pCameraInfoSubPanel = null;
5470 _pListViewCameraTabSubMenu = null;
5476 CamcorderForm::ProcessGeneraTabMainListPopup(int index)
5478 AppLogDebug("ENTER");
5479 Rectangle rectPanel;
5481 String strTitle = L"";
5482 String listName = L"";
5483 result r = E_SUCCESS;
5484 bool drawPopup = true;
5485 AppResource* pAppResource = null;
5487 pAppResource = Application::GetInstance()->GetAppResource();
5488 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
5490 listName = _pListViewGeneralTabMainMenu->GetName();
5491 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)))
5493 if (_pCameraInfoGeneralSubPanel && _pListViewGeneralTabSubMenu)
5495 _pCameraInfoGeneralSubPanel->SetShowState(false);
5496 _pCameraInfoGeneralSubPanel->RemoveControl(*_pListViewGeneralTabSubMenu);
5497 _pListViewGeneralTabSubMenu = null;
5498 RemoveControl(*_pCameraInfoGeneralSubPanel);
5499 _pCameraInfoGeneralSubPanel = null;
5501 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5506 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
5508 AppLogDebug("Set Timer");
5509 pAppResource->GetString(IDS_CAM_BODY_TIMER, strTitle);
5510 rectPanel = Rectangle(X_SUBMENU_TIMER_MODE_PANEL, Y_SUBMENU_TIMER_MODE_PANEL,
5511 W_SUBMENU_TIMER_MODE_PANEL, H_SUBMENU_TIMER_MODE_PANEL);
5512 rectList = Rectangle(X_SUBMENU_TIMER_MODE_LIST, Y_SUBMENU_TIMER_MODE_LIST,
5513 W_SUBMENU_TIMER_MODE_LIST, H_SUBMENU_TIMER_MODE_LIST);
5514 SetGeneralTabSubMenuListviewState(SUBMENU_TIMER_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE);
5518 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
5520 AppLogDebug("Set geo tag or guideline mode");
5522 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, strTitle);
5523 SetGeneralTabSubMenuListviewState(SUBMENU_GUIDELINE_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE);
5525 rectPanel = Rectangle(X_SUBMENU_GUIDELINE_MODE_PANEL, Y_SUBMENU_GUIDELINE_MODE_PANEL,
5526 W_SUBMENU_GUIDELINE_MODE_PANEL, H_SUBMENU_GUIDELINE_MODE_PANEL);
5527 rectList = Rectangle(X_SUBMENU_GUIDELINE_MODE_LIST, Y_SUBMENU_GUIDELINE_MODE_LIST,
5528 W_SUBMENU_GUIDELINE_MODE_LIST, H_SUBMENU_GUIDELINE_MODE_LIST);
5532 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
5534 AppLogDebug("Set storage mode");
5536 pAppResource->GetString(IDS_CAM_BODY_STORAGE, strTitle);
5537 rectPanel = Rectangle(X_SUBMENU_STORAGE_MODE_PANEL, Y_SUBMENU_STORAGE_MODE_PANEL,
5538 W_SUBMENU_STORAGE_MODE_PANEL, H_SUBMENU_STORAGE_MODE_PANEL);
5539 rectList = Rectangle(X_SUBMENU_STORAGE_MODE_LIST, Y_SUBMENU_STORAGE_MODE_LIST,
5540 W_SUBMENU_STORAGE_MODE_LIST, H_SUBMENU_STORAGE_MODE_LIST);
5541 SetGeneralTabSubMenuListviewState(SUBMENU_STORAGE_TYPE_COUNT, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE);
5545 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
5547 AppLogDebug("Camcorder Reset");
5550 pAppResource->GetString(L"IDS_CAM_POP_RESET_SETTINGS_Q", tmpString);
5552 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE);
5555 if (_pResetPopUp == null)
5557 _pResetPopUp = new (std::nothrow) Popup();
5558 _pResetPopUp->Construct(L"IDL_RESET_POPUP");
5559 TryCatch(_pResetPopUp != null, , "Reset Popup not created!");
5564 _pYes = static_cast< Button*>(_pResetPopUp->GetControl(L"IDC_BUTTON_YES", true));
5565 TryCatch(_pYes != null, , "Reset Popup not created!");
5566 _pYes->SetActionId(IDA_BTN_YES);
5567 _pYes->AddActionEventListener(*this);
5568 _pYes->SetShowState(true);
5573 _pNo = static_cast< Button* >(_pResetPopUp->GetControl(L"IDC_BUTTON_NO", true));
5574 TryCatch(_pNo != null, , "Reset Popup not created!");
5575 _pNo->SetActionId(IDA_BTN_NO);
5576 _pNo->AddActionEventListener(*this);
5577 _pNo->SetShowState(true);
5578 _pResetPopUp->Show();
5581 _pResetPopUp->SetShowState(true);
5582 _pResetPopUp->Invalidate(true);
5583 _pResetPopUp->Show();
5587 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
5589 result r = E_SUCCESS;
5591 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, SCREEN_OVERLAY_HELP_ENABLE);
5592 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
5594 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
5596 r = SetScreenOverlayHelpTimer();
5597 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
5599 r = DrawScreenOverlayHelp();
5600 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
5604 MakeSettingPopupTab(false);
5613 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5614 AppLogDebug("Invaild index");
5622 if (__dir == ORIENTATION_STATUS_PORTRAIT
5623 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
5625 rectPanel.x = X_SUBMENU_PANEL_START_PORTRAIT;
5626 rectPanel.y += Y_SUBMENU_PANEL_OFFSET_PORTRAIT;
5630 rectPanel.x = X_SUBMENU_PANEL_START_LANDSCAPE;
5633 if (_pCameraInfoGeneralSubPanel == null)
5635 _pCameraInfoGeneralSubPanel = new (std::nothrow) CameraInfoGeneralSubPanel();
5636 TryCatch(_pCameraInfoGeneralSubPanel != null, r = E_FAILURE, "_pCameraInfoGeneralSubPanel is null");
5638 r = _pCameraInfoGeneralSubPanel->Initialize(rectPanel);
5639 TryCatch(r == E_SUCCESS, , "_pCameraInfoGeneralSubPanel Initialize fail[%s]", GetErrorMessage(r));
5641 if (index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE ||
5642 index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE ||
5643 index == CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE)
5645 _pCameraInfoGeneralSubPanel->SetName(IDS_GENERAL_SETTING_SUB_MENU);
5647 _pCameraInfoGeneralSubPanel->AddTouchEventListener(*this);
5648 AddOrientationEventListener(*this);
5649 AddControl(_pCameraInfoGeneralSubPanel);
5650 SetControlAlwaysOnTop(*_pCameraInfoGeneralSubPanel, true);
5653 _pCameraInfoGeneralSubPanel->SetMenuTitle(strTitle);
5654 _pCameraInfoPanel->Invalidate(true);
5655 _pCameraInfoGeneralSubPanel->Invalidate(true);
5657 _pListViewGeneralTabSubMenu = new (std::nothrow) ListView();
5658 _pListViewGeneralTabSubMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
5660 _pListViewGeneralTabSubMenu->SetItemProvider(*this);
5661 _pListViewGeneralTabSubMenu->AddListViewItemEventListener(*this);
5662 _pCameraInfoGeneralSubPanel->AddControl(_pListViewGeneralTabSubMenu);
5664 _pListViewGeneralTabSubMenu->UpdateList();
5668 AppLogDebug("EXIT");
5672 if (_pCameraInfoGeneralSubPanel)
5674 RemoveControl(*_pCameraInfoGeneralSubPanel);
5675 SetGeneralTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX);
5679 delete _pListViewGeneralTabSubMenu;
5682 _pCameraInfoGeneralSubPanel = null;
5683 _pListViewGeneralTabSubMenu = null;
5685 AppLogDebug("EXIT - CATCH");
5690 CamcorderForm::ProcessFlashListPopup(int index)
5692 AppLogDebug("ENTER");
5693 Rectangle rectPanel;
5695 String strTitle = L"";
5696 String listName = L"";
5697 Bitmap* pBitmapNormal = null;
5698 Bitmap* pBitmapPress = null;
5699 result r = E_SUCCESS;
5700 CameraFlashMode cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5702 AppLogDebug("Sub Menu (%d)", index);
5705 int selfPortraitEnable = 0;
5707 ResourceId resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5708 ResourceId resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5710 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5711 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
5713 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
5715 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5716 regVal = SUBMENU_MODE_OFF;
5717 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5718 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5719 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5723 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
5725 if (value == true && r == E_SUCCESS)
5727 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
5731 case SUBMENU_MODE_OFF:
5733 regVal = SUBMENU_MODE_OFF;
5734 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5735 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5736 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5740 case SUBMENU_MODE_ON:
5742 regVal = SUBMENU_MODE_ON;
5743 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
5744 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_ON_PRESS;
5745 cameraFlashMode = CAMERA_FLASH_MODE_ON;
5749 case SUBMENU_MODE_AUTO:
5751 regVal = SUBMENU_MODE_AUTO;
5752 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
5753 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_PRESS;
5754 cameraFlashMode = CAMERA_FLASH_MODE_AUTO;
5764 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
5766 regVal = SUBMENU_MODE_OFF;
5767 resIdNormal = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
5768 resIdPress = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_PRESS;
5769 cameraFlashMode = CAMERA_FLASH_MODE_OFF;
5773 r = _pCameraPresentationModel->SetFlashMode(cameraFlashMode);
5774 TryCatch(r == E_SUCCESS, , "SetFlash fail[%s]", GetErrorMessage(r));
5776 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, regVal);
5777 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
5779 TryCatch(__pSettingPanel != null, r = E_SYSTEM, "__pSettingPanel is null");
5781 TryCatch(_pFlashButton != null, r = E_SYSTEM, "_pFlashButton is null");
5783 pBitmapNormal = ResourceManager::GetBitmapN(resIdNormal);
5784 TryCatch(pBitmapNormal != null, r = E_SYSTEM, "pBitmapNormal is null");
5786 _pFlashButton->SetNormalBackgroundBitmap(*pBitmapNormal);
5788 delete pBitmapNormal;
5789 pBitmapNormal = null;
5791 pBitmapPress = ResourceManager::GetBitmapN(resIdPress);
5792 TryCatch(pBitmapPress != null, r = E_SYSTEM, "pBitmapPress is null");
5794 _pFlashButton->SetPressedBackgroundBitmap(*pBitmapPress);
5796 delete pBitmapPress;
5797 pBitmapPress = null;
5802 SetCamcorderTabSettingMainMenuCount(MENU_COUNT_CLEAR);
5803 SetCamcorderTabSubMenuListviewState(MENU_COUNT_CLEAR, CAMCORDER_SUB_MENU_CONTENT_MAX);
5805 AppLogDebug("EXIT");
5813 CamcorderForm::SubListPopupWbMode(int index)
5815 AppLogDebug("ENTER");
5816 result r = E_SUCCESS;
5818 int selfPortraitEnable = 0;
5820 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
5821 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
5823 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5825 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
5829 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
5830 AppLogDebug("result is %s",GetErrorMessage(r));
5835 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)index);
5839 AppLogDebug("result is %s",GetErrorMessage(r));
5840 AppLogDebug("Target unsupport - white balance same");
5842 __settingWhiteBalance = index;
5843 regVal = __settingWhiteBalance;
5845 AppLogDebug("regVal = %d", regVal);
5846 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
5848 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
5849 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5853 r = _pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
5854 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5857 AppLogDebug("EXIT");
5861 AppLogDebug("EXIT - CATCH");
5866 CamcorderForm::SubListPopupGuidelineMode(int index)
5868 AppLogDebug("ENTER");
5869 result r = E_SUCCESS;
5875 case SUBMENU_MODE_OFF:
5877 AppLogDebug("Setting - Guideline = off");
5878 guideLine = SUBMENU_MODE_OFF;
5879 SetGuideLine(guideLine);
5880 r = DrawMarker(false);
5881 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
5885 case SUBMENU_MODE_ON:
5887 AppLogDebug("Setting - Guideline = on");
5888 guideLine = SUBMENU_MODE_ON;
5889 SetGuideLine(guideLine);
5890 r = DrawMarker(true);
5891 TryCatch(r == E_SUCCESS, , "DrawMarker() fail[%s]", GetErrorMessage(r));
5897 AppLogDebug("Setting - Guideline, Invail element id");
5904 AppLogDebug("Set vaule");
5906 r = _pCameraPresentationModel->SetValue(GUIDELINE_ENABLE, regVal);
5907 TryCatch(r == E_SUCCESS, , "Faled to set value to registry");
5909 AppLogDebug("EXIT");
5913 AppLogDebug("EXIT - CATCH");
5918 CamcorderForm::SubListPopupStorageTypeMode(int index)
5920 AppLogDebug("ENTER");
5921 int storage = STORAGE_TYPE_PHONE;
5922 String filePath = L"";
5923 result r = E_SUCCESS;
5927 case SUBMENU_STORAGE_TYPE_PHONE:
5929 AppLogDebug("Setting - Storage type = Phone");
5930 storage = STORAGE_TYPE_PHONE;
5931 SetStorageType(storage);
5935 case SUBMENU_STORAGE_TYPE_MEMORYCARD:
5937 AppLogDebug("Setting - Storage type = card");
5938 storage = STORAGE_TYPE_MEMORYCARD;
5940 if (_pCameraPresentationModel->IsStorageCardMounted() == true)
5942 SetStorageType(storage);
5946 AppLogDebug("Setting - don't draw t-flash icon");
5953 AppLogDebug("Setting - Storage, Invaild index id");
5958 _pCameraPresentationModel->UpdateThumbnail(CameraPresentationModel::CAMERA_MODE_RECORD);
5962 _pCameraInfoPanel->SetStorageType(storage);
5963 _pCameraInfoPanel->Invalidate(true);
5965 if (__pFileEventManager == null)
5967 __pFileEventManager = new (std::nothrow) FileEventManager();
5968 r = __pFileEventManager->Construct(*this);
5969 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
5972 filePath = _pCameraPresentationModel->GetfilePath(storage);
5973 AppLogDebug("filePath %ls", filePath.GetPointer());
5975 if (File::IsFileExist(__pFileEventPath))
5977 __pFileEventManager->RemovePath(__pFileEventPath);
5980 if (File::IsFileExist(filePath))
5982 r = __pFileEventManager->AddPath(filePath, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MOVE_SELF);
5983 __pFileEventPath = filePath;
5986 AppLogDebug("FileEventManager()::Construct() fail[%s]", GetErrorMessage(r));
5987 AppLogDebug("EXIT");
5991 CamcorderForm::SubListPopupTimerMode(int index)
5993 AppLogDebug("ENTER");
5994 result r = E_SUCCESS;
5997 __settingTimeInterval = index;
6000 r = _pCameraPresentationModel->SetValue(TIMER_INTERVAL, regVal);
6001 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6003 AppLogDebug("EXIT");
6007 AppLogDebug("EXIT - CATCH");
6012 CamcorderForm::SubListPopupResolutionMode(int index)
6014 AppLogDebug("ENTER");
6015 IList* pList = _pCameraPresentationModel->GetRecordingResolutionList();
6016 int resolutionCnt = 0;
6017 result r = E_SUCCESS;
6018 int selfPortraitEnable = 0;
6020 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6021 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6025 resolutionCnt = pList->GetCount() - INDEX_UNIT_ONE;
6026 //Dimension dimResolution = *(static_cast<Dimension*>(pList->GetAt(resolutionCnt - index)));
6027 Dimension dimResolution = _pCameraPresentationModel->GetRecordingResolution();
6028 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dimResolution.width, dimResolution.height);
6030 if ((__pRecordingResolutionWidth == dimResolution.width )&& (__pRecordingResolutionHeight == dimResolution.height))
6032 AppLogDebug("RESOLUTION Same");
6036 _pCameraPresentationModel->StopPreview();
6038 _pCameraPresentationModel->SetRecordingResolution(dimResolution);
6040 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
6042 r = SetScreenMode(SCREEN_MODE_NORMAL, true);
6046 r = SetScreenMode(__screenMode, true);
6049 AppLogDebug("dimResolution(W:%d, H:%d)", dimResolution.width, dimResolution.height);
6053 __pRecordingResolutionIndex = index;
6055 AppLogDebug("EXIT");
6059 AppLogDebug("EXIT - CATCH");
6064 CamcorderForm::SubListPopupOverlayHelpMode(int index)
6066 AppLogDebug("ENTER");
6067 int value = SUBMENU_MODE_OFF;
6068 result r = E_SUCCESS;
6070 String strRegKey = IDS_INIT_REG_KEY;
6074 case SUBMENU_MODE_OFF:
6076 value = SUBMENU_MODE_OFF;
6081 case SUBMENU_MODE_ON:
6083 AppLogDebug("Setting - Guideline = on");
6084 value = SUBMENU_MODE_ON;
6095 r = _pCameraPresentationModel->SetValue(OVERLAY_HELP_ENABLE, regVal);
6096 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
6098 AppLogDebug("Setting - OVERLAY_HELP_ENABLE = %d", OVERLAY_HELP_ENABLE);
6100 r = SetScreenOverlayHelpTimer();
6101 TryCatch(r == E_SUCCESS, , "SetScreenOverlayHelpTimer() [%s]", GetErrorMessage(r));
6103 r = DrawScreenOverlayHelp();
6104 TryCatch(r == E_SUCCESS, , "DrawScreenOverlayHelp() [%s]", GetErrorMessage(r));
6106 AppLogDebug("EXIT");
6110 AppLogDebug("EXIT - CATCH");
6115 CamcorderForm::ProcessCamcorderTabSubListPopup(int index)
6117 AppLogDebug("ENTER");
6118 result r = E_SUCCESS;
6120 CamcorderTabSubMenuContent camSubMenuContent = CAMCORDER_SUB_MENU_CONTENT_MAX;
6122 camSubMenuContent = GetCamcorderTabSettingSubMenuMode();
6124 switch (camSubMenuContent)
6126 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
6128 r = SubListPopupResolutionMode(index);
6129 TryCatch(r == E_SUCCESS, , "SubListPopupResolutionMode() fail[%s]", GetErrorMessage(r));
6133 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
6142 if (_pListViewCameraTabSubMenu)
6144 if (_pCameraInfoSubPanel != null)
6146 _pCameraInfoSubPanel->SetShowState(false);
6148 _pListViewCameraTabSubMenu->SetShowState(false);
6150 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6151 _pListViewCameraTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6154 _pCameraInfoPanel->Invalidate(true);
6156 AppLogDebug("EXIT");
6160 AppLogDebug("EXIT - CATCH");
6165 CamcorderForm::ProcessGeneraTabSubListPopup(int index)
6167 AppLogDebug("ENTER");
6168 String strRegKey = IDS_INIT_REG_KEY;
6169 result r = E_SUCCESS;
6170 int selfPortraitEnable = 0;
6171 CamcorderGeneralTabSubMenuContent idx = CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX;
6173 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6174 TryCatch(r == E_SUCCESS, , "Reg GetValue() fail[%s]", GetErrorMessage(r));
6176 idx = GetGeneralTabSettingSubMenuMode();
6180 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
6182 r = SubListPopupTimerMode(index);
6183 TryCatch(r == E_SUCCESS, , "SubListPopupTimerMode() fail[%s]", GetErrorMessage(r));
6187 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
6189 r = SubListPopupGuidelineMode(index);
6190 TryCatch(r == E_SUCCESS, , "SubListPopupGuidelineMode() fail[%s]", GetErrorMessage(r));
6194 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
6196 SubListPopupStorageTypeMode(index);
6200 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE:
6205 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
6214 if (_pListViewGeneralTabSubMenu)
6216 if (_pCameraInfoGeneralSubPanel != null)
6218 _pCameraInfoGeneralSubPanel->SetShowState(false);
6220 _pListViewGeneralTabSubMenu->SetShowState(false);
6222 AppLogDebug("_currentSettingsMenuIndex is %d",_currentSettingsMenuIndex);
6223 _pListViewGeneralTabMainMenu->RefreshList(_currentSettingsMenuIndex,LIST_REFRESH_TYPE_ITEM_MODIFY);
6226 _pCameraInfoPanel->Invalidate(true);
6228 AppLogDebug("EXIT");
6232 MakeSettingPopupTab(false);
6235 AppLogDebug("EXIT - CATCH");
6240 CamcorderForm::StartRecordTimer(void)
6242 AppLogDebug("ENTER");
6243 result r = E_SUCCESS;
6244 if (__pRecordTimer == null)
6246 __recordTimeCount = 0;
6247 __recordingMaxTime = 0;
6249 __pRecordTimer = new (std::nothrow) Timer();
6250 __pRecordTimer->Construct(*this);
6252 r = __pRecordTimer->StartAsRepeatable(CAMCORDER_TIMER_ONE_SEC);
6253 TryCatch(r == E_SUCCESS, , "Timer::StartAsRepeatable fail[%s]", GetErrorMessage(r));
6256 AppLogDebug("EXIT");
6260 delete __pRecordTimer;
6261 __pRecordTimer = null;
6263 AppLogDebug("EXIT - CATCH");
6268 CamcorderForm::EndRecordTimer(void)
6270 AppLogDebug("ENTER");
6273 __recordingMaxTime = 0;
6274 __pRecordTimer->Cancel();
6275 delete __pRecordTimer;
6276 __pRecordTimer = null;
6278 AppLogDebug("EXIT");
6282 CamcorderForm::StartPopupTimer(void)
6284 AppLogDebug("ENTER");
6285 result r = E_SUCCESS;
6286 int settingTimer = 0;
6290 _pPopupTimer = new (std::nothrow) Timer();
6291 _pPopupTimer->Construct(*this);
6293 r = _pPopupTimer->StartAsRepeatable(CAMCORDER_TIMER_1_SEC);
6294 TryCatch(r == E_SUCCESS, , "_pPopupTimer start fail[%s]", GetErrorMessage(r));
6296 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, settingTimer);
6297 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
6299 if (settingTimer == SETTING_TIMER_RECORD_2_SEC)
6301 _timeCount = SETTING_TIMER_2_SEC_COUNT;
6303 else if (settingTimer == SETTING_TIMER_RECORD_5_SEC)
6305 _timeCount = SETTING_TIMER_5_SEC_COUNT;
6307 else if (settingTimer == SETTING_TIMER_RECORD_10_SEC)
6309 _timeCount = SETTING_TIMER_10_SEC_COUNT;
6312 _pCameraInfoPanel->SetDrawPopupTimerUpdate(true);
6314 _pCameraInfoPanel->SetDrawPopupTimerCount(_timeCount);
6316 _pCameraInfoPanel->Invalidate(true);
6318 AppLogDebug("EXIT");
6322 delete _pPopupTimer;
6323 _pPopupTimer = null;
6329 CamcorderForm::StopPopupTimer(void)
6331 AppLogDebug("ENTER");
6332 result r = E_SUCCESS;
6333 TryCatch(_pPopupTimer != null, r = E_SYSTEM, "_pPopupTimer is null");
6335 r = _pPopupTimer->Cancel();
6337 delete _pPopupTimer;
6338 _pPopupTimer = null;
6340 AppLogDebug("EXIT");
6348 CamcorderForm::SetRecordPauseButton(bool start)
6350 AppLogDebug("ENTER");
6351 Bitmap* pBitmapRotate = null;
6352 result r = E_SUCCESS;
6354 ImageRotationType rotationType = IMAGE_ROTATION_0;
6355 Point ptModeChangeButton;
6357 TryCatch(__pRecordButton != null, r = E_SYSTEM, "__pRecordButton is null");
6358 TryCatch(__pRecordPauseBitmap != null, r = E_SYSTEM, "__pRecordPauseBitmap is null");
6360 if (__dir == ORIENTATION_STATUS_PORTRAIT
6361 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6363 rotationType = IMAGE_ROTATION_90;
6364 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
6366 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
6367 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
6369 rotationType = IMAGE_ROTATION_0;
6370 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
6373 pBitmapRotate = RotationImageN(__pRecordPauseBitmap, rotationType);
6374 TryCatch(pBitmapRotate != null, , "pBitmap is null");
6376 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
6377 __pRecordButton->Invalidate(true);
6379 delete pBitmapRotate;
6380 pBitmapRotate = null;
6382 AppLogDebug("EXIT");
6386 AppLogDebug("EXIT - CATCH");
6391 CamcorderForm::SetRecordButton(bool start)
6393 AppLogDebug("ENTER");
6394 Bitmap* pBitmap = null;
6395 Bitmap* pBitmapRotate = null;
6396 result r = E_SUCCESS;
6397 ImageRotationType rotationType = IMAGE_ROTATION_0;
6398 Point ptModeChangeButton;
6400 TryCatch(__pRecordButton != null, r = E_SYSTEM, "__pRecordButton is null");
6402 if (__dir == ORIENTATION_STATUS_PORTRAIT
6403 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6405 rotationType = IMAGE_ROTATION_90;
6406 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_PORTRAIT);
6408 else if (__dir == ORIENTATION_STATUS_LANDSCAPE
6409 || __dir == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
6411 rotationType = IMAGE_ROTATION_0;
6412 ptModeChangeButton = Point(X_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE, Y_ACTION_PANEL_CAMERA_CAMCODER_BUTTON_LANDSCAPE);
6417 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_RECORDING_SHUTTER_NORMAL);
6421 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
6423 TryCatch(pBitmap != null, , "pBitmap is null");
6425 pBitmapRotate = RotationImageN(pBitmap, rotationType);
6426 TryCatch(pBitmapRotate != null, , "pBitmap is null");
6428 __pRecordButton->SetNormalBackgroundBitmap(*pBitmapRotate);
6429 __pRecordButton->Invalidate(true);
6434 delete pBitmapRotate;
6435 pBitmapRotate = null;
6437 AppLogDebug("EXIT");
6441 if (pBitmap != null)
6447 AppLogDebug("EXIT - CATCH");
6452 CamcorderForm::ExposureValuePerformed(void)
6454 AppLogDebug("ENTER");
6455 result r = E_SUCCESS;
6456 bool exposureValue = false;
6457 bool brighnesstValue = false;
6458 int selfPortraitEnable = 0;
6459 int adjustValue = 0;
6461 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
6462 _pAppTimer->Cancel();
6464 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
6465 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
6467 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6468 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6470 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6471 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6473 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6475 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6479 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6482 if (exposureValue == true && r == E_SUCCESS)
6484 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
6486 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, adjustValue);
6487 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6489 AppLogDebug("adjustValue = %d", adjustValue);
6491 _pCameraPresentationModel->SetExposure(adjustValue);
6493 MakeSettingPopupTab(false);
6497 r = CreateExposureSlider();
6498 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
6500 r = DrawExposureSlider();
6501 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6505 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6507 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6511 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6514 if (brighnesstValue == true && r == E_SUCCESS)
6516 AppLogDebug("CAMERA_SUB_MENU_CONTENT_EXPOSURE_MODE");
6518 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, adjustValue);
6519 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
6521 AppLogDebug("adjustValue = %d", adjustValue);
6523 _pCameraPresentationModel->SetBrightness(adjustValue);
6525 MakeSettingPopupTab(false);
6529 r = CreateExposureSlider();
6530 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
6532 r = DrawExposureSlider();
6533 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
6537 AppLogDebug("Exposure do not support");
6540 AppLogDebug("EXIT");
6544 CamcorderForm::AutoFocusPerformed(void)
6546 AppLogDebug("ENTER");
6547 Point currentPosition;
6548 int selfPortraitEnable = 0;
6549 bool focusSupport = false;
6550 result r = E_SUCCESS;
6552 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
6554 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
6556 if (__dir == ORIENTATION_STATUS_PORTRAIT
6557 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
6559 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
6560 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
6561 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
6565 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
6566 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
6567 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
6570 //if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
6572 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6573 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
6575 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6577 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
6581 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
6584 if (focusSupport == true && r == E_SUCCESS)
6586 AppLogDebug("focus is Support");
6588 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
6590 _pCameraInfoPanel->SetDrawMarkerFocus(true);
6592 DrawFocus(CAMERA_FOCUS_NOT_READY);
6596 _pCameraInfoPanel->SetDrawMarkerFocus(false);
6598 _pCameraInfoPanel->Invalidate(true);
6601 _pCameraPresentationModel->SetContinuousAutoFocus();
6604 AppLogDebug("EXIT");
6608 CamcorderForm::SetContinuousAutoFocusButton(void)
6610 AppLogDebug("ENTER");
6611 result r = E_SUCCESS;
6612 int selfPortraitEnable = 0;
6613 bool focusSupport = false;
6614 Bitmap* pBitmap = null;
6616 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6617 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
6619 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6621 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
6625 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
6628 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_AUTOFOCUS);
6629 TryReturnVoid(pBitmap != null, "pBitmap is null");
6631 _pAutoFocus->SetNormalBackgroundBitmap(*pBitmap);
6636 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_AUTOFOCUS_PRESS);
6637 TryReturnVoid(pBitmap != null, "pBitmap is null");
6639 _pAutoFocus->SetPressedBackgroundBitmap(*pBitmap);
6644 if (focusSupport == true && r == E_SUCCESS)
6646 _pAutoFocus->SetShowState(true);
6650 _pAutoFocus->SetShowState(false);
6652 _pAutoFocus->Invalidate(true);
6653 AppLogDebug("EXIT");
6657 CamcorderForm::BackButtonPerformed(void)
6659 AppLogDebug("ENTER");
6660 result r = E_SUCCESS;
6661 bool onVideoRecorderStopped = false;
6663 if (_pHelpGoToGallery->GetShowState() == true)
6665 OnHelpCloseTimerExpired();
6666 AppLogDebug("SCREEN OVERLAY HELP");
6670 if (_pCameraPresentationModel->GetPreviewState() == false)
6672 AppLogDebug("StartPreview do not call");
6676 AppLogDebug("RecorderState = %d", _pCameraPresentationModel->GetRecorderState());
6677 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
6679 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING)
6681 AppLogDebug("No RECORDER_STATE_RECORDING AND PAUSE");
6685 if (__pCancelPopup == null)
6687 r = InitializePopup();
6688 TryCatch(r == E_SUCCESS, , "InitializePopup fail[%s]", GetErrorMessage(r));
6690 __pCancelPopup->SetShowState(true);
6691 __pCancelPopup->Show();
6695 __pCancelPopup->SetShowState(true);
6696 __pCancelPopup->Show();
6700 TryCatch(r == E_SUCCESS, , "PauseRecord fail[%s]", GetErrorMessage(r));
6704 if (_isRecording == true)
6706 AppLogDebug("No RECORDER_STATE_RECORDING and _isRecording = true >> DO NOT APP TERMINATE");
6710 if (_pCameraInfoPanel->GetDrawExposure() == true)
6712 _closeTimerValue = 0;
6714 if (_pExposureCloseTimer)
6716 _pExposureCloseTimer->Cancel();
6719 _pCameraInfoPanel->SetDrawExposure(false);
6724 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6726 r = PressBackButton();
6727 TryCatch(r == E_SUCCESS, , "PressBackButton fail[%s]", GetErrorMessage(r));
6731 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
6732 AppLogDebug("onVideoRecorderStopped = %d", onVideoRecorderStopped);
6734 if (onVideoRecorderStopped == false)
6736 if (__setTimerInterval)
6738 AppLogDebug("__setTimerInterval");
6739 CancelTimerIntervalRecord();
6744 TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
6755 AppLogDebug("EXIT");
6759 AppLogDebug("EXIT - CATCH");
6764 CamcorderForm::PressBackButton(void)
6766 AppLogDebug("ENTER");
6767 bool onVideoRecorderStopped = false;
6768 result r = E_SUCCESS;
6770 onVideoRecorderStopped = _pCameraPresentationModel->GetOnVideoRecorderStopped();
6772 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
6774 AppLogDebug("PressBackButton >> Back to the App");
6775 if (onVideoRecorderStopped == false)
6777 if (_isRecording == false)
6779 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_CANCELED);
6783 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
6791 AppLogDebug("EXIT");
6796 CamcorderForm::SetSelfModeButton(void)
6798 AppLogDebug("ENTER");
6799 int selfPortraitEnable = 0;
6800 result r = E_SUCCESS;
6803 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
6805 AppLogDebug("Return Camera transform");
6809 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6810 TryReturnVoid(r == E_SUCCESS, "Reg getvalue fail[%s]", GetErrorMessage(r));
6812 if (selfPortraitEnable == CAMCORDER_FORM_PRIMARY_MODE)
6814 AppLogDebug("PRIMARY -> SECONDARY");
6816 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY);
6817 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6819 r = ToggleCameraDirection(CAMCORDER_FORM_SECONDARY_MODE);
6820 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
6822 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
6823 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6825 r = UpdateUiPanelIcon();
6826 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
6828 else if (selfPortraitEnable == CAMCORDER_FORM_SECONDARY_MODE)
6830 AppLogDebug("SECONDARY -> PRIMARY");
6831 int primaryFlashValue = FLASH_MODE_OFF;
6833 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
6834 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6836 r = ToggleCameraDirection(CAMCORDER_FORM_PRIMARY_MODE);
6837 TryReturnVoid(r == E_SUCCESS, "ToggleCameraDirection() fail[%s]", GetErrorMessage(r));
6839 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
6840 _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
6842 if (value == true && r == E_SUCCESS)
6844 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, primaryFlashValue);
6845 TryReturnVoid(r == E_SUCCESS, "Reg setValue fail[%s]", GetErrorMessage(r));
6849 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
6854 r = UpdateUiPanelIcon();
6855 //TryReturnVoid(r == E_SUCCESS, "UpdateUiPanelIcon() fail[%s]", GetErrorMessage(r));
6858 TryReturnVoid(_pFlashButton != null, "_pFlashButton is null");
6859 _pFlashButton->Invalidate(true);
6861 TryReturnVoid(_pSelfShotButton != null, "_pSelfShotButton is null");
6862 _pSelfShotButton->Invalidate(true);
6863 AppLogDebug("EXIT");
6867 CamcorderForm::SetCamcorderSettingsDevice(void)
6869 AppLogDebug("ENTER");
6874 result r = E_SUCCESS;
6875 bool exposureValue = false;
6876 bool brighnesstValue = false;
6877 int selfPortraitEnable = 0;
6879 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
6880 TryReturnVoid(r == E_SUCCESS, "Faled to Get value to registry[%s]", GetErrorMessage(r));
6882 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6884 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
6888 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
6891 if (exposureValue == true && r == E_SUCCESS)
6893 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
6894 TryReturnVoid(r == E_SUCCESS, "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
6896 _pCameraPresentationModel->SetExposure(exposure);
6900 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6902 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6906 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
6909 if (brighnesstValue == true && r == E_SUCCESS)
6911 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, brightness);
6912 TryReturnVoid(r == E_SUCCESS, "brightness Faled to Get value to registry[%s]", GetErrorMessage(r));
6914 _pCameraPresentationModel->SetBrightness(brightness);
6918 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6920 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_ISO_LEVEL);
6924 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_ISO_LEVEL);
6929 r = _pCameraPresentationModel->GetValue(ISO_VALUE, isoIndex);
6930 TryReturnVoid(r == E_SUCCESS, "isoIndex Faled to Get value to registry[%s]", GetErrorMessage(r));
6932 _pCameraPresentationModel->SetIsoLevel((CameraIsoLevel)isoIndex);
6935 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
6938 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
6941 AppLogDebug("primary mode wb is set");
6942 r =_pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, wbIndex);
6943 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
6948 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
6951 AppLogDebug("secondary mode wb is set");
6952 r =_pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, wbIndex);
6953 TryReturnVoid(r == E_SUCCESS, "WB Faled to Get value to registry[%s]", GetErrorMessage(r));
6957 _pCameraPresentationModel->SetWhiteBalance((CameraWhiteBalance)wbIndex);
6958 AppLogDebug("EXIT");
6962 CamcorderForm::RotationImageN(Bitmap* pSrcBitmap, ImageRotationType rotationType)
6964 AppLogDebug("ENTER");
6965 Bitmap* pBitmap = null;
6966 ByteBuffer* pSrcByteBuff = null;
6967 ByteBuffer dstByteBuff;
6968 BufferInfo buffInfo;
6969 result r = E_SUCCESS;
6973 TryCatch(pSrcBitmap != null, r = E_SYSTEM, "pSrcBitmap is null");
6975 if (rotationType == IMAGE_ROTATION_0)
6977 pBitmap = new (std::nothrow) Bitmap();
6978 r = pBitmap->Construct(*pSrcBitmap, Rectangle(X_BASE_POS, Y_BASE_POS, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight()));
6979 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
6981 AppLogDebug("IMAGE_ROTATION_0 - EXIT");
6985 dim.width = pSrcBitmap->GetWidth();
6986 dim.height = pSrcBitmap->GetHeight();
6988 size = dim.width * dim.height * (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE);
6990 r = dstByteBuff.Construct(size);
6991 TryCatch(r == E_SUCCESS, r = GetLastResult(), "dstByteBuff.Construct failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
6993 r = dstByteBuff.SetPosition(BYTE_BUFFER_START_POS);
6994 TryCatch(r == E_SUCCESS, , "dstByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
6996 r = pSrcBitmap->Lock(buffInfo, CAMERA_TIMER_ONE_MILLI_SEC);
6997 TryCatch(r == E_SUCCESS, , "pSrcBitmap Lock() fail[%s]", GetErrorMessage(r));
6999 dim.width = buffInfo.width;
7000 dim.height = buffInfo.height;
7002 size = buffInfo.pitch * buffInfo.height;
7004 pSrcByteBuff = new (std::nothrow) ByteBuffer();
7005 TryCatch(pSrcByteBuff, , "pSrcByteBuff failed:%s", GetErrorMessage(GetLastResult()));
7007 r = pSrcByteBuff->Construct(size);
7008 TryCatch(r == E_SUCCESS, r = GetLastResult(), "pSrcByteBuff->Construct() failed:%s %d %d %f", GetErrorMessage(GetLastResult()), dim.width, dim.height, (pSrcBitmap->GetBitsPerPixel() / BITS_PER_BYTE));
7010 r = pSrcByteBuff->SetPosition(BYTE_BUFFER_START_POS);
7011 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetPosition() fail[%s]", GetErrorMessage(r));
7013 r = pSrcByteBuff->SetArray(static_cast<byte*>(buffInfo.pPixels), BYTE_ARRAY_START_POS, size);
7014 TryCatch(r == E_SUCCESS, , "pSrcByteBuff SetArray() fail[%s]", GetErrorMessage(r));
7016 r = pSrcBitmap->Unlock();
7017 TryCatch(r == E_SUCCESS, , "pSrcBitmap Unlock() fail[%s]", GetErrorMessage(r));
7019 r = ImageUtil::Rotate(*pSrcByteBuff, dstByteBuff, dim, rotationType, MEDIA_PIXEL_FORMAT_RGBA8888);
7020 TryCatch(r == E_SUCCESS, , "Rotate() fail[%s]", GetErrorMessage(r));
7022 if (rotationType == IMAGE_ROTATION_90
7023 || rotationType == IMAGE_ROTATION_270)
7025 dim.width = buffInfo.height;
7026 dim.height = buffInfo.width;
7030 dim.width = buffInfo.width;
7031 dim.height = buffInfo.height;
7034 pBitmap = new (std::nothrow) Bitmap();
7035 r = pBitmap->Construct(dstByteBuff, dim, pSrcBitmap->GetPixelColorFormat());
7036 TryCatch(r == E_SUCCESS, , "pBitmap->Construct fail[%s]", GetErrorMessage(r));
7038 delete pSrcByteBuff;
7039 pSrcByteBuff = null;
7041 AppLogDebug("EXIT");
7045 AppLogDebug("Image rotation process fail[%s]", GetErrorMessage(r));
7046 if(pBitmap != null) //Prevent issue fix.
7051 if (pSrcByteBuff != null)
7053 delete pSrcByteBuff;
7054 pSrcByteBuff = null;
7061 CamcorderForm::SetSliderAdjustValue(const Tizen::Graphics::Point& currentPosition, const Tizen::Graphics::Rectangle& movableValidRect, const Tizen::Base::String& entryName, const int maxEntryValue)
7063 AppLogDebug("ENTER SliderAdjustValue %ls", entryName.GetPointer());
7064 result r = E_SUCCESS;
7065 int adjustEntryValue = 0;
7066 int currentEntryValue = 0;
7068 bool exposureValue = false;
7069 bool brighnesstValue = false;
7070 int selfPortraitEnable = 0;
7071 bool IsSliderAdjustValue = false;
7073 if (__dir == ORIENTATION_STATUS_PORTRAIT
7074 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7076 step = movableValidRect.width / maxEntryValue;
7077 if (currentPosition.x > movableValidRect.x)
7079 if (currentPosition.x > SLIDER_RECTVALID_X_POS)
7081 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
7082 if (adjustEntryValue == CAMERA_EXPOSURE_VALUE_ONE)
7084 adjustEntryValue = CAMERA_EXPOSURE_VALUE_ZERO;
7089 adjustEntryValue = maxEntryValue - ((currentPosition.x - movableValidRect.x) / step);
7092 IsSliderAdjustValue = true;
7096 IsSliderAdjustValue = false;
7101 step = movableValidRect.height / maxEntryValue;
7102 if (currentPosition.y > movableValidRect.y)
7104 adjustEntryValue = ((currentPosition.y - movableValidRect.y) / step);
7105 IsSliderAdjustValue = true;
7109 IsSliderAdjustValue = false;
7113 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7114 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7116 if (entryName.Equals(String(EXPOSURE_VALUE)))
7118 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7120 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7124 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7127 if (exposureValue == true && r == E_SUCCESS)
7129 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, currentEntryValue);
7130 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7134 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7136 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7140 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7143 if (brighnesstValue == true && r == E_SUCCESS)
7145 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, currentEntryValue);
7146 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
7150 if (currentEntryValue != adjustEntryValue && IsSliderAdjustValue)
7152 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7154 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7158 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7161 if (exposureValue == true && r == E_SUCCESS)
7163 r = _pCameraPresentationModel->SetValue(EXPOSURE_VALUE, adjustEntryValue);
7164 TryCatch(r == E_SUCCESS, , "etValue() fail[%s]", GetErrorMessage(r));
7168 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7170 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7174 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7177 if (brighnesstValue == true && r == E_SUCCESS)
7179 r = _pCameraPresentationModel->SetValue(BRIGHTNESS_VALUE, adjustEntryValue);
7180 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
7184 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7186 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7190 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7193 if (exposureValue == true && r == E_SUCCESS)
7195 _pCameraPresentationModel->SetExposure(adjustEntryValue);
7199 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7201 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7205 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7208 if (brighnesstValue == true && r == E_SUCCESS)
7210 _pCameraPresentationModel->SetBrightness(adjustEntryValue);
7214 AppLogDebug("SetBrightness do not support");
7220 AppLogDebug("EXIT");
7228 CamcorderForm::CreateExposureSlider(void)
7230 AppLogDebug("ENTER");
7231 result r = E_SUCCESS;
7233 TryCatch(_pCameraInfoPanel != null, r = E_FAILURE, "_pCameraInfoPanel is null");
7235 _closeTimerValue = 0;
7236 _pExposureCloseTimer = new (std::nothrow) Timer();
7237 _pExposureCloseTimer->Construct(*this);
7239 r = _pExposureCloseTimer->StartAsRepeatable(CAMERA_EXPOSURE_TIMER_VALUE);
7240 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
7242 _pCameraInfoPanel->SetDrawExposure(true);
7243 _pCameraInfoPanel->Invalidate(true);
7245 AppLogDebug("EXIT");
7249 delete _pExposureCloseTimer;
7250 _pExposureCloseTimer = null;
7256 CamcorderForm::DrawExposureSlider(void)
7258 AppLogDebug("ENTER");
7259 Point buttonPosition;
7260 result r = E_SUCCESS;
7263 int selfPortraitEnable = 0;
7264 bool exposureValue = false;
7265 bool brighnesstValue = false;
7267 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7268 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7270 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7272 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7276 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7279 if (exposureValue == true && r == E_SUCCESS)
7281 r = _pCameraPresentationModel->GetValue(EXPOSURE_VALUE, exposure);
7282 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7283 AppLogDebug("Exposure value %d", exposure);
7287 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7289 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7293 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7296 if (brighnesstValue == true && r == E_SUCCESS)
7298 r = _pCameraPresentationModel->GetValue(BRIGHTNESS_VALUE, exposure);
7299 TryCatch(r == E_SUCCESS, , "exposure Faled to Get value to registry[%s]", GetErrorMessage(r));
7300 AppLogDebug("Exposure value %d",exposure);
7304 if (__dir == ORIENTATION_STATUS_PORTRAIT
7305 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7307 step = W_EXPOSURE_PANEL_SLIDER_PORTRAIT / MAX_CAMERA_EXPOSURE_VALUE;
7309 buttonPosition.x = (step * (MAX_CAMERA_EXPOSURE_VALUE - exposure)) + X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7310 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7311 AppLogDebug("DrawExposureSlider X Point %d", buttonPosition.x);
7315 step = H_EXPOSURE_PANEL_SLIDER_LANDSCAPE / MAX_CAMERA_EXPOSURE_VALUE;
7317 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7318 buttonPosition.y = (step * exposure) + Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7319 AppLogDebug("DrawExposureSlider Y Point %d", buttonPosition.y);
7322 r = DrawExposureSlider(buttonPosition, DRAW_INITIALIZED);
7323 TryCatch(r == E_SUCCESS, , "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7325 AppLogDebug("EXIT");
7333 CamcorderForm::DrawExposureSlider(const Tizen::Graphics::Point& currentPosition, int DrawMode)
7335 AppLogDebug("ENTER");
7336 result r = E_SUCCESS;
7337 Point buttonPosition;
7338 Rectangle rectSlider;
7339 float adjustedXvalue = 0;
7340 int adjustedXinInt = 0;
7342 bool isSliderRectValid = false;
7344 AppLogDebug("DrawExposureSlider DrawMode %d, X Point %d, Y Point %d", DrawMode, currentPosition.x, currentPosition.y);
7346 if (__dir == ORIENTATION_STATUS_PORTRAIT
7347 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7351 case DRAW_INITIALIZED:
7353 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7354 buttonPosition.y = currentPosition.y;
7355 isSliderRectValid = true;
7361 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_PORTRAIT + W_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7363 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_PORTRAIT + H_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7365 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7366 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7367 isSliderRectValid = true;
7369 AppLogDebug("button x= %d , y=%d",buttonPosition.x,buttonPosition.y);
7371 adjustedXvalue = (float)buttonPosition.x - X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7372 adjustedXinInt = buttonPosition.x - X_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7374 adjustedXvalue = adjustedXvalue / BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
7375 adjustedXinInt = adjustedXinInt/ BRIGHTNESS_DIVIDER_PORTRAIT_MODE;
7377 if ((adjustedXvalue - adjustedXinInt) != 0)
7379 adjustedXinInt = adjustedXinInt+1;
7382 adjustedXinInt = BRIGHTNESS_DIVIDER_PORTRAIT_MODE*adjustedXinInt;
7384 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_PORTRAIT + adjustedXinInt;
7385 AppLogDebug("updated button x poitn is %d",buttonPosition.x);
7386 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);
7387 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7391 isSliderRectValid = false;
7396 isSliderRectValid = false;
7403 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_PORTRAIT + W_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7405 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_PORTRAIT) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_PORTRAIT + H_EXPOSURE_PANEL_SLIDER_PORTRAIT)))
7407 buttonPosition.x = currentPosition.x - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7408 buttonPosition.y = Y_EXPOSURE_PANEL_SLIDER_PORTRAIT;
7409 isSliderRectValid = true;
7410 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);
7411 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7416 isSliderRectValid = false;
7419 if ((buttonPosition.y % FRAME_SKIP) != 0)
7421 isSliderRectValid = false;
7434 case DRAW_INITIALIZED:
7436 buttonPosition.x = currentPosition.x;
7437 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7438 isSliderRectValid = true;
7444 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_LANDSCAPE + W_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7446 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE + H_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7448 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7449 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7450 isSliderRectValid = true;
7451 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);
7452 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7457 isSliderRectValid = false;
7464 if ((currentPosition.x >= X_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.x <= (X_EXPOSURE_PANEL_SLIDER_LANDSCAPE + W_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7466 if ((currentPosition.y >= Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE) && (currentPosition.y <= (Y_EXPOSURE_PANEL_SLIDER_LANDSCAPE + H_EXPOSURE_PANEL_SLIDER_LANDSCAPE)))
7468 buttonPosition.x = X_EXPOSURE_PANEL_SLIDER_LANDSCAPE;
7469 buttonPosition.y = currentPosition.y - OFFSET_EXPOSURE_PANEL_SLIDER_BUTTON;
7470 isSliderRectValid = true;
7471 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);
7472 TryCatch(r == E_SUCCESS, , "SliderAdjustValue() fail[%s]", GetErrorMessage(r));
7477 isSliderRectValid = false;
7480 if ((buttonPosition.y % FRAME_SKIP) != 0)
7482 isSliderRectValid = false;
7492 if (isSliderRectValid)
7494 _pCameraInfoPanel->SetButtonPoint(buttonPosition);
7495 _pCameraInfoPanel->Invalidate(true);
7498 AppLogDebug("EXIT");
7507 CamcorderForm::ShowExposureSlider(void)
7509 AppLogDebug("ENTER");
7510 result r = E_SUCCESS;
7511 int selfPortraitEnable = CAMCORDER_FORM_PRIMARY_MODE;
7512 bool exposureValue = false;
7513 bool brighnesstValue = false;
7515 if (_pExposureCloseTimer)
7517 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7518 TryReturnVoid(r == E_SUCCESS, "GetValue() fail(%s)", GetErrorMessage(r));
7520 if (_pExposureCloseTimer->Cancel() == E_SUCCESS)
7524 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7526 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, exposureValue);
7530 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, exposureValue);
7533 if (exposureValue == true && r == E_SUCCESS)
7535 r = CreateExposureSlider();
7536 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7538 r = DrawExposureSlider();
7539 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7543 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
7545 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7549 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, brighnesstValue);
7552 if (brighnesstValue == true && r == E_SUCCESS)
7554 r = CreateExposureSlider();
7555 TryReturnVoid(r == E_SUCCESS, "CreateExposureSlider() fail[%s]", GetErrorMessage(r));
7557 r = DrawExposureSlider();
7558 TryReturnVoid(r == E_SUCCESS, "DrawExposureSlider() fail[%s]", GetErrorMessage(r));
7563 AppLogDebug("EXIT");
7567 CamcorderForm::SetOverlayPanelOrientationChanged(Tizen::Ui::OrientationStatus orientationStatus)
7569 AppLogDebug("ENTER");
7570 result r = E_SUCCESS;
7571 bool modified = false;
7572 bool isValidRect = false;
7573 Dimension dimRendererSize;
7575 if (__screenMode == SCREEN_MODE_NORMAL)
7577 Dimension dim = Dimension(0, 0);
7578 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7579 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7580 Rectangle clientRect = GetClientAreaBounds();
7581 bool isToCompensated = false;
7583 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7584 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7586 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7588 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7589 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
7593 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7594 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7599 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7601 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7602 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7606 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7607 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
7611 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7613 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7614 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7616 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
7617 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7619 if (modified == true)
7621 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7624 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7625 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7627 if (evaluateBoundsRect.height == rect.height)
7629 isToCompensated = false;
7633 isToCompensated = true;
7638 if (evaluateBoundsRect.width == rect.width)
7640 isToCompensated = false;
7644 isToCompensated = true;
7648 r = __pOverlayPanel->SetBounds(rect);
7649 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7650 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7652 if (isToCompensated == true)
7654 AppLogDebug("isToCompensated = true");
7656 rect = __pOverlayPanel->GetBounds();
7657 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7659 r = __pOverlayPanel->SetBounds(rect);
7660 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7661 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7664 dimRendererSize = __pOverlayPanel->GetSize();
7665 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7666 __pOverlayPanel->SetRenderSize(dimRendererSize);
7670 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7671 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7672 Rectangle clientRect = GetClientAreaBounds();
7673 bool isToCompensated = false;
7675 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7676 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7678 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7680 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7684 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
7689 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
7691 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
7695 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
7699 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
7701 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
7702 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7704 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
7705 TryReturnVoid(isValidRect == true, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
7707 if (modified == true)
7709 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
7712 if (orientationStatus == ORIENTATION_STATUS_PORTRAIT
7713 || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
7715 if (evaluateBoundsRect.height == rect.height)
7717 isToCompensated = false;
7721 isToCompensated = true;
7726 if (evaluateBoundsRect.width == rect.width)
7728 isToCompensated = false;
7732 isToCompensated = true;
7736 r = __pOverlayPanel->SetBounds(rect);
7737 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7738 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7740 if (isToCompensated == true)
7742 rect = __pOverlayPanel->GetBounds();
7743 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7745 r = __pOverlayPanel->SetBounds(rect);
7746 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
7747 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
7750 dimRendererSize = __pOverlayPanel->GetSize();
7751 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
7752 __pOverlayPanel->SetRenderSize(dimRendererSize);
7754 AppLogDebug("EXIT");
7758 CamcorderForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
7760 AppLogDebug("ENTER");
7761 result r = E_SUCCESS;
7762 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
7763 BufferInfo bufferinfo;
7764 int selfPortraitEnable = CAMCORDER_FORM_PRIMARY_MODE;
7765 int guideLineEnable = DISABLE_GUIDELINE;
7766 String listName = L"";
7768 if (_appControlActionCompleted)
7770 AppLogDebug("OnOrientationChanged >> TerminateApp Execution");
7772 if (__dir != orientationStatus)
7774 __dir = orientationStatus;
7779 if (__dir != orientationStatus)
7781 __isOrientationChanged = true;
7783 if (_pAppTimer != null)
7785 _pAppTimer->Cancel();
7787 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
7790 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
7791 TryReturnVoid(r == E_SUCCESS, "Faled to set value to registry[%s]", GetErrorMessage(r));
7793 SetOverlayPanelOrientationChanged(orientationStatus);
7795 if (__pOverlayPanel)
7797 switch (orientationStatus)
7799 case ORIENTATION_STATUS_PORTRAIT:
7801 AppLogDebug("PORTRAIT");
7802 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
7806 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
7808 AppLogDebug("PORTRAIT REVERSE");
7809 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
7813 case ORIENTATION_STATUS_LANDSCAPE:
7815 AppLogDebug("LANDSCAPE");
7816 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
7820 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
7822 AppLogDebug("LANDSCAPE REVERSE");
7823 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
7832 __dir = orientationStatus;
7834 _pCameraPresentationModel->SetOrientation(__dir);
7836 if (__screenMode == SCREEN_MODE_FULL)
7838 if (_pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING || _isRecording == true)
7840 HidePanel(true, true);
7844 HidePanel(false, true);
7848 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, guideLineEnable);
7849 TryReturnVoid(r == E_SUCCESS, "Read Reg fail[%s]", GetErrorMessage(r));
7851 if (guideLineEnable == DISABLE_GUIDELINE)
7853 r = DrawMarker(false);
7857 r = DrawMarker(true);
7859 TryReturnVoid(r == E_SUCCESS, "DrawMarker fail[%s]", GetErrorMessage(r));
7861 UpdateUiPanelIcon();
7862 UpdateUiActionPanelIcon();
7863 OnHelpCloseTimerExpired();
7866 if (_isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
7868 if (_pHelpCloseTimer)
7870 _pHelpCloseTimer->Cancel();
7872 delete _pHelpCloseTimer;
7873 _pHelpCloseTimer = null;
7876 HideScreenOverlayHelp();
7878 _pCameraInfoPanel->SetDrawIndicator(false);
7879 _pCameraInfoPanel->Invalidate(true);
7882 if (_pListViewCameraTabMainMenu != null)
7884 listName = _pListViewCameraTabMainMenu->GetName();
7885 if (listName.Equals(String(IDS_MENU_SETTING_MAIN_MENU_NAME)) && _pListViewCameraTabMainMenu->GetShowState() == true)
7891 if (_pListViewGeneralTabMainMenu != null)
7893 listName = _pListViewGeneralTabMainMenu->GetName();
7894 if (listName.Equals(String(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME)) && _pListViewGeneralTabMainMenu->GetShowState() == true)
7900 if (_pListFlashMainMenu != null)
7902 listName = _pListFlashMainMenu->GetName();
7904 if (listName.Equals(String(IDS_MENU_FLASH_MENU_NAME)) && _pListFlashMainMenu->GetShowState() == true)
7910 if (_pListWbMainMenu != null)
7912 listName = _pListWbMainMenu->GetName();
7914 if (listName.Equals(String(IDS_MENU_WB_MENU_NAME)) && _pListWbMainMenu->GetShowState() == true)
7920 if (_pListViewCameraTabSubMenu != null)
7922 if (_pListViewCameraTabSubMenu->GetShowState() == true)
7928 if (_pListViewGeneralTabSubMenu != null)
7930 if (_pListViewGeneralTabSubMenu->GetShowState() == true)
7936 MakeSettingPopupTab(false);
7938 ShowExposureSlider();
7940 __isOrientationChanged = false;
7942 AppLogDebug("EXIT");
7946 CamcorderForm::HidePopup(void)
7948 AppLogDebug("ENTER");
7949 TryReturnVoid(_pCameraInfoPanel != null, "_pCameraInfoPanel is null");
7951 if (_pListViewCameraTabSubMenu)
7953 if (_pCameraInfoSubPanel != null)
7955 _pCameraInfoSubPanel->SetShowState(false);
7957 _pListViewCameraTabSubMenu->SetShowState(false);
7960 if (_pListViewCameraTabMainMenu)
7962 _pListViewCameraTabMainMenu->SetShowState(false);
7965 if (_pListViewGeneralTabSubMenu)
7967 if (_pCameraInfoGeneralSubPanel != null)
7969 _pCameraInfoGeneralSubPanel->SetShowState(false);
7971 _pListViewGeneralTabSubMenu->SetShowState(false);
7974 if (_pListViewGeneralTabMainMenu)
7976 _pListViewGeneralTabMainMenu->SetShowState(false);
7979 if (_pListFlashMainMenu)
7981 _pListFlashMainMenu->SetShowState(false);
7984 if (_pListWbMainMenu)
7986 _pListWbMainMenu->SetShowState(false);
7989 _pCameraInfoPanel->SetDrawExposure(false);
7990 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
7991 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
7992 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
7993 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
7995 if (__isOrientationChanged)
7997 __isOrientationChanged = false;
7999 _pCameraInfoPanel->Invalidate(true);
8003 _pCameraInfoPanel->Draw();
8004 _pCameraInfoPanel->Show();
8006 AppLogDebug("EXIT");
8010 CamcorderForm::CheckStorageInfo(void)
8012 AppLogDebug("ENTER");
8013 result r = E_SUCCESS;
8014 MessageBox messageBox;
8016 String strTemp = L"";
8017 int remainedNum = 0;
8018 int remainedNumOfTwenty = 0;
8020 remainedNum = _pCameraInfoPanel->GetRemainedPhoto();
8021 AppLogDebug("<<<< remainedNum = %d", remainedNum);
8023 remainedNum = remainedNum * UNIT_HUNDRED;
8024 AppLogDebug(">>>> remainedNum = %d", remainedNum);
8026 remainedNumOfTwenty = (remainedNum * UNIT_TWENTY) / UNIT_HUNDRED;
8027 AppLogDebug(">>>> remainedNumOfTwenty ( 20% ) = %d", remainedNumOfTwenty);
8029 if (remainedNum > remainedNumOfTwenty)
8031 AppLogDebug("capacity is over 20%");
8032 __isCapacityBelow = false;
8036 AppLogDebug("capacity is below 20%");
8037 __isCapacityBelow = true;
8040 if (remainedNum == STORAGE_VALUE_ZERO)
8042 if (__lowMemoryCapacity == false)
8044 __lowMemoryCapacity = true;
8045 __isMemoryFull = false;
8046 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);
8048 else if (__lowMemoryCapacity == true)
8050 __isMemoryFull = true;
8051 r = messageBox.Construct(L"", L"Memory Full", MSGBOX_STYLE_OK, MESSAGEBOX_DISPLAY_TIME_3_SEC);
8053 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
8055 r = messageBox.ShowAndWait(result);
8056 TryReturnVoid(r == E_SUCCESS, "ShowAndWait() fail(%s)", GetErrorMessage(r));
8060 case MSGBOX_RESULT_OK:
8062 if (__lowMemoryCapacity == true)
8064 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
8065 _pCameraInfoPanel->SetStorageTitle(strTemp);
8066 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
8067 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
8068 _pCameraInfoPanel->Invalidate(true);
8071 if (__isMemoryFull == true)
8073 strTemp.Format(UI_INDICATOR_STORAGE_FREE_SPACE_BUFFER_LEN, L"%d", remainedNum);
8074 _pCameraInfoPanel->SetStorageTitle(strTemp);
8075 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(false);
8076 _pCameraInfoPanel->SetDrawMemoryfulIndicator(true);
8077 _pCameraInfoPanel->Invalidate(true);
8086 //r = TerminateApp();
8087 //TryCatch(r == E_SUCCESS, , "TerminateApp fail[%s]", GetErrorMessage(r));
8092 if (_isRecording == false)
8094 if (remainedNum > STORAGE_VALUE_ZERO && remainedNum <= STORAGE_DISPLAY_PLACE)
8096 _pCameraInfoPanel->SetStorageTitle(strTemp);
8097 _pCameraInfoPanel->SetDrawIndicatorStroageInfo(true);
8098 _pCameraInfoPanel->SetDrawMemoryfulIndicator(false);
8099 _pCameraInfoPanel->Invalidate(true);
8102 SetStartRecording();
8106 AppLogDebug("_isRecording = true");
8111 AppLogDebug("EXIT");*/
8115 CamcorderForm::SetOverlayRendererRotation(void)
8117 AppLogDebug("ENTER");
8119 TryReturnVoid(__pOverlayPanel != null, "__pOverlayPanel is null");
8123 case ORIENTATION_STATUS_PORTRAIT:
8125 AppLogDebug("PORTRAIT");
8126 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_90);
8130 case ORIENTATION_STATUS_PORTRAIT_REVERSE:
8132 AppLogDebug("PORTRAIT REVERSE");
8133 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_270);
8137 case ORIENTATION_STATUS_LANDSCAPE:
8139 AppLogDebug("LANDSCAPE");
8140 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_NONE);
8144 case ORIENTATION_STATUS_LANDSCAPE_REVERSE:
8146 AppLogDebug("LANDSCAPE REVERSE");
8147 __pOverlayPanel->SetRendererRotation(__pOverlayPanel->ROTATION_180);
8154 AppLogDebug("EXIT");
8158 CamcorderForm::CreateOverlayRegion(Rectangle rect)
8160 AppLogDebug("ENTER");
8161 result r = E_SUCCESS;
8163 __pOverlayPanel = new (std::nothrow) OverlayPanel();
8164 r = __pOverlayPanel->Construct(rect);
8165 TryCatch(r == E_SUCCESS, , "pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
8166 //AppLogDebug("pOverlayPanel->Construct() [%s]", GetErrorMessage(r));
8168 r = AddControl(__pOverlayPanel);
8169 AppLogDebug("CreateOverlayRegion::AddControl() [%s]", GetErrorMessage(r));
8170 //TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
8172 __pOverlayPanel->AddTouchEventListener(*this);
8174 AppLogDebug("EXIT");
8178 RemoveControl(*__pOverlayPanel);
8179 __pOverlayPanel = null;
8180 AppLogDebug("EXIT - CATCH");
8185 CamcorderForm::SetOverlayPanel(Rectangle rect, Rectangle evaluateBoundsRect, Rectangle clientRect, bool destroyOverlay, bool isWideMode)
8187 AppLogDebug("ENTER");
8188 result r = E_SUCCESS;
8189 bool modified = false;
8190 bool isValidRect = false;
8191 bool isToCompensated = false;
8192 Dimension dimRendererSize;
8194 if (destroyOverlay == true)
8196 if (__pOverlayPanel)
8198 __pOverlayPanel->RemoveTouchEventListener(*this);
8199 RemoveControl(*__pOverlayPanel);
8200 __pOverlayPanel = null;
8203 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8204 AppLogDebug("Input bounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8206 if (isWideMode == false)
8208 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8212 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8214 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8216 if (modified == true)
8218 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8221 if (__dir == ORIENTATION_STATUS_PORTRAIT
8222 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8224 if (evaluateBoundsRect.height == rect.height)
8226 isToCompensated = false;
8230 isToCompensated = true;
8235 if (evaluateBoundsRect.width == rect.width)
8237 isToCompensated = false;
8241 isToCompensated = true;
8245 r = CreateOverlayRegion(rect);
8246 AppLogDebug("CreateOverlayRegion() [%s]", GetErrorMessage(r));
8248 if (isToCompensated == true)
8250 AppLogDebug("isToCompensated = true");
8252 rect = __pOverlayPanel->GetBounds();
8253 AppLogDebug("__pOverlayPanel->GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8255 r = __pOverlayPanel->SetBounds(rect);
8256 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8257 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8260 dimRendererSize = __pOverlayPanel->GetSize();
8261 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8262 __pOverlayPanel->SetRenderSize(dimRendererSize);
8266 TryCatch(__pOverlayPanel != null, , "__pOverlayPanel is null");
8268 AppLogDebug("Client area rect (%d, %d, %d, %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
8269 AppLogDebug("Input EvaluateBounds (%d, %d, %d, %d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8271 if (isWideMode == false)
8273 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, evaluateBoundsRect, modified);
8277 isValidRect = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN, evaluateBoundsRect, modified);
8279 TryReturn(isValidRect == true, null, "OverlayRegion::EvaluateBounds returned error[%s]", GetErrorMessage(GetLastResult()));
8281 if (modified == true)
8283 AppLogDebug("OverlayRegion::EvaluateBounds is modified to (%d,%d,%d,%d)", evaluateBoundsRect.x, evaluateBoundsRect.y, evaluateBoundsRect.width, evaluateBoundsRect.height);
8286 if (__dir == ORIENTATION_STATUS_PORTRAIT
8287 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8289 if (evaluateBoundsRect.height == rect.height)
8291 isToCompensated = false;
8295 isToCompensated = true;
8300 if (evaluateBoundsRect.width == rect.width)
8302 isToCompensated = false;
8306 isToCompensated = true;
8310 r = __pOverlayPanel->SetBounds(rect);
8311 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8312 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8314 if (isToCompensated == true)
8316 rect = __pOverlayPanel->GetBounds();
8317 AppLogDebug("__pOverlayPanel GetBounds area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8319 r = __pOverlayPanel->SetBounds(rect);
8320 AppLogDebug("pOverlayPanel->SetBounds() [%s]", GetErrorMessage(r));
8321 AppLogDebug("__pOverlayPanel->SetBounds() area rect (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height);
8324 dimRendererSize = __pOverlayPanel->GetSize();
8325 AppLogDebug("__pOverlayPanel->GetSize() area rect (%d, %d)", dimRendererSize.width, dimRendererSize.height);
8326 __pOverlayPanel->SetRenderSize(dimRendererSize);
8328 AppLogDebug("EXIT");
8332 RemoveControl(*__pOverlayPanel);
8333 __pOverlayPanel = null;
8334 AppLogDebug("EXIT - CATCH");
8339 CamcorderForm::SetOverlayPanelWideMode(bool isRemoved)
8341 AppLogDebug("ENTER");
8342 result r = E_SUCCESS;
8343 Rectangle evaluateBoundsRect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8344 Rectangle rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8345 Rectangle clientRect = GetClientAreaBounds();
8347 if (__dir == ORIENTATION_STATUS_PORTRAIT
8348 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8350 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8352 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8356 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8361 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8363 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width, GetClientAreaBounds().height);
8367 rect = Rectangle(X_BASE_POS, Y_BASE_POS, GetClientAreaBounds().width - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, GetClientAreaBounds().height);
8371 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, true);
8372 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8373 AppLogDebug("EXIT");
8377 CamcorderForm::SetOverlayPanelNormalMode(bool isRemoved)
8379 AppLogDebug("ENTER");
8380 result r = E_SUCCESS;
8381 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8382 Rectangle evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8383 Rectangle clientRect = GetClientAreaBounds();
8385 if (__dir == ORIENTATION_STATUS_PORTRAIT
8386 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8388 if (clientRect.height == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8390 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8391 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
8395 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8396 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN);
8401 if (clientRect.width == (CAMERA_PANEL_SUM_SIZE + PREVIEW_OVERLAY_PANEL_SIZE))
8403 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8404 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8408 evaluateBoundsRect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8409 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE - PREVIEW_OVERLAY_PANEL_SIZE_MARGIN, H_PREVIEW_OVERLAY_LANDSCAPE);
8413 r = SetOverlayPanel(rect, evaluateBoundsRect, clientRect, isRemoved, false);
8414 AppLogDebug("SetOverlayPanel() failed:%s", GetErrorMessage(r));
8415 AppLogDebug("EXIT");
8419 CamcorderForm::SetCamcorderMode(void)
8421 AppLogDebug("ENTER");
8422 result r = E_SUCCESS;
8423 int previewResolutionSize = 0;
8425 BufferInfo bufferinfo;
8427 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
8428 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
8430 dim = _pCameraPresentationModel->GetPreviewResolution();
8431 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
8433 __previewResolutionWidth = dim.width;
8434 __previewResolutionHeight = dim.height;
8436 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
8437 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
8439 _pCameraPresentationModel->StartPreview(&bufferinfo);
8441 _pCameraPresentationModel->SetContinuousAutoFocus();
8443 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
8445 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
8446 AppLogDebug("EXIT");
8450 CamcorderForm::SetScreenMode(const ScreenMode mode, bool destory)
8452 AppLogDebug("ENTER");
8453 result r = E_SUCCESS;
8456 AppLogDebug("__screenMode[%d] mode[%d]", __screenMode, mode);
8460 case SCREEN_MODE_NORMAL:
8462 if (destory == true)
8464 if (__screenMode != mode)
8466 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8467 _pAppTimer->Cancel();
8469 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
8470 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8472 _pCameraPresentationModel->KeepScreenOnState(true, false);
8474 _pCameraPresentationModel->StopCamera();
8477 SetOverlayPanelNormalMode(true);
8479 SetOverlayRendererRotation();
8481 if (__screenMode != mode)
8487 AppLogDebug("__screenMode = mode");
8489 __screenMode = SCREEN_MODE_NORMAL;
8493 SetOverlayPanelNormalMode(false);
8495 SetOverlayRendererRotation();
8497 __screenMode = SCREEN_MODE_NORMAL;
8500 HidePanel(false, false);
8502 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8506 case SCREEN_MODE_FULL:
8508 Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
8510 if (destory == true)
8512 if (__screenMode != mode)
8514 TryCatch(_pAppTimer != null, r = E_SYSTEM, "_pAppTimer is null");
8515 _pAppTimer->Cancel();
8517 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
8518 TryCatch(r == E_SUCCESS, , "_pAppTimer start fail[%s]", GetErrorMessage(r));
8520 _pCameraPresentationModel->KeepScreenOnState(true, false);
8522 _pCameraPresentationModel->StopCamera();
8525 SetOverlayPanelWideMode(true);
8527 SetOverlayRendererRotation();
8529 if (__screenMode != mode)
8535 AppLogDebug("__screenMode = mode");
8537 __screenMode = SCREEN_MODE_FULL;
8541 SetOverlayPanelWideMode(false);
8543 SetOverlayRendererRotation();
8545 __screenMode = SCREEN_MODE_FULL;
8548 HidePanel(true, false);
8550 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8561 AppLogDebug("EXIT");
8565 __screenMode = SCREEN_MODE_NORMAL;
8566 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
8572 CamcorderForm::InDrawFocus(void)
8574 AppLogDebug("ENTER");
8575 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8576 Rectangle clientRect = GetClientAreaBounds();
8577 Point currentPosition;
8578 int selfPortraitEnable = 0;
8579 result r = E_SUCCESS;
8580 bool focusSupport = false;
8582 if (__dir == ORIENTATION_STATUS_PORTRAIT
8583 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
8585 currentPosition.x = (W_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
8586 currentPosition.y = (H_PREVIEW_OVERLAY_PORTRAIT / DIVIDE_BY_TWO);
8590 currentPosition.x = (W_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
8591 currentPosition.y = (H_PREVIEW_OVERLAY_LANDSCAPE / DIVIDE_BY_TWO);
8594 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
8595 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
8597 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
8599 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
8603 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
8606 if (focusSupport == true && r == E_SUCCESS)
8608 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
8609 _pCameraInfoPanel->SetDrawMarkerFocus(true);
8610 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
8614 _pCameraInfoPanel->SetDrawMarkerFocus(false);
8615 _pCameraInfoPanel->Draw();
8616 _pCameraInfoPanel->Show();
8618 AppLogDebug("EXIT");
8622 CamcorderForm::StartRecord(void)
8624 AppLogDebug("ENTER");
8625 result r = E_SUCCESS;
8626 int timerIntervalVale = 0;
8628 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
8629 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
8631 InitMakerFocusTimer();
8633 _pCameraInfoPanel->SetDrawMarkerFocus(false);
8635 _pCameraInfoPanel->SetDrawIndicator(false);
8637 _pCameraInfoPanel->Invalidate(true);
8639 _pMakerFocusTimer->Cancel();
8641 _pMakerFocusTimer->Start(CAMCORDER_TIMER_ONE_SEC);
8643 _pCameraInfoPanel->CheckAvailableStorageSpace();
8647 if (__pThumbnailButton)
8649 __pThumbnailButton->SetShowState(false);
8650 __pThumbnailButton->Invalidate(true);
8655 if (_pThumbnailPanel)
8657 _pThumbnailPanel->SetShowState(false);
8658 _pThumbnailPanel->Invalidate(true);
8660 AppLogDebug("EXIT");
8664 CamcorderForm::StopRecord(void)
8666 AppLogDebug("ENTER");
8667 result r = E_SUCCESS;
8671 _pCameraInfoPanel->SetDrawIndicator(true);
8672 _pCameraInfoPanel->Invalidate(true);
8674 if (_pMakerFocusTimer)
8676 _pMakerFocusTimer->Cancel();
8679 _isRecording = false;
8681 _isRecordingPause = false;
8683 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
8684 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
8685 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
8686 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING
8687 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSING
8690 r = _pCameraPresentationModel->StopRecord();
8691 TryCatch(r == E_SUCCESS, , "Stop record failed [%s]",GetErrorMessage(r));
8694 r = DrawRecord(false);
8695 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8701 r = SetRecordButton(false);
8702 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8706 if (_pIntervalValueTimer)
8708 _pIntervalValueTimer->Cancel();
8713 _pPopupTimer->Cancel();
8716 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8718 _pCameraInfoPanel->SetDrawPopupTimer(false);
8720 _pCameraInfoPanel->Invalidate(true);
8722 AppLogDebug("EXIT");
8725 AppLogDebug("Caught record stop exception. Terminating app");
8726 _pCameraPresentationModel->SetRecordStopException(true);
8727 _pCameraPresentationModel->CancelRecord();
8732 CamcorderForm::HideRecLabe(void)
8734 AppLogDebug("ENTER");
8735 if (__pElapsedTimeLable)
8737 __pElapsedTimeLable->SetShowState(false);
8738 __pElapsedTimeLable->Invalidate(true);
8741 if (__pElapsedTimeMaxLable)
8743 __pElapsedTimeMaxLable->SetShowState(false);
8744 __pElapsedTimeMaxLable->Invalidate(true);
8747 if (__pElapsedRecordSizeLable)
8749 __pElapsedRecordSizeLable->SetShowState(false);
8750 __pElapsedRecordSizeLable->Invalidate(true);
8755 __pRecLabelRed->SetShowState(false);
8756 __pRecLabelRed->Invalidate(true);
8759 if (__pRecLabelText)
8761 __pRecLabelText->SetShowState(false);
8762 __pRecLabelText->Invalidate(true);
8764 AppLogDebug("EXIT");
8768 CamcorderForm::SetRecordPauseBitmap(bool start)
8770 AppLogDebug("ENTER");
8773 __pRecordPauseBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_RECORDING_SHUTTER_NORMAL);
8777 __pRecordPauseBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_STANDBY_SHUTTER_NORMAL);
8779 TryCatch(__pRecordPauseBitmap != null, , "__pRecordPauseBitmap is null");
8781 AppLogDebug("EXIT");
8785 delete __pRecordPauseBitmap;
8786 __pRecordPauseBitmap = null;
8788 AppLogDebug("EXIT - CATCH");
8793 CamcorderForm::PauseRecord(void)
8795 AppLogDebug("ENTER");
8796 result r = E_SUCCESS;
8798 r = SetRecordPauseBitmap(true);
8799 //TryCatch(r == E_SUCCESS, , "SetRecordPauseBitmap start fail[%s]", GetErrorMessage(r));
8800 AppLogDebug("SetRecordPauseBitmap() fail[%s]", GetErrorMessage(r));
8802 r = SetRecordPauseButton(true);
8803 TryCatch(r == E_SUCCESS, , "SetRecordPauseButton start fail[%s]", GetErrorMessage(r));
8805 _isRecording = false;
8807 _isRecordingPause = true;
8809 _pCameraPresentationModel->PauseRecord();
8811 __pRecordTimer->Cancel();
8815 r = DrawPauseRecord();
8816 TryCatch(r == E_SUCCESS, , "DrawPauseRecord start fail[%s]", GetErrorMessage(r));
8818 AppLogDebug("EXIT");
8822 AppLogDebug("EXIT - CATCH");
8827 CamcorderForm::CancelRecord(void)
8829 AppLogDebug("ENTER");
8830 result r = E_SUCCESS;
8834 _pCameraInfoPanel->SetDrawIndicator(true);
8835 _pCameraInfoPanel->Invalidate(true);
8837 if (_pMakerFocusTimer)
8839 _pMakerFocusTimer->Cancel();
8842 _isRecording = false;
8844 _pCameraPresentationModel->SetCancelRecord(true);
8846 AppLogDebug("StopRecord::GetRecorderState() = %d", _pCameraPresentationModel->GetRecorderState());
8847 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
8848 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED
8849 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_STARTING
8850 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSING
8853 _pCameraPresentationModel->StopRecord();
8856 r = DrawRecord(false);
8857 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8863 r = SetRecordButton(false);
8864 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8868 _pIntervalValueTimer->Cancel();
8872 _pPopupTimer->Cancel();
8875 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8877 _pCameraInfoPanel->SetDrawPopupTimer(false);
8879 _pCameraInfoPanel->Invalidate(true);
8881 AppLogDebug("EXIT");
8885 CamcorderForm::CancelTimerIntervalRecord(void)
8887 AppLogDebug("ENTER");
8888 if (_pIntervalValueTimer)
8890 _pIntervalValueTimer->Cancel();
8893 __doRecording = false;
8897 __pBatteryState->SetShowState(true);
8898 __pBatteryState->Draw();
8900 _pCameraInfoPanel->SetDrawIndicator(true);
8901 _pCameraInfoPanel->Invalidate(true);
8903 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
8904 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
8905 _pCameraInfoPanel->Draw();
8906 _pCameraInfoPanel->Show();
8908 _pCameraInfoPanel->SetDrawPopupTimer(false);
8909 _pCameraInfoPanel->Draw();
8910 _pCameraInfoPanel->Show();
8911 __setTimerInterval = false;
8913 _pCameraPresentationModel->SetIntervalTimerRun(false);
8916 AppLogDebug("EXIT");
8920 CamcorderForm::SetRecordEndReached(void)
8922 AppLogDebug("ENTER");
8923 result r = E_SUCCESS;
8927 _isRecording = false;
8929 __doRecording = false;
8931 _isRecordingPause = false;
8935 _pCameraInfoPanel->SetDrawIndicator(true);
8936 _pCameraInfoPanel->Invalidate(true);
8938 if (_pMakerFocusTimer)
8940 _pMakerFocusTimer->Cancel();
8943 _isRecording = false;
8945 _isRecordingPause = false;
8947 r = DrawRecord(false);
8948 TryReturnVoid(r == E_SUCCESS, "DrawRecord() fail[%s]", GetErrorMessage(r));
8954 r = SetRecordButton(false);
8955 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
8959 if (_pIntervalValueTimer)
8961 _pIntervalValueTimer->Cancel();
8966 _pPopupTimer->Cancel();
8969 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
8971 _pCameraInfoPanel->SetDrawPopupTimer(false);
8973 _pCameraInfoPanel->Invalidate(true);
8978 _pCameraPresentationModel->CloseRecord();
8979 AppLogDebug("EXIT");
8983 CamcorderForm::SetRecordErrorOccurred(void)
8985 AppLogDebug("ENTER");
8986 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
8987 Rectangle clientRect = GetClientAreaBounds();
8988 Point currentPosition;
8989 result r = E_SUCCESS;
8991 AppLogDebug("SetRecordErrorOccurred.");
8995 _pCameraInfoPanel->SetDrawIndicator(true);
8996 _pCameraInfoPanel->Invalidate(true);
8998 if (_pMakerFocusTimer)
9000 _pMakerFocusTimer->Cancel();
9003 _isRecording = false;
9007 r = SetRecordButton(false);
9008 TryReturnVoid(r == E_SUCCESS, "SetRecordButton() fail[%s]", GetErrorMessage(r));
9012 if (_pIntervalValueTimer)
9014 _pIntervalValueTimer->Cancel();
9019 _pPopupTimer->Cancel();
9022 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9024 _pCameraInfoPanel->SetDrawPopupTimer(false);
9026 _pCameraInfoPanel->Invalidate(true);
9031 StartInitAppTimer();
9032 AppLogDebug("EXIT");
9036 CamcorderForm::HideUiAction(void)
9038 AppLogDebug("ENTER");
9041 _pPopupTimer->Cancel();
9044 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
9046 _pCameraInfoPanel->SetDrawPopupTimer(false);
9048 _pCameraInfoPanel->Invalidate(true);
9051 if (_pExposureCloseTimer != null)
9053 _closeTimerValue = 0;
9055 _pExposureCloseTimer->Cancel();
9058 if (_pCameraInfoPanel->GetDrawExposure() == true)
9060 _pCameraInfoPanel->SetDrawExposure(false);
9065 if (_pMakerFocusTimer != null)
9067 _pMakerFocusTimer->Cancel();
9069 AppLogDebug("EXIT");
9073 CamcorderForm::HideUiSettingMenu(void)
9075 AppLogDebug("ENTER");
9076 if (_pCameraInfoPanel)
9078 _pCameraInfoPanel->SetDrawWhiteBalanceBackground(false);
9079 _pCameraInfoPanel->SetDrawFlashMenuBackground(false);
9080 _pCameraInfoPanel->SetDrawSettingMenuBackground(false);
9081 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(false);
9084 if (_pListViewCameraTabSubMenu)
9086 if (_pCameraInfoSubPanel != null)
9088 _pCameraInfoSubPanel->SetShowState(false);
9090 _pListViewCameraTabSubMenu->SetShowState(false);
9093 if (_pListViewCameraTabMainMenu)
9095 _pListViewCameraTabMainMenu->SetShowState(false);
9098 if (_pListViewGeneralTabSubMenu)
9100 if (_pCameraInfoGeneralSubPanel != null)
9102 _pCameraInfoGeneralSubPanel->SetShowState(false);
9104 _pListViewGeneralTabSubMenu->SetShowState(false);
9107 if (_pListViewGeneralTabMainMenu)
9109 _pListViewGeneralTabMainMenu->SetShowState(false);
9112 if (_pListFlashMainMenu)
9114 _pListFlashMainMenu->SetShowState(false);
9117 if (_pListWbMainMenu)
9119 _pListWbMainMenu->SetShowState(false);
9121 AppLogDebug("EXIT");
9125 CamcorderForm::HideUiQuickMenu(void)
9127 AppLogDebug("ENTER");
9128 if (_pSelfShotButton != null)
9130 _pSelfShotButton->SetShowState(true);
9131 _pSelfShotButton->Invalidate(true);
9134 if (_pSettingButton != null)
9136 _pSettingButton->SetShowState(true);
9137 _pSettingButton->Invalidate(true);
9140 if (__pSettingLine != null)
9142 __pSettingLine->SetShowState(true);
9143 __pSettingLine->Invalidate(true);
9146 if (_pCameraInfoPanel != null)
9148 _pCameraInfoPanel->SetDrawIndicator(true);
9149 _pCameraInfoPanel->Invalidate(true);
9152 if (_pFlashButton != null)
9154 _pFlashButton->SetShowState(false);
9155 _pFlashButton->Invalidate(true);
9158 if (_pQuickSettingButton != null)
9160 _pQuickSettingButton->SetShowState(false);
9161 _pQuickSettingButton->Invalidate(true);
9164 if (_pWhiteBalanceButton != null)
9166 _pWhiteBalanceButton->SetShowState(false);
9167 _pWhiteBalanceButton->Invalidate(true);
9170 if (_pExposureValueButton != null)
9172 _pExposureValueButton->SetShowState(false);
9173 _pExposureValueButton->Invalidate(true);
9176 if (_pCloseButton != null)
9178 _pCloseButton->SetShowState(false);
9179 _pCloseButton->Invalidate(true);
9181 AppLogDebug("EXIT");
9185 CamcorderForm::ShowUiQuickMenu(void)
9187 AppLogDebug("ENTER");
9188 if (_pCameraInfoPanel)
9190 _pCameraInfoPanel->SetDrawIndicator(false);
9191 _pCameraInfoPanel->Invalidate(true);
9194 if (_pSelfShotButton)
9196 _pSelfShotButton->SetShowState(false);
9197 _pSelfShotButton->Invalidate(true);
9200 if (_pSettingButton)
9202 _pSettingButton->SetShowState(false);
9203 _pSettingButton->Invalidate(true);
9208 __pSettingLine->SetShowState(false);
9209 __pSettingLine->Invalidate(true);
9214 _pFlashButton->SetShowState(true);
9215 _pFlashButton->Invalidate(true);
9218 if (_pQuickSettingButton)
9220 _pQuickSettingButton->SetShowState(true);
9221 _pQuickSettingButton->Invalidate(true);
9224 if (_pWhiteBalanceButton)
9226 _pWhiteBalanceButton->SetShowState(true);
9227 _pWhiteBalanceButton->Invalidate(true);
9230 if (_pExposureValueButton)
9232 _pExposureValueButton->SetShowState(true);
9233 _pExposureValueButton->Invalidate(true);
9238 _pCloseButton->SetShowState(true);
9239 _pCloseButton->Invalidate(true);
9241 AppLogDebug("EXIT");
9245 CamcorderForm::HideUiModeChangedButton(void)
9247 AppLogDebug("ENTER");
9248 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9250 AppControlRequestHideButton();
9254 if (__pCameraIconLabel)
9256 __pCameraIconLabel->SetShowState(true);
9259 if (__pCamcoderIconLabel)
9261 __pCamcoderIconLabel->SetShowState(true);
9266 __pSwButton->SetShowState(true);
9271 AppLogDebug("EXIT");
9275 CamcorderForm::AppControlRequestHideButton(void)
9277 AppLogDebug("ENTER");
9278 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
9279 const IMap* pArguments = pApp->GetAppControlArguments();
9281 if (pArguments == null)
9283 AppLogDebug("pArguments is null");
9285 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
9287 AppLogDebug("Recording");
9288 if (__pCameraIconLabel)
9290 __pCameraIconLabel->SetShowState(false);
9293 if (__pCamcoderIconLabel)
9295 __pCamcoderIconLabel->SetShowState(false);
9300 __pSwButton->SetShowState(false);
9305 if (__pCameraIconLabel)
9307 __pCameraIconLabel->SetShowState(true);
9310 if (__pCamcoderIconLabel)
9312 __pCamcoderIconLabel->SetShowState(true);
9317 __pSwButton->SetShowState(true);
9323 const String* pAllowSwitch = static_cast<const String*>(pArguments->GetValue(String(ALLOW_SWITCH)));
9324 if (pAllowSwitch->Equals(ALLOW_SWITCH_TRUE, false) == true)
9326 AppLogDebug("ALLOW_SWITCH_TRUE");
9327 if (__doRecording || _isRecording || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_RECORDING)
9329 AppLogDebug("Recording");
9331 if (__pCameraIconLabel)
9333 __pCameraIconLabel->SetShowState(false);
9336 if (__pCamcoderIconLabel)
9338 __pCamcoderIconLabel->SetShowState(false);
9343 __pSwButton->SetShowState(false);
9348 if (__pCameraIconLabel)
9350 __pCameraIconLabel->SetShowState(true);
9353 if (__pCamcoderIconLabel)
9355 __pCamcoderIconLabel->SetShowState(true);
9360 __pSwButton->SetShowState(true);
9366 AppLogDebug("ALLOW_SWITCH_FALSE");
9367 if (__pCameraIconLabel)
9369 __pCameraIconLabel->SetShowState(false);
9372 if (__pCamcoderIconLabel)
9374 __pCamcoderIconLabel->SetShowState(false);
9379 __pSwButton->SetShowState(false);
9383 AppLogDebug("EXIT");
9387 CamcorderForm::DoRecordHideUiPanel(void)
9389 AppLogDebug("ENTER");
9390 result r = E_SUCCESS;
9391 int timerIntervalVale = 0;
9393 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, timerIntervalVale);
9394 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9396 _pFlashButton->SetShowState(false);
9397 _pSelfShotButton->SetShowState(false);
9398 _pSettingButton->SetShowState(false);
9399 __pSettingLine->SetShowState(false);
9401 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && !__doRecording)
9403 AppControlRequestHideButton();
9407 __pCameraIconLabel->SetShowState(false);
9408 __pCamcoderIconLabel->SetShowState(false);
9409 __pSwButton->SetShowState(false);
9412 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9414 __pThumbnailButton->SetShowState(false);
9415 _pThumbnailPanel->SetShowState(false);
9421 __pThumbnailButton->SetShowState(false);
9422 _pThumbnailPanel->SetShowState(false);
9426 __pThumbnailButton->SetShowState(true);
9427 _pThumbnailPanel->SetShowState(true);
9430 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9431 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9433 _pQuickSettingButton->SetShowState(false);
9434 _pWhiteBalanceButton->SetShowState(false);
9435 _pExposureValueButton->SetShowState(false);
9436 _pCloseButton->SetShowState(false);
9437 _pAutoFocus->SetShowState(false);
9439 if (__screenMode == SCREEN_MODE_FULL)
9448 AppLogDebug("EXIT");
9452 CamcorderForm::HideUiPanel(bool state)
9454 AppLogDebug("ENTER");
9457 _pFlashButton->SetShowState(false);
9458 _pSelfShotButton->SetShowState(false);
9459 _pSettingButton->SetShowState(false);
9460 __pSettingLine->SetShowState(false);
9462 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET && !__doRecording)
9464 AppControlRequestHideButton();
9468 __pCameraIconLabel->SetShowState(false);
9469 __pCamcoderIconLabel->SetShowState(false);
9470 __pSwButton->SetShowState(false);
9473 __pRecordButton->SetShowState(true);
9475 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9477 __pThumbnailButton->SetShowState(false);
9478 _pThumbnailPanel->SetShowState(false);
9484 __pThumbnailButton->SetShowState(false);
9485 _pThumbnailPanel->SetShowState(false);
9489 __pThumbnailButton->SetShowState(true);
9490 _pThumbnailPanel->SetShowState(true);
9493 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9494 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_BLACK);
9496 _pQuickSettingButton->SetShowState(false);
9497 _pWhiteBalanceButton->SetShowState(false);
9498 _pExposureValueButton->SetShowState(false);
9499 _pCloseButton->SetShowState(false);
9500 _pAutoFocus->SetShowState(false);
9504 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9506 if (__pThumbnailButton)
9508 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9510 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9511 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9515 if (_pThumbnailPanel)
9517 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9519 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9520 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9526 __pThumbnailButton->SetShowState(true);
9527 _pThumbnailPanel->SetShowState(true);
9529 _pFlashButton->SetShowState(false);
9530 _pSelfShotButton->SetShowState(true);
9531 _pSettingButton->SetShowState(true);
9532 __pSettingLine->SetShowState(true);
9533 _pQuickSettingButton->SetShowState(false);
9534 _pWhiteBalanceButton->SetShowState(false);
9535 _pExposureValueButton->SetShowState(false);
9536 _pCloseButton->SetShowState(false);
9537 _pAutoFocus->SetShowState(false);
9539 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9541 AppControlRequestHideButton();
9545 __pCameraIconLabel->SetShowState(true);
9546 __pCamcoderIconLabel->SetShowState(true);
9547 __pSwButton->SetShowState(true);
9550 __pRecordButton->SetShowState(true);
9552 __pSettingPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
9553 __pActionPanel->SetBackgroundColor(COLOR_PANEL_BACKGROUND_GRAY);
9556 if (__screenMode == SCREEN_MODE_FULL)
9565 AppLogDebug("EXIT");
9569 CamcorderForm::SetControlAlwaysOnTopPanel(void)
9571 AppLogDebug("ENTER");
9572 if (__pSettingPanel)
9574 if (IsControlAlwaysOnTop(__pSettingPanel) == false)
9576 AppLogDebug("IsControlAlwaysOnTop __pSettingPanel");
9577 SetControlAlwaysOnTop(*__pSettingPanel, true);
9583 if (IsControlAlwaysOnTop(__pActionPanel) == false)
9585 AppLogDebug("IsControlAlwaysOnTop __pActionPanel");
9586 SetControlAlwaysOnTop(*__pActionPanel, true);
9592 if (IsControlAlwaysOnTop(_pFlashButton) == false)
9594 AppLogDebug("IsControlAlwaysOnTop _pFlashButton");
9595 SetControlAlwaysOnTop(*_pFlashButton, true);
9599 if (_pSelfShotButton)
9601 if (IsControlAlwaysOnTop(_pSelfShotButton) == false)
9603 AppLogDebug("IsControlAlwaysOnTop _pSelfShotButton");
9604 SetControlAlwaysOnTop(*_pSelfShotButton, true);
9608 if (_pSettingButton)
9610 if (IsControlAlwaysOnTop(_pSettingButton) == false)
9612 AppLogDebug("IsControlAlwaysOnTop _pSettingButton");
9613 SetControlAlwaysOnTop(*_pSettingButton, true);
9619 if (IsControlAlwaysOnTop(__pSettingLine) == false)
9621 AppLogDebug("IsControlAlwaysOnTop __pSettingLine");
9622 SetControlAlwaysOnTop(*__pSettingLine, true);
9626 if (__pCameraIconLabel)
9628 if (IsControlAlwaysOnTop(__pCameraIconLabel) == false)
9630 AppLogDebug("IsControlAlwaysOnTop __pCameraIconLabel");
9631 SetControlAlwaysOnTop(*__pCameraIconLabel, true);
9635 if (__pCamcoderIconLabel)
9637 if (IsControlAlwaysOnTop(__pCamcoderIconLabel) == false)
9639 AppLogDebug("IsControlAlwaysOnTop __pCamcoderIconLabel");
9640 SetControlAlwaysOnTop(*__pCamcoderIconLabel, true);
9644 if (_pQuickSettingButton)
9646 if (IsControlAlwaysOnTop(_pQuickSettingButton) == false)
9648 AppLogDebug("IsControlAlwaysOnTop _pQuickSettingButton");
9649 SetControlAlwaysOnTop(*_pQuickSettingButton, true);
9653 if (_pWhiteBalanceButton)
9655 if (IsControlAlwaysOnTop(_pWhiteBalanceButton) == false)
9657 AppLogDebug("IsControlAlwaysOnTop _pWhiteBalanceButton");
9658 SetControlAlwaysOnTop(*_pWhiteBalanceButton, true);
9662 if (_pExposureValueButton)
9664 if (IsControlAlwaysOnTop(_pExposureValueButton) == false)
9666 AppLogDebug("IsControlAlwaysOnTop _pExposureValueButton");
9667 SetControlAlwaysOnTop(*_pExposureValueButton, true);
9673 if (IsControlAlwaysOnTop(_pCloseButton) == false)
9675 AppLogDebug("IsControlAlwaysOnTop _pCloseButton");
9676 SetControlAlwaysOnTop(*_pCloseButton, true);
9682 if (IsControlAlwaysOnTop(_pAutoFocus) == false)
9684 AppLogDebug("IsControlAlwaysOnTop _pAutoFocus");
9685 SetControlAlwaysOnTop(*_pAutoFocus, true);
9689 if (__pBatteryState)
9691 if (IsControlAlwaysOnTop(__pBatteryState) == false)
9693 AppLogDebug("IsControlAlwaysOnTop __pBatteryState");
9694 SetControlAlwaysOnTop(*__pBatteryState, true);
9700 if (IsControlAlwaysOnTop(__pSwButton) == false)
9702 AppLogDebug("IsControlAlwaysOnTop __pSwButton");
9703 SetControlAlwaysOnTop(*__pSwButton, true);
9707 if (__pRecordButton)
9709 if (IsControlAlwaysOnTop(__pRecordButton) == false)
9711 AppLogDebug("IsControlAlwaysOnTop __pRecordButton");
9712 SetControlAlwaysOnTop(*__pRecordButton, true);
9716 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
9718 if (__pThumbnailButton)
9720 if (IsControlAlwaysOnTop(__pThumbnailButton) == true)
9722 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9723 SetControlAlwaysOnTop(*__pThumbnailButton, false);
9727 if (_pThumbnailPanel)
9729 if (IsControlAlwaysOnTop(_pThumbnailPanel) == true)
9731 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9732 SetControlAlwaysOnTop(*_pThumbnailPanel, false);
9738 if (__pThumbnailButton)
9740 if (IsControlAlwaysOnTop(__pThumbnailButton) == false)
9742 AppLogDebug("IsControlAlwaysOnTop __pThumbnailButton");
9743 SetControlAlwaysOnTop(*__pThumbnailButton, true);
9747 if (_pThumbnailPanel)
9749 if (IsControlAlwaysOnTop(_pThumbnailPanel) == false)
9751 AppLogDebug("IsControlAlwaysOnTop _pThumbnailPanel");
9752 SetControlAlwaysOnTop(*_pThumbnailPanel, true);
9757 if (_pHelpGoToGallery)
9759 if (IsControlAlwaysOnTop(_pHelpGoToGallery) == false)
9761 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGallery");
9762 SetControlAlwaysOnTop(*_pHelpGoToGallery, true);
9766 if (_pHelpGoToGalleryText)
9768 if (IsControlAlwaysOnTop(_pHelpGoToGalleryText) == false)
9770 AppLogDebug("IsControlAlwaysOnTop _pHelpGoToGalleryText");
9771 SetControlAlwaysOnTop(*_pHelpGoToGalleryText, true);
9775 if (_pHelpSwitchCamera)
9777 if (IsControlAlwaysOnTop(_pHelpSwitchCamera) == false)
9779 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCamera");
9780 SetControlAlwaysOnTop(*_pHelpSwitchCamera, true);
9784 if (_pHelpSwitchCameraText)
9786 if (IsControlAlwaysOnTop(_pHelpSwitchCameraText) == false)
9788 AppLogDebug("IsControlAlwaysOnTop _pHelpSwitchCameraText");
9789 SetControlAlwaysOnTop(*_pHelpSwitchCameraText, true);
9793 if (_pHelpQuickSetting)
9795 if (IsControlAlwaysOnTop(_pHelpQuickSetting) == false)
9797 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSetting");
9798 SetControlAlwaysOnTop(*_pHelpQuickSetting, true);
9802 if (_pHelpQuickSettingText)
9804 if (IsControlAlwaysOnTop(_pHelpQuickSettingText) == false)
9806 AppLogDebug("IsControlAlwaysOnTop _pHelpQuickSettingText");
9807 SetControlAlwaysOnTop(*_pHelpQuickSettingText, true);
9811 if (_pHelpRecordVideo)
9813 if (IsControlAlwaysOnTop(_pHelpRecordVideo) == false)
9815 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideo");
9816 SetControlAlwaysOnTop(*_pHelpRecordVideo, true);
9820 if (_pHelpRecordVideoText)
9822 if (IsControlAlwaysOnTop(_pHelpRecordVideoText) == false)
9824 AppLogDebug("IsControlAlwaysOnTop _pHelpRecordVideoText");
9825 SetControlAlwaysOnTop(*_pHelpRecordVideoText, true);
9831 if (IsControlAlwaysOnTop(_pHelpShutter) == false)
9833 AppLogDebug("IsControlAlwaysOnTop _pHelpShutter");
9834 SetControlAlwaysOnTop(*_pHelpShutter, true);
9838 if (_pHelpShutterText)
9840 if (IsControlAlwaysOnTop(_pHelpShutterText) == false)
9842 AppLogDebug("IsControlAlwaysOnTop _pHelpShutterText");
9843 SetControlAlwaysOnTop(*_pHelpShutterText, true);
9847 if (__pCamcoderSetting)
9849 if (IsControlAlwaysOnTop(__pCamcoderSetting) == false)
9851 AppLogDebug("IsControlAlwaysOnTop __pCamcoderSetting");
9852 SetControlAlwaysOnTop(*__pCamcoderSetting, true);
9856 if (__pCamcorderSettingLable)
9858 if (IsControlAlwaysOnTop(__pCamcorderSettingLable) == false)
9860 AppLogDebug("IsControlAlwaysOnTop __pCamcorderSettingLable");
9861 SetControlAlwaysOnTop(*__pCamcorderSettingLable, true);
9865 if (__pGeneralSetting)
9867 if (IsControlAlwaysOnTop(__pGeneralSetting) == false)
9869 AppLogDebug("IsControlAlwaysOnTop __pGeneralSetting");
9870 SetControlAlwaysOnTop(*__pGeneralSetting, true);
9874 if (__pGeneralSettingLable)
9876 if (IsControlAlwaysOnTop(__pGeneralSettingLable) == false)
9878 AppLogDebug("IsControlAlwaysOnTop __pGeneralSettingLable");
9879 SetControlAlwaysOnTop(*__pGeneralSettingLable, true);
9882 AppLogDebug("EXIT");
9886 CamcorderForm::HidePanel(bool isWideMode, bool isInvalidated)
9888 AppLogDebug("ENTER");
9889 result r = E_SUCCESS;
9891 SetControlAlwaysOnTopPanel();
9893 if (isWideMode == true)
9895 if (__pSettingPanel)
9897 r = __pSettingPanel->SetShowState(false);
9898 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
9903 r = __pActionPanel->SetShowState(false);
9904 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
9909 if (__pSettingPanel)
9911 r = __pSettingPanel->SetShowState(true);
9912 AppLogDebug("__pSettingPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
9917 r = __pActionPanel->SetShowState(true);
9918 AppLogDebug("__pActionPanel->SetShowState(false) fail[%s]", GetErrorMessage(r));
9922 if (isInvalidated == true)
9931 AppLogDebug("EXIT");
9935 CamcorderForm::DrawTouchAutoFocus(const Tizen::Graphics::Point& currentPosition)
9937 AppLogDebug("ENTER");
9938 result r = E_SUCCESS;
9939 int selfPortraitEnable = 0;
9940 bool focusSupport = false;
9942 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
9943 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
9945 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
9947 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FOCUS, focusSupport);
9951 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_FOCUS, focusSupport);
9954 if (focusSupport == true && r == E_SUCCESS)
9956 _pCameraInfoPanel->SetDrawMarkerFocusType(CAMERA_FOCUS_NOT_READY);
9957 _pCameraInfoPanel->SetCurrentPoint(currentPosition);
9958 _pCameraInfoPanel->SetDrawMarkerFocus(true);
9959 _pCameraInfoPanel->Invalidate(true);
9963 _pCameraInfoPanel->SetDrawMarkerFocus(false);
9964 _pCameraInfoPanel->Invalidate(true);
9966 _pCameraPresentationModel->SetAutoFocusPoint(currentPosition);
9967 AppLogDebug("EXIT");
9971 CamcorderForm::LaunchImageview(void)
9973 AppLogDebug("ENTER");
9974 const String* filePath = null;
9975 String listIndex = L"";
9976 String* temp = null;
9979 result r = E_SUCCESS;
9981 if (_pExposureCloseTimer)
9983 _pExposureCloseTimer->Cancel();
9989 _pPopupTimer->Cancel();
9994 HashMap* pExtraData = new (std::nothrow) HashMap(SingleObjectDeleter);
9995 pExtraData->Construct();
9997 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
9998 pArrayList->Construct();
10000 ArrayList* pContentPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
10001 pContentPathList->Construct();
10003 pContentPathList = _pCameraPresentationModel->GetContentPathListN(CameraPresentationModel::CAMERA_MODE_RECORD);
10004 if (pContentPathList == null)
10008 AppLogDebug("EXIT - pContentPathList is null");
10012 loopCount = _pCameraPresentationModel->GetContentCount();
10013 for (index = 0; index < loopCount; ++index)
10015 filePath = static_cast<const String*>(pContentPathList->GetAt(index));
10016 AppLogDebug("filePath = %ls", filePath->GetPointer());
10017 pArrayList->Add(new (std::nothrow) String(*filePath));
10020 listIndex.Format(INDEX_FREE_SPACE_BUFFER_LEN, L"%d", loopCount - INDEX_UNIT_ONE);
10021 AppLogDebug("listIndex : %ls", listIndex.GetPointer());
10023 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_PATH), (Object*)pArrayList);
10024 pExtraData->Add(new (std::nothrow) String(INPUT_KEY_INDEX), new (std::nothrow) String(listIndex));
10027 SetMime(MIME_TYPE_VALUE_IMAGE);
10029 r = LaunchAppControl(APPCONTROL_PROVIDER_ID_IMAGEVIEW, APPCONTROL_OPERATION_ID_IMAGEVIEW, &GetUri(), &GetMime(), pExtraData);
10030 TryReturnVoid(r == E_SUCCESS, "Faled to LaunchAppControl[%s]", GetErrorMessage(r));
10032 loopCount = pArrayList->GetCount();
10033 for (int i = 0; i < loopCount; ++i)
10035 temp = static_cast<String*>(pArrayList->GetAt(i));
10036 AppLog("print temp(%ls)", temp->GetPointer());
10038 AppLogDebug("EXIT");
10042 CamcorderForm::GetCameraToForeground(void)
10044 AppLogDebug("ENTER");
10045 Rectangle rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
10046 Rectangle clientRect = GetClientAreaBounds();
10048 Point currentPosition;
10049 result r = E_SUCCESS;
10050 int previewResolutionSize = 0;
10051 BufferInfo bufferinfo;
10053 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED happen");
10055 __isLockScreenMode = false;
10057 _pCameraPresentationModel->KeepScreenOnState(true, false);
10059 StartInitAppTimer();
10061 _batteryStatus = GetCurrentBatteryState();
10062 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
10064 StartInitChargingTimer();
10066 r = _pCameraPresentationModel->SetMode(CameraPresentationModel::CAMERA_MODE_RECORD);
10067 TryReturnVoid(r == E_SUCCESS, "SetMode() failed:%s", GetErrorMessage(r));
10071 dim = _pCameraPresentationModel->GetPreviewResolution();
10072 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
10074 __previewResolutionWidth = dim.width;
10075 __previewResolutionHeight = dim.height;
10077 dim = _pCameraPresentationModel->GetRecordingResolution();
10078 AppLogDebug("CamcorderForm::GetPreviewResolution(W:%d, H:%d)", dim.width, dim.height);
10080 __pRecordingResolutionWidth = dim.width;
10081 __pRecordingResolutionHeight = dim.height;
10083 AppLogDebug("CAMERA_ACTION_EVENT_FRAME_ACTIVATED: __screenMode [%d]", __screenMode);
10085 r = SetScreenMode(__screenMode, false);
10086 TryReturnVoid(r == E_SUCCESS, "SetScreenMode() failed:%s", GetErrorMessage(r));
10088 if (__dir == ORIENTATION_STATUS_PORTRAIT
10089 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10091 rect = Rectangle(X_PREVIEW_OVERLAY_PORTRAIT, Y_PREVIEW_OVERLAY_PORTRAIT, W_PREVIEW_OVERLAY_PORTRAIT, H_PREVIEW_OVERLAY_PORTRAIT);
10095 rect = Rectangle(X_PREVIEW_OVERLAY_LANDSCAPE, Y_PREVIEW_OVERLAY_LANDSCAPE, W_PREVIEW_OVERLAY_LANDSCAPE, H_PREVIEW_OVERLAY_LANDSCAPE);
10100 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
10101 TryReturnVoid(r == E_SUCCESS, "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
10103 _pCameraPresentationModel->StartPreview(&bufferinfo);
10105 _pCameraPresentationModel->SetContinuousAutoFocus();
10107 previewResolutionSize = __previewResolutionWidth * __previewResolutionHeight;
10109 _pCameraInfoPanel->SetPreviewResolutionSize(previewResolutionSize);
10111 SetCamcorderSettingsDevice();
10112 AppLogDebug("EXIT");
10116 CamcorderForm::SendCameraToBackground(void)
10118 AppLogDebug("ENTER");
10119 result r = E_SUCCESS;
10122 StopInitAppTimer();
10123 StopInitChargingTimer();
10125 HideUiPanel(false);
10127 _pCameraInfoPanel->SetDrawIndicator(true);
10128 _pCameraInfoPanel->Invalidate(true);
10130 if (_pMakerFocusTimer)
10132 _pMakerFocusTimer->Cancel();
10135 if (_pCameraPresentationModel->GetRecorderState()== RECORDER_STATE_RECORDING
10136 || _pCameraPresentationModel->GetRecorderState() == RECORDER_STATE_PAUSED)
10138 __recorderStopped = true;
10139 _pCameraPresentationModel->StopRecord();
10141 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
10142 TryReturnVoid(r == E_SUCCESS, "Reg getValue fail[%s]", GetErrorMessage(r));
10144 if (flashMode == FLASH_MODE_ON)
10146 _pCameraPresentationModel->SetFlashMode(CAMERA_FLASH_MODE_ON);
10150 _pCameraInfoPanel->SetDrawPopupTimerUpdate(false);
10151 _pCameraInfoPanel->SetDrawPopupTimerCount(0);
10152 _pCameraInfoPanel->Invalidate(true);
10154 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
10156 _pCameraInfoPanel->SetDrawPopupTimer(false);
10157 _pCameraInfoPanel->Invalidate(true);
10161 _isRecording = false;
10162 __setTimerInterval = false;
10163 _pCameraPresentationModel->SetIntervalTimerRun(false);
10164 _isRecordingPause = false;
10165 r = SetRecordButton(false);
10166 AppLogDebug("SetRecordButton() fail[%s]", GetErrorMessage(r));
10168 if (_pIntervalValueTimer)
10170 _pIntervalValueTimer->Cancel();
10175 _pPopupTimer->Cancel();
10178 if (_pCameraInfoPanel->GetDrawPopupTimer() == true)
10180 _pCameraInfoPanel->SetDrawPopupTimer(false);
10181 _pCameraInfoPanel->Invalidate(true);
10184 if (_pChargingCompletedTimer != null)
10186 _chargingCount = 0;
10188 _pChargingCompletedTimer->Cancel();
10191 if (_pPreviewFailPopupTimer != null)
10193 _pPreviewFailPopupTimer->Cancel();
10196 _pCameraInfoPanel->SetDrawMarkerFocus(false);
10197 _pCameraInfoPanel->Invalidate(true);
10200 _pCameraPresentationModel->SetStorageCardChageState(CameraPresentationModel::STORAGE_CARD_CHAGE_STATE_UNKNOWN);
10201 _pCameraPresentationModel->StopCamera();
10202 _pCameraPresentationModel->KeepScreenOnState(false, true);
10204 AppLogDebug("EXIT");
10208 CamcorderForm::DrawThumbnail(void)
10210 AppLogDebug("ENTER");
10211 if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
10213 if (__pThumbnailButton)
10215 __pThumbnailButton->SetShowState(false);
10216 __pThumbnailButton->Draw();
10217 __pThumbnailButton->Show();
10220 if (_pThumbnailPanel)
10222 _pThumbnailPanel->SetShowState(false);
10223 _pThumbnailPanel->Draw();
10224 _pThumbnailPanel->Show();
10229 if (__pThumbnailButton)
10231 __pThumbnailButton->SetShowState(false);
10232 __pThumbnailButton->Draw();
10233 __pThumbnailButton->Show();
10236 if (_pThumbnailPanel)
10238 _pThumbnailPanel->SetShowState(true);
10239 _pThumbnailPanel->Draw();
10240 _pThumbnailPanel->Show();
10243 AppLogDebug("EXIT");
10247 CamcorderForm::ShowCameraFailPopup(void)
10249 AppLogDebug("ENTER");
10250 int modalResult = 0;
10252 String tmpString = L"";
10253 result r = E_SUCCESS;
10254 AppResource* pAppResource = null;
10256 pAppResource = Application::GetInstance()->GetAppResource();
10257 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
10259 pAppResource->GetString(L"IDS_CAM_POP_CAMERA_FAILED", tmpString);
10261 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
10262 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
10263 msgBox.ShowAndWait(modalResult);
10265 switch (modalResult)
10267 case MSGBOX_RESULT_CLOSE:
10269 _pCameraPresentationModel->SetAppControlRequestType(CameraPresentationModel::APP_CONTROL_REQUEST_TYPE_FAILED);
10271 r = _pCameraPresentationModel->SetValue(SELF_PORTRAIT_ENABLE, CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY);
10272 AppLogDebug("SetValue fail [%s]", GetErrorMessage(r));
10274 r = TerminateApp();
10275 AppLogDebug("TerminateApp fail [%s]", GetErrorMessage(r));
10282 AppLogDebug("EXIT");
10286 CamcorderForm::ShowSavingPopup(void)
10288 AppLogDebug("ENTER");
10289 int modalResult = 0;
10292 AppResource* pAppResource = null;
10293 result r = E_SUCCESS;
10295 pAppResource = Application::GetInstance()->GetAppResource();
10296 TryReturnVoid(pAppResource != null, "Failed to allocate memory for pAppResource");
10298 pAppResource->GetString(L"IDS_CAM_POP_SAVING", tmpString);
10300 r = msgBox.Construct(L"", tmpString, MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
10301 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
10303 msgBox.ShowAndWait(modalResult);
10304 AppLogDebug("EXIT");
10308 CamcorderForm::SetScreenOverlayHelpTimer(void)
10310 AppLogDebug("ENTER");
10311 result r = E_SUCCESS;
10312 int overlayHelpEnable = 0;
10314 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
10315 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10317 AppLogDebug("SetScreenOverlayHelpTimer : overlayHelpEnable = %d", overlayHelpEnable);
10319 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_ENABLE)
10321 _pHelpCloseTimer = new (std::nothrow) Timer();
10322 _pHelpCloseTimer->Construct(*this);
10324 r = _pHelpCloseTimer->Start(MESSAGEBOX_DISPLAY_TIME_3_SEC);
10325 TryCatch(r == E_SUCCESS, , "Timer::start fail[%s]", GetErrorMessage(r));
10328 AppLogDebug("EXIT");
10332 delete _pHelpCloseTimer;
10333 _pHelpCloseTimer = null;
10335 AppLogDebug("EXIT - CATCH");
10340 CamcorderForm::DrawScreenOverlayHelp(void)
10342 AppLogDebug("ENTER");
10343 Bitmap* pBitmap = null;
10344 result r = E_SUCCESS;
10345 int overlayHelpEnable = 0;
10346 //AppResource* pAppResource = null;
10347 String ovelayHelpStr = L"";
10349 TryCatch(_pHelpGoToGallery != null, r = E_FAILURE, "_pHelpGoToGallery is null");
10350 TryCatch(_pHelpGoToGalleryText != null, r = E_FAILURE, "_pHelpGoToGalleryText is null");
10351 TryCatch(_pHelpSwitchCamera != null, r = E_FAILURE, "_pHelpSwitchCamera is null");
10352 TryCatch(_pHelpSwitchCameraText != null, r = E_FAILURE, "_pHelpSwitchCameraText is null");
10353 TryCatch(_pHelpQuickSetting != null, r = E_FAILURE, "_pHelpQuickSetting is null");
10354 TryCatch(_pHelpQuickSettingText != null, r = E_FAILURE, "_pHelpQuickSettingText is null");
10355 TryCatch(_pHelpRecordVideo != null, r = E_FAILURE, "_pHelpRecordVideo is null");
10356 TryCatch(_pHelpRecordVideoText != null, r = E_FAILURE, "_pHelpRecordVideoText is null");
10357 TryCatch(_pHelpShutter != null, r = E_FAILURE, "_pHelpShutter is null");
10358 TryCatch(_pHelpShutterText != null, r = E_FAILURE, "_pHelpShutterText is null");
10360 r = _pCameraPresentationModel->GetValue(OVERLAY_HELP_ENABLE, overlayHelpEnable);
10361 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
10363 AppLogDebug("DrawScreenOverlayHelp : overlayHelpEnable = %d", overlayHelpEnable);
10365 if (overlayHelpEnable == SCREEN_OVERLAY_HELP_DISABLE)
10367 _pHelpGoToGallery->SetShowState(false);
10368 _pHelpGoToGalleryText->SetShowState(false);
10369 _pHelpSwitchCamera->SetShowState(false);
10370 _pHelpSwitchCameraText->SetShowState(false);
10371 _pHelpQuickSetting->SetShowState(false);
10372 _pHelpQuickSettingText->SetShowState(false);
10373 _pHelpRecordVideo->SetShowState(false);
10374 _pHelpRecordVideoText->SetShowState(false);
10375 _pHelpShutter->SetShowState(false);
10376 _pHelpShutterText->SetShowState(false);
10380 //pAppResource = Application::GetInstance()->GetAppResource();
10381 //TryCatch(pAppResource != null, , "Failed to allocate memory for pAppResource");
10383 if (GetAppLaunchType() == APP_LAUNCH_TYPE_MAIN)
10385 _pHelpGoToGallery->SetShowState(true);
10386 //pAppResource->GetString(L"IDS_HELP_GOTO_GALLERY", ovelayHelpStr);
10387 ovelayHelpStr = L"GO to Gallery";
10388 _pHelpGoToGalleryText->SetText(ovelayHelpStr);
10389 _pHelpGoToGalleryText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10390 _pHelpGoToGalleryText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10391 _pHelpGoToGalleryText->SetShowState(true);
10394 _pHelpSwitchCamera->SetShowState(true);
10395 //pAppResource->GetString(L"IDS_HELP_SWITCH_CAMERA", ovelayHelpStr);
10396 ovelayHelpStr = L"Switch camera";
10397 _pHelpSwitchCameraText->SetText(ovelayHelpStr);
10398 _pHelpSwitchCameraText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10399 _pHelpSwitchCameraText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10400 _pHelpSwitchCameraText->SetShowState(true);
10402 _pHelpQuickSetting->SetShowState(true);
10403 //pAppResource->GetString(L"IDS_HELP_QUICK_SETTINGT", ovelayHelpStr);
10404 ovelayHelpStr = L"Quick Settings";
10405 _pHelpQuickSettingText->SetText(ovelayHelpStr);
10406 _pHelpQuickSettingText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10407 _pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10408 _pHelpQuickSettingText->SetShowState(true);
10410 _pHelpRecordVideo->SetShowState(true);
10411 //pAppResource->GetString(L"IDS_HELP_RECORD_VIDEO", ovelayHelpStr);
10412 ovelayHelpStr = L"Record video";
10413 _pHelpRecordVideoText->SetText(ovelayHelpStr);
10414 _pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10415 _pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10416 _pHelpRecordVideoText->SetShowState(true);
10418 _pHelpShutter->SetShowState(true);
10419 //pAppResource->GetString(L"IDS_HELP_RECORDER", ovelayHelpStr);
10420 ovelayHelpStr = L"Recorder";
10421 _pHelpShutterText->SetText(ovelayHelpStr);
10422 _pHelpShutterText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
10423 _pHelpShutterText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
10424 _pHelpShutterText->SetShowState(true);
10426 if (__dir == ORIENTATION_STATUS_PORTRAIT
10427 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10429 _pHelpGoToGalleryText->Invalidate(true);
10430 _pHelpSwitchCameraText->Invalidate(true);
10431 _pHelpQuickSettingText->Invalidate(true);
10432 _pHelpRecordVideoText->Invalidate(true);
10433 _pHelpShutterText->Invalidate(true);
10436 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
10437 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10439 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
10440 _pHelpGoToGallery->Invalidate(true);
10445 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
10446 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10448 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
10449 _pHelpSwitchCamera->Invalidate(true);
10454 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_10);
10455 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10457 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
10458 _pHelpQuickSetting->Invalidate(true);
10463 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_08);
10464 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10466 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
10467 _pHelpRecordVideo->Invalidate(true);
10472 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_05);
10473 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10475 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
10476 _pHelpShutter->Invalidate(true);
10481 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_12);
10482 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10489 _pHelpGoToGalleryText->Invalidate(true);
10490 _pHelpSwitchCameraText->Invalidate(true);
10491 _pHelpQuickSettingText->Invalidate(true);
10492 _pHelpRecordVideoText->Invalidate(true);
10493 _pHelpShutterText->Invalidate(true);
10495 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
10496 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10498 _pHelpGoToGallery->SetBackgroundBitmap(*pBitmap);
10499 _pHelpGoToGallery->Invalidate(true);
10504 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_01);
10505 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10507 _pHelpSwitchCamera->SetBackgroundBitmap(*pBitmap);
10508 _pHelpSwitchCamera->Invalidate(true);
10513 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_06);
10514 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10516 _pHelpQuickSetting->SetBackgroundBitmap(*pBitmap);
10517 _pHelpQuickSetting->Invalidate(true);
10522 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
10523 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10525 _pHelpRecordVideo->SetBackgroundBitmap(*pBitmap);
10526 _pHelpRecordVideo->Invalidate(true);
10531 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_03);
10532 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10534 _pHelpShutter->SetBackgroundBitmap(*pBitmap);
10535 _pHelpShutter->Invalidate(true);
10540 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_SCREEN_OVERLAY_HELP_04);
10541 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10548 AppLogDebug("EXIT");
10552 AppLogDebug("EXIT - CATCH");
10557 CamcorderForm::CheckCamcorderSettingLabel(void)
10559 AppLogDebug("ENTER");
10560 if (__pCamcorderSettingLable)
10562 result r = E_SUCCESS;
10564 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10565 _pAppTimer->Cancel();
10567 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
10568 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10570 if (_pListViewGeneralTabMainMenu)
10572 _pListViewGeneralTabMainMenu->SetShowState(false);
10575 if (_pListViewGeneralTabSubMenu)
10577 _pListViewGeneralTabSubMenu->SetShowState(false);
10580 MakeCamcoderTabSettingPopup();
10582 AppLogDebug("EXIT");
10586 CamcorderForm::CheckGeneralSettingLabel(void)
10588 AppLogDebug("ENTER");
10589 if(__pGeneralSettingLable)
10591 result r = E_SUCCESS;
10593 TryReturnVoid(_pAppTimer != null, "_pAppTimer is null");
10594 _pAppTimer->Cancel();
10596 r = _pAppTimer->Start(CAMCORDER_TIMER_LIMIT);
10597 TryReturnVoid(r == E_SUCCESS, "_pAppTimer start fail[%s]", GetErrorMessage(r));
10599 if (_pListViewCameraTabMainMenu)
10601 _pListViewCameraTabMainMenu->SetShowState(false);
10603 if (_pListViewCameraTabSubMenu)
10605 _pListViewCameraTabSubMenu->SetShowState(false);
10608 MakeGeneralTabSettingPopup();
10610 AppLogDebug("EXIT");
10614 CamcorderForm::DrawPauseRecord(void)
10616 AppLogDebug("ENTER");
10617 result r = E_SUCCESS;
10618 Bitmap* pBitmap = null;
10620 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_ICON_RECODING_PAUSE);
10621 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
10623 __pRecLabelRed->SetBackgroundBitmap(*pBitmap);
10625 __pRecLabelRed->SetShowState(true);
10626 __pRecLabelRed->Invalidate(true);
10628 __pRecLabelText->SetShowState(false);
10629 __pRecLabelText->Invalidate(true);
10634 AppLogDebug("EXIT");
10638 AppLogDebug("EXIT - CATCH");
10643 CamcorderForm::DrawRecord(bool isRecord)
10645 AppLogDebug("ENTER");
10646 result r = E_SUCCESS;
10647 Bitmap* pBitmap = null;
10650 TryCatch(__pRecLabelRed != null, r = E_SYSTEM, "__pRecLabelRed is null");
10651 TryCatch(__pRecLabelText != null, r = E_SYSTEM, "__pRecLabelText is null");
10652 TryCatch(__pBatteryState != null, r = E_SYSTEM, "__pBatteryState is null");
10656 timeCnt = __recordTimeCount;
10658 if (_isRecording == true)
10660 if (IsControlAlwaysOnTop(__pRecLabelRed) == false)
10662 AppLogDebug("IsControlAlwaysOnTop __pRecLabelRed");
10663 SetControlAlwaysOnTop(*__pRecLabelRed, true);
10666 if (IsControlAlwaysOnTop(__pRecLabelText) == false)
10668 AppLogDebug("IsControlAlwaysOnTop __pRecLabelText");
10669 SetControlAlwaysOnTop(*__pRecLabelText, true);
10672 if (((++timeCnt) % FRAME_RATE) == INDEX_UNIT_ZERO)
10674 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMCODER_ICON_RECODING);
10675 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
10677 __pRecLabelRed->SetBackgroundBitmap(*pBitmap);
10678 __pRecLabelRed->SetShowState(true);
10679 __pRecLabelRed->Invalidate(true);
10686 __pRecLabelRed->SetShowState(false);
10687 __pRecLabelRed->Invalidate(true);
10690 __pRecLabelText->SetShowState(true);
10691 __pRecLabelText->Invalidate(true);
10693 __pBatteryState->SetShowState(false);
10694 __pBatteryState->Invalidate(true);
10699 __pRecLabelRed->SetShowState(false);
10700 __pRecLabelRed->Invalidate(true);
10702 __pRecLabelText->SetShowState(false);
10703 __pRecLabelText->Invalidate(true);
10705 __pBatteryState->SetShowState(true);
10706 __pBatteryState->Invalidate(true);
10709 AppLogDebug("EXIT");
10713 AppLogDebug("EXIT - CATCH");
10718 CamcorderForm::InitElapsedTimeLable(void)
10720 AppLogDebug("ENTER");
10721 result r = E_SUCCESS;
10723 String endTime = L"";
10724 String maxTime = L"";
10725 String recSize = L"";
10727 if (_isRecording == true || _isRecordingPause == true)
10729 TryCatch(__pElapsedTimeLable != null, r = E_FAILURE, "__pElapsedTimeLable is null");
10730 TryCatch(__pElapsedTimeMaxLable != null, r = E_FAILURE, "__pElapsedTimeMaxLable is null");
10731 TryCatch(__pElapsedRecordSizeLable != null, r = E_FAILURE, "__pElapsedRecordSizeLable is null");
10732 TryCatch(__pRecLabelRed != null, r = E_FAILURE, "__pRecLabelRed is null");
10733 TryCatch(__pRecLabelText != null, r = E_FAILURE, "__pRecLabelText is null");
10735 r = endTime.Append(INIT_REC_TIME);
10736 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10738 r = maxTime.Append(INIT_MAX_REC_TIME);
10739 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10741 r = recSize.Append(INIT_REC_SIZE);
10742 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10744 __pElapsedTimeLable->SetText(endTime);
10745 __pElapsedTimeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10747 __pElapsedTimeMaxLable->SetText(maxTime);
10748 __pElapsedTimeMaxLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10750 __pElapsedRecordSizeLable->SetText(recSize);
10751 __pElapsedRecordSizeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10753 __pElapsedTimeLable->SetShowState(false);
10754 __pElapsedTimeLable->Invalidate(true);
10756 __pElapsedTimeMaxLable->SetShowState(false);
10757 __pElapsedTimeMaxLable->Invalidate(true);
10759 __pElapsedRecordSizeLable->SetShowState(false);
10760 __pElapsedRecordSizeLable->Invalidate(true);
10762 __pRecLabelRed->SetShowState(false);
10763 __pRecLabelRed->Invalidate(true);
10765 __pRecLabelText->SetShowState(false);
10766 __pRecLabelText->Invalidate(true);
10769 AppLogDebug("EXIT");
10777 CamcorderForm::DrawRecordTimer(void)
10779 AppLogDebug("ENTER");
10780 result r = E_SUCCESS;
10781 String endTime = L"";
10782 String maxTime = L"";
10783 String recSize = L"";
10791 long recordedSize = 0;
10792 int recSizeMB = 0 ;
10794 TryCatch(__pElapsedTimeLable != null, r = E_SYSTEM, "__pElapsedTimeLable is null");
10795 TryCatch(__pElapsedTimeMaxLable != null, r = E_SYSTEM, "__pElapsedTimeMaxLable is null");
10796 TryCatch(__pElapsedRecordSizeLable != null, r = E_SYSTEM, "__pElapsedRecordSizeLable is null");
10798 timeCnt = __recordTimeCount;
10799 recordedSize = _pCameraPresentationModel->GetRecordingSize();
10800 recSizeMB = recordedSize / DIVIDE_THOUSAND;
10802 recMin = (timeCnt % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE;
10803 recSec = timeCnt % SECONDS_PER_MINUTE;
10805 if (__recordingMaxTime > INDEX_UNIT_ZERO)
10807 if (__isCapacityBelow)
10809 maxMin = UNIT_TWELVE;
10810 maxSec = UNIT_ZEROTOZERO;
10814 __recordingMaxTime = __recordingMaxTime / DIVIDE_THOUSAND;
10815 maxHour =__recordingMaxTime / SECONDS_PER_HOUR;
10816 maxMin = maxHour * SECONDS_PER_MINUTE;
10817 maxSec = __recordingMaxTime % SECONDS_PER_MINUTE;
10821 if (recMin < UNIT_TEN)
10823 endTime.Append(L"0");
10826 r = endTime.Append(recMin);
10827 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10829 r = endTime.Append(L"");
10830 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10832 r = endTime.Append(L":");
10833 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10835 if (recSec < UNIT_TEN)
10837 r = endTime.Append(L"0");
10838 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10841 r = endTime.Append(recSec);
10842 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10844 r = endTime.Append("");
10845 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10847 r = endTime.Append(L"/");
10848 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10850 r = maxTime.Append(maxMin);
10851 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10853 r = maxTime.Append(L"");
10854 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10856 r = maxTime.Append(L":");
10857 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10859 if (maxSec < UNIT_TEN)
10861 r = maxTime.Append(L"0");
10862 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10865 r = maxTime.Append(maxSec);
10866 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10868 if (recSizeMB < UNIT_TEN)
10870 r = recSize.Append(L"000");
10871 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10873 else if (recSizeMB < UNIT_HUNDRED)
10875 r = recSize.Append(L"00");
10876 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10878 else if (recSizeMB < UNIT_THOUSAND)
10880 r = recSize.Append(L"0");
10881 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10884 r = recSize.Append(recSizeMB);
10885 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10887 r = recSize.Append(L"M");
10888 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10890 __pElapsedTimeLable->SetText(endTime);
10891 __pElapsedTimeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10892 __pElapsedTimeMaxLable->SetText(maxTime);
10893 __pElapsedTimeMaxLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10894 __pElapsedRecordSizeLable->SetText(recSize);
10895 __pElapsedRecordSizeLable->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
10897 if (_isRecording == true)
10899 if (IsControlAlwaysOnTop(__pElapsedTimeLable) == false)
10901 AppLogDebug("IsControlAlwaysOnTop __pElapsedTimeLable");
10902 SetControlAlwaysOnTop(*__pElapsedTimeLable, true);
10905 if (IsControlAlwaysOnTop(__pElapsedTimeMaxLable) == false)
10907 AppLogDebug("IsControlAlwaysOnTop __pElapsedTimeMaxLable");
10908 SetControlAlwaysOnTop(*__pElapsedTimeMaxLable, true);
10911 if (IsControlAlwaysOnTop(__pElapsedRecordSizeLable) == false)
10913 AppLogDebug("IsControlAlwaysOnTop __pElapsedRecordSizeLable");
10914 SetControlAlwaysOnTop(*__pElapsedRecordSizeLable, true);
10916 __pElapsedTimeLable->SetShowState(true);
10917 __pElapsedTimeMaxLable->SetShowState(true);
10918 __pElapsedRecordSizeLable->SetShowState(true);
10922 r = endTime.Append(INIT_REC_TIME);
10923 TryCatch(r == E_SUCCESS, , "endTime::Append() fail[%s]", GetErrorMessage(r));
10925 r = maxTime.Append(INIT_MAX_REC_TIME);
10926 TryCatch(r == E_SUCCESS, , "maxTime::Append() fail[%s]", GetErrorMessage(r));
10928 r = recSize.Append(INIT_REC_SIZE);
10929 TryCatch(r == E_SUCCESS, , "recSize::Append() fail[%s]", GetErrorMessage(r));
10931 __pElapsedTimeLable->SetShowState(false);
10932 __pElapsedTimeMaxLable->SetShowState(false);
10933 __pElapsedRecordSizeLable->SetShowState(false);
10936 __pElapsedTimeLable->Invalidate(true);
10937 __pElapsedTimeMaxLable->Invalidate(true);
10938 __pElapsedRecordSizeLable->Invalidate(true);
10940 AppLogDebug("EXIT");
10948 CamcorderForm::DrawBatteryLevelFull(void)
10950 AppLogDebug("ENTER");
10951 Bitmap* pBitmap = null;
10952 result r = E_SUCCESS;
10954 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
10956 if (__dir == ORIENTATION_STATUS_PORTRAIT
10957 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
10959 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
10963 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
10966 _batteryStatus = BATTERY_STATE_20;
10968 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
10969 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
10971 __pBatteryState->SetBackgroundBitmap(*pBitmap);
10972 __pBatteryState->Invalidate(true);
10977 AppLogDebug("EXIT");
10981 AppLogDebug("EXIT - CATCH");
10986 CamcorderForm::CheckBatteryStatus(void)
10988 AppLogDebug("ENTER");
10989 Bitmap* pBitmap = null;
10990 result r = E_SUCCESS;
10991 int batteryLevel = 0;
10992 bool isCharging = false;
10993 BatteryLevel currentBatteryLevel;
10995 Battery::IsCharging(isCharging);
10996 Battery::GetCurrentLevelInPercentage(batteryLevel);
10997 currentBatteryLevel = _pCameraPresentationModel->GetBatteryLevel();
10999 AppLogDebug("batteryLevel = %d", batteryLevel);
11001 TryCatch(__pBatteryState != null, r = E_FAILURE, "__pBatteryState is null");
11003 if (__dir == ORIENTATION_STATUS_PORTRAIT
11004 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
11006 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_PORTRAIT, Y_INDICATOR_BATTERY_PORTRAIT);
11010 __pBatteryState->SetPosition(X_INDICATOR_BATTERY_LANDSCAPE, Y_INDICATOR_BATTERY_LANDSCAPE);
11015 _batteryStatus = GetCurrentBatteryState();
11016 AppLogDebug("_batteryStatus [%d]", _batteryStatus);
11018 int batteryType = GetCurrentBatteryImage();
11020 AppLogDebug("batteryType = %d", batteryType);
11022 pBitmap = ResourceManager::GetBitmapN(batteryType);
11024 StartInitChargingTimer();
11029 if (currentBatteryLevel == BATTERY_CRITICAL)
11031 if (__setTimerInterval)
11033 AppLogDebug("__setTimerInterval");
11034 CancelTimerIntervalRecord();
11038 if (batteryLevel > BATT_LEVEL_VALUE_95 && batteryLevel <= BATT_LEVEL_VALUE_100)
11040 _batteryStatus = BATTERY_STATE_20;
11042 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_20);
11044 else if (batteryLevel > BATT_LEVEL_VALUE_90 && batteryLevel <= BATT_LEVEL_VALUE_95)
11046 _batteryStatus = BATTERY_STATE_19;
11048 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_19);
11050 else if (batteryLevel > BATT_LEVEL_VALUE_85 && batteryLevel <= BATT_LEVEL_VALUE_90)
11052 _batteryStatus = BATTERY_STATE_18;
11054 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_18);
11056 else if (batteryLevel > BATT_LEVEL_VALUE_80 && batteryLevel <= BATT_LEVEL_VALUE_85)
11058 _batteryStatus = BATTERY_STATE_17;
11060 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_17);
11062 else if (batteryLevel > BATT_LEVEL_VALUE_75 && batteryLevel <= BATT_LEVEL_VALUE_80)
11064 _batteryStatus = BATTERY_STATE_16;
11066 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_16);
11068 else if (batteryLevel > BATT_LEVEL_VALUE_70 && batteryLevel <= BATT_LEVEL_VALUE_75)
11070 _batteryStatus = BATTERY_STATE_15;
11072 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_15);
11074 else if (batteryLevel > BATT_LEVEL_VALUE_65 && batteryLevel <= BATT_LEVEL_VALUE_70)
11076 _batteryStatus = BATTERY_STATE_14;
11078 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_14);
11080 else if (batteryLevel > BATT_LEVEL_VALUE_60 && batteryLevel <= BATT_LEVEL_VALUE_65)
11082 _batteryStatus = BATTERY_STATE_13;
11084 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_13);
11086 else if (batteryLevel > BATT_LEVEL_VALUE_55 && batteryLevel <= BATT_LEVEL_VALUE_60)
11088 _batteryStatus = BATTERY_STATE_12;
11090 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_12);
11092 else if (batteryLevel > BATT_LEVEL_VALUE_50 && batteryLevel <= BATT_LEVEL_VALUE_55)
11094 _batteryStatus = BATTERY_STATE_11;
11096 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_11);
11098 else if (batteryLevel > BATT_LEVEL_VALUE_45 && batteryLevel <= BATT_LEVEL_VALUE_50)
11100 _batteryStatus = BATTERY_STATE_10;
11102 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_10);
11104 else if (batteryLevel > BATT_LEVEL_VALUE_40 && batteryLevel <= BATT_LEVEL_VALUE_45)
11106 _batteryStatus = BATTERY_STATE_9;
11108 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_09);
11110 else if (batteryLevel > BATT_LEVEL_VALUE_35 && batteryLevel <= BATT_LEVEL_VALUE_40)
11112 _batteryStatus = BATTERY_STATE_8;
11114 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_08);
11116 else if (batteryLevel > BATT_LEVEL_VALUE_30 && batteryLevel <= BATT_LEVEL_VALUE_35)
11118 _batteryStatus = BATTERY_STATE_7;
11120 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_07);
11122 else if (batteryLevel > BATT_LEVEL_VALUE_25 && batteryLevel <= BATT_LEVEL_VALUE_30)
11124 _batteryStatus = BATTERY_STATE_6;
11126 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_06);
11128 else if (batteryLevel > BATT_LEVEL_VALUE_20 && batteryLevel <= BATT_LEVEL_VALUE_25)
11130 _batteryStatus = BATTERY_STATE_5;
11132 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_05);
11134 else if (batteryLevel > BATT_LEVEL_VALUE_15 && batteryLevel <= BATT_LEVEL_VALUE_20)
11136 _batteryStatus = BATTERY_STATE_4;
11138 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_04);
11140 else if (batteryLevel > BATT_LEVEL_VALUE_10 && batteryLevel <= BATT_LEVEL_VALUE_15)
11142 _batteryStatus = BATTERY_STATE_3;
11144 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_03);
11146 else if (batteryLevel > BATT_LEVEL_VALUE_05 && batteryLevel <= BATT_LEVEL_VALUE_10)
11148 _batteryStatus = BATTERY_STATE_2;
11150 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_02);
11152 else if (batteryLevel > BATT_LEVEL_VALUE_00 && batteryLevel <= BATT_LEVEL_VALUE_05)
11154 _batteryStatus = BATTERY_STATE_1;
11156 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_01);
11158 else if (batteryLevel == BATT_LEVEL_VALUE_00)
11160 _batteryStatus = BATTERY_STATE_0;
11162 pBitmap = ResourceManager::GetBitmapN(RESOURCE_IC_CAMERA_BATTERY_00);
11165 TryCatch(pBitmap != null, r = E_FAILURE, "pBitmap is null");
11167 AppLogDebug("_batteryStatus = %d", _batteryStatus);
11169 __pBatteryState->SetBackgroundBitmap(*pBitmap);
11170 __pBatteryState->Invalidate(true);
11175 AppLogDebug("ENTER");
11183 CamcorderForm::MakeCamcoderTabMenuString(void)
11185 AppLogDebug("ENTER");
11188 result r = E_SUCCESS;
11189 AppResource* pAppResource = null;
11191 if (__pSettingMenuString == null)
11193 pAppResource = Application::GetInstance()->GetAppResource();
11194 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
11196 __pSettingMenuString = new (std::nothrow) String*[MAX_SETTING_MENU_COUNT];
11198 TryCatch(__pSettingMenuString != null, r = E_FAILURE, "__pSettingMenuString is null");
11200 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
11202 __pSettingMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
11203 TryCatch(__pSettingMenuString[idx] != null, r = E_FAILURE, "__pSettingMenuString[%d] is null", idx);
11206 pAppResource->GetString(IDS_CAM_BODY_RESOLUTION, tmpString);
11207 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE][MENU_IDX_01] = tmpString;
11209 pAppResource->GetString(IDS_RECORDING_MODE, tmpString);
11210 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_01] = tmpString;
11211 pAppResource->GetString(IDS_RECORDING_MODE_NORMAL, tmpString);
11212 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_02] = tmpString;
11213 __pSettingMenuString[CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE][MENU_IDX_03] = IDS_RECORDING_MODE_SHARING;
11216 AppLogDebug("EXIT");
11220 if (__pSettingMenuString)
11222 for (idx = 0; idx < MAX_SETTING_MENU_COUNT; ++idx)
11224 if (__pSettingMenuString[idx])
11226 delete [] __pSettingMenuString[idx];
11227 __pSettingMenuString[idx] = null;
11235 delete __pSettingMenuString;
11236 __pSettingMenuString = null;
11243 CamcorderForm::RunStartPreviewThread(void)
11245 AppLogDebug("ENTER");
11246 result r = E_SUCCESS;
11248 r = __pOverlayPanel->GetBackgroundBufferInfo(__bufferInfo);
11249 TryCatch(r == E_SUCCESS, , "GetBackgroundBufferInfo fail[%s]", GetErrorMessage(r));
11251 __pCameraStarterThread = CameraStarterThread::GetInstance();
11252 TryCatch(__pCameraStarterThread != null, , "__pCameraStarterThread is null");
11254 r = __pCameraStarterThread->SetBufferinfo(&__bufferInfo);
11255 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
11257 r = __pCameraStarterThread->Start();
11258 TryCatch(r == E_SUCCESS, , "SetBufferinfo fail[%s]", GetErrorMessage(r));
11260 AppLogDebug("EXIT");
11264 ShowCameraFailPopup();
11266 AppLogDebug("EXIT - CATCH");
11271 CamcorderForm::CreateCamcorderTabSubMenuItem(int index, int itemWidth)
11273 AppLogDebug("ENTER");
11274 CustomItem* pItem = null;
11275 result r = E_SUCCESS;
11277 Bitmap* pBitmap = null;
11278 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11279 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11280 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11281 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11282 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11283 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11284 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
11285 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11288 pItem = new (std::nothrow) CustomItem();
11289 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11291 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11292 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11294 switch (GetCamcorderTabSettingSubMenuMode())
11296 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE:
11298 int selfPortraitEnable = 0;
11300 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11301 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11303 if (__pRecordingResolutionList)
11307 if (__pRecordingResolutionList->GetCount() > index)
11309 if (index == __pRecordingResolutionIndex)
11311 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11315 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11318 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11319 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11325 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_640X480);
11326 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11328 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11329 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11334 str = *(static_cast<String*>(__pRecordingResolutionList->GetAt(index)));
11337 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);
11338 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11344 case CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE:
11353 AppLogDebug("EXIT");
11363 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11368 CamcorderForm::CreateCamcorderTabMainMenuItem(int index, int itemWidth)
11370 AppLogDebug("ENTER");
11371 CustomItem* pItem = null;
11372 result r = E_SUCCESS;
11376 int camcorderResolutionCount = 0;
11377 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11378 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11380 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11381 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11382 int selfPortraitEnable = 0;
11383 String strTmp = L"";
11385 String arrRegStringSupport[2] =
11387 RECORDING_RESOLUTION,
11391 pItem = new (std::nothrow) CustomItem();
11392 TryCatch(pItem != null,,"Failed to allocate memory for CustomItem");
11394 r = pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11395 TryCatch(r == E_SUCCESS,,"Failed to construct CustomItem");
11397 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11398 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11400 elementId = (index * MENU_TWO_ELEMENT);
11401 strTmp = __pSettingMenuString[index][0];
11404 if (strTmp.GetLength())
11406 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11408 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11410 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
11411 if (r == E_SUCCESS)
11413 if (__pRecordingResolutionList != null)
11415 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11418 if (camcorderResolutionCount > 1)
11420 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11424 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);
11426 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11430 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);
11431 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11436 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11438 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);
11439 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11443 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11444 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11450 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11452 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
11453 if (r == E_SUCCESS)
11455 if (__pRecordingResolutionList != null)
11457 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11460 if (camcorderResolutionCount > 1)
11462 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11466 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);
11468 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11472 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);
11473 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11478 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11480 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);
11481 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11485 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11486 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11492 if (index < GetCamcorderTabSettingMainMenuCount() - INDEX_UNIT_ONE)
11494 int storageType = STORAGE_TYPE_PHONE;
11496 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11497 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11499 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11501 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11502 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11503 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11506 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11512 r = _pCameraPresentationModel->GetValue(arrRegStringSupport[index], regVal);
11513 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11516 AppLogDebug("Setting Main Menu");
11517 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11518 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11520 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11522 if (__pRecordingResolutionList)
11524 AppLogDebug("Setting GetCount = %d", __pRecordingResolutionList->GetCount());
11526 int idx = __pRecordingResolutionList->GetCount() - INDEX_UNIT_ONE;
11532 if (__pRecordingResolutionIndex == INDEX_UNIT_ONE)
11534 __pRecordingResolutionIndex = __pRecordingResolutionIndex - INDEX_UNIT_ONE;
11536 strTmp = *(static_cast<String*>(__pRecordingResolutionList->GetAt(__pRecordingResolutionIndex)));
11540 strTmp = *(static_cast<String*>(__pRecordingResolutionList->GetAt(__pRecordingResolutionIndex)));
11547 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11552 if (strTmp.GetLength())
11554 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11556 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11558 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_RECORDING_RESOLUTION);
11559 if (r == E_SUCCESS)
11562 if (__pRecordingResolutionList != null)
11564 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11567 if (camcorderResolutionCount > 1)
11569 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11573 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);
11575 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11579 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);
11580 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11585 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11586 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11591 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_RESOLUTION_MODE)
11593 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_RECORDING_RESOLUTION);
11594 if (r == E_SUCCESS)
11596 if (__pRecordingResolutionList != null)
11598 camcorderResolutionCount = __pRecordingResolutionList->GetCount();
11601 if (camcorderResolutionCount > 1)
11603 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_RESOLUTION_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11607 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);
11609 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11613 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);
11614 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11619 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11620 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11624 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11625 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11630 if (index == CAMCORDER_SUB_MENU_CONTENT_RECORDING_MODE)
11634 r = _pCameraPresentationModel->GetValue(RECORDING_MODE, regVal);
11635 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11637 strTmp = __pSettingMenuString[index][regVal + INDEX_UNIT_ONE];
11641 if (strTmp.GetLength())
11643 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, COLOR_SETTING_MENU_VALUE_DISABLE, true);
11644 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11646 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11647 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11652 AppLogDebug("EXIT");
11659 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11664 CamcorderForm::CreateGeneralTabMainMenuItem(int index, int itemWidth)
11666 AppLogDebug("ENTER");
11667 CustomItem* pItem = null;
11668 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON, Y_SETTING_SUBMENU_RADIO_ICON,
11669 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11670 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON, Y_SETTING_SUBMENU_ICON,
11671 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11672 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11673 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11674 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11675 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11677 result r = E_SUCCESS;
11680 String strTmp = L"";
11681 int selfPortraitEnable = 0;
11682 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11683 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11685 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11686 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11687 String arrRegStringSupporExposure[] =
11692 OVERLAY_HELP_ENABLE,
11695 pItem = new (std::nothrow) CustomItem();
11696 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11698 pItem->Construct(Dimension(itemWidth, H_SETTING_MENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11699 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11701 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11702 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11704 elementId = (index * MENU_TWO_ELEMENT);
11705 strTmp = __pSettingGeneralMenuString[index][0];
11708 r = pItem->AddElement(rectContents, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11709 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11711 AppLogDebug("index = %d ", index);
11712 AppLogDebug("GetGeneralTabSettingMainMenuCount = %d ", GetGeneralTabSettingMainMenuCount());
11714 if (index < (GetGeneralTabSettingMainMenuCount() - INDEX_UNIT_ONE))
11716 bool value = false;
11717 int storageType = STORAGE_TYPE_PHONE;
11719 _pCameraPresentationModel->GetValue(STORAGE_TYPE, storageType);
11721 if (storageType == STORAGE_TYPE_MEMORYCARD && _pCameraPresentationModel->IsStorageCardMounted() == false)
11723 r = _pCameraPresentationModel->SetValue(STORAGE_TYPE, STORAGE_TYPE_PHONE);
11724 TryCatch(r == E_SUCCESS, , "SetValue() fail[%s]", GetErrorMessage(r));
11725 _pCameraPresentationModel->SetStorageCardState(CameraPresentationModel::STORAGE_CARD_STATE_UNMOUNT);
11728 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11730 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_EXPOSURE, value);
11734 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_EXPOSURE, value);
11737 if (value == true && r == E_SUCCESS)
11739 r = _pCameraPresentationModel->GetValue(arrRegStringSupporExposure[index], regVal);
11740 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11744 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_PRIMARY)
11746 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_BRIGHTNESS, value);
11750 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_SUPPORT_BRIGHTNESS, value);
11753 r = _pCameraPresentationModel->GetValue(arrRegStringSupporExposure[index], regVal);
11754 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11757 AppLogDebug("Setting Main Menu");
11758 AppLogDebug("%ls[%d]", strTmp.GetPointer(), regVal);
11759 AppLogDebug("Err = %s", GetErrorMessage(GetLastResult()));
11761 strTmp = __pSettingGeneralMenuString[index][regVal + INDEX_UNIT_ONE];
11765 if (strTmp.GetLength())
11767 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11769 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11770 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11774 r = pItem->AddElement(rectContentsValue, elementId, strTmp, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, COLOR_SETTING_MENU_VAULE, true);
11775 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11778 r = pItem->SetElementTextHorizontalAlignment(elementId, ALIGNMENT_CENTER);
11779 TryCatch(r == E_SUCCESS, , "CustomItem::SetElementTextHorizontalAlignment() fail[%s]", GetErrorMessage(r));
11783 AppLogDebug("EXIT");
11790 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11795 CamcorderForm::CreateFlashMainMenuItem(int index, int itemWidth)
11797 AppLogDebug("ENTER");
11798 CustomItem* pItem = null;
11799 result r = E_SUCCESS;
11802 Bitmap* pBitmap = null;
11803 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_FLASH_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11804 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11805 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11806 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11808 String listName = L"";
11809 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11810 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11811 ResourceId resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11812 AppResource* pAppResource = null;
11813 String tmpString = L"";
11814 bool value = false;
11815 int selfPortraitEnable = 0;
11818 String arrString[] =
11825 pItem = new (std::nothrow) CustomItem();
11826 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
11828 r = pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
11829 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
11831 pAppResource = Application::GetInstance()->GetAppResource();
11832 TryCatch(pAppResource != null, , "pAppResource is null");
11834 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
11835 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
11837 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
11839 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11841 r = _pCameraPresentationModel->GetValue(FLASH_MODE_SECONDARY, flashMode);
11842 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11844 if (flashMode != FLASH_MODE_OFF)
11846 r = _pCameraPresentationModel->SetValue(FLASH_MODE_SECONDARY, FLASH_MODE_OFF);
11847 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11852 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11854 if (value == true && r == E_SUCCESS)
11856 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
11860 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
11862 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, flashMode);
11863 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11865 if (flashMode != FLASH_MODE_OFF)
11867 r = _pCameraPresentationModel->SetValue(FLASH_MODE_PRIMARY, FLASH_MODE_OFF);
11868 TryCatch(r == E_SUCCESS, , "SetValue Reg Fail[%s]", GetErrorMessage(r));
11873 r = _pCameraPresentationModel->GetValue(FLASH_MODE_PRIMARY, regVal);
11874 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
11878 case SUBMENU_MODE_OFF:
11880 resId = RESOURCE_ID_CAMERA_MODE_FLASH_OFF_NOR;
11884 case SUBMENU_MODE_ON:
11886 resId = RESOURCE_ID_CAMERA_MODE_FLASH_ON_NOR;
11890 case SUBMENU_MODE_AUTO:
11892 resId = RESOURCE_ID_CAMERA_MODE_FLASH_AUTO_NOR;
11900 pAppResource->GetString(arrString[index], tmpString);
11902 if (index == regVal)
11904 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
11908 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
11910 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11912 elementId = (index * MENU_THREE_ELEMENT);
11915 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
11916 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11922 pBitmap = ResourceManager::GetBitmapN(resId);
11923 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
11925 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
11926 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11933 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_SUPPORT_FLASH, value);
11935 if (value == true && r == E_SUCCESS)
11937 r = pItem->AddElement(rectThreeTextItem, elementId, tmpString, FONT_SIZE_SETTING_MENU_ITEM, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, COLOR_SETTING_MENU_TITLE, true);
11938 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11942 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);
11943 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
11946 AppLogDebug("EXIT");
11956 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
11961 CamcorderForm::CreateWhiteBalanceItem(int index, int itemWidth)
11963 AppLogDebug("ENTER");
11964 CustomItem* pItem = null;
11965 Bitmap* pBitmap = null;
11966 Rectangle rectRadioIcon = Rectangle(X_WHITE_BALANCE_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
11967 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
11968 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
11969 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
11971 String listName = L"";
11972 Rectangle rectContents = Rectangle(X_SETTING_MENU_CONTESTS, Y_SETTING_MENU_CONTESTS,
11973 W_SETTING_MENU_CONTESTS, H_SETTING_MENU_CONTESTS);
11975 Rectangle rectContentsValue = Rectangle(X_SETTING_MENU_CONTENTS_VALUE, Y_SETTING_MENU_CONTENTS_VALUE,
11976 W_SETTING_MENU_CONTENTS_VALUE, H_SETTING_MENU_CONTENTS_VALUE);
11978 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
11979 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
11980 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_FLASH_SETTING_SUBMENU_3TEXT_ITEM, Y_SETTING_SUBMENU_3TEXT_ITEM,
11981 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
11982 AppResource* pAppResource = null;
11984 result r = E_SUCCESS;
11987 int selfPortraitEnable = 0;
11988 ResourceId resId = RESOURCE_ID_WB_AWB;
11990 String arrString[] =
11993 IDS_CAM_BODY_WHITEBALANCE_INCANDESCENT,
11994 IDS_CAM_BODY_FLUORESCENT,
11995 IDS_CAM_BODY_DAYLIGHT,
11996 IDS_CAM_BODY_CLOUDY,
11999 pItem = new (std::nothrow) CustomItem();
12000 TryCatch(pItem != null, , "Failed to allocate memory for CustomItem");
12002 pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12003 TryCatch(r == E_SUCCESS, , "Failed to construct CustomItem");
12005 pAppResource = Application::GetInstance()->GetAppResource();
12006 TryCatch(pAppResource != null,,"pAppResource is null");
12008 r = _pCameraPresentationModel->GetValue(SELF_PORTRAIT_ENABLE, selfPortraitEnable);
12009 TryCatch(r == E_SUCCESS, , "GetValue Reg Fail[%s]", GetErrorMessage(r));
12011 if (selfPortraitEnable == CameraPresentationModel::CAM_SELF_PORTRAIT_MODE_SECONDARY)
12013 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_SECONDARY_WHITE_BALANCE);
12015 if (r == E_SUCCESS)
12017 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12021 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12023 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_SECONDARY, 0);
12024 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
12026 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_SECONDARY, regVal);
12027 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12031 r = _pCameraPresentationModel->GetMediaCapability(CAMERA_PRIMARY_WHITE_BALANCE);
12033 if (r == E_SUCCESS)
12035 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is support");
12039 AppLogDebug("CAMERA_PRIMARY_SUPPORT_FLASH is not support");
12041 r =_pCameraPresentationModel->SetValue(WHITE_BALANCE_TYPE_PRIMARY, 0);
12042 TryCatch(r == E_SUCCESS, , "Reg SetValue() fail[%s]", GetErrorMessage(r));
12044 r = _pCameraPresentationModel->GetValue(WHITE_BALANCE_TYPE_PRIMARY, regVal);
12045 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12048 AppLogDebug("regVal = %d", regVal);
12054 resId = RESOURCE_ID_WB_AWB;
12058 case MODE_WHITEBALANCE_INCANDESCENT:
12060 resId = RESOURCE_ID_WB_DAYLIGHT;
12064 case MODE_FLUORESCENT:
12066 resId = RESOURCE_ID_WB_CLOUDY;
12070 case MODE_DAYLIGHT:
12072 resId = RESOURCE_ID_WB_FLUORESCENT_H;
12078 resId = RESOURCE_ID_WB_FLUORESCENT_L;
12086 pAppResource->GetString(arrString[index], tmpString);
12088 if (index == regVal)
12090 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12094 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12096 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12098 elementId = (index * MENU_THREE_ELEMENT);
12100 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12101 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12107 pBitmap = ResourceManager::GetBitmapN(resId);
12108 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12110 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12111 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12117 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);
12118 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12120 AppLogDebug("EXIT");
12130 AppLogDebug("EXIT - CATCH : pItem is null or not SettingMainMenu/FlashMenu");
12135 CamcorderForm::MakeSettingPopupTab(bool isShow)
12137 AppLogDebug("ENTER");
12140 if (__pCamcoderSetting)
12142 __pCamcoderSetting->SetShowState(true);
12143 __pCamcoderSetting->Invalidate(true);
12146 if (__pCamcorderSettingLable)
12148 __pCamcorderSettingLable->SetShowState(true);
12149 __pCamcorderSettingLable->Invalidate(true);
12152 if (__pGeneralSetting)
12154 __pGeneralSetting->SetShowState(true);
12155 __pGeneralSetting->Invalidate(true);
12158 if (__pGeneralSettingLable)
12160 __pGeneralSettingLable->SetShowState(true);
12161 __pGeneralSettingLable->Invalidate(true);
12166 if (__pCamcoderSetting)
12168 __pCamcoderSetting->SetShowState(false);
12169 __pCamcoderSetting->Invalidate(true);
12172 if (__pCamcorderSettingLable)
12174 __pCamcorderSettingLable->SetShowState(false);
12175 __pCamcorderSettingLable->Invalidate(true);
12178 if (__pGeneralSetting)
12180 __pGeneralSetting->SetShowState(false);
12181 __pGeneralSetting->Invalidate(true);
12184 if (__pGeneralSettingLable)
12186 __pGeneralSettingLable->SetShowState(false);
12187 __pGeneralSettingLable->Invalidate(true);
12190 AppLogDebug("EXIT");
12194 CamcorderForm::MakeCamcoderTabSettingPopup(void)
12196 AppLogDebug("ENTER");
12197 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
12198 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12201 MakeRecordingResolutionList(true);
12205 _pCameraInfoPanel->SetDrawExposure(false);
12207 if (__dir == ORIENTATION_STATUS_PORTRAIT
12208 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
12210 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
12211 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT - H_SETTING_MENU_LIST_MARGIN);
12215 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
12216 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE - H_SETTING_MENU_LIST_MARGIN);
12219 MakeCamcoderTabMenuString();
12220 SetCamcorderTabSettingMainMenuCount(MAX_SETTING_MENU_COUNT);
12221 MakeSettingPopupTab(true);
12223 _pCameraInfoPanel->SetDrawSettingMenuBackground(true);
12224 _pCameraInfoPanel->Invalidate(true);
12225 if (_pListViewCameraTabMainMenu == null)
12227 _pListViewCameraTabMainMenu = new (std::nothrow) ListView();
12228 _pListViewCameraTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
12230 _pListViewCameraTabMainMenu->SetItemProvider(*this);
12231 _pListViewCameraTabMainMenu->AddListViewItemEventListener(*this);
12232 _pListViewCameraTabMainMenu->SetName(IDS_MENU_SETTING_MAIN_MENU_NAME);
12236 _pListViewCameraTabMainMenu->SetShowState(true);
12237 _pListViewCameraTabMainMenu->SetBounds(rectList);
12239 _pCameraInfoPanel->AddControl(_pListViewCameraTabMainMenu);
12241 _pListViewCameraTabMainMenu->UpdateList();
12242 AppLogDebug("EXIT");
12246 CamcorderForm::MakeGeneralTabSettingPopup(void)
12248 AppLogDebug("ENTER");
12249 Rectangle rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE,
12250 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12253 _pCameraInfoPanel->SetDrawExposure(false);
12255 if (__dir == ORIENTATION_STATUS_PORTRAIT
12256 || __dir == ORIENTATION_STATUS_PORTRAIT_REVERSE)
12258 rectList = Rectangle(X_SETTING_MENU_LIST_PORTRAIT, Y_SETTING_MENU_LIST_PORTRAIT,
12259 W_SETTING_MENU_LIST_PORTRAIT, H_SETTING_MENU_LIST_PORTRAIT);
12263 rectList = Rectangle(X_SETTING_MENU_LIST_LANDSCAPE, Y_SETTING_MENU_LIST_LANDSCAPE_MARGIN,
12264 W_SETTING_MENU_LIST_LANDSCAPE, H_SETTING_MENU_LIST_LANDSCAPE);
12267 MakeGeneralTabMenuString();
12268 SetGeneralTabSettingMainMenuCount(MAX_GENERAL_TAB_SETTING_MENU_COUNT);
12269 MakeSettingPopupTab(true);
12271 _pCameraInfoPanel->SetGeneralDrawSettingMenuBackground(true);
12272 _pCameraInfoPanel->Invalidate(true);
12274 if (_pListViewGeneralTabMainMenu == null)
12276 _pListViewGeneralTabMainMenu = new (std::nothrow) ListView();
12277 _pListViewGeneralTabMainMenu->Construct(rectList, true, SCROLL_STYLE_FAST_SCROLL);
12279 _pListViewGeneralTabMainMenu->SetItemProvider(*this);
12280 _pListViewGeneralTabMainMenu->AddListViewItemEventListener(*this);
12281 _pListViewGeneralTabMainMenu->SetName(IDS_MENU_SETTING_GEN_MAIN_MENU_NAME);
12285 _pListViewGeneralTabMainMenu->SetShowState(true);
12286 _pListViewGeneralTabMainMenu->SetBounds(rectList);
12289 _pCameraInfoPanel->AddControl(_pListViewGeneralTabMainMenu);
12290 _pListViewGeneralTabMainMenu->UpdateList();
12291 AppLogDebug("EXIT");
12295 CamcorderForm::MakeGeneralTabMenuString(void)
12297 AppLogDebug("ENTER");
12300 result r = E_SUCCESS;
12301 AppResource* pAppResource = null;
12303 if (__pSettingGeneralMenuString == null)
12305 pAppResource = Application::GetInstance()->GetAppResource();
12306 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
12308 __pSettingGeneralMenuString = new (std::nothrow) String*[MAX_GENERAL_TAB_SETTING_MENU_COUNT];
12310 TryCatch(__pSettingGeneralMenuString != null, r = E_FAILURE, "__pSettingGeneralMenuString is null");
12312 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
12314 __pSettingGeneralMenuString[idx] = new (std::nothrow) String[MAX_SUBMENU_CONTENT];
12315 TryCatch(__pSettingGeneralMenuString[idx] != null, r = E_FAILURE, "__pSettingGeneralMenuString[%d] is null", idx);
12318 pAppResource->GetString(IDS_CAM_BODY_TIMER, tmpString);
12319 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_01] = tmpString;
12321 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
12322 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_02] = tmpString;
12323 pAppResource->GetString(IDS_CAM_BODY_2_SEC, tmpString);
12324 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_03] = tmpString;
12325 pAppResource->GetString(IDS_CAM_BODY_5_SEC, tmpString);
12326 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_04] = tmpString;
12327 pAppResource->GetString(IDS_CAM_BODY_10_SEC, tmpString);
12328 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE][MENU_IDX_05] = tmpString;
12330 pAppResource->GetString(IDS_CAM_BODY_GUIDELINE, tmpString);
12331 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_01] = tmpString;
12332 pAppResource->GetString(IDS_CAM_BODY_OFF, tmpString);
12333 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_02] = tmpString;
12334 pAppResource->GetString(IDS_CAM_BODY_ON, tmpString);
12335 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE][MENU_IDX_03] = tmpString;
12337 pAppResource->GetString(IDS_CAM_BODY_STORAGE, tmpString);
12338 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_01] = tmpString;
12339 pAppResource->GetString(IDS_CAM_BODY_PHONE, tmpString);
12340 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_02] = tmpString;
12341 pAppResource->GetString(IDS_CAM_OPT_MEMORY_CARD, tmpString);
12342 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE][MENU_IDX_03] = tmpString;
12344 pAppResource->GetString(IDS_CAM_BODY_RESET_SETTINGS_RESET, tmpString);
12345 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_RESET_MODE][MENU_IDX_01] = tmpString;
12347 //pAppResource->GetString(IDS_CAM_OVERLAY_HELP_VALUE, tmpString);
12348 //__pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = tmpString;
12349 __pSettingGeneralMenuString[CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE][MENU_IDX_01] = IDS_MENU_OVERLAY_HELP_VALUE;
12352 AppLogDebug("EXIT");
12356 if (__pSettingGeneralMenuString)
12358 for (idx = 0; idx < MAX_GENERAL_TAB_SETTING_MENU_COUNT; ++idx)
12360 if (__pSettingGeneralMenuString[idx])
12362 delete [] __pSettingGeneralMenuString[idx];
12363 __pSettingGeneralMenuString[idx] = null;
12371 delete __pSettingGeneralMenuString;
12372 __pSettingGeneralMenuString = null;
12379 CamcorderForm::GetGeneralTabSettingMainMenuCount(void) const
12381 AppLogDebug("ENTER");
12382 AppLogDebug("EXIT");
12383 return __generalTabMainMenuCount;
12387 CamcorderForm::SetGeneralTabSettingMainMenuCount(int count)
12389 AppLogDebug("ENTER");
12390 __generalTabMainMenuCount = count;
12391 AppLogDebug("EXIT");
12395 CamcorderForm::GetGeneralTabSettingSubMenuCount(void) const
12397 AppLogDebug("ENTER");
12398 AppLogDebug("EXIT");
12399 return __generalTabSubMenuCount;
12403 CamcorderForm::SetGeneralTabSettingSubMenuCount(int count)
12405 AppLogDebug("ENTER");
12406 __generalTabSubMenuCount = count;
12407 AppLogDebug("EXIT");
12410 inline CamcorderGeneralTabSubMenuContent
12411 CamcorderForm::GetGeneralTabSettingSubMenuMode(void) const
12413 AppLogDebug("ENTER");
12414 AppLogDebug("EXIT");
12415 return __generalTabSettingMode;
12419 CamcorderForm::SetSettingGenSubMenuMode(const CamcorderGeneralTabSubMenuContent mode)
12421 AppLogDebug("ENTER");
12422 AppLogDebug("EXIT");
12423 __generalTabSettingMode = mode;
12427 CamcorderForm::SetGeneralTabSubMenuListviewState(const int menuCount, const CamcorderGeneralTabSubMenuContent mode)
12429 AppLogDebug("ENTER");
12430 SetGeneralTabSettingSubMenuCount(menuCount);
12431 SetSettingGenSubMenuMode(mode);
12432 AppLogDebug("EXIT");
12436 CamcorderForm::GetCamcorderTabSettingMainMenuCount(void) const
12438 AppLogDebug("ENTER");
12439 AppLogDebug("EXIT");
12440 return __camcoderTabMainMenuCount;
12444 CamcorderForm::SetCamcorderTabSettingMainMenuCount(int count)
12446 AppLogDebug("ENTER");
12447 __camcoderTabMainMenuCount = count;
12448 AppLogDebug("EXIT");
12452 CamcorderForm::GetCamcorderTabSettingSubMenuCount(void) const
12454 AppLogDebug("ENTER");
12455 AppLogDebug("EXIT");
12456 return __camcoderTabSubMenuCount;
12460 CamcorderForm::SetCamcorderTabSettingSubMenuCount(int count)
12462 AppLogDebug("ENTER");
12463 __camcoderTabSubMenuCount = count;
12464 AppLogDebug("EXIT");
12467 inline CamcorderTabSubMenuContent
12468 CamcorderForm::GetCamcorderTabSettingSubMenuMode(void) const
12470 AppLogDebug("ENTER");
12471 AppLogDebug("EXIT");
12472 return __camcoderTabSettingMode;
12476 CamcorderForm::SetCamcorderTabSettingSubMenuMode(const CamcorderTabSubMenuContent mode)
12478 AppLogDebug("ENTER");
12479 AppLogDebug("EXIT");
12480 __camcoderTabSettingMode = mode;
12484 CamcorderForm::SetCamcorderTabSubMenuListviewState(const int menuCount, const CamcorderTabSubMenuContent mode)
12486 AppLogDebug("ENTER");
12487 SetCamcorderTabSettingSubMenuCount(menuCount);
12488 SetCamcorderTabSettingSubMenuMode(mode);
12489 AppLogDebug("EXIT");
12493 CamcorderForm::CreateGeneralTabSubMenuItem(int index, int itemWidth)
12495 AppLogDebug("ENTER");
12496 CustomItem* pItem = null;
12497 Bitmap* pBitmap = null;
12498 Rectangle rectRadioIcon = Rectangle(X_SETTING_SUBMENU_RADIO_ICON + X_SETTING_SUBMENU_RADIO_ICON_MARGIN, Y_SETTING_SUBMENU_RADIO_ICON,
12499 W_SETTING_SUBMENU_RADIO_ICON, H_SETTING_SUBMENU_RADIO_ICON);
12500 Rectangle rectIcon = Rectangle(X_SETTING_SUBMENU_ICON - X_SETTING_SUBMENU_ICON_MARGIN, Y_SETTING_SUBMENU_ICON,
12501 W_SETTING_SUBMENU_ICON, H_SETTING_SUBMENU_ICON);
12502 Rectangle rectTwoTextItem = Rectangle(X_SETTING_SUBMENU_2TEXT_ITEM, Y_SETTING_SUBMENU_2TEXT_ITEM,
12503 W_SETTING_SUBMENU_2TEXT_ITEM, H_SETTING_SUBMENU_2TEXT_ITEM);
12504 Rectangle rectThreeTextItem = Rectangle(X_SETTING_SUBMENU_3TEXT_ITEM - X_SETTING_SUBMENU_3TEXT_ITEM_MARGIN, Y_SETTING_SUBMENU_3TEXT_ITEM,
12505 W_SETTING_SUBMENU_3TEXT_ITEM, H_SETTING_SUBMENU_3TEXT_ITEM);
12507 AppResource* pAppResource = null;
12509 result r = E_SUCCESS;
12513 CamcorderGeneralTabSubMenuContent idx = CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_MAX;
12515 pItem = new (std::nothrow) CustomItem();
12516 TryCatch(pItem != null,,"Failed to allocate memory for CustomItem");
12518 pItem->Construct(Dimension(itemWidth, H_SETTING_SUBMENU_ITEM), LIST_ANNEX_STYLE_NORMAL);
12519 TryCatch(r == E_SUCCESS,,"Failed to construct CustomItem");
12521 pAppResource = Application::GetInstance()->GetAppResource();
12522 TryCatch(pAppResource != null,,"pAppResource is null");
12524 idx = GetGeneralTabSettingSubMenuMode();
12527 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_TIMER_MODE:
12529 ResourceId resId = RESOURCE_ID_TIMER_OFF;
12533 case SETTING_TIMER_RECORD_0_SEC:
12535 resId = RESOURCE_ID_TIMER_OFF;
12539 case SETTING_TIMER_RECORD_2_SEC:
12541 resId = RESOURCE_ID_TIMER_2SEC;
12545 case SETTING_TIMER_RECORD_5_SEC:
12547 resId = RESOURCE_ID_TIMER_5SEC;
12551 case SETTING_TIMER_RECORD_10_SEC:
12553 resId = RESOURCE_ID_TIMER_10SEC;
12561 String arrString[] =
12564 IDS_CAM_BODY_2_SEC,
12565 IDS_CAM_BODY_5_SEC,
12566 IDS_CAM_BODY_10_SEC,
12569 pAppResource->GetString(arrString[index], tmpString);
12571 r = _pCameraPresentationModel->GetValue(TIMER_INTERVAL, regVal);
12572 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12574 if (index == regVal)
12576 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12580 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12582 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12584 elementId = (index * MENU_TWO_ELEMENT);
12586 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12587 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12590 pBitmap = ResourceManager::GetBitmapN(resId);
12592 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12593 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12594 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12599 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);
12600 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12604 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_GUIDELINE_MODE:
12606 ResourceId resId = RESOURCE_ID_GUIDELINE_OFF;
12610 case SUBMENU_GUIDELINE_OFF:
12612 resId = RESOURCE_ID_GUIDELINE_OFF;
12616 case SUBMENU_GUIDELINE_ON:
12618 resId = RESOURCE_ID_GUIDELINE_ON;
12626 elementId = (index * MENU_TWO_ELEMENT);
12628 r = _pCameraPresentationModel->GetValue(GUIDELINE_ENABLE, regVal);
12629 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12631 if (index == regVal)
12633 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12637 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12639 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12641 if (index == SUBMENU_MODE_OFF)
12643 str = IDS_CAM_BODY_OFF;
12647 str = IDS_CAM_BODY_ON;
12650 pAppResource->GetString(str, tmpString);
12652 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12653 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12660 pBitmap = ResourceManager::GetBitmapN(resId);
12661 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12663 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12664 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12671 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);
12672 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12676 case CAMCORDER_GENERAL_TAB_SUB_MENU_CONTENT_STORAGE_TYPE_MODE:
12678 ResourceId resId = RESOURCE_ID_STORAGE_PHONE;
12682 case SUBMENU_MODE_OFF:
12684 resId = RESOURCE_ID_STORAGE_PHONE;
12688 case SUBMENU_MODE_ON:
12690 resId = RESOURCE_ID_STORAGE_CARD;
12698 elementId = (index * MENU_TWO_ELEMENT);
12700 r = _pCameraPresentationModel->GetValue(STORAGE_TYPE, regVal);
12701 TryCatch(r == E_SUCCESS, , "GetValue() fail[%s]", GetErrorMessage(r));
12703 if (index == regVal)
12705 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_ON);
12709 pBitmap = ResourceManager::GetBitmapN(RESOURCE_ID_CAMERA_RADIO_BTN_OFF);
12711 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12713 if (index == STORAGE_TYPE_PHONE)
12715 str = IDS_CAM_BODY_PHONE;
12719 str = IDS_CAM_OPT_MEMORY_CARD;
12722 pAppResource->GetString(str, tmpString);
12724 r = pItem->AddElement(rectRadioIcon, elementId, *pBitmap, null, null);
12725 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12731 pBitmap = ResourceManager::GetBitmapN(resId);
12732 TryCatch(pBitmap != null, r = E_SYSTEM, "pBitmap is null");
12734 r = pItem->AddElement(rectIcon, elementId, *pBitmap, null, null);
12735 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12742 if (str.Equals(String(IDS_CAM_OPT_MEMORY_CARD)))
12744 if (_pCameraPresentationModel->IsStorageCardMounted() == false)
12746 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);
12750 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);
12755 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);
12757 TryCatch(r == E_SUCCESS, , "CustomItem::AddElement() fail[%s]", GetErrorMessage(r));
12761 case CAMCORDER_GENERAL_TAB_SUB_MENU_OVERLAY_HELP_MODE:
12770 AppLogDebug("EXIT");
12780 AppLogDebug("EXIT - CATCH : pItem is null or not CreateGeneralTabSubMenuItem");
12785 CamcorderForm::SetOverlayPanelChangeMode(bool isMode)
12787 AppLogDebug("ENTER");
12788 Rectangle rect = Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
12790 if (isMode == true)
12792 SetOverlayPanelWideMode(false);
12794 SetOverlayRendererRotation();
12796 __screenMode = SCREEN_MODE_FULL;
12798 HidePanel(true, false);
12800 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
12807 HidePanel(false, false);
12809 SetOverlayPanelWideMode(false);
12811 SetOverlayRendererRotation();
12813 __screenMode = SCREEN_MODE_NORMAL;
12815 _pCameraInfoPanel->SetOverlayPanelMode(__screenMode);
12820 AppLogDebug("EXIT");
12824 CamcorderForm::InitializePopup(void)
12826 AppLogDebug("ENTER");
12827 AppResource* pAppResource = null;
12828 String strTitle = L"";
12829 String okString = L"";
12830 String cancelString = L"";
12831 result r = E_SUCCESS;
12832 Label* pTitleLabel = null;
12833 Button* pOkButton = null;
12834 Button* pCancelButton = null;
12836 if (__pCancelPopup == null)
12838 pAppResource = Application::GetInstance()->GetAppResource();
12839 TryCatch(pAppResource != null,,"Failed to allocate memory for pAppResource");
12841 __pCancelPopup = new (std::nothrow) Popup();
12842 r = __pCancelPopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
12843 TryCatch(r == E_SUCCESS, , "__pCancelPopup::Construct() Failed:%s", GetErrorMessage(r));
12845 Rectangle popupClientBounds = __pCancelPopup->GetClientAreaBounds();
12846 pTitleLabel = new (std::nothrow) Label();
12847 pAppResource->GetString(L"IDS_CAM_BODY_CANCEL_RECORDING_Q", strTitle);
12849 r = pTitleLabel->Construct(Rectangle(X_BASE_POS, Y_BASE_POS, popupClientBounds.width, H_DELETE_LABEL), strTitle);
12850 TryCatch(r == E_SUCCESS, , "pTitleLabel::Construct() fail[%s]", GetErrorMessage(r));
12852 pTitleLabel->SetTextConfig(FONT_SIZE_CANCEL_CONFIRM, LABEL_TEXT_STYLE_NORMAL);
12853 pTitleLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
12854 pTitleLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
12856 pOkButton = new (std::nothrow) Button();
12857 pAppResource->GetString(L"IDS_COM_SK_OK", okString);
12858 r = pOkButton->Construct(Rectangle(X_BASE_POS, Y_DELETE_BUTTON, popupClientBounds.width / DIVIDE_BY_TWO - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), okString);
12859 TryCatch(r == E_SUCCESS, r = E_OUT_OF_MEMORY, "Unable to construct pOkButton button.\n");
12861 pOkButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_CANCEL_BUTTON_NORMAL);
12862 pOkButton->SetTextColor(COLOR_CANCEL_BUTTON_TEXT);
12863 pOkButton->SetTextSize(FONT_SIZE_CANCEL_BUTTON);
12864 pOkButton->SetActionId(IDA_BUTTON_RECORDING_POPUP_OK);
12865 pOkButton->AddActionEventListener(*this);
12867 pCancelButton = new (std::nothrow) Button();
12868 pAppResource->GetString(L"IDS_COM_POP_CANCEL", cancelString);
12869 r = pCancelButton->Construct(Rectangle(popupClientBounds.width / DIVIDE_BY_TWO + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON, popupClientBounds.width / DIVIDE_BY_TWO - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), cancelString);
12870 TryCatch(r == E_SUCCESS, r = E_OUT_OF_MEMORY, "Unable to construct pCancelButton button.\n");
12872 pCancelButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_CANCEL_BUTTON_NORMAL);
12873 pCancelButton->SetTextColor(COLOR_CANCEL_BUTTON_TEXT);
12874 pCancelButton->SetTextSize(FONT_SIZE_CANCEL_BUTTON);
12875 pCancelButton->SetActionId(IDA_BUTTON_RECORDING_POPUP_CANCEL);
12876 pCancelButton->AddActionEventListener(*this);
12878 __pCancelPopup->AddControl(pTitleLabel);
12879 __pCancelPopup->AddControl(pOkButton);
12880 __pCancelPopup->AddControl(pCancelButton);
12884 __pCancelPopup->SetShowState(true);
12885 __pCancelPopup->Show();
12887 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
12891 delete pTitleLabel;
12892 pTitleLabel = null;
12897 delete pCancelButton;
12898 pCancelButton = null;
12903 CamcorderForm::ReInitialise(void)
12905 result r = E_SUCCESS;
12906 BufferInfo bufferinfo;
12907 AppLogDebug("Camera State is %d",_pCameraPresentationModel->GetCameraState());
12908 AppLogDebug("Video State is %d",_pCameraPresentationModel->GetRecorderState());
12909 _pCameraPresentationModel->StopCamera();
12910 CameraApp* pApp = static_cast<CameraApp*>(UiApp::GetInstance());
12912 if (pApp->GetAppUiState() == APP_UI_STATE_FOREGROUND)
12914 r = _pCameraPresentationModel->InitializeCamcorder();
12915 TryReturnVoid(r == E_SUCCESS, "InitializeCamcorder [%s]", GetErrorMessage(r));
12916 r = __pOverlayPanel->GetBackgroundBufferInfo(bufferinfo);
12917 TryReturnVoid(r == E_SUCCESS, "__pOverlayPanel->GetBackgroundBufferInfo() fail(%s)", GetErrorMessage(r));
12919 _pCameraPresentationModel->StartPreview(&bufferinfo);
12920 _pCameraPresentationModel->SetContinuousAutoFocus();
12925 CamcorderForm::UpdatePopUp(void)
12927 bool doHidePopup = false;
12928 MakeSettingPopupTab(false);
12930 doHidePopup = OnTouchDoHidePopup();
12931 AppLogDebug("doHidePopup = %d", doHidePopup);
12939 CamcorderForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
12941 AppLogDebug("ENTER");
12943 if (_timeCount == INDEX_UNIT_ZERO)
12945 BackButtonPerformed();
12948 AppLogDebug("EXIT");
12952 CamcorderForm::ShowMemoryFull(void)
12954 MessageBox messageBox;
12955 result r = E_SUCCESS;
12957 r = messageBox.Construct(L"", L"Memory Full. Terminating App", MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_3_SEC);
12958 TryReturnVoid(r == E_SUCCESS, "msgBox::Construct() failed by [%s]", GetErrorMessage(r));
12960 r = messageBox.ShowAndWait(result);
12964 CamcorderForm::OnKeyLongPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12966 //Empty Implementation
12970 CamcorderForm::OnKeyPressed (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12975 if ((source.GetName().Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
12977 OnTouchModeSwitch();
12987 CamcorderForm::OnKeyReleased (const Tizen::Ui::Control &source, Tizen::Ui::KeyCode keyCode)
12989 //Empty Implementation
12993 CamcorderForm::OnAccessibilityActionPerformed (const Control &control, const AccessibilityElement &element)
12995 AppLogDebug("Enter");
12997 if ((control.GetName().Equals(String(IDS_ACTION_UI_CAMCORDER_MODE))))
12999 OnTouchModeSwitch();
13002 AppLogDebug("Exit");
13006 CamcorderForm::OnAccessibilityFocusIn (const Control &control, const AccessibilityElement &element)
13008 AppLogDebug("Enter");
13009 AppLogDebug("Exit");
13013 CamcorderForm::OnAccessibilityFocusOut (const Control &control, const AccessibilityElement &element)
13015 AppLogDebug("Enter");
13016 AppLogDebug("Exit");
13020 CamcorderForm::OnAccessibilityScreenReaderStatusChanged (const Control &control, const AccessibilityElement &element, AccessibilityScreenReaderStatus status)
13022 AppLogDebug("Enter");
13023 AppLogDebug("Exit");