FreeCalypso > hg > fc-magnetite
comparison src/ui3/bmi/mmiFileManager.c @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 21 Jan 2018 03:09:00 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
419:59143cd42ec7 | 420:e8ddbb0837ed |
---|---|
1 | |
2 #ifdef FF_MMI_FILEMANAGER | |
3 | |
4 /* ========================================================= | |
5 * Texas Instruments OMAP(TM) Platform Software | |
6 * (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. | |
7 * | |
8 * Use of this software is controlled by the terms and conditions found | |
9 * in the license agreement under which this software has been supplied. | |
10 * ========================================================== */ | |
11 | |
12 /*========================================================== | |
13 * @file mmi_FileManager.c | |
14 * | |
15 * This provides the functionality of File Manager Applications. | |
16 * It supports file/folder related operations on FFS and MMC | |
17 * | |
18 * @path \bmi\condat\ms\src\bmi | |
19 * | |
20 * @rev 00.01 | |
21 */ | |
22 /* ========================================================== */ | |
23 /*=========================================================== | |
24 *! | |
25 *! Revision History | |
26 *! =================================== | |
27 | |
28 Nov 06, 2007 DRT: OMAPS00151698 x0056422 | |
29 Description: BMI requirments needed to support Bluetooth AVRCP in Locosto 5.x | |
30 Solution : In mfw_audResume, Pause, Stop functions, if BT is connected, send a callback. | |
31 In the case of audio play, handle the callback of START_IND from audio task and | |
32 post a callback to BT if expected. | |
33 | |
34 August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) | |
35 Description: COMBO: Board reboots on receiving call during file viewer | |
36 Issue: When an incoming call / SMS arrives, a winShow of Idle's | |
37 window is done (to update the Icons etc..) which causes all windows | |
38 chained to Idle's window to be updated. In this process, even the | |
39 Image List and Image Viewer Windows' Updates happen, wherein the existing | |
40 MSL Pipeline is used to draw the Viewer (ThumbNail / QCIF). During this, | |
41 many of the global flags to maintain the status, command etc.. seem to get | |
42 reinitialized and corrupted and this lead to a weird memory corruption and hence | |
43 a crash. | |
44 Solution: A Status Indicator is maintained each for Image List and Image Viewer cases. | |
45 This shall be updated / set whenever the window gets suspended. In such cases, | |
46 the MSL Viewer Drawing shall not be done even when a WinVisible is received | |
47 and this flag shall be reset during the window create/destroy/resume. | |
48 Essentially, the Image List window / Image Viewer window shall call | |
49 MSL_Viewer_View ONLY when it is in the foreground and shall not do the same | |
50 | |
51 | |
52 Jul 10, 2007 DRT:OMAPS00138065 x0062174(Nimitha) | |
53 Description: Stop button disappears while we play an audio file when progressbar is on and the only way to stop the file is to press back. | |
54 STOP button is appearing for a moment if progress bar is ON. | |
55 Solution: STOP button should not appear in progressbar window. STOP button is displayed at proper place. | |
56 When progressbar is on, to stop the audio play we have to press BACK button, that is by design. | |
57 | |
58 Jul 04, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
59 Description: Once the audio file has finished automatically play button has to be pressed twice, | |
60 in order to be played again. | |
61 Solution : a) A Global variable aud_state_status is added to maintain the status of the player once the user presses Back button | |
62 during the file playing and coming back to File Management window. Two function mmi_set_aud_state_status and | |
63 mmi_get_aud_state_status is added to set/get the status of the audio player. | |
64 b) A condition is added to check the status of the audio player when user presses the joystick, | |
65 audio state is made to FM_AUD_PLAY if the audio is still playing. | |
66 c) While drawing File Management window a condition is added to check the status of the audio player and proper PLAY/STOP key is displayed | |
67 according to the status of the player. | |
68 | |
69 June 11, 2007 DRT:OMAPS00132505 x0061088 | |
70 Description: Impossible to see an 303kb image | |
71 Solution: Now thumb generation error given by MSL synchronously is handled MMI. | |
72 May28,07 DRT:OMAPS00132459 x0061560(sateeshg) | |
73 Description: while midi is playing stop button makes restart the playing | |
74 Solution:A flag been added when user plays the file and this flag is checked after coming back from current | |
75 directory to pause the play using joystick. | |
76 | |
77 April 27, 2007 DRT:OMAPS00128836 x0073106 | |
78 Description: Unexpected behavior when copying images with the same names from a memory to another. | |
79 Solution:In function mmi_fm_copy_start() added FM_COPY_NONE flag | |
80 and in function mmi_copy_End() added FM_COPY_NONE in two conditions. | |
81 | |
82 Apr 10, 2007 DRT: OMAPS00125325 x0039928 | |
83 Description: Hang up key doesn't work in File Manager audio and image lists | |
84 Solution: Hang up key is now mapped to back operation in the list. | |
85 | |
86 Apr 05, 2007 DRT: OMAPS00124859 x0039928 | |
87 Description: MM: Imelody can not be moved or copied | |
88 Solution: Copy-Move is displayed for all audio files | |
89 | |
90 Apr 06, 2007 DRT: OMAPS00124874 x0039928 | |
91 Description: MM: Renaming process of an Imy file is incorrect | |
92 Solution: Seperate enum values for different audio files is added. | |
93 | |
94 Apr 06, 2007 DRT: OMAPS00124877 x0039928 | |
95 Description: MM: Voice limit Options doesn't work | |
96 Solution: voice limit value is taken from the global variable set by menu options. | |
97 | |
98 Mar 30, 2007 DRT: OMAPS00122768 x0039928 | |
99 Description: MM: The board is blocked after having moved a file between NOR and T-FLASH | |
100 Solution: Image viewer is deinitialized when there are no image files in image viewer. | |
101 | |
102 Mar 30, 2007 DRT: OMAPS00122772 x0039928 | |
103 Description: MM: Image viewer in Filemanagement is blocked when there is just a directory | |
104 Solution: An invalid condition is removed which is checked aginst press of back key in FMA | |
105 | |
106 Mar 28, 2007 ER: OMAPS00106188 x0039928 | |
107 Description: Align Midi application menu choices and audio Player menu choices | |
108 | |
109 Mar 29, 2007 DRT: OMAPS00122677 x0039928 | |
110 Description: MM: By default, Storage devices in Camera Application is not set, taking a snapshot is impossible | |
111 Solution: Root directories are created on entering camera application. | |
112 | |
113 Mar 15, 2007 DRT: OMAPS00120225 x0039928 | |
114 Description: File Manager:Copy, move between NOR-MS,T-FLASH,NAND failed | |
115 Solution: A condition is added to check the source and destination device are same. | |
116 | |
117 Mar 15, 2007 DRT: OMAPS00120187 x0039928 | |
118 Description: MMI shows error if back button is pressed while playing audio files with N5.23 Pre release | |
119 Solution: mfw_fm_audStop is commented in func mmi_fm_aud_list_cb for event | |
120 LISTS_REASON_DRAWCOMPLETE which was being called twice in the scenario. | |
121 | |
122 | |
123 *! 10-Apr-2006 mf: Modified x0020906. Change required per SRxxxx | |
124 *! to provide File Manager Functionality. | |
125 *! | |
126 *! | |
127 *! 17-Jan-2006 mf: Revisions appear in reverse chronological order; | |
128 *! that is, newest first. The date format is dd-Mon-yyyy. | |
129 | |
130 | |
131 * =========================================================== */ | |
132 /****************************************************************************** | |
133 Include Files | |
134 *******************************************************************************/ | |
135 | |
136 #define ENTITY_MFW | |
137 /* includes */ | |
138 #include <string.h> | |
139 #include <stdio.h> | |
140 #include <stdlib.h> | |
141 #if defined (NEW_FRAME) | |
142 #include "typedefs.h" | |
143 #include "vsi.h" | |
144 #include "pei.h" | |
145 #include "custom.h" | |
146 #include "gsm.h" | |
147 #else | |
148 #include "STDDEFS.H" | |
149 #include "custom.h" | |
150 #include "gsm.h" | |
151 #include "vsi.h" | |
152 #endif | |
153 | |
154 #include "mfw_mfw.h" | |
155 #include "mfw_win.h" | |
156 #include "mfw_icn.h" /* included for mfw_mnu.h */ | |
157 #include "mfw_mnu.h" | |
158 #include "mfw_tim.h" | |
159 #include "mfw_kbd.h" | |
160 #include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ | |
161 #include "mfw_camapp.h" | |
162 #include "mfw_fm.h" | |
163 #include "MmiBlkLangDB.h" | |
164 #include "mmiColours.h" | |
165 #include "MmiDialogs.h" | |
166 #include "MmiDummy.h" /* included for MmiMenu.h */ | |
167 #include "MmiLists.h" | |
168 #include "MmiMenu.h" | |
169 #include "MmiSoftKeys.h" | |
170 #include "AUIEditor.h" | |
171 #include "MmiMain.h" | |
172 #include "Mmiicons.h" | |
173 #include "MmiWindow.h" | |
174 #include "MmiCall.h" | |
175 | |
176 #include "mfw_ffs.h" | |
177 | |
178 #include "mmiFileManager.h" | |
179 #include "mmiBookShared.h" | |
180 | |
181 | |
182 | |
183 /* OMAPS00151698, x0056422 */ | |
184 #ifdef FF_MMI_A2DP_AVRCP | |
185 #include "mfw_bt_api.h" | |
186 #include "mfw_bt_private.h" | |
187 #endif | |
188 | |
189 | |
190 | |
191 /******************************************************************************* | |
192 | |
193 Defines | |
194 | |
195 *******************************************************************************/ | |
196 T_MMI_FM_STRUCT *fm_data; | |
197 GLOBAL BOOL mslPrimHandler (USHORT opc, void * data); | |
198 extern MfwHnd winIconsLists; | |
199 | |
200 const unsigned char file[]={ | |
201 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
202 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
203 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25, | |
204 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
205 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
206 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
207 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
208 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
209 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25, | |
210 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
211 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
212 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25, | |
213 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
214 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
215 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25, | |
216 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
217 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00, | |
218 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
219 0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
220 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
221 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
222 0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
223 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
224 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
225 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
226 0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
227 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
228 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
229 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
230 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
231 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
232 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, | |
233 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
234 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
235 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
236 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
237 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
238 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
239 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
240 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
241 0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
242 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
243 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
244 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
245 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
246 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
247 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, | |
248 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25, | |
249 0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
250 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
251 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25, | |
252 0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
253 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
254 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
255 0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
256 0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
257 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
258 0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
259 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
260 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
261 0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
262 0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
263 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
264 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
265 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
266 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
267 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
268 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
269 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
270 0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
271 0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
272 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
273 }; | |
274 const unsigned char folder[]= | |
275 { | |
276 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
277 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
278 0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
279 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
280 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
281 0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
282 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
283 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
284 0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
285 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
286 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
287 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
288 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
289 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
290 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
291 0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
292 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
293 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
294 0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
295 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00, | |
296 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
297 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
298 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00, | |
299 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25, | |
300 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
301 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00, | |
302 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25, | |
303 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
304 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00, | |
305 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
306 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
307 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00, | |
308 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
309 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
310 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00, | |
311 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
312 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
313 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF, | |
314 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
315 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
316 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF, | |
317 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
318 0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
319 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, | |
320 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
321 0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
322 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, | |
323 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
324 0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
325 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF, | |
326 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
327 0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
328 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF, | |
329 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25, | |
330 0x25,0x25,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
331 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
332 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25, | |
333 0x25,0x25,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
334 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
335 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
336 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
337 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
338 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
339 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
340 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
341 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
342 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
343 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
344 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
345 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
346 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
347 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
348 }; | |
349 const unsigned char audiofile[]= | |
350 { | |
351 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
352 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
353 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25, | |
354 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
355 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
356 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
357 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
358 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
359 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25, | |
360 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
361 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
362 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25, | |
363 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
364 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
365 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25, | |
366 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
367 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00, | |
368 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
369 0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
370 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
371 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25, | |
372 0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
373 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
374 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
375 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
376 0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
377 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
378 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
379 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
380 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
381 0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
382 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, | |
383 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
384 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF, | |
385 0xFF,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
386 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25, | |
387 0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, | |
388 0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
389 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
390 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
391 0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
392 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
393 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00, | |
394 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
395 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25, | |
396 0x25,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
397 0xFF,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, | |
398 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25, | |
399 0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
400 0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
401 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x00,0x00,0x00,0x25, | |
402 0x25,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
403 0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x00,0x00,0x00,0x25,0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
404 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x00,0x00, | |
405 0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
406 0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x00,0x00,0x25,0x25,0x00,0x00,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
407 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x00,0x00,0x25,0x00,0x00, | |
408 0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, | |
409 0xFF,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
410 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x00,0x00,0x00, | |
411 0x25,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00, | |
412 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
413 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00, | |
414 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
415 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x00,0x00,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
416 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00, | |
417 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
418 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
419 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
420 0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
421 0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25, | |
422 0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x00,0x00,0x00,0x00,0x25, | |
423 }; | |
424 MfwIcnAttr fmIconFile = | |
425 { | |
426 { 0, 0,48,48 }, 1, COLOUR_ICON_XX, ICON_TYPE_256_COL, (char *) file | |
427 }; | |
428 MfwIcnAttr fmIconFolder = | |
429 { | |
430 { 0, 0,48,48 }, 1, COLOUR_ICON_XX, ICON_TYPE_256_COL, (char *) folder | |
431 }; | |
432 MfwIcnAttr fmIconAudioFile = | |
433 { | |
434 { 0, 0,48,48 }, 1, COLOUR_ICON_XX, ICON_TYPE_256_COL, (char *) audiofile | |
435 }; | |
436 | |
437 #define PB_OFF 0 | |
438 #define PB_ON 1 | |
439 BOOL mmi_progress_bar = PB_ON; | |
440 //Jun 26, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
441 /* //May28,07 DRT:OMAPS00132459 x0061560(sateeshg) | |
442 BOOL aud_state_back=0;*/ | |
443 | |
444 //Jun 25,2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
445 int aud_state_status = 1; | |
446 | |
447 //Daisy tang added for Real Resume feature 20071107 | |
448 //start | |
449 BOOL IsMP3Playing = FALSE; | |
450 extern BOOL IsRealPaused; | |
451 //end | |
452 | |
453 extern UBYTE aud_state; | |
454 extern T_MFW_AUD_PARA para_aud; | |
455 extern T_MFW_HND pb_win; | |
456 | |
457 | |
458 /* OMAPS00151698, x0056422 */ | |
459 #ifdef FF_MMI_A2DP_AVRCP | |
460 extern BMI_BT_STRUCTTYPE tGlobalBmiBtStruct; | |
461 #endif //FF_MMI_A2DP_AVRCP | |
462 | |
463 | |
464 | |
465 | |
466 | |
467 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
468 | |
469 static unsigned char ucImgList_Sts = 0; | |
470 static unsigned char ucImgViewer_Sts = 0; | |
471 | |
472 #define MMI_IMGLIST_STS ucImgList_Sts | |
473 #define MMI_IMGVIEWER_STS ucImgViewer_Sts | |
474 | |
475 #define MMI_IMGLIST_STS_NORMAL 0x00 | |
476 #define MMI_IMGLIST_STS_SUSPENDED 0x01 | |
477 | |
478 #define MMI_IMGVIEWER_STS_NORMAL 0x00 | |
479 #define MMI_IMGVIEWER_STS_SUSPENDED 0x01 | |
480 | |
481 #define MMI_IMGLIST_CHANGE_STS(a) ( ucImgList_Sts = a ) | |
482 | |
483 #define MMI_IMGVIEWER_CHANGE_STS(a) ( ucImgViewer_Sts = a ) | |
484 | |
485 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
486 /******************************************************************************* | |
487 | |
488 Local prototypes | |
489 | |
490 *******************************************************************************/ | |
491 static T_MFW_HND mmi_fm_start( T_MFW_HND parent_win); | |
492 static T_MFW_HND mmi_fm_create (T_MFW_HND parent_win); | |
493 static int mmi_fm_app_root_cb(T_MFW_EVENT evnt, void *para); | |
494 int mmi_fm_win_cb (MfwEvt e, MfwWin *w); | |
495 void mmi_fm_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
496 static void mmi_fm_destroy(MfwHnd own_window); | |
497 | |
498 void mmi_fm_drives_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
499 void mmi_fm_root_folders_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
500 | |
501 void mmi_fm_list_create( T_MFW_HND win); | |
502 static void mmi_fm_list_destroy(MfwHnd own_window); | |
503 | |
504 void mmi_fm_imgThmbGen_start(void); | |
505 void mmi_fm_imgThmbGen_resume(void); | |
506 void mmi_fm_imgThmbGen(void); | |
507 void mmi_fm_imgThmbGen_identifyFile(void); | |
508 | |
509 void mmi_fm_imgThmbDraw_start(void); | |
510 void mmi_fm_imgThmbDraw_resume(void) ; | |
511 void mmi_fm_imgThmbDraw_identifyFile(void); | |
512 void mmi_fm_imgThmbDraw(void); | |
513 | |
514 T_MFW_HND mmi_fm_img_list_create(T_MFW_HND win); | |
515 void mmi_fm_img_list_cb(T_MFW_HND * Parent, ListMenuData * ListData); | |
516 BOOL mmi_fm_img_validate(void); | |
517 void mmi_fm_imgDraw(void); | |
518 | |
519 T_MFW_HND mmi_fm_aud_list_create(T_MFW_HND win); | |
520 void mmi_fm_aud_validate(void); | |
521 void mmi_fm_aud_list_cb(T_MFW_HND * Parent, ListMenuData * ListData); | |
522 | |
523 void mmi_fm_view_start(void); | |
524 T_MFW_HND mmi_fm_view_create(void); | |
525 int mmi_fm_view_win_cb (MfwEvt e, MfwWin *w); | |
526 void mmi_fm_view_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
527 static int mmi_fm_view_kbd_cb (MfwEvt e, MfwKbd *k); | |
528 void mmi_fm_view_destroy(T_MMI_FM_IMGDRAW_STRUCT * imgDraw_data); | |
529 | |
530 T_MFW_HND mmi_fm_rename_editor_create(T_MFW_HND parent_win); | |
531 static void mmi_fm_rename_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason); | |
532 void mmi_fm_rename_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
533 void mmi_fm_rename_editor_destroy(void); | |
534 | |
535 T_MFW_HND mmi_fm_newdir_editor_create(T_MFW_HND parent_win); | |
536 static void mmi_fm_newdir_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason); | |
537 void mmi_fm_newdir_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
538 void mmi_fm_newdir_editor_destroy(void); | |
539 | |
540 void mmi_fm_remove_confirm_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
541 void mmi_fm_remove_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
542 | |
543 T_MFW_HND mmi_fm_properties_editor_create(T_MFW_HND parent_win); | |
544 static void mmi_fm_properties_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason); | |
545 void mmi_fm_properties_editor_destroy(void); | |
546 void mmi_fm_format_confirm_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
547 | |
548 T_MFW_HND mmi_fm_memStat_editor_create(T_MFW_HND parent_win); | |
549 static void mmi_fm_memStat_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason); | |
550 void mmi_fm_memStat_editor_destroy(void); | |
551 | |
552 void mmi_fm_nofile_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
553 void mmi_fm_open (void); | |
554 void mmi_fm_goback(void); | |
555 T_MFW_HND mmi_fm_app_show_info(T_MFW_HND parent_win, int str1, int str2,int skey1, int skey2, T_VOID_FUNC callback,int timer, T_MFW_EVENT keyEvents); | |
556 void mmi_fm_get_filename( char * filename); | |
557 char * mmi_fm_get_ext( char * filename); | |
558 void mmi_fm_dest_root_folders_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
559 static T_MFW_HND mmi_fm_dest_start( T_MFW_HND parent_win); | |
560 static T_MFW_HND mmi_fm_dest_create (T_MFW_HND parent_win); | |
561 int mmi_fm_dest_win_cb (MfwEvt e, MfwWin *w); | |
562 void mmi_fm_dest_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
563 static void mmi_fm_dest_destroy(MfwHnd own_window); | |
564 T_MFW_HND mmi_fm_dest_list_create( T_MFW_HND win); | |
565 void mmi_fm_dest_list_cb(T_MFW_HND * Parent, ListMenuData * ListData); | |
566 void mmi_fm_destnofile_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
567 | |
568 static void mmi_fm_dest_list_destroy(MfwHnd own_window); | |
569 void mmi_fm_copy_create(char * dest_folder); | |
570 T_MFW_HND mmi_fm_copy_dialog_create(T_MFW_HND parent_win); | |
571 static int mmi_fm_copy_dialog_kbd_cb (MfwEvt e, MfwKbd *k); | |
572 int mmi_fm_copy_dialog_win_cb (MfwEvt e, MfwWin *w); | |
573 void mmi_fm_copy_dialog_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
574 void mmi_fm_copy_dialog_destroy(); | |
575 void mmi_fm_copy_progress_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
576 void mmi_fm_copy_start(void); | |
577 void mmi_fm_copy_end(void); | |
578 int mmi_fm_copy_timer_cb ( MfwEvt e, MfwTim *m ); | |
579 void mmi_fm_copy_destroy(T_FM_COPY_STATE status); | |
580 void mmi_fm_displayDestDrive_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
581 void mmi_fm_copy_end_cb (T_MFW_HND win, USHORT identifier, SHORT reason); | |
582 void mmi_fm_displayDestDrive(void); | |
583 void mmi_fm_destgoback(void); | |
584 void mmi_fm_set_mmi_plane_to_front(void); | |
585 /* Jun 26, 200 07, 2007 DRT: OMAPS00135749 x0062174 */ | |
586 GLOBAL void mmi_set_aud_state_status( T_FM_AUD_STATE status); | |
587 T_FM_AUD_STATE mmi_get_aud_state_status( ); | |
588 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support*/ | |
589 static void unicode_to_char_array(T_WCHAR *inp, char *out); | |
590 | |
591 /******************************************************************************* | |
592 | |
593 $Function: mmi_set_aud_state_status | |
594 | |
595 $Description: set audio state status | |
596 | |
597 $Returns: none. | |
598 | |
599 $Arguments: | |
600 | |
601 *******************************************************************************/ | |
602 //Jun 26, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
603 | |
604 GLOBAL void mmi_set_aud_state_status( T_FM_AUD_STATE status) | |
605 { | |
606 TRACE_FUNCTION("mmi_set_aud_status()"); | |
607 | |
608 aud_state_status = status; | |
609 TRACE_EVENT_P1("aud_state in set_aud_status %d", aud_state_status); | |
610 | |
611 } | |
612 | |
613 /******************************************************************************* | |
614 | |
615 $Function: mmi_get_aud_state_status | |
616 | |
617 $Description: get audio state status | |
618 | |
619 $Returns: none. | |
620 | |
621 $Arguments: | |
622 | |
623 *******************************************************************************/ | |
624 //Jun 26, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
625 | |
626 T_FM_AUD_STATE mmi_get_aud_state_status( ) | |
627 { | |
628 TRACE_FUNCTION("mmi_get_aud_status()"); | |
629 TRACE_EVENT_P1("aud_state in get_aud_status %d", aud_state_status); | |
630 | |
631 return aud_state_status; | |
632 | |
633 } | |
634 | |
635 | |
636 | |
637 /******************************************************************************* | |
638 $Function: mmi_fm_app_show_info | |
639 | |
640 $Description: information Dialog function | |
641 | |
642 $Returns: Created Window Pointer | |
643 | |
644 $Arguments: parent_win: -Parent window | |
645 str1, str2 -String IDs | |
646 skey1, skey2 -Softkey lables | |
647 callback -Callback Function | |
648 timer -Timeout value | |
649 keyEvents -Key events to be handled | |
650 *******************************************************************************/ | |
651 T_MFW_HND mmi_fm_app_show_info(T_MFW_HND parent_win, int str1, int str2,int skey1, int skey2, T_VOID_FUNC callback,int timer, T_MFW_EVENT keyEvents) | |
652 { | |
653 T_DISPLAY_DATA display_info; | |
654 T_MFW_HND win; | |
655 | |
656 TRACE_FUNCTION ("mmi_fm_app_show_info()"); | |
657 | |
658 dlg_initDisplayData_TextId( &display_info, skey1, skey2, str1, str2, COLOUR_STATUS); | |
659 dlg_initDisplayData_events( &display_info, callback, timer, keyEvents); | |
660 win = info_dialog(parent_win, &display_info); | |
661 return win; | |
662 } | |
663 | |
664 | |
665 /******************************************************************************* | |
666 $Function: mmi_fm_drives | |
667 | |
668 $Description: Display the drive options open , memory status, format | |
669 | |
670 $Returns: Execution status | |
671 | |
672 $Arguments: mnu -Pointer to current menu | |
673 item -Pointer to current menu item | |
674 *******************************************************************************/ | |
675 GLOBAL int mmi_fm_drives(MfwMnu* mnu, MfwMnuItem* item) | |
676 { | |
677 T_MFW_HND parent_win; | |
678 T_MFW_HND win; | |
679 | |
680 TRACE_FUNCTION("mmi_fm_drives" ); | |
681 | |
682 fm_data = (T_MMI_FM_STRUCT *)mfwAlloc(sizeof(T_MMI_FM_STRUCT)); | |
683 parent_win = mfwParent(mfw_header()); | |
684 fm_data->source = (T_FM_DEVICE_TYPE)mnu->lCursor[mnu->level]; | |
685 TRACE_EVENT_P1("Selected Drive %d",fm_data->source); | |
686 /* Apr 06, 2007 DRT: OMAPS00124877 x0039928 */ | |
687 /* Fix: Default settings for audio player */ | |
688 mfw_player_init(); | |
689 win=(T_MFW_HND)bookMenuStart( parent_win, FMDrivesOptionsListAttributes(), 0); | |
690 SEND_EVENT(win,ADD_CALLBACK,NULL,(void *)mmi_fm_drives_cb); | |
691 | |
692 return MFW_EVENT_CONSUMED; | |
693 } | |
694 | |
695 /******************************************************************************* | |
696 | |
697 $Function: mmi_fm_drives_cb | |
698 | |
699 $Description: Callback function for the drive option window | |
700 | |
701 $Returns: Execution status | |
702 | |
703 $Arguments: win -current window | |
704 event -window event Id | |
705 value -unique Id | |
706 parameter -optional data. | |
707 *******************************************************************************/ | |
708 void mmi_fm_drives_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
709 { | |
710 TRACE_FUNCTION("mmi_fm_drives_cb"); | |
711 | |
712 mfwFree((U8 *)fm_data, sizeof (T_MMI_FM_STRUCT)); | |
713 fm_data = NULL; | |
714 } | |
715 | |
716 /******************************************************************************* | |
717 $Function: mmi_fm_root_folders | |
718 | |
719 $Description: Display the root Image, Audio Directories | |
720 | |
721 $Returns: Execution status | |
722 | |
723 $Arguments: mnu -Pointer to current menu | |
724 item -Pointer to current menu item | |
725 *******************************************************************************/ | |
726 GLOBAL int mmi_fm_root_folders(MfwMnu* mnu, MfwMnuItem* item) | |
727 { | |
728 T_MFW_HND parent_win; | |
729 T_MFW_HND win; | |
730 | |
731 TRACE_FUNCTION("mmi_fm_root_folders" ); | |
732 | |
733 parent_win = mfwParent(mfw_header()); | |
734 fm_data->cur_dir = (T_FM_CURDIR *)mfwAlloc(sizeof(T_FM_CURDIR)); | |
735 win = (T_MFW_HND)bookMenuStart( parent_win, FMRootFolderAttributes(), 0); | |
736 SEND_EVENT(win,ADD_CALLBACK,NULL,(void *)mmi_fm_root_folders_cb); | |
737 return MFW_EVENT_CONSUMED; | |
738 } | |
739 | |
740 /******************************************************************************* | |
741 $Function: mmi_fm_root_event_cb | |
742 | |
743 $Description: Callback function for the root Image, Audio Directory window | |
744 | |
745 $Returns: None | |
746 | |
747 $Arguments: win -current window | |
748 event -window event Id | |
749 value -unique Id | |
750 parameter -optional data. | |
751 *******************************************************************************/ | |
752 void mmi_fm_root_folders_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
753 { | |
754 TRACE_FUNCTION("mmi_fm_root_event_cb"); | |
755 | |
756 mfwFree((U8 *)fm_data->cur_dir , sizeof (T_FM_CURDIR)); | |
757 fm_data->cur_dir = NULL; | |
758 } | |
759 /******************************************************************************* | |
760 $Function: mmi_fm_display | |
761 | |
762 $Description: Displays the files and folders given path | |
763 | |
764 $Returns: Execution status | |
765 | |
766 $Arguments: mnu -Pointer to current menu | |
767 item -Pointer to current menu item | |
768 *******************************************************************************/ | |
769 GLOBAL int mmi_fm_display(MfwMnu* mnu, MfwMnuItem* item) | |
770 { | |
771 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
772 T_MFW_HND parent_win = mfwParent(mfw_header()); | |
773 | |
774 TRACE_FUNCTION("mmi_fm_display"); | |
775 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state11 %d",cur_dir->dirinfo.aud.state); | |
776 | |
777 cur_dir->depth = 0; | |
778 cur_dir->dir_type = OBJECT_TYPE_NONE; | |
779 cur_dir->currentIndex = 0; | |
780 cur_dir->num_objs = 0; | |
781 cur_dir->startIndex = 0; | |
782 switch(mnu->lCursor[mnu->level]) | |
783 { | |
784 case 0: | |
785 fm_data->app = FM_IMAGE; | |
786 cur_dir->dir_type=OBJECT_TYPE_IMAGE_FOLDER; | |
787 break; | |
788 case 1: | |
789 fm_data->app = FM_AUDIO; | |
790 cur_dir->dir_type=OBJECT_TYPE_AUDIO_FOLDER; | |
791 break; | |
792 } | |
793 //Based on the selected drive, load the root image, audio directory names | |
794 switch(fm_data->source) | |
795 { | |
796 case FM_NOR_FLASH: | |
797 if(cur_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
798 { | |
799 strcpy( cur_dir->dir_path, NORDIR); | |
800 strcpy( cur_dir->dir_name, NORDIR_IMG); | |
801 } | |
802 else if(cur_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
803 { | |
804 strcpy( cur_dir->dir_path, NORDIR); | |
805 strcpy( cur_dir->dir_name, NORDIR_AUD); | |
806 } | |
807 break; | |
808 case FM_NORMS_FLASH: | |
809 if(cur_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
810 { | |
811 strcpy( cur_dir->dir_path, NORMSDIR); | |
812 strcpy( cur_dir->dir_name, NORMSDIR_IMG); | |
813 } | |
814 else if(cur_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
815 { | |
816 strcpy( cur_dir->dir_path, NORMSDIR); | |
817 strcpy( cur_dir->dir_name, NORMSDIR_AUD); | |
818 } | |
819 break; | |
820 case FM_NAND_FLASH: | |
821 if(cur_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
822 { | |
823 strcpy( cur_dir->dir_path, NANDDIR); | |
824 strcpy( cur_dir->dir_name, NANDDIR_IMG); | |
825 } | |
826 else if(cur_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
827 { | |
828 strcpy( cur_dir->dir_path, NANDDIR); | |
829 strcpy( cur_dir->dir_name, NANDDIR_AUD); | |
830 } | |
831 break; | |
832 case FM_T_FLASH: | |
833 if(cur_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
834 { | |
835 strcpy( cur_dir->dir_path, TFLASHDIR); | |
836 strcpy( cur_dir->dir_name, TFLASHDIR_IMG); | |
837 } | |
838 else if(cur_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
839 { | |
840 strcpy( cur_dir->dir_path, TFLASHDIR); | |
841 strcpy( cur_dir->dir_name, TFLASHDIR_AUD); | |
842 } | |
843 break; | |
844 } | |
845 TRACE_EVENT_P2("Path %s Dir %s", cur_dir->dir_path,cur_dir->dir_name); | |
846 cur_dir->depth = 1; | |
847 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state12 %d",cur_dir->dirinfo.aud.state); | |
848 mmi_fm_start( parent_win); | |
849 return MFW_EVENT_CONSUMED; | |
850 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state13 %d",cur_dir->dirinfo.aud.state); | |
851 } | |
852 | |
853 /******************************************************************************* | |
854 $Function: mmi_fm_start | |
855 | |
856 $Description: To create the FileManager window | |
857 | |
858 $Returns: Created Window Pointer | |
859 | |
860 $Arguments: parent_win -Parent Window | |
861 *******************************************************************************/ | |
862 static T_MFW_HND mmi_fm_start( T_MFW_HND parent_win) | |
863 { | |
864 TRACE_FUNCTION("mmi_fm_list_Start"); | |
865 | |
866 //Checks and creates the root directories for image and audio | |
867 mfw_fm_createRootDir(fm_data->source); | |
868 | |
869 //Creating the root window for FileManager | |
870 fm_data->root_win=mmi_fm_create(parent_win); | |
871 | |
872 if (fm_data->root_win NEQ NULL) | |
873 { | |
874 fm_data->opt_type=FM_NONE; | |
875 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
876 } | |
877 return fm_data->root_win; | |
878 } | |
879 | |
880 /******************************************************************************* | |
881 $Function: mmi_fm_create | |
882 | |
883 $Description: To create the FileManager window | |
884 | |
885 $Returns: Created Window Pointer | |
886 | |
887 $Arguments: parent_win -Parent Window | |
888 *******************************************************************************/ | |
889 static T_MFW_HND mmi_fm_create (T_MFW_HND parent_win) | |
890 { | |
891 | |
892 T_MFW_WIN * win; | |
893 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
894 | |
895 TRACE_FUNCTION("mmi_fm_create"); | |
896 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state31 %d",cur_dir->dirinfo.aud.state); | |
897 | |
898 //Creating the root window for FileManager | |
899 fm_data->root_win = win_create (parent_win, 0, E_WIN_VISIBLE, (T_MFW_CB)mmi_fm_win_cb); | |
900 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state32 %d",cur_dir->dirinfo.aud.state); | |
901 TRACE_EVENT_P1("fm_data->root_win %x",fm_data->root_win); | |
902 if (fm_data->root_win EQ NULL) | |
903 { | |
904 mfwFree((U8 *)fm_data, (U16)sizeof(T_MMI_FM_STRUCT)); | |
905 fm_data=NULL; | |
906 return NULL; | |
907 } | |
908 /* | |
909 connect the dialog data to the MFW-window | |
910 */ | |
911 fm_data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_fm_exec_cb; | |
912 fm_data->mmi_control.data = fm_data; | |
913 fm_data->parent_win= parent_win; | |
914 win = ((T_MFW_HDR *)fm_data->root_win)->data; | |
915 win->user = (void *)fm_data; | |
916 if(fm_data->mfw_win == NULL) | |
917 { | |
918 //Creating the mfw component for the root window for FileManager | |
919 fm_data->mfw_win = (T_MFW_HND)mfw_fm_create(fm_data->root_win, E_FM_ALL_SERVICES, (MfwCb)mmi_fm_app_root_cb); | |
920 } | |
921 if (fm_data->mfw_win== NULL) | |
922 { | |
923 winDelete(fm_data->root_win); | |
924 mfwFree((U8 *)fm_data, (U16)sizeof(T_MMI_FM_STRUCT)); | |
925 fm_data=NULL; | |
926 return NULL; | |
927 } | |
928 | |
929 fm_data->list_win=NULL; | |
930 cur_dir->startIndex=0; | |
931 winShow(fm_data->root_win); | |
932 return fm_data->root_win; | |
933 } | |
934 | |
935 /******************************************************************************* | |
936 $Function: mmi_fm_app_root_cb | |
937 | |
938 $Description: Handler for all the events from mfw for FileManager | |
939 | |
940 $Returns: Execution status | |
941 | |
942 $Arguments: event -window event Id | |
943 para -optional data. | |
944 *******************************************************************************/ | |
945 static int mmi_fm_app_root_cb(T_MFW_EVENT event, void *para) | |
946 { | |
947 T_MFW_HND win = mfw_parent(mfw_header()); | |
948 T_MFW_WIN * win_data; | |
949 T_MMI_FM_STRUCT *fm_data; | |
950 T_FM_CURDIR *cur_dir ; | |
951 T_MFW_FM_PARA *fm_para=(T_MFW_FM_PARA*) para; | |
952 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
953 | |
954 TRACE_FUNCTION ("mmi_fm_app_root_cb()"); | |
955 | |
956 win_data = ((T_MFW_HDR *) win)->data; | |
957 fm_data = (T_MMI_FM_STRUCT *)win_data->user; | |
958 cur_dir = fm_data->cur_dir; | |
959 | |
960 TRACE_EVENT_P2(" Event %x, state %d",event,fm_para->img_state); | |
961 switch (event) | |
962 { | |
963 case E_FM_THMB_INIT: | |
964 if(fm_para->img_state == FM_UCP_NO_ERROR) | |
965 { | |
966 //Initialization successful. Start generating thumbnails | |
967 cur_dir->dirinfo.img.cmd = FM_UCP_THMB_GEN; | |
968 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
969 result = mfw_fm_imgThmb_generate(); | |
970 if(result != FM_UCP_NO_ERROR) | |
971 { | |
972 //Error Generating thumbnails | |
973 //Deinitialize the Thumbnail UCP and destroy it | |
974 TRACE_ERROR("Error generating thumbnails"); | |
975 cur_dir->dirinfo.img.cmd=FM_UCP_THMB_DEINIT; | |
976 cur_dir->dirinfo.img.state=FM_UCP_ERROR; | |
977 result = mfw_fm_imgThmb_deinit(); | |
978 if(result != FM_UCP_NO_ERROR) | |
979 { | |
980 TRACE_ERROR("Error deinitializing the thumbnail UCP"); | |
981 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
982 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
983 result = mfw_fm_imgThmb_destroy(); | |
984 if(result != FM_UCP_NO_ERROR) | |
985 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
986 } | |
987 } | |
988 } | |
989 else | |
990 { | |
991 //Error in initialization. Destroy the Thumbnail UCP | |
992 //Create the Viewer UCP | |
993 result = mfw_fm_imgThmb_destroy(); | |
994 if(result != FM_UCP_NO_ERROR) | |
995 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
996 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
997 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
998 cur_dir->currentIndex = cur_dir->startIndex; | |
999 mmi_fm_img_validate(); | |
1000 mmi_fm_imgThmbDraw_start(); | |
1001 } | |
1002 break; | |
1003 case E_FM_THMB_GEN: | |
1004 switch(fm_para->img_state) | |
1005 { | |
1006 case FM_UCP_NO_ERROR: | |
1007 //Thumbanail generation successful. Continue generating thumbnails | |
1008 cur_dir->dirinfo.img.state = FM_UCP_NO_ERROR; | |
1009 mmi_fm_imgThmbGen(); | |
1010 break; | |
1011 case FM_UCP_ERROR_BAD_STREAM: | |
1012 case FM_UCP_ERROR_UNKNOWN: | |
1013 //NonFatal Error in generation. Deinitialize and Initialize the Thumbnail UCP | |
1014 cur_dir->dirinfo.img.cmd = FM_UCP_THMB_DEINIT; | |
1015 cur_dir->dirinfo.img.state = FM_UCP_ERROR_NONFATAL; | |
1016 result = mfw_fm_imgThmb_deinit(); | |
1017 if(result != FM_UCP_NO_ERROR) | |
1018 { | |
1019 TRACE_ERROR("Error deinitializing the thumbnail UCP"); | |
1020 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
1021 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
1022 result = mfw_fm_imgThmb_destroy(); | |
1023 if(result != FM_UCP_NO_ERROR) | |
1024 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
1025 } | |
1026 break; | |
1027 case FM_UCP_ERROR_NO_MEM: | |
1028 case FM_UCP_ERROR_INVALID_ARGUMENT: | |
1029 case FM_UCP_ERROR: | |
1030 //Fatal Error in generation. Deinitialize and Destroy the Thumbnail UCP | |
1031 cur_dir->dirinfo.img.cmd = FM_UCP_THMB_DEINIT; | |
1032 cur_dir->dirinfo.img.state = FM_UCP_ERROR_FATAL; | |
1033 result = mfw_fm_imgThmb_deinit(); | |
1034 if(result != FM_UCP_NO_ERROR) | |
1035 { | |
1036 TRACE_ERROR("Error deinitializing the thumbnail UCP"); | |
1037 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
1038 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
1039 result = mfw_fm_imgThmb_destroy(); | |
1040 if(result != FM_UCP_NO_ERROR) | |
1041 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
1042 } | |
1043 break; | |
1044 } | |
1045 break; | |
1046 case E_FM_THMB_DEINIT: | |
1047 if(fm_para->img_state == FM_UCP_NO_ERROR) | |
1048 { | |
1049 switch(cur_dir->dirinfo.img.state) | |
1050 { | |
1051 case FM_UCP_NONE: | |
1052 //Had completed thumbnail generation successfully | |
1053 //Thumbnail UCP deinitialized, Destroy the Thumbnail UCP. | |
1054 //Create the Viewer UCP for drawing the thumbnails | |
1055 result = mfw_fm_imgThmb_destroy(); | |
1056 if(result != FM_UCP_NO_ERROR) | |
1057 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
1058 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
1059 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
1060 cur_dir->currentIndex=cur_dir->startIndex; | |
1061 mmi_fm_img_validate(); | |
1062 mmi_fm_imgThmbDraw_start(); | |
1063 break; | |
1064 case FM_UCP_ERROR_FATAL: | |
1065 //Had Encountered a fatal error. | |
1066 //Thumbnail UCP deinitialized, Destroy the Thumbnail UCP. | |
1067 //Create the Viewer UCP for drawing the thumbnails | |
1068 result = mfw_fm_imgThmb_destroy(); | |
1069 if(result != FM_UCP_NO_ERROR) | |
1070 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
1071 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
1072 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
1073 cur_dir->currentIndex=cur_dir->startIndex; | |
1074 mmi_fm_img_validate(); | |
1075 mmi_fm_imgThmbDraw_start(); | |
1076 break; | |
1077 /*May 11, 2007 DRT:OMAPS00132505 x0061088*/ | |
1078 case FM_UCP_ERROR: | |
1079 case FM_UCP_ERROR_NONFATAL: | |
1080 //Had Encountered a nonfatal error. Thumbnail UCP was deinitialized | |
1081 //initialize again to continue with the next thumbnail generation | |
1082 mmi_fm_imgThmbGen_resume(); | |
1083 break; | |
1084 } | |
1085 } | |
1086 else | |
1087 { | |
1088 //Error in deinitializing the Thumbnail UCP. Destroy the Thumbnail UCP. | |
1089 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
1090 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1091 result = mfw_fm_imgThmb_destroy(); | |
1092 if(result != FM_UCP_NO_ERROR) | |
1093 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
1094 } | |
1095 break; | |
1096 case E_FM_IMG_INIT: | |
1097 if(fm_para->img_state == FM_UCP_NO_ERROR) | |
1098 { | |
1099 //Viewer UCP is successfully initialized. | |
1100 if(cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_INIT) | |
1101 { | |
1102 //Draw the 48 X 48 thumbnail | |
1103 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_DRAW; | |
1104 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1105 } | |
1106 else if (cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_INIT) | |
1107 { | |
1108 //Draw the QCIF Width X QCIF Height image | |
1109 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DRAW; | |
1110 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1111 } | |
1112 result = mfw_fm_imgViewer_view(); | |
1113 if(result != FM_UCP_NO_ERROR) | |
1114 { | |
1115 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
1116 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
1117 if( cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) | |
1118 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_DEINIT; | |
1119 else | |
1120 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
1121 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
1122 result = mfw_fm_imgViewer_deinit(); | |
1123 if(result != FM_UCP_NO_ERROR) | |
1124 { | |
1125 //Error deinitializing the Viewer UCP, destroy it | |
1126 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
1127 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1128 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1129 result = mfw_fm_imgViewer_destroy(); | |
1130 if(result != FM_UCP_NO_ERROR) | |
1131 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1132 } | |
1133 } | |
1134 } | |
1135 else | |
1136 { | |
1137 //Error initializing the Viewer UCP. Destroy it | |
1138 //Unlock the keys | |
1139 if(cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_INIT) | |
1140 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
1141 else | |
1142 displayMenuKeys(MENU_KEY_ALL); | |
1143 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
1144 result = mfw_fm_imgViewer_destroy(); | |
1145 if(result != FM_UCP_NO_ERROR) | |
1146 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1147 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1148 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1149 } | |
1150 break; | |
1151 case E_FM_IMG_DRAW: | |
1152 switch(fm_para->img_state ) | |
1153 { | |
1154 case FM_UCP_NO_ERROR: | |
1155 cur_dir->dirinfo.img.state = FM_UCP_NO_ERROR; | |
1156 if(cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) | |
1157 { | |
1158 //Drawing the 48 X 48 thumbnail was successful. Conitnue to the next one | |
1159 cur_dir->currentIndex++; | |
1160 mmi_fm_imgThmbDraw(); | |
1161 } | |
1162 else if(cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW) | |
1163 { | |
1164 //Drawing the QCIF Width X QCIF Height image was successful. Unlock the keys now. | |
1165 displayMenuKeys(MENU_KEY_ALL); | |
1166 } | |
1167 break; | |
1168 case FM_UCP_ERROR_UNKNOWN: | |
1169 case FM_UCP_ERROR_BAD_STREAM: | |
1170 case FM_UCP_ERROR_READ_FAILED: | |
1171 if(cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) | |
1172 { | |
1173 //Error drawing the thumbnail image. Deinitialize the Viewer UCP, Initialize again to draw the next thumbnail. | |
1174 cur_dir->dirinfo.img.cmd=FM_UCP_THMBIMG_DEINIT; | |
1175 cur_dir->dirinfo.img.state = FM_UCP_ERROR_NONFATAL; | |
1176 } | |
1177 else if(cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW) | |
1178 { | |
1179 //Error drawing theQCIF image. Deinitialize the Viewer UCP and destroy it | |
1180 cur_dir->dirinfo.img.cmd=FM_UCP_QCIFIMG_DEINIT; | |
1181 cur_dir->dirinfo.img.state = FM_UCP_ERROR_FATAL; | |
1182 } | |
1183 result = mfw_fm_imgViewer_deinit(); | |
1184 if(result != FM_UCP_NO_ERROR) | |
1185 { | |
1186 //Error deinitializing the Viewer UCP, destroy it | |
1187 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
1188 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1189 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1190 result = mfw_fm_imgViewer_destroy(); | |
1191 if(result != FM_UCP_NO_ERROR) | |
1192 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1193 } | |
1194 break; | |
1195 case FM_UCP_ERROR_INVALID_ARGUMENT: | |
1196 case FM_UCP_ERROR : | |
1197 //Error drawing the image. Deinitialize the Viewer UCP, unblock the keys and destroy it. | |
1198 //48 X 48 Thumbnail drawing | |
1199 if(cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) | |
1200 { | |
1201 cur_dir->dirinfo.img.cmd=FM_UCP_THMBIMG_DEINIT; | |
1202 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
1203 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
1204 } | |
1205 //QCIF Image Drawing | |
1206 else if(cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW) | |
1207 { | |
1208 cur_dir->dirinfo.img.cmd=FM_UCP_QCIFIMG_DEINIT; | |
1209 displayMenuKeys(MENU_KEY_ALL); | |
1210 } | |
1211 cur_dir->dirinfo.img.state = FM_UCP_ERROR_FATAL; | |
1212 result = mfw_fm_imgViewer_deinit(); | |
1213 if(result != FM_UCP_NO_ERROR) | |
1214 { | |
1215 //Error deinitializing the Viewer UCP, destroy it | |
1216 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
1217 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1218 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1219 result = mfw_fm_imgViewer_destroy(); | |
1220 if(result != FM_UCP_NO_ERROR) | |
1221 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1222 } | |
1223 break; | |
1224 } | |
1225 break; | |
1226 case E_FM_IMG_DEINIT: | |
1227 switch(cur_dir->dirinfo.img.state) | |
1228 { | |
1229 case FM_UCP_NONE: | |
1230 //Viewer UCP is deinitialized, destroy it | |
1231 result = mfw_fm_imgViewer_destroy(); | |
1232 break; | |
1233 case FM_UCP_ERROR_NONFATAL: | |
1234 //Viewer UCP is deinitialized, initialize and continue with next one | |
1235 mmi_fm_imgThmbDraw_resume(); | |
1236 break; | |
1237 case FM_UCP_ERROR_FATAL: | |
1238 //Viewer UCP is deinitialized, destroy it | |
1239 result = mfw_fm_imgViewer_destroy(); | |
1240 break; | |
1241 } | |
1242 if(result != FM_UCP_NO_ERROR) | |
1243 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1244 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1245 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1246 switch(fm_data->opt_type) | |
1247 { | |
1248 case FM_OPEN: | |
1249 mmi_fm_open(); | |
1250 break; | |
1251 case FM_BACK: | |
1252 mmi_fm_goback(); | |
1253 break; | |
1254 } | |
1255 break; | |
1256 case E_FM_AUDIO_PROG: | |
1257 pbar_update(para_aud.aud_pt, para_aud.aud_tt); | |
1258 break; | |
1259 case E_FM_AUDIO_STOP: | |
1260 if(fm_para->aud_state != FM_AUD_NONE) | |
1261 { | |
1262 USHORT TextId = TxtAudNotAllowed; | |
1263 //Jul 03,07 DRT:OMAPS00135749 x0062174(Nimitha) | |
1264 //May28,07 DRT:OMAPS00132459 x0061560(sateeshg) | |
1265 /*if(aud_state_back ) | |
1266 { | |
1267 aud_state_back =0; | |
1268 }*/ | |
1269 switch(fm_para->aud_state) | |
1270 { | |
1271 case FM_AUD_ERROR_NOTALLOWED: | |
1272 TextId = TxtAudNotAllowed; | |
1273 break; | |
1274 case FM_AUD_ERROR_AUDIO: | |
1275 TextId = TxtAudAudioError; | |
1276 break; | |
1277 case FM_AUD_ERROR_DENIED: | |
1278 TextId = TxtAudDenied; | |
1279 break; | |
1280 case FM_AUD_ERROR_PLAYER: | |
1281 TextId = TxtAudPlayerError; | |
1282 break; | |
1283 case FM_AUD_ERROR_FFS: | |
1284 TextId = TxtAudFFSError; | |
1285 break; | |
1286 case FM_AUD_ERROR_MSGING: | |
1287 TextId = TxtAudMessagingError; | |
1288 break; | |
1289 case FM_AUD_ERROR_NOTREADY: | |
1290 TextId = TxtAudNotReady; | |
1291 break; | |
1292 case FM_AUD_ERROR_INVALIDPARAM: | |
1293 TextId = TxtAudInvalidParam; | |
1294 break; | |
1295 case FM_AUD_ERROR_INTERNAL: | |
1296 TextId = TxtAudInternalError; | |
1297 break; | |
1298 case FM_AUD_ERROR_MEM: | |
1299 TextId = TxtAudMemoryError; | |
1300 break; | |
1301 case FM_AUD_ERROR_NOTSUPPORTED: | |
1302 TextId = TxtAudNotSupported; | |
1303 break; | |
1304 } | |
1305 mmi_fm_app_show_info(win,TxtError,TextId,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
1306 } | |
1307 /*a0393213(R.Prabakar) OMAPS00128976 - No return to File Management screen when a corrupted file is played | |
1308 The window was not getting destroyed in case of error. Now it's destroyed.*/ | |
1309 if(!IsRealPaused)//Daisy tang added for Real Resume feature 20071107 | |
1310 { | |
1311 if(mmi_progress_bar == PB_ON) | |
1312 { | |
1313 winDelete(pb_win); | |
1314 pb_win = 0; | |
1315 } | |
1316 /* Mar 15, 2007 DRT: OMAPS00120187 x0039928 */ | |
1317 /* Fix: Proper soft keys are displayed */ | |
1318 if(fm_data->opt_win) | |
1319 displaySoftKeys(TxtSelect, TxtSoftBack); | |
1320 else | |
1321 displayMenuKeys(MENU_KEY_UP_DOWN_PLAY); | |
1322 } | |
1323 cur_dir->dirinfo.aud.state = FM_AUD_NONE; | |
1324 aud_state = 1; | |
1325 break; | |
1326 } | |
1327 return MFW_EVENT_CONSUMED; | |
1328 } | |
1329 | |
1330 | |
1331 | |
1332 /******************************************************************************* | |
1333 $Function: mmi_fm_win_cb | |
1334 | |
1335 $Description: Handler for window events for the FileManager window | |
1336 | |
1337 $Returns: Execution status | |
1338 | |
1339 $Arguments: e -window event Id | |
1340 w -current window | |
1341 *******************************************************************************/ | |
1342 int mmi_fm_win_cb (MfwEvt e, MfwWin *w) | |
1343 { | |
1344 TRACE_FUNCTION ("mmi_fm_win_cb()"); | |
1345 // TRACE_EVENT_P1("cur_dir->dirinfo.aud.state6 %d",cur_dir->dirinfo.aud.state); | |
1346 | |
1347 switch (e) | |
1348 { | |
1349 case MfwWinVisible: | |
1350 break; | |
1351 case MfwWinFocussed: | |
1352 break; | |
1353 case MfwWinDelete: | |
1354 break; | |
1355 default: | |
1356 return MFW_EVENT_REJECTED; | |
1357 } | |
1358 return MFW_EVENT_CONSUMED; | |
1359 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state7 %d",cur_dir->dirinfo.aud.state); | |
1360 } | |
1361 | |
1362 /******************************************************************************* | |
1363 $Function: mmi_fm_exec_cb | |
1364 | |
1365 $Description: Handler for events for the FileManager window | |
1366 | |
1367 $Returns: None | |
1368 | |
1369 $Arguments: win -current window | |
1370 event -window event Id | |
1371 value -unique Id | |
1372 parameter -optional data. | |
1373 *******************************************************************************/ | |
1374 void mmi_fm_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
1375 { | |
1376 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | |
1377 T_MMI_FM_STRUCT * fm_data = (T_MMI_FM_STRUCT *)win_data->user; | |
1378 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
1379 | |
1380 TRACE_FUNCTION ("mmi_fm_exec_cb()"); | |
1381 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state9 %d",cur_dir->dirinfo.aud.state); | |
1382 | |
1383 TRACE_EVENT_P1("Event %d",event ); | |
1384 switch (event) | |
1385 { | |
1386 case FM_INIT: | |
1387 mmi_fm_list_create(fm_data->root_win); | |
1388 break; | |
1389 case FM_DESTROY: | |
1390 mmi_fm_destroy(fm_data->root_win); | |
1391 break; | |
1392 case LISTS_REASON_RESUME: | |
1393 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1394 | |
1395 MMI_IMGLIST_CHANGE_STS(MMI_IMGLIST_STS_NORMAL); | |
1396 | |
1397 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1398 if(cur_dir->dir_type == OBJECT_TYPE_IMAGE_FOLDER) | |
1399 { | |
1400 displaySoftKeys(fm_data->menu_list_data->LeftSoftKey,fm_data->menu_list_data->RightSoftKey); | |
1401 mmi_fm_set_mmi_plane_to_front(); | |
1402 } | |
1403 break; | |
1404 case LISTS_REASON_SUSPEND: | |
1405 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1406 | |
1407 MMI_IMGLIST_CHANGE_STS(MMI_IMGLIST_STS_SUSPENDED); | |
1408 | |
1409 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1410 if(cur_dir->dir_type == OBJECT_TYPE_IMAGE_FOLDER) | |
1411 { | |
1412 mmi_fm_set_mmi_plane_to_front(); | |
1413 } | |
1414 break; | |
1415 default: | |
1416 break; | |
1417 } | |
1418 } | |
1419 | |
1420 /******************************************************************************* | |
1421 $Function: mmi_fm_destroy | |
1422 | |
1423 $Description: To destroy the FileManager window | |
1424 | |
1425 $Returns: None | |
1426 | |
1427 $Arguments: own_window -FileManager window | |
1428 *******************************************************************************/ | |
1429 static void mmi_fm_destroy(MfwHnd own_window) | |
1430 { | |
1431 TRACE_FUNCTION ("mmi_fm_destroy()"); | |
1432 // TRACE_EVENT_P1("cur_dir->dirinfo.aud.state10 %d",cur_dir->dirinfo.aud.state); | |
1433 | |
1434 if (own_window) | |
1435 { | |
1436 if ( fm_data ) | |
1437 { | |
1438 //Delete the mfw component of the FileManager | |
1439 if ( fm_data->mfw_win!=NULL) | |
1440 { | |
1441 mfw_fm_delete(fm_data->mfw_win); | |
1442 fm_data->mfw_win = NULL; | |
1443 } | |
1444 //Delete the FileManager window | |
1445 if ( fm_data->root_win!=NULL) | |
1446 { | |
1447 win_delete (fm_data->root_win); | |
1448 fm_data->root_win = NULL; | |
1449 } | |
1450 } | |
1451 } | |
1452 dspl_Enable(1); | |
1453 } | |
1454 | |
1455 /******************************************************************************* | |
1456 $Function: mmi_fm_list_create | |
1457 | |
1458 $Description: Start building the list | |
1459 | |
1460 $Returns: None | |
1461 $Arguments: win -Parent window | |
1462 *******************************************************************************/ | |
1463 void mmi_fm_list_create( T_MFW_HND win) | |
1464 { | |
1465 T_MFW_FM_STATUS status; | |
1466 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
1467 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
1468 | |
1469 TRACE_FUNCTION("mmi_fm_list_create" ); | |
1470 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state34 %d",cur_dir->dirinfo.aud.state); | |
1471 | |
1472 //Read the objects in the given directory | |
1473 status = mfw_fm_readDir(cur_dir->dir_path,cur_dir->dir_name,&cur_dir->num_objs,cur_dir->obj_list,fm_data->source,fm_data->app); | |
1474 if( status == FM_DIR_DOESNOTEXISTS) | |
1475 { | |
1476 //Root directory does not exists, display dialog to user and exit FileManager application | |
1477 TRACE_EVENT("Directory does not exists"); | |
1478 mmi_fm_app_show_info(win,TxtFileNotLoaded,TxtNull,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
1479 mmi_fm_list_destroy(fm_data->root_win); | |
1480 SEND_EVENT(fm_data->root_win,FM_DESTROY,0,NULL); | |
1481 return; | |
1482 } | |
1483 else if( cur_dir->num_objs == 0 ) | |
1484 { | |
1485 //Directory is empty. Display dialog ot teh user and return to previous directory /exit FileManager application | |
1486 TRACE_EVENT("Empty Directory"); | |
1487 /* Mar 30, 2007 DRT: OMAPS00122768 x0039928 */ | |
1488 /* Fix: image viewer is deinitialized */ | |
1489 if( (cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW || cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) && | |
1490 cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
1491 { | |
1492 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_DEINIT; | |
1493 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1494 result = mfw_fm_imgViewer_deinit(); | |
1495 if(result != FM_UCP_NO_ERROR) | |
1496 { | |
1497 //Error deinitializing the Viewer UCP, destroy it | |
1498 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
1499 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1500 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1501 result = mfw_fm_imgViewer_destroy(); | |
1502 if(result != FM_UCP_NO_ERROR) | |
1503 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1504 } | |
1505 } | |
1506 mmi_fm_app_show_info(win,TxtFileNotLoaded,TxtNull,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_nofile_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
1507 return; | |
1508 } | |
1509 //Read the properties for all the files | |
1510 mfw_fm_readProperties(cur_dir->dir_path,cur_dir->dir_name,cur_dir->num_objs,cur_dir->obj_list,cur_dir->obj_properties,fm_data->source, fm_data->app); | |
1511 fm_data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); | |
1512 if(fm_data->menu_list_data == NULL ) | |
1513 { | |
1514 TRACE_EVENT("Memory failure."); | |
1515 return; | |
1516 } | |
1517 fm_data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( (cur_dir->num_objs) * sizeof(T_MFW_MNU_ITEM) ); | |
1518 if(fm_data->menu_list_data->List == NULL) | |
1519 { | |
1520 TRACE_EVENT("Memory failure."); | |
1521 return; | |
1522 } | |
1523 //Based on the directory type, build the corresponding list | |
1524 switch(cur_dir->dir_type) | |
1525 { | |
1526 case OBJECT_TYPE_AUDIO_FOLDER: | |
1527 fm_data->list_win=mmi_fm_aud_list_create(win); | |
1528 break; | |
1529 case OBJECT_TYPE_IMAGE_FOLDER: | |
1530 fm_data->list_win=mmi_fm_img_list_create(win); | |
1531 break; | |
1532 } | |
1533 } | |
1534 | |
1535 /******************************************************************************* | |
1536 $Function: mmi_fm_list_destroy | |
1537 | |
1538 $Description: Frees the memory allocated during list creation | |
1539 | |
1540 $Returns: None | |
1541 | |
1542 $Arguments: own_window -FileManager window | |
1543 *******************************************************************************/ | |
1544 static void mmi_fm_list_destroy(MfwHnd own_window) | |
1545 { | |
1546 T_MFW_WIN * win_data; | |
1547 T_MMI_FM_STRUCT *fm_data; | |
1548 int i=0; | |
1549 T_FM_CURDIR *cur_dir; | |
1550 | |
1551 TRACE_FUNCTION ("mmi_fm_list_destroy()"); | |
1552 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state8 %d",cur_dir->dirinfo.aud.state); | |
1553 | |
1554 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1555 | |
1556 MMI_IMGLIST_CHANGE_STS(MMI_IMGLIST_STS_NORMAL); | |
1557 | |
1558 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1559 if (own_window) | |
1560 { | |
1561 win_data = ((T_MFW_HDR *)own_window)->data; | |
1562 fm_data = (T_MMI_FM_STRUCT *)win_data->user; | |
1563 cur_dir = fm_data->cur_dir; | |
1564 if ( fm_data ) | |
1565 { | |
1566 if (fm_data->menu_list_data != NULL) | |
1567 { | |
1568 #ifdef FF_MMI_UNICODE_SUPPORT | |
1569 if (fm_data->app == FM_AUDIO) | |
1570 { | |
1571 for (i=0; i<cur_dir->num_objs; i++) | |
1572 { | |
1573 mfwFree(fm_data->menu_list_data->List[i].str, (wstrlen(cur_dir->obj_list[i]->name_uc)+1)*2); | |
1574 } | |
1575 } | |
1576 #endif | |
1577 mfwFree( (U8 *)fm_data->menu_list_data->List,(cur_dir->num_objs) * sizeof(T_MFW_MNU_ITEM) ); | |
1578 mfwFree ((U8 *)fm_data->menu_list_data, sizeof(ListMenuData)); | |
1579 } | |
1580 i=0; | |
1581 while(cur_dir->obj_list[i] != NULL) | |
1582 { | |
1583 mfwFree((U8 *)cur_dir->obj_list[i], sizeof(T_FM_OBJ)); | |
1584 cur_dir->obj_list[i] = NULL; | |
1585 mfwFree((U8 *)cur_dir->obj_properties[i], sizeof(T_FM_OBJ_PROPERTIES)); | |
1586 cur_dir->obj_properties[i] = NULL; | |
1587 mfwFree((U8 *)cur_dir->obj_data[i], sizeof(T_FM_OBJ_DATA)); | |
1588 cur_dir->obj_data[i] = NULL; | |
1589 i++; | |
1590 } | |
1591 | |
1592 } | |
1593 } | |
1594 | |
1595 } | |
1596 | |
1597 /******************************************************************************* | |
1598 $Function: mmi_fm_img_validate | |
1599 | |
1600 $Description: Validates the files in the image folder. Checks for thumbnail and updates | |
1601 the flag for each object in the given image folder | |
1602 | |
1603 $Returns: None | |
1604 | |
1605 $Arguments: None | |
1606 *******************************************************************************/ | |
1607 BOOL mmi_fm_img_validate(void) | |
1608 { | |
1609 USHORT count = 0; | |
1610 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
1611 char *ext; | |
1612 T_MFW_FM_STATUS status; | |
1613 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
1614 BOOL thumbanil_generation= FALSE; | |
1615 | |
1616 TRACE_FUNCTION ("mmi_fm_img_validate()"); | |
1617 for (count=0; count<cur_dir->num_objs; count++) | |
1618 { | |
1619 strcpy(curFilename,cur_dir->obj_list[count]->name); | |
1620 cur_dir->obj_data[count] = (T_FM_OBJ_DATA*)mfwAlloc(sizeof(T_FM_OBJ_DATA)); | |
1621 if(cur_dir->obj_list[count]->type == OBJECT_TYPE_FILE || cur_dir->obj_list[count]->type == OBJECT_TYPE_IMAGE) | |
1622 { | |
1623 ext=(char *)mmi_fm_get_ext(curFilename); | |
1624 if(strcmp((const char*)ext, "jpg") == 0 ) | |
1625 { | |
1626 cur_dir->obj_list[count]->type = OBJECT_TYPE_IMAGE; | |
1627 mmi_fm_get_filename(curFilename); | |
1628 status=mfw_fm_checkThumbnail(curFilename,fm_data->source); | |
1629 if(status == FM_FILE_EXISTS) | |
1630 { | |
1631 TRACE_EVENT("Thumbnail exists()"); | |
1632 cur_dir->obj_data[count]->image.thumbnail = TRUE; | |
1633 } | |
1634 else | |
1635 { | |
1636 TRACE_EVENT("Thumbnail does not exists()"); | |
1637 cur_dir->obj_data[count]->image.thumbnail = FALSE; | |
1638 //Thumbnail generation required | |
1639 thumbanil_generation = TRUE; | |
1640 } | |
1641 } | |
1642 else | |
1643 { | |
1644 //Other unsupported files | |
1645 cur_dir->obj_data[count]->image.thumbnail=FALSE; | |
1646 } | |
1647 } | |
1648 else | |
1649 { | |
1650 cur_dir->obj_data[count]->image.thumbnail=FALSE; | |
1651 } | |
1652 } | |
1653 return thumbanil_generation; | |
1654 } | |
1655 | |
1656 | |
1657 /******************************************************************************* | |
1658 $Function: mmi_fm_img_list_create | |
1659 | |
1660 $Description: Creates the image files list | |
1661 | |
1662 $Returns: Created Window Pointer | |
1663 | |
1664 $Arguments: win -Parent window | |
1665 *******************************************************************************/ | |
1666 T_MFW_HND mmi_fm_img_list_create(T_MFW_HND win) | |
1667 { | |
1668 USHORT file_count = 0, list_count=0; | |
1669 BOOL thumbanil_generation= FALSE; | |
1670 | |
1671 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
1672 | |
1673 TRACE_FUNCTION ("mmi_fm_img_list_create()"); | |
1674 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1675 | |
1676 MMI_IMGLIST_CHANGE_STS(MMI_IMGLIST_STS_NORMAL); | |
1677 | |
1678 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1679 | |
1680 //Traverse through the list to find out valid image objects in the given directory, | |
1681 //and if thumbnail generation is needed | |
1682 thumbanil_generation = mmi_fm_img_validate(); | |
1683 cur_dir->startIndex = 0; | |
1684 for (file_count=0; file_count<cur_dir->num_objs; file_count++) | |
1685 { | |
1686 if(cur_dir->obj_list[file_count]->type == OBJECT_TYPE_FILE || cur_dir->obj_list[file_count]->type == OBJECT_TYPE_IMAGE) | |
1687 { | |
1688 mnuInitDataItem(&fm_data->menu_list_data->List[list_count]); | |
1689 fm_data->menu_list_data->List[list_count].icon=&fmIconFile; | |
1690 fm_data->menu_list_data->List[list_count].str = (char *)cur_dir->obj_list[file_count]->name; | |
1691 fm_data->menu_list_data->List[list_count].flagFunc = item_flag_none; | |
1692 list_count++; | |
1693 } | |
1694 else if( cur_dir->obj_list[file_count]->type == OBJECT_TYPE_FOLDER) | |
1695 { | |
1696 mnuInitDataItem(&fm_data->menu_list_data->List[list_count]); | |
1697 fm_data->menu_list_data->List[list_count].icon=&fmIconFolder; | |
1698 fm_data->menu_list_data->List[list_count].str = (char *)cur_dir->obj_list[file_count]->name; | |
1699 fm_data->menu_list_data->List[list_count].flagFunc = item_flag_none; | |
1700 list_count++; | |
1701 } | |
1702 } | |
1703 fm_data->menu_list_data->ListLength = list_count; | |
1704 fm_data->menu_list_data->ListPosition = cur_dir->startIndex+1; | |
1705 fm_data->menu_list_data->CursorPosition = cur_dir->startIndex+1; | |
1706 if(cur_dir->num_objs < 3) | |
1707 fm_data->menu_list_data->SnapshotSize =cur_dir->num_objs;// list_count; | |
1708 else | |
1709 fm_data->menu_list_data->SnapshotSize =3;// list_count; | |
1710 fm_data->menu_list_data->Font = 1; | |
1711 fm_data->menu_list_data->LeftSoftKey = TxtSoftOptions; | |
1712 fm_data->menu_list_data->RightSoftKey = TxtSoftBack; | |
1713 fm_data->menu_list_data->KeyEvents = KEY_ALL; | |
1714 fm_data->menu_list_data->Reason = 0; | |
1715 fm_data->menu_list_data->Strings = TRUE; | |
1716 fm_data->menu_list_data->Attr = (MfwMnuAttr*)&FMList_Attrib; | |
1717 fm_data->menu_list_data->autoDestroy = FALSE; | |
1718 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
1719 fm_data->list_state = FM_LIST_CREATE; | |
1720 | |
1721 //Create the List window with default file and folder icons | |
1722 listIconsDisplayListMenu(win, fm_data->menu_list_data, (ListCbFunc)mmi_fm_img_list_cb, 0); | |
1723 dspl_Enable(1); | |
1724 cur_dir->currentIndex=cur_dir->startIndex; | |
1725 TRACE_EVENT_P2("Num of obj %d, CurrIndex %d",cur_dir->num_objs, cur_dir->currentIndex); | |
1726 if(thumbanil_generation && (fm_data->opt_type == FM_NONE || fm_data->opt_type == FM_OPEN)) | |
1727 { | |
1728 //Thumbnails need to be generated | |
1729 mmi_fm_imgThmbGen_start(); | |
1730 } | |
1731 else | |
1732 { | |
1733 //Thumbnails are already generated | |
1734 mmi_fm_imgThmbDraw_start(); | |
1735 } | |
1736 return fm_data->menu_list_data->win; | |
1737 } | |
1738 | |
1739 /******************************************************************************* | |
1740 $Function: mmi_fm_img_list_cb | |
1741 | |
1742 $Description: Call back function for the image list window | |
1743 | |
1744 $Returns: None | |
1745 | |
1746 $Arguments: Parent -window handler | |
1747 List Data -Menu list data | |
1748 *******************************************************************************/ | |
1749 void mmi_fm_img_list_cb(T_MFW_HND * Parent, ListMenuData * ListData) | |
1750 { | |
1751 T_FM_CURDIR *cur_dir ; | |
1752 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
1753 | |
1754 TRACE_FUNCTION("mmi_fm_img_list_cb"); | |
1755 | |
1756 cur_dir = fm_data->cur_dir; | |
1757 mmi_fm_set_mmi_plane_to_front(); | |
1758 TRACE_EVENT_P1("Reason %d",ListData->Reason); | |
1759 switch(ListData->Reason) | |
1760 { | |
1761 case LISTS_REASON_SELECT: | |
1762 cur_dir->currentIndex=ListData->CursorPosition; | |
1763 if(ListData->selectKey==TRUE) | |
1764 { | |
1765 fm_data->opt_type=FM_OPEN; | |
1766 switch(cur_dir->obj_list[cur_dir->currentIndex]->type) | |
1767 { | |
1768 case OBJECT_TYPE_IMAGE : | |
1769 TRACE_EVENT("OBJECT_TYPE_IMAGE" ); | |
1770 if(cur_dir->obj_data[cur_dir->currentIndex]->image.thumbnail == TRUE && | |
1771 cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW && | |
1772 cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
1773 { | |
1774 mmi_fm_view_start(); | |
1775 } | |
1776 else | |
1777 { | |
1778 mmi_fm_app_show_info(fm_data->list_win,TxtNo,TxtThumbnail,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
1779 } | |
1780 break; | |
1781 case OBJECT_TYPE_FOLDER: | |
1782 case OBJECT_TYPE_IMAGE_FOLDER: | |
1783 TRACE_EVENT("OBJECT_TYPE_FOLDER" ); | |
1784 if( (cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW || cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) && | |
1785 cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
1786 { | |
1787 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_DEINIT; | |
1788 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1789 result = mfw_fm_imgViewer_deinit(); | |
1790 if(result != FM_UCP_NO_ERROR) | |
1791 { | |
1792 //Error deinitializing the Viewer UCP, destroy it | |
1793 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
1794 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1795 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1796 result = mfw_fm_imgViewer_destroy(); | |
1797 if(result != FM_UCP_NO_ERROR) | |
1798 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1799 } | |
1800 } | |
1801 else | |
1802 mmi_fm_open(); | |
1803 break; | |
1804 case OBJECT_TYPE_FILE: | |
1805 TRACE_EVENT("OBJECT_TYPE_FILE" ); | |
1806 mmi_fm_app_show_info(fm_data->list_win,TxtNo,TxtThumbnail,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
1807 break; | |
1808 } | |
1809 } | |
1810 else | |
1811 { | |
1812 TRACE_EVENT("Left Softkey" ); | |
1813 fm_data->opt_type=FM_OPTIONS_FOLDER; | |
1814 fm_data->opt_win=(T_MFW_HND)bookMenuStart(fm_data->root_win, FMMenuOptionAttributes(),0); | |
1815 } | |
1816 break; | |
1817 case LISTS_REASON_BACK: | |
1818 case LISTS_REASON_HANGUP: /* Apr 10, 2007 DRT: OMAPS00125325 x0039928 */ | |
1819 TRACE_EVENT("Going back" ); | |
1820 fm_data->opt_type=FM_BACK; | |
1821 if( (cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW || cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW) && | |
1822 cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
1823 { | |
1824 cur_dir->dirinfo.img.cmd=FM_UCP_THMBIMG_DEINIT; | |
1825 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1826 if(cur_dir->num_objs) | |
1827 { | |
1828 result = mfw_fm_imgViewer_deinit(); | |
1829 if(result != FM_UCP_NO_ERROR) | |
1830 { | |
1831 //Error deinitializing the Viewer UCP, destroy it | |
1832 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
1833 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
1834 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
1835 result = mfw_fm_imgViewer_destroy(); | |
1836 if(result != FM_UCP_NO_ERROR) | |
1837 TRACE_ERROR("Error destroying the Viewer UCP"); | |
1838 } | |
1839 } | |
1840 else | |
1841 result = mfw_fm_imgViewer_destroy(); | |
1842 } | |
1843 else | |
1844 /* Mar 30, 2007 DRT: OMAPS00122772 x0039928 */ | |
1845 mmi_fm_goback(); | |
1846 break; | |
1847 case LISTS_REASON_DRAWCOMPLETE: | |
1848 TRACE_EVENT("LISTS_REASON_DRAWCOMPLETE " ); | |
1849 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1850 | |
1851 if ( MMI_IMGLIST_STS == MMI_IMGLIST_STS_SUSPENDED ) | |
1852 { | |
1853 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
1854 } | |
1855 else | |
1856 { | |
1857 | |
1858 fm_data->lineheight = ListData->lineHeight; | |
1859 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
1860 if(fm_data->list_state == FM_LIST_UPDATE) | |
1861 { | |
1862 | |
1863 /* Aug 06, 2007 DRT: OMAPS00140423, x0081909 (Deepak) | |
1864 | |
1865 In a list of 5 images when scrolled from 4th image to 3rd,the first file has the thumbnail of the fourth the, | |
1866 second one has the fifth and the third one doesn't have a thumbnail */ | |
1867 | |
1868 /*Now thumbnails are displayed correctly and correspond to the name of the file */ | |
1869 | |
1870 if( (cur_dir->startIndex = (ListData->CursorPosition / ListData->SnapshotSize)*3) != 0) | |
1871 { | |
1872 cur_dir->currentIndex = cur_dir->startIndex; | |
1873 } | |
1874 else | |
1875 { | |
1876 cur_dir->startIndex = 0; | |
1877 cur_dir->currentIndex = cur_dir->startIndex; | |
1878 } | |
1879 /* Aug 06, 2007 DRT: OMAPS00140423, x0081909 (Deepak) end */ | |
1880 | |
1881 mmi_fm_imgThmbDraw(); | |
1882 } | |
1883 else if(fm_data->list_state == FM_LIST_CREATE) | |
1884 fm_data->list_state = FM_LIST_UPDATE; | |
1885 } | |
1886 | |
1887 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1888 break; | |
1889 } | |
1890 } | |
1891 | |
1892 /******************************************************************************* | |
1893 $Function: mmi_fm_view_start | |
1894 | |
1895 $Description: Starts drawing the image in QCIF width and height in a new window | |
1896 | |
1897 $Returns: None | |
1898 | |
1899 $Arguments: None | |
1900 *******************************************************************************/ | |
1901 void mmi_fm_view_start(void) | |
1902 { | |
1903 TRACE_FUNCTION("mmi_fm_view_start"); | |
1904 | |
1905 fm_data->img_win = mmi_fm_view_create(); | |
1906 } | |
1907 | |
1908 /******************************************************************************* | |
1909 $Function: mmi_fm_view_create | |
1910 | |
1911 $Description: Creates a new window for drawing the image in QCIF width and height | |
1912 | |
1913 $Returns: None | |
1914 | |
1915 $Arguments: None | |
1916 *******************************************************************************/ | |
1917 T_MFW_HND mmi_fm_view_create(void) | |
1918 { | |
1919 T_MMI_FM_IMGDRAW_STRUCT *imgDraw_data; | |
1920 T_MFW_WIN * win; | |
1921 | |
1922 TRACE_FUNCTION("mmi_fm_view_create"); | |
1923 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1924 | |
1925 MMI_IMGVIEWER_CHANGE_STS(MMI_IMGVIEWER_STS_NORMAL); | |
1926 | |
1927 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1928 | |
1929 imgDraw_data = (T_MMI_FM_IMGDRAW_STRUCT *)mfwAlloc(sizeof(T_MMI_FM_IMGDRAW_STRUCT)); | |
1930 | |
1931 //Create a window for drawing the image in QCIF width and height | |
1932 imgDraw_data->img_win = win_create (fm_data->list_win, 0, E_WIN_VISIBLE|E_WIN_SUSPEND|E_WIN_RESUME|E_WIN_DELETE, (T_MFW_CB)mmi_fm_view_win_cb); | |
1933 | |
1934 imgDraw_data ->mmi_control.dialog = (T_DIALOG_FUNC)mmi_fm_view_exec_cb; | |
1935 imgDraw_data ->mmi_control.data = imgDraw_data ; | |
1936 imgDraw_data->parent_win= fm_data->list_win; | |
1937 win = (T_MFW_WIN *)getWinData(imgDraw_data->img_win); | |
1938 win->user = (MfwUserDataPtr)imgDraw_data; | |
1939 imgDraw_data->kbd = kbd_create (imgDraw_data->img_win,KEY_ALL|KEY_MAKE,(T_MFW_CB)mmi_fm_view_kbd_cb); | |
1940 SEND_EVENT(imgDraw_data->img_win, FM_IMGDRAW_INIT, 0, (void *)NULL); | |
1941 winShow(imgDraw_data->img_win ); | |
1942 return imgDraw_data->img_win ; | |
1943 } | |
1944 | |
1945 /******************************************************************************* | |
1946 $Function: mmi_fm_view_exec_cb | |
1947 | |
1948 $Description: Img draw call back for the | |
1949 | |
1950 $Returns: None | |
1951 | |
1952 $Arguments: win -current window | |
1953 event -window event Id | |
1954 value -unique Id | |
1955 parameter -optional data. | |
1956 *******************************************************************************/ | |
1957 void mmi_fm_view_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
1958 { | |
1959 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | |
1960 T_MMI_FM_IMGDRAW_STRUCT * imgDraw_data = (T_MMI_FM_IMGDRAW_STRUCT *)win_data->user; | |
1961 | |
1962 TRACE_FUNCTION("mmi_fm_view_exec_cb"); | |
1963 TRACE_EVENT_P1("event %d",event); | |
1964 switch (event) | |
1965 { | |
1966 case FM_IMGDRAW_INIT: | |
1967 dspl_ClearAll(); | |
1968 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
1969 mmi_fm_set_mmi_plane_to_front(); | |
1970 imgDraw_data->zoom = MFW_FM_ZOOM_LOW; | |
1971 imgDraw_data->rotate = MFW_FM_ROTATE_0; | |
1972 break; | |
1973 case FM_IMGDRAW_DRAW: | |
1974 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
1975 | |
1976 if ( MMI_IMGVIEWER_STS == MMI_IMGVIEWER_STS_SUSPENDED ) | |
1977 { | |
1978 displayMenuKeys(MENU_KEY_ALL); | |
1979 } | |
1980 else | |
1981 { | |
1982 displayMenuKeys(MENU_KEY_WAIT); | |
1983 mmi_fm_imgDraw(); | |
1984 } | |
1985 | |
1986 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
1987 break; | |
1988 case FM_IMGDRAW_SUSPEND: | |
1989 mmi_fm_set_mmi_plane_to_front(); | |
1990 break; | |
1991 case FM_IMGDRAW_RESUME: | |
1992 mmi_fm_set_mmi_plane_to_front(); | |
1993 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
1994 break; | |
1995 case FM_IMGDRAW_DESTROY: | |
1996 mmi_fm_view_destroy(imgDraw_data); | |
1997 break; | |
1998 } | |
1999 } | |
2000 | |
2001 /******************************************************************************* | |
2002 $Function: mmi_fm_view_win_cb | |
2003 | |
2004 $Description: Handler for window events for the image window | |
2005 | |
2006 $Returns: Execution status | |
2007 | |
2008 $Arguments: e -window event Id | |
2009 w -current window | |
2010 *******************************************************************************/ | |
2011 int mmi_fm_view_win_cb (MfwEvt e, MfwWin *w) | |
2012 { | |
2013 T_MMI_FM_IMGDRAW_STRUCT * imgDraw_data = (T_MMI_FM_IMGDRAW_STRUCT *)w->user; | |
2014 TRACE_FUNCTION ("mmi_fm_view_win_cb()"); | |
2015 TRACE_EVENT_P1("event %d",e); | |
2016 switch (e) | |
2017 { | |
2018 case MfwWinVisible: /* window is visible */ | |
2019 SEND_EVENT(imgDraw_data->img_win, FM_IMGDRAW_DRAW, 0, (void *)NULL); | |
2020 break; | |
2021 case MfwWinSuspend: /* input focus / selected */ | |
2022 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
2023 | |
2024 MMI_IMGVIEWER_CHANGE_STS(MMI_IMGVIEWER_STS_SUSPENDED); | |
2025 | |
2026 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
2027 SEND_EVENT(imgDraw_data->img_win, FM_IMGDRAW_SUSPEND, 0, (void *)NULL); | |
2028 break; | |
2029 case MfwWinResume: /* input focus / selected */ | |
2030 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
2031 | |
2032 MMI_IMGVIEWER_CHANGE_STS(MMI_IMGVIEWER_STS_NORMAL); | |
2033 | |
2034 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
2035 SEND_EVENT(imgDraw_data->img_win, FM_IMGDRAW_RESUME, 0, (void *)NULL); | |
2036 break; | |
2037 case MfwWinDelete: /* window will be deleted */ | |
2038 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- Start --> */ | |
2039 | |
2040 MMI_IMGVIEWER_CHANGE_STS(MMI_IMGVIEWER_STS_NORMAL); | |
2041 | |
2042 /* August 03, 2007 DRT:OMAPS00138886 x0080701 (Bharat) -- End --> */ | |
2043 break; | |
2044 default: | |
2045 return MFW_EVENT_REJECTED; | |
2046 } | |
2047 return MFW_EVENT_CONSUMED; | |
2048 } | |
2049 | |
2050 /******************************************************************************* | |
2051 $Function: mmi_fm_view_kbd_cb | |
2052 | |
2053 $Description: Handler for key events for the image window | |
2054 | |
2055 $Returns: Execution status | |
2056 | |
2057 $Arguments: e -window event Id | |
2058 k -key event | |
2059 *******************************************************************************/ | |
2060 static int mmi_fm_view_kbd_cb (MfwEvt e, MfwKbd *k) | |
2061 { | |
2062 T_MFW_HND win = mfwParent(mfw_header()); | |
2063 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | |
2064 T_MMI_FM_IMGDRAW_STRUCT * data = (T_MMI_FM_IMGDRAW_STRUCT *)win_data->user; | |
2065 char currFile[FM_MAX_DIR_PATH_LENGTH]; | |
2066 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
2067 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
2068 | |
2069 TRACE_FUNCTION("mmi_fm_view_kbd_cb"); | |
2070 | |
2071 if (!(e & KEY_MAKE)) | |
2072 { | |
2073 return MFW_EVENT_CONSUMED; | |
2074 } | |
2075 if(cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW && cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
2076 { | |
2077 //Viewer UCP created successfully. Handle the key events | |
2078 switch (k->code) | |
2079 { | |
2080 case KCD_LEFT: | |
2081 fm_data->opt_type = FM_OPTIONS_FILE; | |
2082 fm_data->opt_win = (T_MFW_HND)bookMenuStart(data->img_win, FMMenuOptionAttributes(),0); | |
2083 break; | |
2084 case KCD_RIGHT: | |
2085 case KCD_HUP: | |
2086 SEND_EVENT(win,FM_IMGDRAW_DESTROY,0,(void *)NULL); | |
2087 break; | |
2088 case KCD_MNUUP: | |
2089 data->zoom = data->zoom * 2; | |
2090 if(data->zoom > MFW_FM_ZOOM_MAX) | |
2091 data->zoom = MFW_FM_ZOOM_MAX; | |
2092 sprintf(currFile,"%s%s/%s",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
2093 result = mfw_fm_imgViewer_setConfigs(currFile,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,0,0,data->zoom, data->rotate, fm_data->source); | |
2094 if(result != FM_UCP_NO_ERROR) | |
2095 { | |
2096 //Error configuring the Viewer UCP, deinit and destroy it | |
2097 TRACE_ERROR("Error configuring Viewer UCP"); | |
2098 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2099 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2100 result = mfw_fm_imgViewer_deinit(); | |
2101 if(result != FM_UCP_NO_ERROR) | |
2102 { | |
2103 //Error deinitializing the Viewer UCP, destroy it | |
2104 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2105 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2106 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2107 result = mfw_fm_imgViewer_destroy(); | |
2108 if(result != FM_UCP_NO_ERROR) | |
2109 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2110 } | |
2111 return MFW_EVENT_CONSUMED; | |
2112 } | |
2113 displayMenuKeys(MENU_KEY_WAIT); | |
2114 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DRAW; | |
2115 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2116 result = mfw_fm_imgViewer_view(); | |
2117 if(result != FM_UCP_NO_ERROR) | |
2118 { | |
2119 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
2120 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
2121 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2122 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2123 result = mfw_fm_imgViewer_deinit(); | |
2124 if(result != FM_UCP_NO_ERROR) | |
2125 { | |
2126 //Error deinitializing the Viewer UCP, destroy it | |
2127 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2128 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2129 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2130 result = mfw_fm_imgViewer_destroy(); | |
2131 if(result != FM_UCP_NO_ERROR) | |
2132 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2133 } | |
2134 } | |
2135 break; | |
2136 case KCD_MNUDOWN: | |
2137 data->zoom = data->zoom / 2; | |
2138 if(data->zoom < MFW_FM_ZOOM_LOW) | |
2139 data->zoom = MFW_FM_ZOOM_LOW; | |
2140 sprintf(currFile,"%s%s/%s",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
2141 result = mfw_fm_imgViewer_setConfigs(currFile,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,0,0,data->zoom, data->rotate,fm_data->source); | |
2142 if(result != FM_UCP_NO_ERROR) | |
2143 { | |
2144 //Error configuring the Viewer UCP, deinit and destroy it | |
2145 TRACE_ERROR("Error configuring Viewer UCP"); | |
2146 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2147 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2148 result = mfw_fm_imgViewer_deinit(); | |
2149 if(result != FM_UCP_NO_ERROR) | |
2150 { | |
2151 //Error deinitializing the Viewer UCP, destroy it | |
2152 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2153 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2154 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2155 result = mfw_fm_imgViewer_destroy(); | |
2156 if(result != FM_UCP_NO_ERROR) | |
2157 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2158 } | |
2159 return MFW_EVENT_CONSUMED; | |
2160 } | |
2161 displayMenuKeys(MENU_KEY_WAIT); | |
2162 cur_dir->dirinfo.img.cmd =FM_UCP_QCIFIMG_DRAW; | |
2163 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2164 result = mfw_fm_imgViewer_view(); | |
2165 if(result != FM_UCP_NO_ERROR) | |
2166 { | |
2167 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
2168 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
2169 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2170 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2171 result = mfw_fm_imgViewer_deinit(); | |
2172 if(result != FM_UCP_NO_ERROR) | |
2173 { | |
2174 //Error deinitializing the Viewer UCP, destroy it | |
2175 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2176 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2177 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2178 result = mfw_fm_imgViewer_destroy(); | |
2179 if(result != FM_UCP_NO_ERROR) | |
2180 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2181 } | |
2182 } | |
2183 break; | |
2184 case KCD_MNURIGHT: | |
2185 data->rotate = (T_FM_IMG_ROTATE) (data->rotate+1); | |
2186 if(data->rotate > MFW_FM_ROTATE_270) | |
2187 data->rotate = MFW_FM_ROTATE_0; | |
2188 sprintf(currFile,"%s%s/%s",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
2189 dspl_ClearAll(); | |
2190 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
2191 dspl_Enable(1); | |
2192 mmi_fm_set_mmi_plane_to_front(); | |
2193 result = mfw_fm_imgViewer_setConfigs(currFile,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,0,0,data->zoom, data->rotate,fm_data->source); | |
2194 if(result != FM_UCP_NO_ERROR) | |
2195 { | |
2196 //Error configuring the Viewer UCP, deinit and destroy it | |
2197 TRACE_ERROR("Error configuring Viewer UCP"); | |
2198 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2199 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2200 result = mfw_fm_imgViewer_deinit(); | |
2201 if(result != FM_UCP_NO_ERROR) | |
2202 { | |
2203 //Error deinitializing the Viewer UCP, destroy it | |
2204 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2205 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2206 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2207 result = mfw_fm_imgViewer_destroy(); | |
2208 if(result != FM_UCP_NO_ERROR) | |
2209 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2210 } | |
2211 return MFW_EVENT_CONSUMED; | |
2212 } | |
2213 displayMenuKeys(MENU_KEY_WAIT); | |
2214 cur_dir->dirinfo.img.cmd =FM_UCP_QCIFIMG_DRAW; | |
2215 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2216 result = mfw_fm_imgViewer_view(); | |
2217 if(result != FM_UCP_NO_ERROR) | |
2218 { | |
2219 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
2220 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
2221 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2222 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2223 result = mfw_fm_imgViewer_deinit(); | |
2224 if(result != FM_UCP_NO_ERROR) | |
2225 { | |
2226 //Error deinitializing the Viewer UCP, destroy it | |
2227 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2228 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2229 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2230 result = mfw_fm_imgViewer_destroy(); | |
2231 if(result != FM_UCP_NO_ERROR) | |
2232 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2233 } | |
2234 } | |
2235 break; | |
2236 case KCD_MNULEFT: | |
2237 data->rotate = (T_FM_IMG_ROTATE) (data->rotate-1); | |
2238 if(data->rotate < MFW_FM_ROTATE_0) | |
2239 data->rotate = MFW_FM_ROTATE_270; | |
2240 sprintf(currFile,"%s%s/%s",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
2241 dspl_ClearAll(); | |
2242 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
2243 dspl_Enable(1); | |
2244 mmi_fm_set_mmi_plane_to_front(); | |
2245 result = mfw_fm_imgViewer_setConfigs(currFile,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,0,0,data->zoom, data->rotate,fm_data->source); | |
2246 if(result != FM_UCP_NO_ERROR) | |
2247 { | |
2248 //Error configuring the Viewer UCP, deinit and destroy it | |
2249 TRACE_ERROR("Error configuring Viewer UCP"); | |
2250 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2251 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2252 result = mfw_fm_imgViewer_deinit(); | |
2253 if(result != FM_UCP_NO_ERROR) | |
2254 { | |
2255 //Error deinitializing the Viewer UCP, destroy it | |
2256 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2257 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2258 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2259 result = mfw_fm_imgViewer_destroy(); | |
2260 if(result != FM_UCP_NO_ERROR) | |
2261 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2262 } | |
2263 return MFW_EVENT_CONSUMED; | |
2264 } | |
2265 displayMenuKeys(MENU_KEY_WAIT); | |
2266 cur_dir->dirinfo.img.cmd =FM_UCP_QCIFIMG_DRAW; | |
2267 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2268 result = mfw_fm_imgViewer_view(); | |
2269 if(result != FM_UCP_NO_ERROR) | |
2270 { | |
2271 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
2272 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
2273 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
2274 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
2275 result = mfw_fm_imgViewer_deinit(); | |
2276 if(result != FM_UCP_NO_ERROR) | |
2277 { | |
2278 //Error deinitializing the Viewer UCP, destroy it | |
2279 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
2280 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
2281 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
2282 result = mfw_fm_imgViewer_destroy(); | |
2283 if(result != FM_UCP_NO_ERROR) | |
2284 TRACE_ERROR("Error destroying the Viewer UCP"); | |
2285 } | |
2286 } | |
2287 break; | |
2288 } | |
2289 } | |
2290 else if(cur_dir->dirinfo.img.cmd == FM_UCP_NONE && cur_dir->dirinfo.img.state == FM_UCP_NONE) | |
2291 { | |
2292 //Viewer UCP was not created successfully. | |
2293 switch (k->code) | |
2294 { | |
2295 case KCD_LEFT: | |
2296 fm_data->opt_type=FM_OPTIONS_FILE; | |
2297 fm_data->opt_win=(T_MFW_HND)bookMenuStart(data->img_win, FMMenuOptionAttributes(),0); | |
2298 break; | |
2299 case KCD_RIGHT: | |
2300 case KCD_HUP: | |
2301 SEND_EVENT(win,FM_IMGDRAW_DESTROY,0,(void *)NULL); | |
2302 break; | |
2303 } | |
2304 } | |
2305 return MFW_EVENT_CONSUMED; | |
2306 } | |
2307 | |
2308 /******************************************************************************* | |
2309 $Function: mmi_fm_view_destroy | |
2310 | |
2311 $Description: Destroys the image window and releases the allocated memory for the internal structure | |
2312 | |
2313 $Returns: None | |
2314 | |
2315 $Arguments: None | |
2316 *******************************************************************************/ | |
2317 void mmi_fm_view_destroy(T_MMI_FM_IMGDRAW_STRUCT * imgDraw_data) | |
2318 { | |
2319 TRACE_FUNCTION("mmi_fm_view_destroy"); | |
2320 | |
2321 mmi_fm_set_mmi_plane_to_front(); | |
2322 winDelete(imgDraw_data->img_win); | |
2323 fm_data->img_win = NULL; | |
2324 mfwFree((U8 *)imgDraw_data, sizeof(T_MMI_FM_IMGDRAW_STRUCT)); | |
2325 | |
2326 } | |
2327 | |
2328 /******************************************************************************* | |
2329 $Function: mmi_fm_aud_validate | |
2330 | |
2331 $Description: Validates the files in the audio folder. | |
2332 | |
2333 $Returns: None | |
2334 | |
2335 $Arguments: None | |
2336 *******************************************************************************/ | |
2337 void mmi_fm_aud_validate(void) | |
2338 { | |
2339 USHORT count = 0; | |
2340 #ifdef FF_MMI_UNICODE_SUPPORT | |
2341 T_WCHAR curFilename_uc[FM_MAX_OBJ_NAME_LENGTH]; | |
2342 #else | |
2343 char curFilename_u8[FM_MAX_OBJ_NAME_LENGTH]; | |
2344 #endif | |
2345 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2346 | |
2347 char ext[FM_MAX_EXT_LENGTH]; | |
2348 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
2349 | |
2350 TRACE_FUNCTION ("mmi_fm_aud_validate()"); | |
2351 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state03 %d",cur_dir->dirinfo.aud.state); | |
2352 for (count=0; count<cur_dir->num_objs; count++) | |
2353 { | |
2354 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2355 #ifdef FF_MMI_UNICODE_SUPPORT | |
2356 wstrcpy(curFilename_uc,cur_dir->obj_list[count]->name_uc); | |
2357 #else | |
2358 strcpy(curFilename_u8,cur_dir->obj_list[count]->name); | |
2359 #endif | |
2360 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2361 cur_dir->obj_data[count] = (T_FM_OBJ_DATA*)mfwAlloc(sizeof(T_FM_OBJ_DATA)); | |
2362 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2363 #ifdef FF_MMI_UNICODE_SUPPORT | |
2364 TRACE_EVENT_P2("File %s type %d",cur_dir->obj_list[count]->name_uc,cur_dir->obj_list[count]->type); | |
2365 #else | |
2366 TRACE_EVENT_P2("File %s type %d",cur_dir->obj_list[count]->name,cur_dir->obj_list[count]->type); | |
2367 #endif | |
2368 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2369 if(cur_dir->obj_list[count]->type == OBJECT_TYPE_FILE ) | |
2370 { | |
2371 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2372 #ifdef FF_MMI_UNICODE_SUPPORT | |
2373 convert_unicode_to_u8(wstrchr(curFilename_uc,'.')+1, ext); | |
2374 #else | |
2375 strcpy(ext, mmi_fm_get_ext(curFilename_u8)); | |
2376 #endif | |
2377 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2378 if(strcmp((const char*)ext, "mid") == 0 ) | |
2379 { | |
2380 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_MIDI; | |
2381 } | |
2382 else if(strcmp((const char*)ext, "mp3") == 0 ) | |
2383 { | |
2384 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_MP3; | |
2385 } | |
2386 else if(strcmp((const char*)ext, "aac") == 0 ) | |
2387 { | |
2388 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_AAC; | |
2389 } /* Apr 06, 2007 DRT: OMAPS00124874 x0039928 */ | |
2390 else if(strcmp((const char*)ext, "xmf") == 0 ) | |
2391 { | |
2392 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_XMF; | |
2393 } | |
2394 else if(strcmp((const char*)ext, "imy") == 0 ) | |
2395 { | |
2396 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_IMY; | |
2397 } | |
2398 else if(strcmp((const char*)ext, "mmf") == 0 ) | |
2399 { | |
2400 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_MMF; | |
2401 } | |
2402 else if(strcmp((const char*)ext, "mxmf") == 0 ) | |
2403 { | |
2404 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_MXMF; | |
2405 } | |
2406 else if(strcmp((const char*)ext, "sms") == 0 ) | |
2407 { | |
2408 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_SMS; | |
2409 } | |
2410 else if(strcmp((const char*)ext, "wav") == 0 ) | |
2411 { | |
2412 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO_WAV; | |
2413 } | |
2414 else | |
2415 cur_dir->obj_list[count]->type = OBJECT_TYPE_AUDIO; | |
2416 } | |
2417 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2418 #ifdef FF_MMI_UNICODE_SUPPORT | |
2419 TRACE_EVENT_P2("File %s type %d",cur_dir->obj_list[count]->name_uc,cur_dir->obj_list[count]->type); | |
2420 #else | |
2421 TRACE_EVENT_P2("File %s type %d",cur_dir->obj_list[count]->name,cur_dir->obj_list[count]->type); | |
2422 #endif | |
2423 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2424 } | |
2425 } | |
2426 | |
2427 /******************************************************************************* | |
2428 $Function: mmi_fm_aud_list_cb | |
2429 | |
2430 $Description: Call back function for the audio list window | |
2431 | |
2432 $Returns: None | |
2433 | |
2434 $Arguments: Parent -window handler | |
2435 List Data -Menu list data | |
2436 *******************************************************************************/ | |
2437 | |
2438 void mmi_fm_aud_list_cb(T_MFW_HND * Parent, ListMenuData * ListData) | |
2439 { | |
2440 T_MFW_WIN * win_data; | |
2441 T_MMI_FM_STRUCT* fm_data; | |
2442 T_FM_CURDIR *cur_dir; | |
2443 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
2444 T_FM_AUD_STATE aud_state; | |
2445 int state; | |
2446 | |
2447 | |
2448 win_data = ((T_MFW_HDR *)Parent)->data; | |
2449 fm_data = (T_MMI_FM_STRUCT*)win_data->user; | |
2450 cur_dir = fm_data->cur_dir; | |
2451 TRACE_EVENT_P1("Reason %d",ListData->Reason); | |
2452 switch(ListData->Reason) | |
2453 { | |
2454 case LISTS_REASON_SELECT: | |
2455 cur_dir->currentIndex=ListData->CursorPosition; | |
2456 //Jun 26, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
2457 state = mmi_get_aud_state_status(); | |
2458 if( state == FM_AUD_PLAY) | |
2459 { | |
2460 cur_dir->dirinfo.aud.state = FM_AUD_PLAY; | |
2461 mmi_set_aud_state_status(FM_AUD_NONE); | |
2462 } | |
2463 /* Apr 06, 2007 DRT: OMAPS00124874 x0039928 */ | |
2464 | |
2465 //Jun 26, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
2466 //May28,07 DRT:OMAPS00132459 x0061560(sateeshg) | |
2467 /*if(aud_state_back ) | |
2468 { | |
2469 displayMenuKeys(MENU_KEY_UP_DOWN_STOP); | |
2470 cur_dir->dirinfo.aud.state = FM_AUD_PLAY; | |
2471 aud_state_back=0; | |
2472 }*/ | |
2473 | |
2474 | |
2475 cur_dir->currentIndex=ListData->CursorPosition; | |
2476 /* Apr 06, 2007 DRT: OMAPS00124874 x0039928 */ | |
2477 | |
2478 //May28,07 DRT:OMAPS00132459 x0061560(sateeshg) | |
2479 /*if(aud_state_back ) | |
2480 { | |
2481 displayMenuKeys(MENU_KEY_UP_DOWN_STOP); | |
2482 cur_dir->dirinfo.aud.state = FM_AUD_PLAY; | |
2483 aud_state_back=0; | |
2484 }*/ | |
2485 | |
2486 | |
2487 if(ListData->selectKey==TRUE) | |
2488 { | |
2489 if(cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO || | |
2490 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MIDI || | |
2491 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MP3 || | |
2492 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_AAC || | |
2493 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_XMF || | |
2494 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_IMY || | |
2495 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MMF || | |
2496 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MXMF || | |
2497 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_SMS || | |
2498 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_WAV) | |
2499 { | |
2500 | |
2501 switch(cur_dir->dirinfo.aud.state) | |
2502 { | |
2503 case FM_AUD_NONE: | |
2504 { | |
2505 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2506 #ifdef FF_MMI_UNICODE_SUPPORT | |
2507 T_WCHAR filename_uc[FM_MAX_DIR_PATH_LENGTH]; | |
2508 #endif | |
2509 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2510 | |
2511 cur_dir->dirinfo.aud.state = FM_AUD_PLAY; | |
2512 switch(fm_data->source) | |
2513 { | |
2514 case FM_NOR_FLASH: | |
2515 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2516 #ifdef FF_MMI_UNICODE_SUPPORT | |
2517 sprintf(currFilePath,"%s%s%s/","/FFS",cur_dir->dir_path,cur_dir->dir_name); | |
2518 #else | |
2519 sprintf(currFilePath,"%s%s%s/%s","/FFS",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
2520 #endif | |
2521 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2522 break; | |
2523 | |
2524 case FM_NORMS_FLASH: | |
2525 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2526 #ifdef FF_MMI_UNICODE_SUPPORT | |
2527 sprintf(currFilePath,"%s%s%s/","/NOR",cur_dir->dir_path,cur_dir->dir_name); | |
2528 #else | |
2529 sprintf(currFilePath,"%s%s%s/%s","/NOR",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
2530 #endif | |
2531 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2532 break; | |
2533 | |
2534 case FM_NAND_FLASH: | |
2535 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2536 #ifdef FF_MMI_UNICODE_SUPPORT | |
2537 sprintf(currFilePath,"%s%s%s/","/NAND",cur_dir->dir_path,cur_dir->dir_name); | |
2538 #else | |
2539 sprintf(currFilePath,"%s%s%s/%s","/NAND",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
2540 #endif | |
2541 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2542 break; | |
2543 | |
2544 case FM_T_FLASH: | |
2545 #ifdef FF_MMI_UNICODE_SUPPORT | |
2546 sprintf(currFilePath,"%s%s%s/","/MMC",cur_dir->dir_path,cur_dir->dir_name); | |
2547 #else | |
2548 sprintf(currFilePath,"%s%s%s/%s","/MMC",cur_dir->dir_path,cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
2549 #endif | |
2550 break; | |
2551 } | |
2552 | |
2553 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2554 #ifdef FF_MMI_UNICODE_SUPPORT | |
2555 convert_u8_to_unicode(currFilePath, filename_uc); | |
2556 wstrcat(filename_uc, cur_dir->obj_list[cur_dir->currentIndex]->name_uc); | |
2557 #endif | |
2558 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2559 if(mmi_progress_bar == PB_OFF) | |
2560 { | |
2561 IsMP3Playing = TRUE;//Daisy tang added for Real Resume feature 20071107 | |
2562 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2563 #ifdef FF_MMI_UNICODE_SUPPORT | |
2564 aud_state =mfw_fm_audPlay(filename_uc, cur_dir->obj_list[cur_dir->currentIndex]->type, mmi_progress_bar); | |
2565 #else | |
2566 aud_state =mfw_fm_audPlay(currFilePath, cur_dir->obj_list[cur_dir->currentIndex]->type, mmi_progress_bar); | |
2567 #endif | |
2568 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2569 //Jun 28, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
2570 /* //May28,07 DRT:OMAPS00132459 x0061560(sateeshg) | |
2571 aud_state_back=1;*/ | |
2572 if(aud_state == FM_AUD_NO_ERROR) | |
2573 displayMenuKeys(MENU_KEY_UP_DOWN_STOP); | |
2574 else | |
2575 mmi_fm_app_show_info(Parent,TxtPlay,TxtFailed,TxtNull,TxtSoftBack,NULL,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
2576 } | |
2577 else | |
2578 { | |
2579 if((cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MP3) || | |
2580 (cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_AAC) || | |
2581 (cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MIDI)) | |
2582 { | |
2583 IsMP3Playing = TRUE;//Daisy tang added for Real Resume feature 20071107 | |
2584 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2585 #ifdef FF_MMI_UNICODE_SUPPORT | |
2586 aud_state =mfw_fm_audPlay(filename_uc, cur_dir->obj_list[cur_dir->currentIndex]->type, mmi_progress_bar); | |
2587 #else | |
2588 | |
2589 aud_state =mfw_fm_audPlay(currFilePath, cur_dir->obj_list[cur_dir->currentIndex]->type, mmi_progress_bar); | |
2590 #endif | |
2591 if(aud_state == FM_AUD_NO_ERROR) | |
2592 { | |
2593 //Jul 09, 2007 DRT:OMAPS00138065 x0062174(Nimitha) | |
2594 displayMenuKeys(MENU_KEY_UP_DOWN_STOP); | |
2595 progress_bar(Parent); | |
2596 } | |
2597 //Jul 09, 2007 DRT:OMAPS00138065 x0062174(Nimitha) | |
2598 else | |
2599 mmi_fm_app_show_info(Parent,TxtPlay,TxtFailed,TxtNull,TxtSoftBack,NULL,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
2600 } | |
2601 else | |
2602 { | |
2603 IsMP3Playing = TRUE;//Daisy tang added for Real Resume feature 20071107 | |
2604 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2605 #ifdef FF_MMI_UNICODE_SUPPORT | |
2606 aud_state =mfw_fm_audPlay(filename_uc, cur_dir->obj_list[cur_dir->currentIndex]->type, PB_OFF); | |
2607 #else | |
2608 | |
2609 aud_state =mfw_fm_audPlay(currFilePath, cur_dir->obj_list[cur_dir->currentIndex]->type, PB_OFF); | |
2610 #endif | |
2611 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2612 | |
2613 if(aud_state == FM_AUD_NO_ERROR) | |
2614 displayMenuKeys(MENU_KEY_UP_DOWN_STOP); | |
2615 else | |
2616 mmi_fm_app_show_info(Parent,TxtPlay,TxtFailed,TxtNull,TxtSoftBack,NULL,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
2617 } | |
2618 } | |
2619 } | |
2620 break; | |
2621 case FM_AUD_PLAY: | |
2622 cur_dir->dirinfo.aud.state = FM_AUD_NONE; | |
2623 IsMP3Playing = FALSE;//Daisy tang added for Real Resume feature 20071107 | |
2624 aud_state = mfw_fm_audStop(); | |
2625 if(aud_state != FM_AUD_NO_ERROR) | |
2626 mmi_fm_app_show_info(Parent,TxtError,TxtNull,TxtNull,TxtSoftBack,NULL,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
2627 displayMenuKeys(MENU_KEY_UP_DOWN_PLAY); | |
2628 | |
2629 break; | |
2630 } | |
2631 } | |
2632 else | |
2633 { | |
2634 mmi_fm_open(); | |
2635 } | |
2636 } | |
2637 else | |
2638 { | |
2639 | |
2640 if(cur_dir->dirinfo.aud.state == FM_AUD_PLAY) | |
2641 { | |
2642 cur_dir->dirinfo.aud.state = FM_AUD_NONE; | |
2643 IsMP3Playing = FALSE;//Daisy tang added for Real Resume feature 20071107 | |
2644 mfw_fm_audStop(); | |
2645 | |
2646 } | |
2647 fm_data->opt_type=FM_OPTIONS_FOLDER; | |
2648 fm_data->opt_win=(T_MFW_HND)bookMenuStart(fm_data->root_win, FMMenuOptionAttributes(),0); | |
2649 } | |
2650 break; | |
2651 case LISTS_REASON_BACK: | |
2652 case LISTS_REASON_HANGUP: /* Apr 10, 2007 DRT: OMAPS00125325 x0039928 */ | |
2653 fm_data->opt_type=FM_BACK; | |
2654 | |
2655 /* if(cur_dir->dirinfo.aud.state == FM_AUD_PLAY) | |
2656 { | |
2657 cur_dir->dirinfo.aud.state = FM_AUD_NONE; | |
2658 mfw_fm_audStop(); | |
2659 }*/ | |
2660 | |
2661 //Jun 26, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
2662 if(cur_dir->dirinfo.aud.state == FM_AUD_PLAY) | |
2663 mmi_set_aud_state_status( FM_AUD_PLAY); | |
2664 | |
2665 mmi_fm_goback(); | |
2666 | |
2667 TRACE_EVENT_P1("cur_dir->dirinfo.aud.state222 %d",cur_dir->dirinfo.aud.state); | |
2668 break; | |
2669 case LISTS_REASON_DRAWCOMPLETE: | |
2670 displaySoftKeys(TxtSoftOptions,TxtSoftBack); | |
2671 //Jul 03, 2007 DRT:OMAPS00135749 x0062174(Nimitha) | |
2672 state = mmi_get_aud_state_status(); | |
2673 if( state == FM_AUD_PLAY) | |
2674 displayMenuKeys(MENU_KEY_UP_DOWN_STOP); | |
2675 else | |
2676 displayMenuKeys(MENU_KEY_UP_DOWN_PLAY); | |
2677 if(fm_data->list_state == FM_LIST_CREATE) | |
2678 fm_data->list_state = FM_LIST_UPDATE; | |
2679 /* Mar 15, 2007 DRT: OMAPS00120187 x0039928 */ | |
2680 /* Fix: mfw_fm_audStop is commented */ | |
2681 /* if(cur_dir->dirinfo.aud.state == FM_AUD_PLAY) | |
2682 { | |
2683 cur_dir->dirinfo.aud.state = FM_AUD_NONE; | |
2684 mfw_fm_audStop(); | |
2685 }*/ | |
2686 TRACE_FUNCTION("LISTS_REASON_DRAWCOMPLETE"); | |
2687 break; | |
2688 | |
2689 } | |
2690 } | |
2691 | |
2692 /******************************************************************************* | |
2693 $Function: mmi_fm_aud_list_create | |
2694 | |
2695 $Description: Creates the audio files list | |
2696 | |
2697 $Returns: Created Window Pointer | |
2698 | |
2699 $Arguments: win -Parent window | |
2700 *******************************************************************************/ | |
2701 T_MFW_HND mmi_fm_aud_list_create(T_MFW_HND win) | |
2702 { | |
2703 USHORT file_count = 0, list_count=0; | |
2704 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
2705 | |
2706 TRACE_FUNCTION ("mmi_fm_aud_list_create()"); | |
2707 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state04 %d",cur_dir->dirinfo.aud.state); | |
2708 //Traverse through the list to find out valid audio objects in the given directory | |
2709 mmi_fm_aud_validate(); | |
2710 | |
2711 for (file_count=0; file_count<cur_dir->num_objs; file_count++) | |
2712 { | |
2713 mnuInitDataItem(&fm_data->menu_list_data->List[list_count]); | |
2714 | |
2715 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2716 #ifdef FF_MMI_UNICODE_SUPPORT | |
2717 { | |
2718 char *filename; | |
2719 | |
2720 filename = (char *)mfwAlloc((wstrlen(cur_dir->obj_list[file_count]->name_uc)+1)*2); | |
2721 unicode_to_char_array(cur_dir->obj_list[file_count]->name_uc, filename); | |
2722 | |
2723 fm_data->menu_list_data->List[list_count].str = filename; | |
2724 } | |
2725 #else | |
2726 fm_data->menu_list_data->List[list_count].str = (char *)cur_dir->obj_list[file_count]->name; | |
2727 #endif | |
2728 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2729 | |
2730 //TRACE_EVENT_P2("file %s type %d", cur_dir->obj_list[file_count]->name_uc,cur_dir->obj_list[file_count]->type); | |
2731 | |
2732 fm_data->menu_list_data->List[list_count].flagFunc = item_flag_none; | |
2733 /* Apr 06, 2007 DRT: OMAPS00124874 x0039928 */ | |
2734 switch( cur_dir->obj_list[file_count]->type) | |
2735 { | |
2736 case OBJECT_TYPE_AUDIO: | |
2737 case OBJECT_TYPE_AUDIO_MIDI: | |
2738 case OBJECT_TYPE_AUDIO_MP3: | |
2739 case OBJECT_TYPE_AUDIO_AAC: | |
2740 case OBJECT_TYPE_AUDIO_XMF: | |
2741 case OBJECT_TYPE_AUDIO_IMY: | |
2742 case OBJECT_TYPE_AUDIO_MMF: | |
2743 case OBJECT_TYPE_AUDIO_MXMF: | |
2744 case OBJECT_TYPE_AUDIO_SMS: | |
2745 case OBJECT_TYPE_AUDIO_WAV: | |
2746 { | |
2747 TRACE_EVENT("Audio"); | |
2748 fm_data->menu_list_data->List[list_count].icon=&fmIconAudioFile; | |
2749 // cur_dir->obj_list[file_count]->type = mfw_fm_aud_get_type(cur_dir->obj_list[file_count]->name); | |
2750 } | |
2751 list_count++; | |
2752 break; | |
2753 case OBJECT_TYPE_FILE: | |
2754 { | |
2755 TRACE_EVENT("File"); | |
2756 fm_data->menu_list_data->List[list_count].icon=&fmIconFile; | |
2757 } | |
2758 list_count++; | |
2759 break; | |
2760 case OBJECT_TYPE_FOLDER: | |
2761 { | |
2762 TRACE_EVENT("Folder"); | |
2763 fm_data->menu_list_data->List[list_count].icon=&fmIconFolder; | |
2764 } | |
2765 list_count++; | |
2766 break; | |
2767 } | |
2768 | |
2769 } | |
2770 TRACE_EVENT_P1("Total %d",list_count); | |
2771 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state05 %d",cur_dir->dirinfo.aud.state); | |
2772 fm_data->menu_list_data->ListLength = list_count; | |
2773 fm_data->menu_list_data->ListPosition = cur_dir->startIndex+1; | |
2774 fm_data->menu_list_data->CursorPosition = cur_dir->startIndex+1; | |
2775 if(cur_dir->num_objs < 3) | |
2776 fm_data->menu_list_data->SnapshotSize =cur_dir->num_objs;// list_count; | |
2777 else | |
2778 fm_data->menu_list_data->SnapshotSize =3;// list_count; | |
2779 fm_data->menu_list_data->Font = 1; | |
2780 fm_data->menu_list_data->LeftSoftKey = TxtSoftOptions; | |
2781 fm_data->menu_list_data->RightSoftKey = TxtSoftBack; | |
2782 fm_data->menu_list_data->KeyEvents = KEY_ALL; | |
2783 fm_data->menu_list_data->Reason = 0; | |
2784 fm_data->menu_list_data->Strings = TRUE; | |
2785 fm_data->menu_list_data->Attr = (MfwMnuAttr*)&FMList_Attrib; | |
2786 fm_data->menu_list_data->autoDestroy = FALSE; | |
2787 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
2788 cur_dir->dirinfo.aud.state = FM_AUD_NONE; | |
2789 | |
2790 /* OMAPS00151698,x0056422 */ | |
2791 #ifdef FF_MMI_A2DP_AVRCP | |
2792 mmi_set_aud_state_status(FM_AUD_NONE); | |
2793 tGlobalBmiBtStruct.tAudioState =FM_AUD_NONE; | |
2794 #endif //FF_MMI_A2DP_AVRCP | |
2795 | |
2796 fm_data->list_state = FM_LIST_CREATE; | |
2797 //Create the List window with default file and folder icons | |
2798 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) For Unicode Support--> Start*/ | |
2799 #ifdef FF_MMI_UNICODE_SUPPORT | |
2800 listIconsDisplayListMenu(win, fm_data->menu_list_data, (ListCbFunc)mmi_fm_aud_list_cb, TRUE); | |
2801 #else | |
2802 listIconsDisplayListMenu(win, fm_data->menu_list_data, (ListCbFunc)mmi_fm_aud_list_cb, FALSE); | |
2803 #endif | |
2804 /* January 29, 2008 DRT:OMAPS00156759 (x0082844) --> End*/ | |
2805 | |
2806 dspl_Enable(1); | |
2807 return fm_data->menu_list_data->win; | |
2808 } | |
2809 | |
2810 /******************************************************************************* | |
2811 $Function: mmi_fm_nofile_cb | |
2812 | |
2813 $Description: Callback function for "no files loaded" dialog | |
2814 | |
2815 $Returns: None | |
2816 | |
2817 $Arguments: win -current window | |
2818 identifier -window id | |
2819 reason -Event cause. | |
2820 *******************************************************************************/ | |
2821 void mmi_fm_nofile_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
2822 { | |
2823 TRACE_FUNCTION("mmi_fm_nofile_cb" ); | |
2824 | |
2825 mmi_fm_goback(); | |
2826 } | |
2827 | |
2828 /******************************************************************************* | |
2829 $Function: mmi_fm_goback | |
2830 | |
2831 $Description: returns to the previous directory. | |
2832 | |
2833 $Returns: None | |
2834 | |
2835 $Arguments: None | |
2836 *******************************************************************************/ | |
2837 void mmi_fm_goback(void) | |
2838 { | |
2839 char *strTempPtr; | |
2840 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
2841 | |
2842 TRACE_FUNCTION("mmi_fm_goback"); | |
2843 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state1 %d",cur_dir->dirinfo.aud.state); | |
2844 cur_dir->depth--; | |
2845 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state2 %d",cur_dir->dirinfo.aud.state); | |
2846 mmi_fm_set_mmi_plane_to_front(); | |
2847 if( cur_dir->depth <= 0 ) | |
2848 { | |
2849 //Root directory, exit the list window | |
2850 TRACE_EVENT("Root directory"); | |
2851 if(fm_data->list_win) | |
2852 { | |
2853 listsIconsDestroy(fm_data->list_win); | |
2854 fm_data->list_win=NULL; | |
2855 mmi_fm_list_destroy( fm_data->root_win ); | |
2856 } | |
2857 if(cur_dir->dir_type == OBJECT_TYPE_IMAGE_FOLDER) | |
2858 { | |
2859 if(cur_dir->dirinfo.img.ipMsl) | |
2860 { | |
2861 aci_delete(cur_dir->dirinfo.img.ipMsl); | |
2862 cur_dir->dirinfo.img.ipMsl=0; | |
2863 } | |
2864 } | |
2865 SEND_EVENT (fm_data->root_win, FM_DESTROY, 0, (void *)NULL); | |
2866 } | |
2867 else | |
2868 { | |
2869 | |
2870 //Extract the previous directory path | |
2871 strTempPtr=(char*) &cur_dir->dir_path + strlen(cur_dir->dir_path)-1; | |
2872 *strTempPtr='\0'; | |
2873 strTempPtr--; | |
2874 while( *strTempPtr != '/' ) | |
2875 { | |
2876 strTempPtr = strTempPtr - 1; | |
2877 } | |
2878 strTempPtr++; | |
2879 strcpy(cur_dir->dir_name,strTempPtr); | |
2880 *strTempPtr='\0'; | |
2881 | |
2882 //Destroy the current list | |
2883 if(fm_data->list_win) | |
2884 { | |
2885 listsIconsDestroy(fm_data->list_win); | |
2886 fm_data->list_win=NULL; | |
2887 mmi_fm_list_destroy( fm_data->root_win ); | |
2888 } | |
2889 | |
2890 //Populate the new list | |
2891 fm_data->opt_type=FM_BACK; | |
2892 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
2893 return; | |
2894 } | |
2895 } | |
2896 | |
2897 /******************************************************************************* | |
2898 $Function: mmi_fm_goback | |
2899 | |
2900 $Description: populates the list from the selected directory | |
2901 | |
2902 $Returns: None | |
2903 | |
2904 $Arguments: None | |
2905 *******************************************************************************/ | |
2906 void mmi_fm_open (void) | |
2907 { | |
2908 char curDir[FM_MAX_DIR_PATH_LENGTH]; | |
2909 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
2910 TRACE_FUNCTION ("mmi_fm_open()"); | |
2911 if( (cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE_FOLDER) || | |
2912 (cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_FOLDER) || | |
2913 (cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_FOLDER) ) | |
2914 { | |
2915 cur_dir->depth ++; | |
2916 //Update the current directory name with the selected directory | |
2917 if(cur_dir->dir_name[0]!='\0') | |
2918 { | |
2919 sprintf(curDir,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
2920 strcpy(cur_dir->dir_path,curDir); | |
2921 strcpy(cur_dir->dir_name , cur_dir->obj_list[cur_dir->currentIndex]->name); | |
2922 } | |
2923 //Destroy the current list | |
2924 if(fm_data->list_win) | |
2925 { | |
2926 listsIconsDestroy(fm_data->list_win); | |
2927 fm_data->list_win=NULL; | |
2928 mmi_fm_list_destroy( fm_data->root_win); | |
2929 } | |
2930 //Populate the new list | |
2931 fm_data->opt_type=FM_OPEN; | |
2932 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
2933 } | |
2934 else if ( ( cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE) || | |
2935 ( cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE)) | |
2936 { | |
2937 TRACE_EVENT("Invalid object found"); | |
2938 } | |
2939 } | |
2940 | |
2941 /******************************************************************************* | |
2942 $Function: mmi_fm_rename | |
2943 | |
2944 $Description: Creates an editor for editing the selected objects name | |
2945 | |
2946 $Returns: Execution status | |
2947 | |
2948 $Arguments: mnu -Pointer to current menu | |
2949 item -Pointer to current menu item | |
2950 *******************************************************************************/ | |
2951 GLOBAL int mmi_fm_rename (MfwMnu* m, MfwMnuItem* i) | |
2952 { | |
2953 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
2954 | |
2955 TRACE_FUNCTION ("mmi_fm_rename()"); | |
2956 | |
2957 mmi_fm_rename_editor_create(parent_win); | |
2958 | |
2959 return MFW_EVENT_CONSUMED; | |
2960 } | |
2961 | |
2962 /******************************************************************************* | |
2963 $Function: mmi_fm_rename_editor_create | |
2964 | |
2965 $Description: Create an editor for editing the object name | |
2966 | |
2967 $Returns: Created Window Pointer | |
2968 | |
2969 $Arguments: parent_win -parent_win window | |
2970 *******************************************************************************/ | |
2971 T_MFW_HND mmi_fm_rename_editor_create(T_MFW_HND parent_win) | |
2972 { | |
2973 T_MFW_HND win; | |
2974 T_AUI_EDITOR_DATA editor_data; | |
2975 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
2976 | |
2977 TRACE_FUNCTION ("mmi_fm_rename_editor_create"); | |
2978 | |
2979 fm_data->edt_buf = (char *)mfwAlloc(FM_MAX_OBJ_NAME_LENGTH); | |
2980 | |
2981 memset(&editor_data,'\0',sizeof(editor_data)); | |
2982 //Update the editor buffer with the current object name | |
2983 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> Start*/ | |
2984 #ifdef FF_MMI_UNICODE_SUPPORT | |
2985 // unicode support is there only for audio files | |
2986 if (fm_data->app == FM_AUDIO) | |
2987 convert_unicode_to_u8(cur_dir->obj_list[cur_dir->currentIndex]->name_uc, fm_data->edt_buf); | |
2988 else | |
2989 #endif | |
2990 strcpy(fm_data->edt_buf, cur_dir->obj_list[cur_dir->currentIndex]->name); | |
2991 /* | |
2992 ** Initialise the editor | |
2993 */ | |
2994 AUI_edit_SetDefault(&editor_data); | |
2995 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)fm_data->edt_buf, FM_MAX_OBJ_NAME_LENGTH); | |
2996 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtRename, NULL); | |
2997 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack); | |
2998 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_fm_rename_editor_exec_cb); | |
2999 win = AUI_edit_Start(parent_win, &editor_data); | |
3000 | |
3001 | |
3002 return win; | |
3003 | |
3004 } | |
3005 | |
3006 /******************************************************************************* | |
3007 $Function: mmi_fm_rename_editor_exec_cb | |
3008 | |
3009 $Description: Event handler for the editor | |
3010 | |
3011 $Returns: None | |
3012 | |
3013 $Arguments: win -current window | |
3014 identifier -window id | |
3015 reason -Event cause. | |
3016 *******************************************************************************/ | |
3017 static void mmi_fm_rename_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason) | |
3018 { | |
3019 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
3020 T_MFW_FM_STATUS status = FM_NO_ERROR; | |
3021 | |
3022 char * fileExt; | |
3023 BOOL valid_ext = FALSE; | |
3024 | |
3025 TRACE_FUNCTION ("mmi_fm_rename_editor_exec_cb()"); | |
3026 | |
3027 | |
3028 switch (reason) | |
3029 { | |
3030 case INFO_KCD_LEFT: | |
3031 { | |
3032 /* | |
3033 ** If there is no string entered, treat this as if it was a "Cancel" | |
3034 */ | |
3035 if (fm_data->edt_buf[0] == NULL) | |
3036 { | |
3037 mmi_fm_app_show_info(win,TxtRename,TxtFailed,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_rename_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3038 } | |
3039 else | |
3040 { | |
3041 //If the file extn is not jpg, send cancel event | |
3042 fileExt = (char *)mmi_fm_get_ext((char *) fm_data->edt_buf); | |
3043 switch(cur_dir->obj_list[cur_dir->currentIndex]->type) | |
3044 { | |
3045 case OBJECT_TYPE_IMAGE: | |
3046 if(strcmp((const char*)fileExt, "jpg") != 0 ) | |
3047 { | |
3048 valid_ext = FALSE; | |
3049 } | |
3050 else | |
3051 { | |
3052 valid_ext = TRUE; | |
3053 } | |
3054 break; | |
3055 case OBJECT_TYPE_AUDIO_MIDI: | |
3056 if(strcmp((const char*)fileExt, "mid") != 0 ) | |
3057 { | |
3058 valid_ext = FALSE; | |
3059 } | |
3060 else | |
3061 { | |
3062 valid_ext = TRUE; | |
3063 } | |
3064 break; | |
3065 case OBJECT_TYPE_AUDIO_MP3: | |
3066 if(strcmp((const char*)fileExt, "mp3") != 0 ) | |
3067 { | |
3068 valid_ext = FALSE; | |
3069 } | |
3070 else | |
3071 { | |
3072 valid_ext = TRUE; | |
3073 } | |
3074 break; | |
3075 case OBJECT_TYPE_AUDIO_AAC: | |
3076 if(strcmp((const char*)fileExt, "aac") != 0 ) | |
3077 { | |
3078 valid_ext = FALSE; | |
3079 } | |
3080 else | |
3081 { | |
3082 valid_ext = TRUE; | |
3083 } | |
3084 break; | |
3085 /* Apr 06, 2007 DRT: OMAPS00124874 x0039928 */ | |
3086 case OBJECT_TYPE_AUDIO_XMF: | |
3087 if(strcmp((const char*)fileExt, "xmf") != 0 ) | |
3088 { | |
3089 valid_ext = FALSE; | |
3090 } | |
3091 else | |
3092 { | |
3093 valid_ext = TRUE; | |
3094 } | |
3095 break; | |
3096 case OBJECT_TYPE_AUDIO_IMY: | |
3097 if(strcmp((const char*)fileExt, "imy") != 0 ) | |
3098 { | |
3099 valid_ext = FALSE; | |
3100 } | |
3101 else | |
3102 { | |
3103 valid_ext = TRUE; | |
3104 } | |
3105 break; | |
3106 case OBJECT_TYPE_AUDIO_MMF: | |
3107 if(strcmp((const char*)fileExt, "mmf") != 0 ) | |
3108 { | |
3109 valid_ext = FALSE; | |
3110 } | |
3111 else | |
3112 { | |
3113 valid_ext = TRUE; | |
3114 } | |
3115 break; | |
3116 case OBJECT_TYPE_AUDIO_MXMF: | |
3117 if(strcmp((const char*)fileExt, "mxmf") != 0 ) | |
3118 { | |
3119 valid_ext = FALSE; | |
3120 } | |
3121 else | |
3122 { | |
3123 valid_ext = TRUE; | |
3124 } | |
3125 break; | |
3126 case OBJECT_TYPE_AUDIO_SMS: | |
3127 if(strcmp((const char*)fileExt, "sms") != 0 ) | |
3128 { | |
3129 valid_ext = FALSE; | |
3130 } | |
3131 else | |
3132 { | |
3133 valid_ext = TRUE; | |
3134 } | |
3135 break; | |
3136 case OBJECT_TYPE_AUDIO_WAV: | |
3137 if(strcmp((const char*)fileExt, "wav") != 0 ) | |
3138 { | |
3139 valid_ext = FALSE; | |
3140 } | |
3141 else | |
3142 { | |
3143 valid_ext = TRUE; | |
3144 } | |
3145 break; | |
3146 case OBJECT_TYPE_FILE: | |
3147 case OBJECT_TYPE_AUDIO: | |
3148 case OBJECT_TYPE_FOLDER: | |
3149 case OBJECT_TYPE_IMAGE_FOLDER: | |
3150 case OBJECT_TYPE_AUDIO_FOLDER: | |
3151 valid_ext = TRUE; | |
3152 break; | |
3153 } | |
3154 if(valid_ext == FALSE) | |
3155 { | |
3156 TRACE_EVENT("Invalid Extension"); | |
3157 mmi_fm_app_show_info( win,TxtNoExtension,TxtNull,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_rename_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3158 } | |
3159 else | |
3160 { | |
3161 if( cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE&& | |
3162 cur_dir->obj_data[cur_dir->currentIndex]->image.thumbnail == TRUE) | |
3163 { | |
3164 char t_oldFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
3165 char t_newFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
3166 | |
3167 valid_ext = TRUE; | |
3168 strcpy(t_oldFilename,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
3169 strcpy(t_newFilename,fm_data->edt_buf); | |
3170 mmi_fm_get_filename(t_oldFilename); | |
3171 mmi_fm_get_filename(t_newFilename); | |
3172 status =mfw_fm_rename_image(cur_dir->dir_path, cur_dir->dir_name,t_oldFilename,t_newFilename,fm_data->source); | |
3173 } | |
3174 else | |
3175 { | |
3176 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> Start*/ | |
3177 #ifdef FF_MMI_UNICODE_SUPPORT | |
3178 T_WCHAR oldFilename[FM_MAX_DIR_PATH_LENGTH]; | |
3179 T_WCHAR newFilename[FM_MAX_DIR_PATH_LENGTH]; | |
3180 | |
3181 char oldFilename_u8[FM_MAX_DIR_PATH_LENGTH]; | |
3182 char newFilename_u8[FM_MAX_DIR_PATH_LENGTH]; | |
3183 | |
3184 sprintf(oldFilename_u8,"%s%s/",cur_dir->dir_path, cur_dir->dir_name); | |
3185 sprintf(newFilename_u8,"%s%s/%s",cur_dir->dir_path, cur_dir->dir_name, fm_data->edt_buf); | |
3186 | |
3187 // only audio files have unicode support at the moment | |
3188 if (fm_data->app != FM_AUDIO) | |
3189 strcat(oldFilename_u8, cur_dir->obj_list[cur_dir->currentIndex]->name); | |
3190 | |
3191 convert_u8_to_unicode(oldFilename_u8, oldFilename); | |
3192 convert_u8_to_unicode(newFilename_u8, newFilename); | |
3193 | |
3194 if (fm_data->app == FM_AUDIO) | |
3195 wstrcat(oldFilename, cur_dir->obj_list[cur_dir->currentIndex]->name_uc); | |
3196 | |
3197 #else | |
3198 char oldFilename[FM_MAX_DIR_PATH_LENGTH]; | |
3199 char newFilename[FM_MAX_DIR_PATH_LENGTH]; | |
3200 sprintf(oldFilename,"%s%s/%s",cur_dir->dir_path, cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
3201 sprintf(newFilename,"%s%s/%s",cur_dir->dir_path, cur_dir->dir_name, fm_data->edt_buf); | |
3202 #endif | |
3203 status =mfw_fm_rename(oldFilename,newFilename,fm_data->source); | |
3204 } | |
3205 if(status == FM_NO_ERROR) | |
3206 { | |
3207 TRACE_EVENT("Rename Done"); | |
3208 fm_data->list_state = FM_LIST_RECREATE; | |
3209 mmi_fm_app_show_info(win,TxtRename,TxtDone,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_rename_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3210 | |
3211 } | |
3212 else | |
3213 { | |
3214 TRACE_EVENT("Rename Error"); | |
3215 //Display the error message to the user | |
3216 mmi_fm_app_show_info(win,TxtRename,TxtFailed,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_rename_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3217 } | |
3218 } | |
3219 } | |
3220 } | |
3221 break; | |
3222 case INFO_KCD_RIGHT: | |
3223 case INFO_KCD_HUP: | |
3224 mmi_fm_rename_editor_destroy( ); | |
3225 break; | |
3226 default: | |
3227 /* otherwise no action to be performed | |
3228 */ | |
3229 break; | |
3230 } | |
3231 } | |
3232 | |
3233 /******************************************************************************* | |
3234 $Function: mmi_fm_rename_cb | |
3235 | |
3236 $Description: Callback function for rename success/failure dialog | |
3237 | |
3238 $Returns: None | |
3239 | |
3240 $Arguments: win -current window | |
3241 identifier -window id | |
3242 reason -Event cause. | |
3243 *******************************************************************************/ | |
3244 void mmi_fm_rename_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
3245 { | |
3246 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
3247 | |
3248 TRACE_FUNCTION ("mmi_fm_rename_cb()"); | |
3249 | |
3250 mmi_fm_rename_editor_destroy(); | |
3251 | |
3252 if(fm_data->list_state == FM_LIST_RECREATE) | |
3253 { | |
3254 //Delete the options window | |
3255 if(fm_data->opt_win) | |
3256 { | |
3257 bookMenuDestroy(fm_data->opt_win); | |
3258 fm_data->opt_win = NULL; | |
3259 } | |
3260 //Delete the image window | |
3261 if(fm_data->img_win) | |
3262 { | |
3263 SEND_EVENT(fm_data->img_win,FM_IMGDRAW_DESTROY,0,(void *)NULL); | |
3264 } | |
3265 //Populate the list again | |
3266 if(fm_data->list_win) | |
3267 { | |
3268 listsIconsDestroy(fm_data->list_win); | |
3269 fm_data->list_win=NULL; | |
3270 mmi_fm_list_destroy( fm_data->root_win); | |
3271 } | |
3272 fm_data->opt_type=FM_RENAME; | |
3273 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
3274 } | |
3275 } | |
3276 | |
3277 /******************************************************************************* | |
3278 $Function: mmi_fm_rename_editor_destroy | |
3279 | |
3280 $Description: Frees the allocated memory | |
3281 | |
3282 $Returns: None | |
3283 | |
3284 $Arguments: None | |
3285 *******************************************************************************/ | |
3286 void mmi_fm_rename_editor_destroy(void) | |
3287 { | |
3288 TRACE_FUNCTION ("mmi_fm_rename_editor_destroy"); | |
3289 | |
3290 mfwFree((U8 *)fm_data->edt_buf, FM_MAX_OBJ_NAME_LENGTH); | |
3291 } | |
3292 | |
3293 /******************************************************************************* | |
3294 $Function: mmi_fm_newdir | |
3295 | |
3296 $Description: Creates an editor for creating a new directory | |
3297 | |
3298 $Returns: Execution status | |
3299 | |
3300 $Arguments: mnu -Pointer to current menu | |
3301 item -Pointer to current menu item | |
3302 *******************************************************************************/ | |
3303 GLOBAL int mmi_fm_newdir (MfwMnu* m, MfwMnuItem* i) | |
3304 { | |
3305 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
3306 | |
3307 TRACE_FUNCTION ("mmi_fm_newdir()"); | |
3308 | |
3309 mmi_fm_newdir_editor_create(parent_win); | |
3310 | |
3311 return MFW_EVENT_CONSUMED; | |
3312 } | |
3313 | |
3314 /******************************************************************************* | |
3315 $Function: mmi_fm_newdir_editor_create | |
3316 | |
3317 $Description: Creates an editor for creating a new directory | |
3318 | |
3319 $Returns: Execution status | |
3320 | |
3321 $Arguments: parent_win -Parent window | |
3322 *******************************************************************************/ | |
3323 T_MFW_HND mmi_fm_newdir_editor_create(T_MFW_HND parent_win) | |
3324 { | |
3325 T_MFW_HND win; | |
3326 T_AUI_EDITOR_DATA editor_data; | |
3327 | |
3328 TRACE_FUNCTION ("mmi_fm_newdir_editor_create"); | |
3329 | |
3330 fm_data->edt_buf = (char *)mfwAlloc(FM_MAX_OBJ_NAME_LENGTH); | |
3331 | |
3332 memset(&editor_data,'\0',sizeof(editor_data)); | |
3333 /* | |
3334 ** Initialise the editor | |
3335 */ | |
3336 AUI_edit_SetDefault(&editor_data); | |
3337 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII,(UBYTE *) fm_data->edt_buf, FM_MAX_OBJ_NAME_LENGTH); | |
3338 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtNull, NULL); | |
3339 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack); | |
3340 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_fm_newdir_editor_exec_cb); | |
3341 win = AUI_edit_Start(parent_win, &editor_data); | |
3342 return win; | |
3343 } | |
3344 | |
3345 /******************************************************************************* | |
3346 $Function: mmi_fm_newdir_editor_exec_cb | |
3347 | |
3348 $Description: Event handler for the editor | |
3349 | |
3350 $Returns: None | |
3351 | |
3352 $Arguments: win -current window | |
3353 identifier -window id | |
3354 reason -Event cause. | |
3355 *******************************************************************************/ | |
3356 static void mmi_fm_newdir_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason) | |
3357 { | |
3358 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
3359 T_MFW_FM_STATUS status = FM_NO_ERROR; | |
3360 | |
3361 TRACE_FUNCTION ("mmi_fm_newdir_exec_cb()"); | |
3362 | |
3363 switch (reason) | |
3364 { | |
3365 case INFO_KCD_LEFT: | |
3366 if (fm_data->edt_buf[0] == NULL) | |
3367 { | |
3368 mmi_fm_app_show_info(win,TxtCreateDir,TxtFailed,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_newdir_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3369 } | |
3370 else | |
3371 { | |
3372 char dirname[FM_MAX_DIR_PATH_LENGTH]; | |
3373 sprintf(dirname,"%s%s/%s",cur_dir->dir_path, cur_dir->dir_name,fm_data->edt_buf); | |
3374 status =mfw_fm_newdir(dirname,fm_data->source); | |
3375 if(status == FM_DIR_EXISTS) | |
3376 mmi_fm_app_show_info(win,TxtDirectory,TxtExists,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_newdir_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3377 else | |
3378 { | |
3379 fm_data->list_state = FM_LIST_RECREATE; | |
3380 mmi_fm_app_show_info(win,TxtDirectory,TxtCreated,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_newdir_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3381 | |
3382 } | |
3383 } | |
3384 break; | |
3385 case INFO_KCD_RIGHT: | |
3386 case INFO_KCD_HUP: | |
3387 mmi_fm_newdir_editor_destroy( ); | |
3388 break; | |
3389 | |
3390 default: | |
3391 /* otherwise no action to be performed | |
3392 */ | |
3393 break; | |
3394 | |
3395 | |
3396 } | |
3397 } | |
3398 | |
3399 /******************************************************************************* | |
3400 $Function: mmi_fm_newdir_cb | |
3401 | |
3402 $Description: Callback function for new directory create success/failure dialog | |
3403 | |
3404 $Returns: None | |
3405 | |
3406 $Arguments: win -current window | |
3407 identifier -window id | |
3408 reason -Event cause. | |
3409 *******************************************************************************/ | |
3410 void mmi_fm_newdir_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
3411 { | |
3412 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
3413 TRACE_FUNCTION ("mmi_fm_newdir_cb()"); | |
3414 | |
3415 mmi_fm_rename_editor_destroy(); | |
3416 if(fm_data->list_state == FM_LIST_RECREATE) | |
3417 { | |
3418 //Delete the options window | |
3419 if(fm_data->opt_win) | |
3420 { | |
3421 bookMenuDestroy(fm_data->opt_win); | |
3422 fm_data->opt_win = NULL; | |
3423 } | |
3424 //Populate the list again | |
3425 if(fm_data->list_win) | |
3426 { | |
3427 listsIconsDestroy(fm_data->list_win); | |
3428 fm_data->list_win=NULL; | |
3429 mmi_fm_list_destroy( fm_data->root_win); | |
3430 } | |
3431 fm_data->opt_type=FM_NEWDIR; | |
3432 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
3433 } | |
3434 } | |
3435 | |
3436 /******************************************************************************* | |
3437 $Function: mmi_fm_newdir_editor_destroy | |
3438 | |
3439 $Description: Frees the allocated memory | |
3440 | |
3441 $Returns: None | |
3442 | |
3443 $Arguments: None | |
3444 *******************************************************************************/ | |
3445 void mmi_fm_newdir_editor_destroy(void) | |
3446 { | |
3447 TRACE_FUNCTION ("mmi_fm_newdir_destroy"); | |
3448 | |
3449 mfwFree((U8 *)fm_data->edt_buf, FM_MAX_OBJ_NAME_LENGTH); | |
3450 } | |
3451 | |
3452 /******************************************************************************* | |
3453 $Function: mmi_fm_copy | |
3454 | |
3455 $Description: Removes the selected object after user confirmation and displays the updated | |
3456 | |
3457 $Returns: Execution status | |
3458 | |
3459 $Arguments: mnu -Pointer to current menu | |
3460 item -Pointer to current menu item | |
3461 *******************************************************************************/ | |
3462 GLOBAL int mmi_fm_remove (MfwMnu* m, MfwMnuItem* i) | |
3463 { | |
3464 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
3465 | |
3466 TRACE_FUNCTION ("mmi_fm_remove()"); | |
3467 | |
3468 mmi_fm_app_show_info(parent_win,TxtDelete,TxtFile,TxtSoftOK,TxtSoftBack,(T_VOID_FUNC)mmi_fm_remove_confirm_cb,FOREVER,KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3469 return MFW_EVENT_CONSUMED; | |
3470 } | |
3471 | |
3472 /******************************************************************************* | |
3473 $Function: mmi_fm_remove_confirm_cb | |
3474 | |
3475 $Description: Callback function for remove confirmation dialog | |
3476 | |
3477 $Returns: None | |
3478 | |
3479 $Arguments: win -current window | |
3480 identifier -window id | |
3481 reason -Event cause. | |
3482 *******************************************************************************/ | |
3483 void mmi_fm_remove_confirm_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
3484 { | |
3485 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
3486 T_MFW_FM_STATUS status = FM_NO_ERROR; | |
3487 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
3488 | |
3489 TRACE_FUNCTION ("mmi_fm_remove_confirm_cb()"); | |
3490 | |
3491 switch(reason) | |
3492 { | |
3493 case INFO_KCD_LEFT: | |
3494 if( cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE && | |
3495 cur_dir->obj_data[cur_dir->currentIndex]->image.thumbnail == TRUE) | |
3496 { | |
3497 char filename[FM_MAX_OBJ_NAME_LENGTH]; | |
3498 strcpy(filename,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
3499 mmi_fm_get_filename(filename); | |
3500 status =mfw_fm_remove_image(cur_dir->dir_path, cur_dir->dir_name,filename,fm_data->source); | |
3501 } | |
3502 else | |
3503 { | |
3504 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> Start*/ | |
3505 #ifdef FF_MMI_UNICODE_SUPPORT | |
3506 T_WCHAR filename[FM_MAX_DIR_PATH_LENGTH]; | |
3507 char dirPath[FM_MAX_DIR_PATH_LENGTH]; | |
3508 sprintf(dirPath, "%s%s/",cur_dir->dir_path, cur_dir->dir_name); | |
3509 convert_u8_to_unicode(dirPath, filename); | |
3510 wstrcat(filename, cur_dir->obj_list[cur_dir->currentIndex]->name_uc); | |
3511 #else | |
3512 char filename[FM_MAX_DIR_PATH_LENGTH]; | |
3513 sprintf(filename,"%s%s/%s",cur_dir->dir_path, cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
3514 | |
3515 #endif | |
3516 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> End*/ | |
3517 status =mfw_fm_remove(filename, fm_data->source); | |
3518 } | |
3519 switch(status) | |
3520 { | |
3521 case FM_NO_ERROR: | |
3522 fm_data->list_state = FM_LIST_RECREATE; | |
3523 mmi_fm_app_show_info(parent_win,TxtDelete,TxtDone,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_remove_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3524 | |
3525 break; | |
3526 case FM_DELETE_DIRNOTEMPTY: | |
3527 mmi_fm_app_show_info(parent_win,TxtDirectory,TxtNotEmpty,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_remove_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3528 break; | |
3529 default: | |
3530 //Display the error message to the user | |
3531 mmi_fm_app_show_info(parent_win,TxtDelete,TxtFailed,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_remove_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
3532 break; | |
3533 } | |
3534 break; | |
3535 } | |
3536 } | |
3537 | |
3538 /******************************************************************************* | |
3539 $Function: mmi_fm_remove_cb | |
3540 | |
3541 $Description: Callback function for remove success/failure dialog | |
3542 | |
3543 $Returns: None | |
3544 | |
3545 $Arguments: win -current window | |
3546 identifier -window id | |
3547 reason -Event cause. | |
3548 *******************************************************************************/ | |
3549 void mmi_fm_remove_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
3550 { | |
3551 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
3552 | |
3553 TRACE_FUNCTION ("mmi_fm_remove_cb()"); | |
3554 | |
3555 if(fm_data->list_state == FM_LIST_RECREATE) | |
3556 { | |
3557 //Delete the options window | |
3558 if(fm_data->opt_win) | |
3559 { | |
3560 TRACE_EVENT("bookMenuDestroy"); | |
3561 bookMenuDestroy(fm_data->opt_win); | |
3562 fm_data->opt_win = NULL; | |
3563 } | |
3564 //Delete the image window | |
3565 if(fm_data->img_win) | |
3566 { | |
3567 TRACE_EVENT("FM_IMGDRAW_DESTROY"); | |
3568 SEND_EVENT(fm_data->img_win,FM_IMGDRAW_DESTROY,0,(void *)NULL); | |
3569 } | |
3570 //Populate the list again | |
3571 if(fm_data->list_win) | |
3572 { | |
3573 listsIconsDestroy(fm_data->list_win); | |
3574 fm_data->list_win=NULL; | |
3575 mmi_fm_list_destroy( fm_data->root_win); | |
3576 TRACE_EVENT("List destroyed"); | |
3577 } | |
3578 fm_data->opt_type=FM_REMOVE; | |
3579 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
3580 } | |
3581 | |
3582 } | |
3583 | |
3584 /******************************************************************************* | |
3585 $Function: showCopyMove | |
3586 | |
3587 $Description: Shows or hides the copy and move option | |
3588 | |
3589 $Returns: 0 - shows the item, 1 - hides the item | |
3590 | |
3591 $Arguments: None | |
3592 *******************************************************************************/ | |
3593 USHORT showCopyMove( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
3594 { | |
3595 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
3596 | |
3597 TRACE_FUNCTION ("showCopyMove()"); | |
3598 | |
3599 /* Apr 05, 2007 DRT: OMAPS00124859 x0039928 */ | |
3600 if(cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_FILE|| | |
3601 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO || | |
3602 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_AAC || | |
3603 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MIDI || | |
3604 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MP3|| | |
3605 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_XMF|| | |
3606 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_IMY|| | |
3607 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MMF|| | |
3608 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_MXMF|| | |
3609 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_SMS|| | |
3610 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_AUDIO_WAV|| | |
3611 cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE | |
3612 ) | |
3613 return 0; | |
3614 else | |
3615 return 1; | |
3616 } | |
3617 | |
3618 /******************************************************************************* | |
3619 $Function: showCreate | |
3620 | |
3621 $Description: Shows or hides the create directory option | |
3622 | |
3623 $Returns: 0 - shows the item, 1 - hides the item | |
3624 | |
3625 $Arguments: None | |
3626 *******************************************************************************/ | |
3627 USHORT showCreate( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
3628 { | |
3629 TRACE_FUNCTION ("showCreate()"); | |
3630 | |
3631 if (fm_data->opt_type == FM_OPTIONS_FOLDER) | |
3632 { | |
3633 return 0; | |
3634 } | |
3635 else | |
3636 return 1; | |
3637 } | |
3638 | |
3639 /******************************************************************************* | |
3640 $Function: mmi_fm_copy | |
3641 | |
3642 $Description: Copies the selected object from source to destination | |
3643 | |
3644 $Returns: Execution status | |
3645 | |
3646 $Arguments: mnu -Pointer to current menu | |
3647 item -Pointer to current menu item | |
3648 *******************************************************************************/ | |
3649 GLOBAL int mmi_fm_copy (MfwMnu* m, MfwMnuItem* i) | |
3650 { | |
3651 TRACE_FUNCTION ("mmi_fm_copy()"); | |
3652 | |
3653 fm_data->opt_type = FM_COPY; | |
3654 mmi_fm_displayDestDrive(); | |
3655 | |
3656 return MFW_EVENT_CONSUMED; | |
3657 } | |
3658 | |
3659 /******************************************************************************* | |
3660 $Function: mmi_fm_displayDestDrive | |
3661 | |
3662 $Description: Display the destination drive | |
3663 | |
3664 $Returns: None | |
3665 | |
3666 $Arguments: None | |
3667 *******************************************************************************/ | |
3668 void mmi_fm_displayDestDrive(void) | |
3669 { | |
3670 T_MFW_HND parent_win = mfwParent(mfw_header()); | |
3671 | |
3672 TRACE_FUNCTION ("mmi_fm_displayDestDrive()"); | |
3673 | |
3674 fm_data->copymove.data = (T_MFW_FM_COPYMOVE_STRUCT *)mfwAlloc(sizeof(T_MFW_FM_COPYMOVE_STRUCT)); | |
3675 fm_data->dest_data = (T_MMI_FM_DEST_STRUCT *)mfwAlloc(sizeof(T_MMI_FM_DEST_STRUCT)); | |
3676 fm_data->dest_data->dest_drive_win=(T_MFW_HND)bookMenuStart( parent_win, FMDestDrivesListAttributes(), 0); | |
3677 SEND_EVENT(fm_data->dest_data->dest_drive_win,ADD_CALLBACK,NULL,(void *)mmi_fm_displayDestDrive_cb); | |
3678 | |
3679 } | |
3680 /******************************************************************************* | |
3681 $Function: mmi_fm_displayDestDrive_cb | |
3682 | |
3683 $Description: Callback function for the destination Directory window | |
3684 | |
3685 $Returns: None | |
3686 | |
3687 $Arguments: win -current window | |
3688 event -window event Id | |
3689 value -unique Id | |
3690 parameter -optional data. | |
3691 *******************************************************************************/ | |
3692 void mmi_fm_displayDestDrive_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
3693 { | |
3694 TRACE_FUNCTION("mmi_fm_dest_root_folders_cb"); | |
3695 | |
3696 mfwFree((U8 *)fm_data->copymove.data, sizeof(T_MFW_FM_COPYMOVE_STRUCT)); | |
3697 mfwFree((U8 *)fm_data->dest_data , sizeof (T_MMI_FM_DEST_STRUCT)); | |
3698 fm_data->dest_data = NULL; | |
3699 } | |
3700 | |
3701 /******************************************************************************* | |
3702 $Function: mmi_fm_dest_root_folders | |
3703 | |
3704 $Description: Display the destination root folders | |
3705 | |
3706 $Returns: Execution status | |
3707 | |
3708 $Arguments: mnu -Pointer to current menu | |
3709 item -Pointer to current menu item | |
3710 *******************************************************************************/ | |
3711 GLOBAL int mmi_fm_dest_root_folders(MfwMnu* mnu, MfwMnuItem* item) | |
3712 { | |
3713 T_MFW_HND parent_win; | |
3714 | |
3715 TRACE_FUNCTION("mmi_fm_dest_root_folders" ); | |
3716 | |
3717 parent_win = mfwParent(mfw_header()); | |
3718 fm_data->dest_data->destination= (T_FM_DEVICE_TYPE)mnu->lCursor[mnu->level]; | |
3719 fm_data->dest_data->dest_dir = (T_FM_DESTDIR *)mfwAlloc(sizeof(T_FM_DESTDIR)); | |
3720 fm_data->dest_data->dest_rootfolderlist_win=(T_MFW_HND)bookMenuStart( parent_win, FMDestRootFolderAttributes(), 0); | |
3721 SEND_EVENT(fm_data->dest_data->dest_rootfolderlist_win,ADD_CALLBACK,NULL,(void *)mmi_fm_dest_root_folders_cb); | |
3722 return MFW_EVENT_CONSUMED; | |
3723 } | |
3724 | |
3725 /******************************************************************************* | |
3726 $Function: mmi_fm_dest_root_folders_cb | |
3727 | |
3728 $Description: Callback function for the root Image, Audio Directory window | |
3729 | |
3730 $Returns: None | |
3731 | |
3732 $Arguments: win -current window | |
3733 event -window event Id | |
3734 value -unique Id | |
3735 parameter -optional data. | |
3736 *******************************************************************************/ | |
3737 void mmi_fm_dest_root_folders_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
3738 { | |
3739 TRACE_FUNCTION("mmi_fm_dest_root_folders_cb"); | |
3740 | |
3741 mfwFree((U8 *)fm_data->dest_data->dest_dir , sizeof (T_FM_DESTDIR)); | |
3742 fm_data->dest_data->dest_dir = NULL; | |
3743 } | |
3744 | |
3745 /******************************************************************************* | |
3746 $Function: mmi_fm_dest_display | |
3747 | |
3748 $Description: Displays the folders given path | |
3749 | |
3750 $Returns: Execution status | |
3751 | |
3752 $Arguments: mnu -Pointer to current menu | |
3753 item -Pointer to current menu item | |
3754 *******************************************************************************/ | |
3755 GLOBAL int mmi_fm_dest_display(MfwMnu* mnu, MfwMnuItem* item) | |
3756 { | |
3757 T_FM_DESTDIR *dest_dir = fm_data->dest_data->dest_dir; | |
3758 | |
3759 TRACE_FUNCTION("mmi_fm_dest_display"); | |
3760 | |
3761 dest_dir->depth = 0; | |
3762 dest_dir->dir_type = OBJECT_TYPE_NONE; | |
3763 dest_dir->currentIndex = 0; | |
3764 dest_dir->num_objs = 0; | |
3765 switch(mnu->lCursor[mnu->level]) | |
3766 { | |
3767 case 0: | |
3768 fm_data->dest_data->app = FM_IMAGE; | |
3769 dest_dir->dir_type=OBJECT_TYPE_IMAGE_FOLDER; | |
3770 break; | |
3771 case 1: | |
3772 fm_data->dest_data->app = FM_AUDIO; | |
3773 dest_dir->dir_type=OBJECT_TYPE_AUDIO_FOLDER; | |
3774 break; | |
3775 } | |
3776 //Based on the selected drive, load the root image, audio directory names | |
3777 switch(fm_data->dest_data->destination) | |
3778 { | |
3779 case FM_NOR_FLASH: | |
3780 if(dest_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
3781 { | |
3782 strcpy( dest_dir->dir_path, NORDIR); | |
3783 strcpy( dest_dir->dir_name, NORDIR_IMG); | |
3784 } | |
3785 else if(dest_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
3786 { | |
3787 strcpy( dest_dir->dir_path, NORDIR); | |
3788 strcpy( dest_dir->dir_name, NORDIR_AUD); | |
3789 } | |
3790 break; | |
3791 case FM_NORMS_FLASH: | |
3792 if(dest_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
3793 { | |
3794 strcpy( dest_dir->dir_path, NORMSDIR); | |
3795 strcpy( dest_dir->dir_name, NORMSDIR_IMG); | |
3796 } | |
3797 else if(dest_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
3798 { | |
3799 strcpy( dest_dir->dir_path, NORMSDIR); | |
3800 strcpy( dest_dir->dir_name, NORMSDIR_AUD); | |
3801 } | |
3802 break; | |
3803 case FM_NAND_FLASH: | |
3804 if(dest_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
3805 { | |
3806 strcpy( dest_dir->dir_path, NANDDIR); | |
3807 strcpy( dest_dir->dir_name, NANDDIR_IMG); | |
3808 } | |
3809 else if(dest_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
3810 { | |
3811 strcpy( dest_dir->dir_path, NANDDIR); | |
3812 strcpy( dest_dir->dir_name, NANDDIR_AUD); | |
3813 } | |
3814 break; | |
3815 case FM_T_FLASH: | |
3816 if(dest_dir->dir_type==OBJECT_TYPE_IMAGE_FOLDER) | |
3817 { | |
3818 strcpy( dest_dir->dir_path, TFLASHDIR); | |
3819 strcpy( dest_dir->dir_name, TFLASHDIR_IMG); | |
3820 } | |
3821 else if(dest_dir->dir_type==OBJECT_TYPE_AUDIO_FOLDER) | |
3822 { | |
3823 strcpy( dest_dir->dir_path, TFLASHDIR); | |
3824 strcpy( dest_dir->dir_name, TFLASHDIR_AUD); | |
3825 } | |
3826 break; | |
3827 } | |
3828 TRACE_EVENT_P2("Path %s Dir %s", dest_dir->dir_path,dest_dir->dir_name); | |
3829 dest_dir->depth = 1; | |
3830 mmi_fm_dest_start( fm_data->dest_data->dest_rootfolderlist_win); | |
3831 return MFW_EVENT_CONSUMED; | |
3832 } | |
3833 | |
3834 /******************************************************************************* | |
3835 $Function: mmi_fm_dest_start | |
3836 | |
3837 $Description: To create the destination FileManager window | |
3838 | |
3839 $Returns: Created Window Pointer | |
3840 | |
3841 $Arguments: parent_win -Parent Window | |
3842 *******************************************************************************/ | |
3843 static T_MFW_HND mmi_fm_dest_start( T_MFW_HND parent_win) | |
3844 { | |
3845 TRACE_FUNCTION("mmi_fm_dest_start"); | |
3846 | |
3847 //Creating the root window for FileManager | |
3848 fm_data->dest_data->dest_root_win=mmi_fm_dest_create(parent_win); | |
3849 | |
3850 if (fm_data->dest_data->dest_root_win NEQ NULL) | |
3851 { | |
3852 SEND_EVENT (fm_data->dest_data->dest_root_win, FM_INIT, 0, (void *)NULL); | |
3853 } | |
3854 return fm_data->dest_data->dest_root_win; | |
3855 } | |
3856 | |
3857 /******************************************************************************* | |
3858 $Function: mmi_fm_dest_create | |
3859 | |
3860 $Description: To create the destination FileManager window | |
3861 | |
3862 $Returns: Created Window Pointer | |
3863 | |
3864 $Arguments: parent_win -Parent Window | |
3865 *******************************************************************************/ | |
3866 static T_MFW_HND mmi_fm_dest_create (T_MFW_HND parent_win) | |
3867 { | |
3868 | |
3869 T_MFW_WIN * win; | |
3870 T_MMI_FM_DEST_STRUCT *dest_data = fm_data->dest_data; | |
3871 | |
3872 TRACE_FUNCTION("mmi_fm_dest_create"); | |
3873 | |
3874 //Creating the root window for FileManager | |
3875 dest_data->dest_root_win = win_create (parent_win, 0, E_WIN_VISIBLE, (T_MFW_CB)mmi_fm_dest_win_cb); | |
3876 /* | |
3877 connect the dialog data to the MFW-window | |
3878 */ | |
3879 dest_data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_fm_dest_exec_cb; | |
3880 dest_data->mmi_control.data = dest_data; | |
3881 dest_data->parent_win= parent_win; | |
3882 win = ((T_MFW_HDR *)dest_data->dest_root_win)->data; | |
3883 win->user = (void *)dest_data; | |
3884 | |
3885 winShow(dest_data->dest_root_win); | |
3886 return dest_data->dest_root_win; | |
3887 } | |
3888 | |
3889 /******************************************************************************* | |
3890 $Function: mmi_fm_dest_win_cb | |
3891 | |
3892 $Description: Handler for window events for the destination FileManager window | |
3893 | |
3894 $Returns: Execution status | |
3895 | |
3896 $Arguments: e -window event Id | |
3897 w -current window | |
3898 *******************************************************************************/ | |
3899 int mmi_fm_dest_win_cb (MfwEvt e, MfwWin *w) | |
3900 { | |
3901 TRACE_FUNCTION ("mmi_fm_dest_win_cb()"); | |
3902 | |
3903 switch (e) | |
3904 { | |
3905 case MfwWinVisible: | |
3906 break; | |
3907 case MfwWinFocussed: | |
3908 break; | |
3909 case MfwWinDelete: | |
3910 break; | |
3911 default: | |
3912 return MFW_EVENT_REJECTED; | |
3913 } | |
3914 return MFW_EVENT_CONSUMED; | |
3915 } | |
3916 | |
3917 /******************************************************************************* | |
3918 $Function: mmi_fm_dest_exec_cb | |
3919 | |
3920 $Description: Handler for events for the destination FileManager window | |
3921 | |
3922 $Returns: None | |
3923 | |
3924 $Arguments: win -current window | |
3925 event -window event Id | |
3926 value -unique Id | |
3927 parameter -optional data. | |
3928 *******************************************************************************/ | |
3929 void mmi_fm_dest_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
3930 { | |
3931 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | |
3932 T_MMI_FM_DEST_STRUCT * dest_data = (T_MMI_FM_DEST_STRUCT *)win_data->user; | |
3933 | |
3934 | |
3935 TRACE_FUNCTION ("mmi_fm_dest_exec_cb()"); | |
3936 | |
3937 TRACE_EVENT_P1("Event %d",event ); | |
3938 switch (event) | |
3939 { | |
3940 case FM_INIT: | |
3941 dest_data->dest_list_win=mmi_fm_dest_list_create(dest_data->dest_root_win); | |
3942 break; | |
3943 case FM_DESTROY: | |
3944 //Destroy the current list | |
3945 mmi_fm_dest_destroy(dest_data->dest_root_win); | |
3946 break; | |
3947 default: | |
3948 break; | |
3949 } | |
3950 } | |
3951 | |
3952 /******************************************************************************* | |
3953 $Function: mmi_fm_dest_destroy | |
3954 | |
3955 $Description: To destroy the destination FileManager window | |
3956 | |
3957 $Returns: None | |
3958 | |
3959 $Arguments: own_window -FileManager window | |
3960 *******************************************************************************/ | |
3961 static void mmi_fm_dest_destroy(MfwHnd own_window) | |
3962 { | |
3963 T_MMI_FM_DEST_STRUCT *dest_data; | |
3964 | |
3965 TRACE_FUNCTION ("mmi_fm_dest_destroy()"); | |
3966 dest_data = fm_data->dest_data; | |
3967 | |
3968 if ( dest_data ) | |
3969 { | |
3970 //Delete the dest_root_win window | |
3971 win_delete (dest_data->dest_root_win); | |
3972 dest_data->dest_root_win = NULL; | |
3973 } | |
3974 dspl_Enable(1); | |
3975 } | |
3976 /******************************************************************************* | |
3977 $Function: mmi_fm_dest_list_create | |
3978 | |
3979 $Description: Start building the destination list | |
3980 | |
3981 $Returns: Current created window | |
3982 | |
3983 $Arguments: win -Parent window | |
3984 *******************************************************************************/ | |
3985 T_MFW_HND mmi_fm_dest_list_create( T_MFW_HND win) | |
3986 { | |
3987 T_MMI_FM_DEST_STRUCT *dest_data = fm_data->dest_data; | |
3988 T_FM_DESTDIR *dest_dir = fm_data->dest_data->dest_dir; | |
3989 USHORT file_count = 0, list_count=0; | |
3990 | |
3991 TRACE_FUNCTION("mmi_fm_dest_list_create" ); | |
3992 | |
3993 //Read the objects in the given directory | |
3994 mfw_fm_readDir(dest_dir->dir_path,dest_dir->dir_name,&dest_dir->num_objs,dest_dir->obj_list,fm_data->dest_data->destination, fm_data->dest_data->app); | |
3995 | |
3996 //Read the file/folder | |
3997 mfw_fm_readFileFolders(dest_dir->dir_path,dest_dir->dir_name,dest_dir->num_objs,dest_dir->obj_list,fm_data->dest_data->destination); | |
3998 dest_data->dest_menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); | |
3999 if(dest_data->dest_menu_list_data == NULL ) | |
4000 { | |
4001 TRACE_EVENT("Memory failure."); | |
4002 return NULL; | |
4003 } | |
4004 dest_data->dest_menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( (dest_dir->num_objs+1) * sizeof(T_MFW_MNU_ITEM) ); | |
4005 if(dest_data->dest_menu_list_data->List == NULL) | |
4006 { | |
4007 TRACE_EVENT("Memory failure."); | |
4008 return NULL; | |
4009 } | |
4010 | |
4011 for (file_count=0; file_count<dest_dir->num_objs; file_count++) | |
4012 { | |
4013 if( dest_dir->obj_list[file_count]->type == OBJECT_TYPE_FOLDER) | |
4014 { | |
4015 mnuInitDataItem(&dest_data->dest_menu_list_data->List[list_count]); | |
4016 dest_data->dest_menu_list_data->List[list_count].str = (char *)dest_dir->obj_list[file_count]->name; | |
4017 dest_data->dest_menu_list_data->List[list_count].flagFunc = item_flag_none; | |
4018 dest_data->dest_menu_list_data->List[list_count].icon=&fmIconFolder; | |
4019 list_count++; | |
4020 } | |
4021 } | |
4022 mnuInitDataItem(&dest_data->dest_menu_list_data->List[list_count]); | |
4023 if(fm_data->opt_type == FM_COPY) | |
4024 dest_data->dest_menu_list_data->List[list_count].str = "[Copy Here]"; | |
4025 else | |
4026 dest_data->dest_menu_list_data->List[list_count].str = "[Move Here]"; | |
4027 dest_data->dest_menu_list_data->List[list_count].flagFunc = item_flag_none; | |
4028 dest_data->dest_menu_list_data->List[list_count].icon=NULL; | |
4029 list_count++; | |
4030 TRACE_EVENT_P1("Total %d",list_count); | |
4031 dest_data->dest_menu_list_data->ListLength = list_count; | |
4032 dest_data->dest_menu_list_data->ListPosition = 1; | |
4033 dest_data->dest_menu_list_data->CursorPosition = 1; | |
4034 if((dest_dir->num_objs+1) < 3) | |
4035 dest_data->dest_menu_list_data->SnapshotSize =dest_dir->num_objs+1;// list_count; | |
4036 else | |
4037 dest_data->dest_menu_list_data->SnapshotSize =3;// list_count; | |
4038 dest_data->dest_menu_list_data->Font = 1; | |
4039 if(fm_data->opt_type == FM_COPY) | |
4040 dest_data->dest_menu_list_data->LeftSoftKey = TxtCopy; | |
4041 else | |
4042 dest_data->dest_menu_list_data->LeftSoftKey = TxtMove; | |
4043 dest_data->dest_menu_list_data->RightSoftKey = TxtSoftBack; | |
4044 dest_data->dest_menu_list_data->KeyEvents = KEY_ALL; | |
4045 dest_data->dest_menu_list_data->Reason = 0; | |
4046 dest_data->dest_menu_list_data->Strings = TRUE; | |
4047 dest_data->dest_menu_list_data->Attr = (MfwMnuAttr*)&FMList_Attrib; | |
4048 dest_data->dest_menu_list_data->autoDestroy = FALSE; | |
4049 dest_data->dest_menu_list_data->block_keys = (BOOL)FALSE; | |
4050 //Create the List window with default file and folder icons | |
4051 listIconsDisplayListMenu(win, dest_data->dest_menu_list_data, (ListCbFunc)mmi_fm_dest_list_cb, 0); | |
4052 dspl_Enable(1); | |
4053 return dest_data->dest_menu_list_data->win; | |
4054 } | |
4055 | |
4056 /******************************************************************************* | |
4057 $Function: mmi_fm_nofile_cb | |
4058 | |
4059 $Description: Callback function for "no files loaded" dialog | |
4060 | |
4061 $Returns: None | |
4062 | |
4063 $Arguments: win -current window | |
4064 identifier -window id | |
4065 reason -Event cause. | |
4066 *******************************************************************************/ | |
4067 void mmi_fm_destnofile_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
4068 { | |
4069 TRACE_FUNCTION("mmi_fm_nofile_cb" ); | |
4070 | |
4071 mmi_fm_destgoback(); | |
4072 } | |
4073 | |
4074 /******************************************************************************* | |
4075 $Function: mmi_fm_dest_list_cb | |
4076 | |
4077 $Description: Call back function for the destination list window | |
4078 | |
4079 $Returns: None | |
4080 | |
4081 $Arguments: Parent -window handler | |
4082 List Data -Menu list data | |
4083 *******************************************************************************/ | |
4084 void mmi_fm_dest_list_cb(T_MFW_HND * Parent, ListMenuData * ListData) | |
4085 { | |
4086 T_MFW_WIN * win_data; | |
4087 T_MMI_FM_DEST_STRUCT* dest_data; | |
4088 T_FM_DESTDIR *dest_dir; | |
4089 char curDir[FM_MAX_DIR_PATH_LENGTH]; | |
4090 | |
4091 TRACE_FUNCTION("mmi_fm_dest_list_cb" ); | |
4092 | |
4093 win_data = ((T_MFW_HDR *)Parent)->data; | |
4094 dest_data = (T_MMI_FM_DEST_STRUCT*)win_data->user; | |
4095 dest_dir = dest_data->dest_dir; | |
4096 TRACE_EVENT_P3("Reason %d length %d cur %d",ListData->Reason,ListData->ListLength , ListData->CursorPosition); | |
4097 switch(ListData->Reason) | |
4098 { | |
4099 case LISTS_REASON_SELECT: | |
4100 if(ListData->CursorPosition == (ListData->ListLength-1) ) | |
4101 { //Selecting the [Copy here] item | |
4102 mmi_fm_copy_create(NULL); | |
4103 } | |
4104 else | |
4105 { | |
4106 dest_dir->currentIndex=ListData->CursorPosition; | |
4107 if(ListData->selectKey==TRUE) | |
4108 { | |
4109 //Update the current directory name with the selected directory | |
4110 if(dest_dir->dir_name[0]!='\0') | |
4111 { | |
4112 sprintf(curDir,"%s%s/",dest_dir->dir_path,dest_dir->dir_name); | |
4113 strcpy(dest_dir->dir_path,curDir); | |
4114 strcpy(dest_dir->dir_name , dest_data->dest_menu_list_data->List[dest_dir->currentIndex].str); | |
4115 } | |
4116 //Destroy the current list | |
4117 if(dest_data->dest_list_win) | |
4118 { | |
4119 listsIconsDestroy(dest_data->dest_list_win); | |
4120 dest_data->dest_list_win=NULL; | |
4121 mmi_fm_dest_list_destroy( dest_data->dest_root_win); | |
4122 } | |
4123 //Populate the new list | |
4124 SEND_EVENT (dest_data->dest_root_win, FM_INIT, 0, (void *)NULL); | |
4125 } | |
4126 else | |
4127 { | |
4128 mmi_fm_copy_create(dest_data->dest_menu_list_data->List[dest_dir->currentIndex].str); | |
4129 } | |
4130 } | |
4131 break; | |
4132 case LISTS_REASON_BACK: | |
4133 case LISTS_REASON_HANGUP: /* Apr 10, 2007 DRT: OMAPS00125325 x0039928 */ | |
4134 mmi_fm_destgoback(); | |
4135 break; | |
4136 case LISTS_REASON_DRAWCOMPLETE: | |
4137 if(fm_data->opt_type == FM_COPY) | |
4138 displaySoftKeys(TxtCopy,TxtSoftBack); | |
4139 else | |
4140 displaySoftKeys(TxtMove,TxtSoftBack); | |
4141 break; | |
4142 | |
4143 } | |
4144 } | |
4145 /******************************************************************************* | |
4146 $Function: mmi_fm_destgoback | |
4147 | |
4148 $Description: returns to the previous directory. | |
4149 | |
4150 $Returns: None | |
4151 | |
4152 $Arguments: None | |
4153 *******************************************************************************/ | |
4154 void mmi_fm_destgoback(void) | |
4155 { | |
4156 char *strTempPtr; | |
4157 T_FM_DESTDIR *dest_dir = fm_data->dest_data->dest_dir; | |
4158 T_MMI_FM_DEST_STRUCT* dest_data = fm_data->dest_data; | |
4159 | |
4160 TRACE_FUNCTION("mmi_fm_destgoback"); | |
4161 | |
4162 dest_dir->depth--; | |
4163 mmi_fm_set_mmi_plane_to_front(); | |
4164 if( dest_dir->depth <= 0 ) | |
4165 { | |
4166 //Root directory, exit the list window | |
4167 TRACE_EVENT("Root directory"); | |
4168 if(dest_data->dest_list_win) | |
4169 { | |
4170 listsIconsDestroy( dest_data->dest_list_win); | |
4171 dest_data->dest_list_win=NULL; | |
4172 mmi_fm_dest_list_destroy( dest_data->dest_root_win ); | |
4173 } | |
4174 SEND_EVENT ( dest_data->dest_root_win, FM_DESTROY, 0, (void *)NULL); | |
4175 winIconsLists = fm_data->list_win; | |
4176 } | |
4177 else | |
4178 { | |
4179 | |
4180 //Extract the previous directory path | |
4181 strTempPtr=(char*) &dest_dir->dir_path + strlen(dest_dir->dir_path)-1; | |
4182 *strTempPtr='\0'; | |
4183 strTempPtr--; | |
4184 while( *strTempPtr != '/' ) | |
4185 { | |
4186 strTempPtr = strTempPtr - 1; | |
4187 } | |
4188 strTempPtr++; | |
4189 strcpy(dest_dir->dir_name,strTempPtr); | |
4190 *strTempPtr='\0'; | |
4191 | |
4192 //Destroy the current list | |
4193 if( dest_data->dest_list_win) | |
4194 { | |
4195 listsIconsDestroy( dest_data->dest_list_win); | |
4196 dest_data->dest_list_win=NULL; | |
4197 mmi_fm_dest_list_destroy( dest_data->dest_root_win ); | |
4198 } | |
4199 //Populate the new list | |
4200 SEND_EVENT ( dest_data->dest_root_win, FM_INIT, 0, (void *)NULL); | |
4201 return; | |
4202 } | |
4203 } | |
4204 | |
4205 /******************************************************************************* | |
4206 $Function: mmi_fm_dest_list_destroy | |
4207 | |
4208 $Description: Frees the memory allocated during destination list creation | |
4209 | |
4210 $Returns: None | |
4211 | |
4212 $Arguments: own_window -FileManager window | |
4213 *******************************************************************************/ | |
4214 static void mmi_fm_dest_list_destroy(MfwHnd own_window) | |
4215 { | |
4216 T_MFW_WIN * win_data; | |
4217 T_MMI_FM_DEST_STRUCT* dest_data; | |
4218 int i=0; | |
4219 T_FM_DESTDIR *dest_dir; | |
4220 | |
4221 TRACE_FUNCTION ("mmi_fm_dest_list_destroy()"); | |
4222 | |
4223 if (own_window) | |
4224 { | |
4225 win_data = ((T_MFW_HDR *)own_window)->data; | |
4226 dest_data = (T_MMI_FM_DEST_STRUCT *)win_data->user; | |
4227 dest_dir = dest_data->dest_dir; | |
4228 if ( dest_data ) | |
4229 { | |
4230 if (dest_data->dest_menu_list_data != NULL) | |
4231 { | |
4232 mfwFree( (U8 *)dest_data->dest_menu_list_data->List,(dest_dir->num_objs+1) * sizeof(T_MFW_MNU_ITEM) ); | |
4233 mfwFree ((U8 *)dest_data->dest_menu_list_data, sizeof(ListMenuData)); | |
4234 } | |
4235 i=0; | |
4236 while(dest_dir->obj_list[i] != NULL) | |
4237 { | |
4238 mfwFree((U8 *)dest_dir->obj_list[i], sizeof(T_FM_OBJ)); | |
4239 dest_dir->obj_list[i] = NULL; | |
4240 i++; | |
4241 } | |
4242 | |
4243 } | |
4244 } | |
4245 } | |
4246 | |
4247 /******************************************************************************* | |
4248 $Function: mmi_fm_copy_create | |
4249 | |
4250 $Description: To start copying the file | |
4251 | |
4252 $Returns: None | |
4253 | |
4254 $Arguments: dest_folder - destination folder name | |
4255 *******************************************************************************/ | |
4256 void mmi_fm_copy_create(char * dest_folder) | |
4257 { | |
4258 T_FM_DESTDIR *dest_dir = fm_data->dest_data->dest_dir; | |
4259 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
4260 T_MMI_FM_DEST_STRUCT* dest_data =fm_data->dest_data; | |
4261 | |
4262 TRACE_FUNCTION ("mmi_fm_copy_create()"); | |
4263 | |
4264 //User has selected the destination. | |
4265 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> Start*/ | |
4266 #ifdef FF_MMI_UNICODE_SUPPORT | |
4267 fm_data->copymove.data->sourceFile= (T_WCHAR *)mfwAlloc(FM_MAX_DIR_PATH_LENGTH); | |
4268 fm_data->copymove.data->destinationFile = (T_WCHAR *)mfwAlloc(FM_MAX_DIR_PATH_LENGTH); | |
4269 | |
4270 { | |
4271 char destFolder[FM_MAX_DIR_PATH_LENGTH]; | |
4272 char sourceFolder[FM_MAX_DIR_PATH_LENGTH]; | |
4273 T_WCHAR *dest, *source; | |
4274 | |
4275 dest = fm_data->copymove.data->destinationFile; | |
4276 source = fm_data->copymove.data->sourceFile; | |
4277 | |
4278 if(dest_folder == NULL) | |
4279 sprintf(destFolder,"%s%s/",dest_dir->dir_path,dest_dir->dir_name); | |
4280 else | |
4281 sprintf(destFolder,"%s%s/%s/",dest_dir->dir_path,dest_dir->dir_name,dest_folder); | |
4282 | |
4283 sprintf(sourceFolder,"%s%s/",cur_dir->dir_path, cur_dir->dir_name); | |
4284 | |
4285 // unicode support is there for audio only at the moment | |
4286 if (fm_data->app == FM_AUDIO) | |
4287 { | |
4288 //destination file | |
4289 convert_u8_to_unicode(destFolder, dest); | |
4290 wstrcat(dest, cur_dir->obj_list[cur_dir->currentIndex]->name_uc); | |
4291 | |
4292 //source file | |
4293 convert_u8_to_unicode(sourceFolder, source); | |
4294 wstrcat(source, cur_dir->obj_list[cur_dir->currentIndex]->name_uc); | |
4295 } | |
4296 else | |
4297 { | |
4298 //destination file | |
4299 strcat(destFolder, cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4300 convert_u8_to_unicode(destFolder, dest); | |
4301 | |
4302 //source file | |
4303 strcat(sourceFolder, cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4304 convert_u8_to_unicode(sourceFolder, source); | |
4305 } | |
4306 } | |
4307 #else | |
4308 fm_data->copymove.data->sourceFile= (char *)mfwAlloc(FM_MAX_DIR_PATH_LENGTH); | |
4309 fm_data->copymove.data->destinationFile = (char *)mfwAlloc(FM_MAX_DIR_PATH_LENGTH); | |
4310 if(dest_folder == NULL) | |
4311 sprintf( fm_data->copymove.data->destinationFile,"%s%s/%s",dest_dir->dir_path,dest_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4312 else | |
4313 sprintf( fm_data->copymove.data->destinationFile,"%s%s/%s/%s",dest_dir->dir_path,dest_dir->dir_name,dest_folder,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4314 sprintf( fm_data->copymove.data->sourceFile,"%s%s/%s",cur_dir->dir_path, cur_dir->dir_name,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4315 #endif | |
4316 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> End*/ | |
4317 TRACE_EVENT_P2("Source %s Destination %s", fm_data->copymove.data->sourceFile, fm_data->copymove.data->destinationFile); | |
4318 if(dest_data->dest_list_win) | |
4319 { | |
4320 listsIconsDestroy(dest_data->dest_list_win); | |
4321 dest_data->dest_list_win=NULL; | |
4322 mmi_fm_dest_list_destroy( dest_data->dest_root_win ); | |
4323 winIconsLists = fm_data->list_win; | |
4324 } | |
4325 SEND_EVENT (dest_data->dest_root_win, FM_DESTROY, 0, (void *)NULL); | |
4326 //Destroy the destinatin root folder list | |
4327 bookMenuDestroy(dest_data->dest_rootfolderlist_win); | |
4328 dest_data->dest_rootfolderlist_win = NULL; | |
4329 //Destroy the destination drive list | |
4330 bookMenuDestroy(dest_data->dest_drive_win); | |
4331 dest_data->dest_drive_win = NULL; | |
4332 //Free the buffer allocated for destination directory lists | |
4333 mfwFree((U8 *)dest_data->dest_dir , sizeof (T_FM_DESTDIR)); | |
4334 dest_data->dest_dir = NULL; | |
4335 /* Mar 15, 2007 DRT: OMAPS00120225 x0039928 */ | |
4336 /* Fix: Condition added to check source and destination device are same */ | |
4337 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> Start*/ | |
4338 #ifdef FF_MMI_UNICODE_SUPPORT | |
4339 if((wstrcmp(fm_data->copymove.data->sourceFile,fm_data->copymove.data->destinationFile) == 0) | |
4340 #else | |
4341 if((strcmp(fm_data->copymove.data->sourceFile,fm_data->copymove.data->destinationFile) == 0) | |
4342 #endif | |
4343 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> End*/ | |
4344 && (fm_data->source == fm_data->dest_data->destination)) | |
4345 { | |
4346 mmi_fm_app_show_info(0,TxtSourceDest,TxtSame,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4347 mmi_fm_copy_destroy(fm_data->copymove.data->state); | |
4348 } | |
4349 else | |
4350 { | |
4351 mmi_fm_copy_start(); | |
4352 } | |
4353 } | |
4354 | |
4355 /******************************************************************************* | |
4356 $Function: mmi_fm_copy_start | |
4357 | |
4358 $Description: To start copying the file | |
4359 | |
4360 $Returns: None | |
4361 | |
4362 $Arguments: None | |
4363 *******************************************************************************/ | |
4364 void mmi_fm_copy_start(void) | |
4365 { | |
4366 T_MFW_HND parent_win = mfwParent(mfw_header()); | |
4367 TRACE_FUNCTION ("mmi_fm_copy_start()"); | |
4368 | |
4369 fm_data->copymove.data->source_type = fm_data->source; | |
4370 fm_data->copymove.data->sourceFileSize = fm_data->cur_dir->obj_properties[fm_data->cur_dir->currentIndex]->size; | |
4371 fm_data->copymove.data->destination_type = fm_data->dest_data->destination; | |
4372 fm_data->copymove.data->buf = (char *)mfwAlloc(FM_COPY_BUFFER_SIZE); | |
4373 fm_data->copymove.data->state = mfw_fm_copy_start(fm_data->copymove.data); | |
4374 if(fm_data->copymove.data->state == FM_COPY_PROGRESS) | |
4375 { | |
4376 fm_data->copymove.win = mmi_fm_copy_dialog_create(parent_win); | |
4377 SEND_EVENT(fm_data->copymove.win, FM_COPY_INIT, 0, (void *)NULL); | |
4378 fm_data->copymove.timer = timCreate( 0, FM_COPYMOVE_TIMER, (MfwCb)mmi_fm_copy_timer_cb ); | |
4379 timStart(fm_data->copymove.timer) ; | |
4380 } | |
4381 else if(fm_data->copymove.data->state == FM_COPY_DONE ||fm_data->copymove.data->state == FM_COPY_ERROR||fm_data->copymove.data->state == FM_COPY_NONE)//April 27, 2007 DRT:OMAPS00128836 x0073106 | |
4382 { | |
4383 mmi_fm_copy_end(); | |
4384 } | |
4385 } | |
4386 | |
4387 /******************************************************************************* | |
4388 $Function: mmi_fm_copy_dialog_create | |
4389 | |
4390 $Description: Creates a new window for showing the progress of copying | |
4391 | |
4392 $Returns: None | |
4393 | |
4394 $Arguments: None | |
4395 *******************************************************************************/ | |
4396 T_MFW_HND mmi_fm_copy_dialog_create(T_MFW_HND parent_win) | |
4397 { | |
4398 T_MMI_FM_COPY_STRUCT *copy_data; | |
4399 T_MFW_WIN * win; | |
4400 | |
4401 TRACE_FUNCTION("mmi_fm_copy_dialog_create"); | |
4402 | |
4403 copy_data = (T_MMI_FM_COPY_STRUCT *)mfwAlloc(sizeof(T_MMI_FM_COPY_STRUCT)); | |
4404 | |
4405 //Create a window for drawing the image in QCIF width and height | |
4406 copy_data->win = win_create (fm_data->list_win, 0, E_WIN_VISIBLE|E_WIN_SUSPEND|E_WIN_RESUME|E_WIN_DELETE, (T_MFW_CB)mmi_fm_copy_dialog_win_cb); | |
4407 | |
4408 copy_data ->mmi_control.dialog = (T_DIALOG_FUNC)mmi_fm_copy_dialog_exec_cb; | |
4409 copy_data ->mmi_control.data = copy_data ; | |
4410 copy_data->parent_win= fm_data->list_win; | |
4411 win = (T_MFW_WIN *)getWinData(copy_data->win); | |
4412 win->user = (MfwUserDataPtr)copy_data; | |
4413 copy_data->kbd = kbd_create (copy_data->win,KEY_ALL|KEY_MAKE,(T_MFW_CB)mmi_fm_copy_dialog_kbd_cb); | |
4414 winShow(copy_data->win ); | |
4415 return copy_data->win ; | |
4416 } | |
4417 | |
4418 /******************************************************************************* | |
4419 $Function: mmi_fm_copy_dialog_kbd_cb | |
4420 | |
4421 $Description: Handler for key events for the copy progress window | |
4422 | |
4423 $Returns: Execution status | |
4424 | |
4425 $Arguments: e -window event Id | |
4426 k -key event | |
4427 *******************************************************************************/ | |
4428 static int mmi_fm_copy_dialog_kbd_cb (MfwEvt e, MfwKbd *k) | |
4429 { | |
4430 TRACE_FUNCTION("mmi_fm_copy_dialog_kbd_cb"); | |
4431 | |
4432 if (!(e & KEY_MAKE)) | |
4433 { | |
4434 return MFW_EVENT_CONSUMED; | |
4435 } | |
4436 | |
4437 switch (k->code) | |
4438 { | |
4439 case KCD_LEFT: | |
4440 break; | |
4441 case KCD_RIGHT: | |
4442 case KCD_HUP: | |
4443 break; | |
4444 } | |
4445 return MFW_EVENT_CONSUMED; | |
4446 } | |
4447 | |
4448 /******************************************************************************* | |
4449 $Function: mmi_fm_copy_dialog_win_cb | |
4450 | |
4451 $Description: Handler for window events for the copy progress window | |
4452 | |
4453 $Returns: Execution status | |
4454 | |
4455 $Arguments: e -window event Id | |
4456 w -current window | |
4457 *******************************************************************************/ | |
4458 int mmi_fm_copy_dialog_win_cb (MfwEvt e, MfwWin *w) | |
4459 { | |
4460 T_MMI_FM_COPY_STRUCT * copy_data = (T_MMI_FM_COPY_STRUCT *)w->user; | |
4461 | |
4462 TRACE_FUNCTION ("mmi_fm_copy_dialog_win_cb()"); | |
4463 | |
4464 TRACE_EVENT_P1("event %d",e); | |
4465 switch (e) | |
4466 { | |
4467 case MfwWinVisible: /* window is visible */ | |
4468 SEND_EVENT(copy_data->win, FM_COPY_DRAW, 0, (void *)NULL); | |
4469 break; | |
4470 case MfwWinSuspend: /* input focus / selected */ | |
4471 SEND_EVENT(copy_data->win, FM_COPY_SUSPEND, 0, (void *)NULL); | |
4472 break; | |
4473 case MfwWinResume: /* input focus / selected */ | |
4474 SEND_EVENT(copy_data->win, FM_COPY_RESUME, 0, (void *)NULL); | |
4475 break; | |
4476 case MfwWinDelete: /* window will be deleted */ | |
4477 break; | |
4478 default: | |
4479 return MFW_EVENT_REJECTED; | |
4480 } | |
4481 return MFW_EVENT_CONSUMED; | |
4482 | |
4483 } | |
4484 | |
4485 /******************************************************************************* | |
4486 $Function: mmi_fm_copy_dialog_exec_cb | |
4487 | |
4488 $Description: Eevnt handler copy progress window | |
4489 | |
4490 $Returns: None | |
4491 | |
4492 $Arguments: win -current window | |
4493 event -window event Id | |
4494 value -unique Id | |
4495 parameter -optional data. | |
4496 *******************************************************************************/ | |
4497 void mmi_fm_copy_dialog_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
4498 { | |
4499 int x1, y1, x2, y2; | |
4500 int txtId1= TxtPleaseWait, txtId2 = TxtCopying; | |
4501 char * str1, *str2; | |
4502 | |
4503 TRACE_FUNCTION("mmi_fm_copy_dialog_exec_cb"); | |
4504 | |
4505 TRACE_EVENT_P1("event %d",event); | |
4506 switch (event) | |
4507 { | |
4508 case FM_COPY_INIT: | |
4509 break; | |
4510 case FM_COPY_DRAW: | |
4511 dspl_ClearAll(); | |
4512 switch(fm_data->copymove.data->state) | |
4513 { | |
4514 case FM_COPY_START: | |
4515 case FM_COPY_PROGRESS: | |
4516 txtId1 = TxtPleaseWait; | |
4517 if(fm_data->opt_type == FM_COPY) | |
4518 txtId2 = TxtCopying; | |
4519 else | |
4520 txtId2 = TxtMove; | |
4521 break; | |
4522 case FM_COPY_DONE: | |
4523 break; | |
4524 } | |
4525 str1 = MmiRsrcGetText(txtId1); | |
4526 str2 = MmiRsrcGetText(txtId2); | |
4527 x1= (SCREEN_SIZE_X/2) - (dspl_GetTextExtent(str1,0) / 2) ; | |
4528 y1= (SCREEN_SIZE_Y -Mmi_layout_softkeyHeight())/2 - Mmi_layout_line_height(); | |
4529 x2= (SCREEN_SIZE_X/2) - (dspl_GetTextExtent(str2,0) / 2) ; | |
4530 y2= y1+Mmi_layout_line_height(); | |
4531 dspl_TextOut(x1,y1,DSPL_TXTATTR_NORMAL,str1); | |
4532 dspl_TextOut(x2,y2,DSPL_TXTATTR_NORMAL,str2); | |
4533 displaySoftKeys(TxtNull,TxtSoftBack); | |
4534 dspl_Enable(1); | |
4535 break; | |
4536 case FM_COPY_SUSPEND: | |
4537 TRACE_EVENT("Suspend"); | |
4538 timStop(fm_data->copymove.timer) ; | |
4539 break; | |
4540 case FM_COPY_RESUME: | |
4541 TRACE_EVENT("Resume"); | |
4542 timStart(fm_data->copymove.timer) ; | |
4543 break; | |
4544 case FM_COPY_DESTROY: | |
4545 mmi_fm_copy_dialog_destroy(); | |
4546 break; | |
4547 } | |
4548 } | |
4549 | |
4550 /******************************************************************************* | |
4551 $Function: mmi_fm_copy_dialog_destroy | |
4552 | |
4553 $Description: Destroys the copy progress window and releases the allocated memory for the internal structure | |
4554 | |
4555 $Returns: None | |
4556 | |
4557 $Arguments: None | |
4558 *******************************************************************************/ | |
4559 void mmi_fm_copy_dialog_destroy(void) | |
4560 { | |
4561 T_MFW_HND win = fm_data->copymove.win;//mfwParent(mfw_header()); | |
4562 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | |
4563 T_MMI_FM_COPY_STRUCT * copy_data = (T_MMI_FM_COPY_STRUCT *)win_data->user; | |
4564 TRACE_FUNCTION("mmi_fm_copy_dialog_destroy"); | |
4565 mmi_fm_set_mmi_plane_to_front(); | |
4566 winDelete(copy_data->win); | |
4567 mfwFree((U8 *)copy_data, sizeof(T_MMI_FM_COPY_STRUCT)); | |
4568 } | |
4569 | |
4570 /******************************************************************************* | |
4571 $Function: mmi_fm_copy_end | |
4572 | |
4573 $Description: Displays the result of Copy or Move operation | |
4574 | |
4575 $Returns: None | |
4576 | |
4577 $Arguments: None | |
4578 *******************************************************************************/ | |
4579 void mmi_fm_copy_end(void) | |
4580 { | |
4581 TRACE_FUNCTION ("mmi_fm_copy_end()"); | |
4582 | |
4583 if(fm_data->opt_type == FM_COPY) | |
4584 { | |
4585 if(fm_data->copymove.data->state == FM_COPY_DONE) | |
4586 { | |
4587 fm_data->list_state = FM_LIST_RECREATE; | |
4588 mmi_fm_app_show_info(0,TxtCopy,TxtDone,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_copy_end_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4589 } | |
4590 else if (fm_data->copymove.data->state == FM_COPY_ERROR) | |
4591 mmi_fm_app_show_info(0,TxtCopy,TxtError,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_copy_end_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4592 else if (fm_data->copymove.data->state == FM_COPY_NONE)//April 27, 2007 DRT:OMAPS00128836 x0073106 | |
4593 { | |
4594 mmi_fm_app_show_info(0,TxtFile,TxtExists,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_copy_end_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4595 } | |
4596 | |
4597 } | |
4598 else | |
4599 { | |
4600 if(fm_data->copymove.data->state == FM_COPY_DONE) | |
4601 { | |
4602 mfw_fm_remove(fm_data->copymove.data->sourceFile, fm_data->source); | |
4603 fm_data->list_state = FM_LIST_RECREATE; | |
4604 mmi_fm_app_show_info(0,TxtMove,TxtDone,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_copy_end_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4605 } | |
4606 else if (fm_data->copymove.data->state == FM_COPY_ERROR) | |
4607 mmi_fm_app_show_info(0,TxtMove,TxtError,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_copy_end_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4608 else if (fm_data->copymove.data->state == FM_COPY_NONE)//April 27, 2007 DRT:OMAPS00128836 x0073106 | |
4609 { | |
4610 mmi_fm_app_show_info(0,TxtFile,TxtFailed,TxtNull,TxtSoftBack,(T_VOID_FUNC)mmi_fm_copy_end_cb,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
4611 } | |
4612 } | |
4613 mfwFree((U8 *)fm_data->copymove.data->buf, FM_COPY_BUFFER_SIZE); | |
4614 | |
4615 } | |
4616 | |
4617 /******************************************************************************* | |
4618 $Function: mmi_fm_copy_end_cb | |
4619 | |
4620 $Description: Callback function for copy info dialog | |
4621 | |
4622 $Returns: None | |
4623 | |
4624 $Arguments: win -current window | |
4625 identifier -window id | |
4626 reason -Event cause. | |
4627 *******************************************************************************/ | |
4628 void mmi_fm_copy_end_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
4629 { | |
4630 TRACE_EVENT_P1("state %d",fm_data->copymove.data->state ); | |
4631 mmi_fm_copy_destroy(fm_data->copymove.data->state); | |
4632 } | |
4633 | |
4634 /******************************************************************************* | |
4635 $Function: mmi_fm_copy_destroy | |
4636 | |
4637 $Description: Destroy the source list and repopulates | |
4638 | |
4639 $Returns: None | |
4640 | |
4641 $Arguments: status - Status of Copy or Move operation | |
4642 *******************************************************************************/ | |
4643 void mmi_fm_copy_destroy(T_FM_COPY_STATE status) | |
4644 { | |
4645 T_MMI_FM_DEST_STRUCT* dest_data = fm_data->dest_data; | |
4646 | |
4647 TRACE_FUNCTION ("mmi_fm_copy_destroy()"); | |
4648 | |
4649 mfwFree((U8 *)fm_data->copymove.data->sourceFile, FM_MAX_DIR_PATH_LENGTH); | |
4650 mfwFree((U8 *)fm_data->copymove.data->destinationFile, FM_MAX_DIR_PATH_LENGTH); | |
4651 mfwFree((U8 *)fm_data->copymove.data, sizeof(T_MFW_FM_COPYMOVE_STRUCT)); | |
4652 mfwFree((U8 *)dest_data , sizeof (T_MMI_FM_DEST_STRUCT)); | |
4653 fm_data->dest_data = NULL; | |
4654 TRACE_EVENT_P1("state %d",status ); | |
4655 if(fm_data->list_state == FM_LIST_RECREATE) | |
4656 { | |
4657 //Delete the options window | |
4658 if(fm_data->opt_win) | |
4659 { | |
4660 TRACE_EVENT("bookMenuDestroy"); | |
4661 bookMenuDestroy(fm_data->opt_win); | |
4662 fm_data->opt_win = NULL; | |
4663 } | |
4664 //Populate the list again | |
4665 if(fm_data->list_win) | |
4666 { | |
4667 listsIconsDestroy(fm_data->list_win); | |
4668 fm_data->list_win=NULL; | |
4669 mmi_fm_list_destroy( fm_data->root_win); | |
4670 TRACE_EVENT("List destroyed"); | |
4671 } | |
4672 SEND_EVENT (fm_data->root_win, FM_INIT, 0, (void *)NULL); | |
4673 } | |
4674 } | |
4675 | |
4676 /******************************************************************************* | |
4677 $Function: mmi_fm_copy_timer_cb | |
4678 | |
4679 $Description: Timer callback | |
4680 | |
4681 $Returns: None | |
4682 | |
4683 $Arguments: e -window event Id | |
4684 m - Timer Handle | |
4685 *******************************************************************************/ | |
4686 int mmi_fm_copy_timer_cb ( MfwEvt e, MfwTim *m ) | |
4687 { | |
4688 TRACE_FUNCTION ("mmi_fm_copy_timer_cb()"); | |
4689 fm_data->copymove.data->state = mfw_fm_copy_continue(fm_data->copymove.data); | |
4690 TRACE_EVENT_P1("state %d",fm_data->copymove.data->state ); | |
4691 if(fm_data->copymove.data->state == FM_COPY_PROGRESS) | |
4692 { | |
4693 timStart(fm_data->copymove.timer) ; | |
4694 } | |
4695 else if(fm_data->copymove.data->state == FM_COPY_DONE || fm_data->copymove.data->state == FM_COPY_ERROR) | |
4696 { | |
4697 timDelete(fm_data->copymove.timer); | |
4698 fm_data->copymove.timer= NULL; | |
4699 SEND_EVENT(fm_data->copymove.win, FM_COPY_DESTROY,0, (void *)NULL); | |
4700 mmi_fm_copy_end(); | |
4701 } | |
4702 return MFW_EVENT_CONSUMED; | |
4703 } | |
4704 | |
4705 /******************************************************************************* | |
4706 $Function: mmi_fm_move | |
4707 | |
4708 $Description: Moves the selected object from source to destination | |
4709 | |
4710 $Returns: Execution status | |
4711 | |
4712 $Arguments: mnu -Pointer to current menu | |
4713 item -Pointer to current menu item | |
4714 *******************************************************************************/ | |
4715 GLOBAL int mmi_fm_move (MfwMnu* m, MfwMnuItem* i) | |
4716 { | |
4717 TRACE_FUNCTION ("mmi_fm_move()"); | |
4718 fm_data->opt_type = FM_MOVE; | |
4719 mmi_fm_displayDestDrive(); | |
4720 return MFW_EVENT_CONSUMED; | |
4721 } | |
4722 | |
4723 | |
4724 /******************************************************************************* | |
4725 $Function: mmi_fm_properties | |
4726 | |
4727 $Description: Display the selected object properties | |
4728 | |
4729 $Returns: Execution status | |
4730 | |
4731 $Arguments: mnu -Pointer to current menu | |
4732 item -Pointer to current menu item | |
4733 *******************************************************************************/ | |
4734 GLOBAL int mmi_fm_properties(MfwMnu* m, MfwMnuItem* i) | |
4735 { | |
4736 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
4737 | |
4738 TRACE_FUNCTION ("mmi_fm_properties()"); | |
4739 | |
4740 mmi_fm_properties_editor_create(parent_win); | |
4741 | |
4742 return MFW_EVENT_CONSUMED; | |
4743 } | |
4744 | |
4745 /******************************************************************************* | |
4746 $Function: mmi_fm_properties_editor_create | |
4747 | |
4748 $Description: Creates an editor for creating a new directory | |
4749 | |
4750 $Returns: Execution status | |
4751 | |
4752 $Arguments: parent_win -Parent window | |
4753 *******************************************************************************/ | |
4754 T_MFW_HND mmi_fm_properties_editor_create(T_MFW_HND parent_win) | |
4755 { | |
4756 T_MFW_HND win; | |
4757 T_AUI_EDITOR_DATA editor_data; | |
4758 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
4759 /*#ifdef FF_MMI_UNICODE_SUPPORT | |
4760 T_WCHAR name[FM_MAX_OBJ_NAME_LENGTH]; | |
4761 #else | |
4762 char name[FM_MAX_OBJ_NAME_LENGTH]; | |
4763 #endif*/ | |
4764 char size[FM_MAX_OBJ_NAME_LENGTH]; | |
4765 char date[FM_MAX_OBJ_NAME_LENGTH]; | |
4766 char time[FM_MAX_OBJ_NAME_LENGTH]; | |
4767 | |
4768 TRACE_FUNCTION ("mmi_fm_newdir_editor_create"); | |
4769 | |
4770 fm_data->edt_buf = (char *)mfwAlloc(FM_MAX_DETAILS_BUFFER); | |
4771 | |
4772 memset(&editor_data,'\0',sizeof(editor_data)); | |
4773 /* | |
4774 ** Initialise the editor | |
4775 */ | |
4776 AUI_edit_SetDefault(&editor_data); | |
4777 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII,(UBYTE *) fm_data->edt_buf, 100); | |
4778 AUI_edit_SetMode(&editor_data,ED_MODE_ALPHA,0); | |
4779 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtNull, TxtDetails, NULL); | |
4780 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtNull); | |
4781 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_fm_properties_editor_exec_cb); | |
4782 win = AUI_edit_Start(parent_win, &editor_data); | |
4783 //Name | |
4784 AUI_edit_InsertString(win , (UBYTE *) "Name : ",ATB_DCS_ASCII); | |
4785 | |
4786 #ifdef FF_MMI_UNICODE_SUPPORT | |
4787 //sprintf(name," : %s",cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4788 if (fm_data->app == FM_AUDIO) | |
4789 { | |
4790 char *name; | |
4791 int size= (wstrlen(cur_dir->obj_list[cur_dir->currentIndex]->name_uc)+1)*2; | |
4792 name = (char *)mfwAlloc(size); | |
4793 | |
4794 unicode_to_char_array(cur_dir->obj_list[cur_dir->currentIndex]->name_uc, name); | |
4795 AUI_edit_InsertString(win , (UBYTE *)name,ATB_DCS_UNICODE); | |
4796 | |
4797 mfwFree(name, size); | |
4798 } | |
4799 else | |
4800 #endif | |
4801 { | |
4802 //sprintf(name," : %s",cur_dir->obj_list[cur_dir->currentIndex]->name); | |
4803 AUI_edit_InsertString(win , (UBYTE *)cur_dir->obj_list[cur_dir->currentIndex]->name,ATB_DCS_ASCII); | |
4804 } | |
4805 | |
4806 AUI_edit_InsertChar(win , ctrlEnter); | |
4807 //size | |
4808 AUI_edit_InsertString(win , (UBYTE *) "Size",ATB_DCS_ASCII); | |
4809 sprintf(size," : %d bytes",cur_dir->obj_properties[cur_dir->currentIndex]->size); | |
4810 AUI_edit_InsertString(win , (UBYTE *)size,ATB_DCS_ASCII); | |
4811 AUI_edit_InsertChar(win , ctrlEnter); | |
4812 TRACE_EVENT("Date"); | |
4813 //Date | |
4814 AUI_edit_InsertString(win , (UBYTE *) "Date",ATB_DCS_ASCII); | |
4815 sprintf(date," : %s",cur_dir->obj_properties[cur_dir->currentIndex]->date); | |
4816 AUI_edit_InsertString(win , (UBYTE *)date,ATB_DCS_ASCII); | |
4817 AUI_edit_InsertChar(win , ctrlEnter); | |
4818 //Time | |
4819 AUI_edit_InsertString(win , (UBYTE *) "Time",ATB_DCS_ASCII); | |
4820 sprintf(time," : %s",cur_dir->obj_properties[cur_dir->currentIndex]->time); | |
4821 AUI_edit_InsertString(win , (UBYTE *)time,ATB_DCS_ASCII); | |
4822 AUI_edit_InsertChar(win , ctrlEnter); | |
4823 | |
4824 AUI_edit_SetMode(&editor_data,ED_MODE_READONLY,0); | |
4825 win_show(win); | |
4826 return win; | |
4827 } | |
4828 | |
4829 /******************************************************************************* | |
4830 $Function: mmi_fm_properties_editor_exec_cb | |
4831 | |
4832 $Description: Event handler for the editor | |
4833 | |
4834 $Returns: None | |
4835 | |
4836 $Arguments: win -current window | |
4837 identifier -window id | |
4838 reason -Event cause. | |
4839 *******************************************************************************/ | |
4840 static void mmi_fm_properties_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason) | |
4841 { | |
4842 TRACE_FUNCTION ("mmi_fm_properties_editor_exec_cb()"); | |
4843 | |
4844 switch (reason) | |
4845 { | |
4846 case INFO_KCD_LEFT: | |
4847 case INFO_KCD_RIGHT: | |
4848 case INFO_KCD_HUP: | |
4849 mmi_fm_properties_editor_destroy( ); | |
4850 break; | |
4851 default: | |
4852 /* otherwise no action to be performed | |
4853 */ | |
4854 break; | |
4855 | |
4856 } | |
4857 } | |
4858 | |
4859 /******************************************************************************* | |
4860 $Function: mmi_fm_properties_editor_destroy | |
4861 | |
4862 $Description: Frees the allocated memory | |
4863 | |
4864 $Returns: None | |
4865 | |
4866 $Arguments: None | |
4867 *******************************************************************************/ | |
4868 void mmi_fm_properties_editor_destroy(void) | |
4869 { | |
4870 TRACE_FUNCTION ("mmi_fm_properties_editor_destroy"); | |
4871 | |
4872 mfwFree((U8 *)fm_data->edt_buf, FM_MAX_DETAILS_BUFFER); | |
4873 } | |
4874 | |
4875 /******************************************************************************* | |
4876 $Function: mmi_fm_memStat | |
4877 | |
4878 $Description: Display the selected drive's free, used space | |
4879 | |
4880 $Returns: Execution status | |
4881 | |
4882 $Arguments: mnu -Pointer to current menu | |
4883 item -Pointer to current menu item | |
4884 *******************************************************************************/ | |
4885 GLOBAL int mmi_fm_memStat(MfwMnu* m, MfwMnuItem* i) | |
4886 { | |
4887 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
4888 | |
4889 TRACE_FUNCTION ("mmi_fm_memStat()"); | |
4890 | |
4891 mfw_fm_getMemStat(&fm_data->nFreeBytes, &fm_data->nUsedBytes,fm_data->source); | |
4892 mmi_fm_memStat_editor_create(parent_win); | |
4893 return MFW_EVENT_CONSUMED; | |
4894 } | |
4895 | |
4896 /******************************************************************************* | |
4897 $Function: mmi_fm_memStat_editor_create | |
4898 | |
4899 $Description: Creates an editor for creating a new directory | |
4900 | |
4901 $Returns: Execution status | |
4902 | |
4903 $Arguments: parent_win -Parent window | |
4904 *******************************************************************************/ | |
4905 T_MFW_HND mmi_fm_memStat_editor_create(T_MFW_HND parent_win) | |
4906 { | |
4907 T_MFW_HND win; | |
4908 T_AUI_EDITOR_DATA editor_data; | |
4909 char free[FM_MAX_OBJ_NAME_LENGTH]; | |
4910 char used[FM_MAX_OBJ_NAME_LENGTH]; | |
4911 char total[FM_MAX_OBJ_NAME_LENGTH]; | |
4912 | |
4913 TRACE_FUNCTION ("mmi_fm_newdir_editor_create"); | |
4914 | |
4915 fm_data->edt_buf = (char *)mfwAlloc(FM_MAX_DETAILS_BUFFER); | |
4916 | |
4917 memset(&editor_data,'\0',sizeof(editor_data)); | |
4918 /* | |
4919 ** Initialise the editor | |
4920 */ | |
4921 AUI_edit_SetDefault(&editor_data); | |
4922 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII,(UBYTE *) fm_data->edt_buf, 100); | |
4923 AUI_edit_SetMode(&editor_data,ED_MODE_ALPHA,0); | |
4924 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtNull, TxtMemorystat, NULL); | |
4925 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtNull); | |
4926 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_fm_memStat_editor_exec_cb); | |
4927 win = AUI_edit_Start(parent_win, &editor_data); | |
4928 | |
4929 AUI_edit_InsertString(win , (UBYTE *) "Used",ATB_DCS_ASCII); | |
4930 sprintf(used," :%d KB ",(fm_data->nUsedBytes)); | |
4931 AUI_edit_InsertString(win , (UBYTE *)used,ATB_DCS_ASCII); | |
4932 AUI_edit_InsertChar(win , ctrlEnter); | |
4933 AUI_edit_InsertChar(win , ctrlEnter); | |
4934 | |
4935 AUI_edit_InsertString(win , (UBYTE *) "Free",ATB_DCS_ASCII); | |
4936 sprintf(free," :%d KB ",fm_data->nFreeBytes); | |
4937 AUI_edit_InsertString(win , (UBYTE *)free,ATB_DCS_ASCII); | |
4938 AUI_edit_InsertChar(win , ctrlEnter); | |
4939 AUI_edit_InsertChar(win , ctrlEnter); | |
4940 | |
4941 AUI_edit_InsertString(win , (UBYTE *) "Total",ATB_DCS_ASCII); | |
4942 sprintf(total," :%d KB ",(fm_data->nFreeBytes+fm_data->nUsedBytes)); | |
4943 AUI_edit_InsertString(win , (UBYTE *)total,ATB_DCS_ASCII); | |
4944 AUI_edit_InsertChar(win , ctrlEnter); | |
4945 | |
4946 AUI_edit_SetMode(&editor_data,ED_MODE_READONLY, ED_CURSOR_NONE); | |
4947 win_show(win); | |
4948 return win; | |
4949 } | |
4950 | |
4951 /******************************************************************************* | |
4952 $Function: mmi_fm_memStat_editor_exec_cb | |
4953 | |
4954 $Description: Event handler for the editor | |
4955 | |
4956 $Returns: None | |
4957 | |
4958 $Arguments: win -current window | |
4959 identifier -window id | |
4960 reason -Event cause. | |
4961 *******************************************************************************/ | |
4962 static void mmi_fm_memStat_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason) | |
4963 { | |
4964 TRACE_FUNCTION ("mmi_fm_memStat_editor_exec_cb()"); | |
4965 | |
4966 switch (reason) | |
4967 { | |
4968 case INFO_KCD_LEFT: | |
4969 case INFO_KCD_RIGHT: | |
4970 case INFO_KCD_HUP: | |
4971 mmi_fm_memStat_editor_destroy( ); | |
4972 break; | |
4973 default: | |
4974 /* otherwise no action to be performed | |
4975 */ | |
4976 break; | |
4977 | |
4978 | |
4979 } | |
4980 } | |
4981 | |
4982 /******************************************************************************* | |
4983 $Function: mmi_fm_memStat_editor_destroy | |
4984 | |
4985 $Description: Frees the allocated memory | |
4986 | |
4987 $Returns: None | |
4988 | |
4989 $Arguments: None | |
4990 *******************************************************************************/ | |
4991 void mmi_fm_memStat_editor_destroy(void) | |
4992 { | |
4993 TRACE_FUNCTION ("mmi_fm_properties_editor_destroy"); | |
4994 | |
4995 mfwFree((U8 *)fm_data->edt_buf, FM_MAX_DETAILS_BUFFER); | |
4996 } | |
4997 | |
4998 /******************************************************************************* | |
4999 $Function: mmi_fm_format | |
5000 | |
5001 $Description: Formats the seleted drive | |
5002 | |
5003 $Returns: Execution status | |
5004 | |
5005 $Arguments: mnu -Pointer to current menu | |
5006 item -Pointer to current menu item | |
5007 *******************************************************************************/ | |
5008 GLOBAL int mmi_fm_format(MfwMnu* m, MfwMnuItem* i) | |
5009 { | |
5010 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
5011 | |
5012 TRACE_FUNCTION ("mmi_fm_format()"); | |
5013 | |
5014 if( fm_data->source == FM_NOR_FLASH) | |
5015 mmi_fm_app_show_info(parent_win,TxtFormat,TxtNotAllowed,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
5016 else | |
5017 mmi_fm_app_show_info(parent_win,TxtFormat,TxtNull,TxtSoftOK,TxtSoftBack,(T_VOID_FUNC)mmi_fm_format_confirm_cb,FOREVER,KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
5018 return MFW_EVENT_CONSUMED; | |
5019 } | |
5020 | |
5021 USHORT check_source_setting( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
5022 { | |
5023 if((fm_data->app == FM_AUDIO) && (fm_data->cur_dir->dirinfo.aud.state == FM_AUD_NONE)) | |
5024 return 0; | |
5025 else | |
5026 return 1; | |
5027 } | |
5028 | |
5029 USHORT check_source_audio( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
5030 { | |
5031 if(fm_data->app == FM_AUDIO) | |
5032 return 0; | |
5033 else | |
5034 return 1; | |
5035 } | |
5036 | |
5037 USHORT check_source_image( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
5038 { | |
5039 if(fm_data->app == FM_IMAGE) | |
5040 return 0; | |
5041 else | |
5042 return 1; | |
5043 } | |
5044 | |
5045 USHORT format_check_dev( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
5046 { | |
5047 if(fm_data->source == FM_NOR_FLASH) | |
5048 return 1; | |
5049 else | |
5050 return 0; | |
5051 } | |
5052 USHORT check_dev( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
5053 { | |
5054 | |
5055 char curDir[10]; | |
5056 UINT16 curDir_uc[10]; | |
5057 UINT16 objName_uc[10]; | |
5058 char objName[10]; | |
5059 T_RFS_DIR f_dir; | |
5060 | |
5061 strcpy(curDir, "/"); | |
5062 convert_u8_to_unicode(curDir, curDir_uc); | |
5063 | |
5064 if (rfs_opendir (curDir_uc, &f_dir) < 0) | |
5065 { | |
5066 TRACE_EVENT_P1("Opening dir %s Failed",curDir); | |
5067 return FM_DIR_DOESNOTEXISTS; | |
5068 } | |
5069 | |
5070 while(rfs_readdir (&f_dir, objName_uc, FM_MAX_OBJ_NAME_LENGTH) > 0x0 ) | |
5071 { | |
5072 if (objName_uc[0] == '\0') | |
5073 { | |
5074 return FM_READDIR_ERROR; | |
5075 } | |
5076 | |
5077 convert_unicode_to_u8(objName_uc, objName); | |
5078 | |
5079 if(strcmp(objName,"MMC")==0) | |
5080 { | |
5081 rfs_closedir(&f_dir); | |
5082 return 0; | |
5083 } | |
5084 } | |
5085 rfs_closedir(&f_dir); | |
5086 return 1; | |
5087 } | |
5088 | |
5089 /******************************************************************************* | |
5090 $Function: mmi_fm_format_confirm_cb | |
5091 | |
5092 $Description: Callback function for remove confirmation dialog | |
5093 | |
5094 $Returns: None | |
5095 | |
5096 $Arguments: win -current window | |
5097 identifier -window id | |
5098 reason -Event cause. | |
5099 *******************************************************************************/ | |
5100 void mmi_fm_format_confirm_cb (T_MFW_HND win, USHORT identifier, SHORT reason) | |
5101 { | |
5102 T_MFW_FM_STATUS status = FM_NO_ERROR; | |
5103 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
5104 | |
5105 TRACE_FUNCTION ("mmi_fm_format_confirm_cb()"); | |
5106 | |
5107 switch(reason) | |
5108 { | |
5109 case INFO_KCD_LEFT: | |
5110 status =mfw_fm_format( fm_data->source); | |
5111 switch(status) | |
5112 { | |
5113 case FM_NO_ERROR: | |
5114 mmi_fm_app_show_info(parent_win,TxtFormat,TxtDone,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
5115 break; | |
5116 case FM_FORMAT_ERROR: | |
5117 mmi_fm_app_show_info(parent_win,TxtFormat,TxtError,TxtNull,TxtSoftBack,0,THREE_SECS,KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
5118 break; | |
5119 } | |
5120 break; | |
5121 } | |
5122 | |
5123 } | |
5124 | |
5125 /******************************************************************************* | |
5126 $Function: mmi_fm_get_filename | |
5127 | |
5128 $Description: Extracts the filename discarding the extension | |
5129 | |
5130 $Returns: None | |
5131 | |
5132 $Arguments: filename -Pointer to filename | |
5133 ******************************************************************************/ | |
5134 void mmi_fm_get_filename( char * filename) | |
5135 { | |
5136 char* temp; | |
5137 int s; | |
5138 | |
5139 TRACE_FUNCTION("mmi_fm_img_getfilename"); | |
5140 | |
5141 temp=(char *)strchr(filename,'.'); | |
5142 if(filename && temp) | |
5143 { | |
5144 s = temp -filename; | |
5145 filename[s] ='\0'; | |
5146 } | |
5147 return; | |
5148 } | |
5149 | |
5150 /******************************************************************************* | |
5151 $Function: mmi_fm_get_ext | |
5152 | |
5153 $Description: Extracts the extension discarding the filename | |
5154 | |
5155 $Returns: Extention | |
5156 | |
5157 $Arguments: filename -Pointer to filename | |
5158 ******************************************************************************/ | |
5159 char * mmi_fm_get_ext( char * filename) | |
5160 { | |
5161 char * ext; | |
5162 | |
5163 TRACE_FUNCTION("mmi_fm_img_getext"); | |
5164 | |
5165 ext=(char *)strchr(filename,'.'); | |
5166 if(ext) | |
5167 ext++; | |
5168 return ext; | |
5169 } | |
5170 | |
5171 /******************************************************************************* | |
5172 $Function: mmi_fm_imgThmbGen_identifyFile | |
5173 | |
5174 $Description: Identifies the valid image file for which the thumbnail is not yet generated | |
5175 Index is updated in cur_dir->currentIndex | |
5176 | |
5177 $Returns: None | |
5178 | |
5179 $Arguments: None | |
5180 ******************************************************************************/ | |
5181 void mmi_fm_imgThmbGen_identifyFile() | |
5182 { | |
5183 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5184 | |
5185 TRACE_FUNCTION ("mmi_fm_imgThmbGen_identifyFile()"); | |
5186 | |
5187 while(cur_dir->currentIndex < cur_dir->num_objs) | |
5188 { | |
5189 if( cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE && | |
5190 cur_dir->obj_data[cur_dir->currentIndex]->image.thumbnail == FALSE ) | |
5191 { | |
5192 break; | |
5193 } | |
5194 cur_dir->currentIndex++; | |
5195 } | |
5196 } | |
5197 | |
5198 /******************************************************************************* | |
5199 $Function: mmi_fm_imgThmbGen_start | |
5200 | |
5201 $Description: Starts the thumbnail generation UCP | |
5202 | |
5203 $Returns: None | |
5204 | |
5205 $Arguments: None | |
5206 ******************************************************************************/ | |
5207 void mmi_fm_imgThmbGen_start(void) | |
5208 { | |
5209 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5210 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5211 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5212 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5213 | |
5214 TRACE_FUNCTION ("mmi_fm_imgThmbGen_start()"); | |
5215 | |
5216 cur_dir->dirinfo.img.ipMsl = aci_create(mslPrimHandler,NULL); | |
5217 //cur_dir->currentIndex would contain the index to the valid file for thumbnail generation | |
5218 mmi_fm_imgThmbGen_identifyFile(); | |
5219 //No files for thumbnail generation or | |
5220 if( cur_dir->currentIndex < cur_dir->num_objs ) | |
5221 { | |
5222 displayMenuKeys(MENU_KEY_WAIT); | |
5223 fm_data->menu_list_data->block_keys = (BOOL)TRUE; | |
5224 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5225 mmi_fm_get_filename(curFilename); | |
5226 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5227 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5228 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5229 result = mfw_fm_imgThmb_create(); | |
5230 if(result == FM_UCP_NO_ERROR) | |
5231 { | |
5232 result = mfw_fm_imgThmb_setparams((char *)currFilePath,curFilename,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT, fm_data->source); | |
5233 if(result == FM_UCP_NO_ERROR) | |
5234 { | |
5235 result = mfw_fm_imgThmb_setcallback(); | |
5236 if(result == FM_UCP_NO_ERROR) | |
5237 { | |
5238 cur_dir->dirinfo.img.cmd = FM_UCP_THMB_INIT; | |
5239 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5240 result = mfw_fm_imgThmb_init(); | |
5241 if(result != FM_UCP_NO_ERROR) | |
5242 { | |
5243 //Error initializing thumbnail UCP | |
5244 TRACE_ERROR("Error initializing thumbnail UCP"); | |
5245 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5246 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5247 result = mfw_fm_imgThmb_destroy(); | |
5248 if(result != FM_UCP_NO_ERROR) | |
5249 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5250 } | |
5251 } | |
5252 else | |
5253 { | |
5254 //Error setting callback for thumbnail UCP | |
5255 TRACE_ERROR("Error setting callback for thumbnail UCP"); | |
5256 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5257 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5258 result = mfw_fm_imgThmb_destroy(); | |
5259 if(result != FM_UCP_NO_ERROR) | |
5260 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5261 } | |
5262 } | |
5263 else | |
5264 { | |
5265 //Error configuring thumbnail UCP | |
5266 TRACE_ERROR("Error configuring thumbnail UCP"); | |
5267 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5268 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5269 result = mfw_fm_imgThmb_destroy(); | |
5270 if(result != FM_UCP_NO_ERROR) | |
5271 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5272 } | |
5273 } | |
5274 else | |
5275 { | |
5276 //Error creating thumbnail UCP | |
5277 TRACE_ERROR("Error creating thumbnail UCP"); | |
5278 } | |
5279 } | |
5280 else | |
5281 { | |
5282 //No files for thumbnail generation | |
5283 cur_dir->currentIndex=cur_dir->startIndex; | |
5284 mmi_fm_imgThmbDraw_start(); | |
5285 } | |
5286 | |
5287 } | |
5288 /******************************************************************************* | |
5289 $Function: mmi_fm_imgThmbGen_resume | |
5290 | |
5291 $Description: Starts the thumbnail generation UCP | |
5292 | |
5293 $Returns: None | |
5294 | |
5295 $Arguments: None | |
5296 ******************************************************************************/ | |
5297 | |
5298 void mmi_fm_imgThmbGen_resume(void) | |
5299 { | |
5300 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5301 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5302 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5303 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5304 | |
5305 TRACE_FUNCTION ("mmi_fm_imgThmbGen_resume()"); | |
5306 | |
5307 cur_dir->currentIndex++; | |
5308 | |
5309 //cur_dir->currentIndex would contain the index to the valid file for thumbnail generation | |
5310 mmi_fm_imgThmbGen_identifyFile(); | |
5311 | |
5312 if(cur_dir->currentIndex < cur_dir->num_objs ) | |
5313 { | |
5314 displayMenuKeys(MENU_KEY_WAIT); | |
5315 fm_data->menu_list_data->block_keys = (BOOL)TRUE; | |
5316 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5317 mmi_fm_get_filename(curFilename); | |
5318 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5319 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5320 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5321 result = mfw_fm_imgThmb_setparams((char *)currFilePath,curFilename,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT, fm_data->source); | |
5322 if(result == FM_UCP_NO_ERROR) | |
5323 { | |
5324 result = mfw_fm_imgThmb_setcallback(); | |
5325 if(result == FM_UCP_NO_ERROR) | |
5326 { | |
5327 cur_dir->dirinfo.img.cmd = FM_UCP_THMB_INIT; | |
5328 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5329 result = mfw_fm_imgThmb_init(); | |
5330 if(result != FM_UCP_NO_ERROR) | |
5331 { | |
5332 //Error initializing thumbnail UCP | |
5333 TRACE_ERROR("Error initializing thumbnail UCP"); | |
5334 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5335 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5336 result = mfw_fm_imgThmb_destroy(); | |
5337 if(result != FM_UCP_NO_ERROR) | |
5338 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5339 } | |
5340 } | |
5341 else | |
5342 { | |
5343 //Error setting callback for thumbnail UCP | |
5344 TRACE_ERROR("Error setting callback for thumbnail UCP"); | |
5345 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5346 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5347 result = mfw_fm_imgThmb_destroy(); | |
5348 if(result != FM_UCP_NO_ERROR) | |
5349 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5350 } | |
5351 } | |
5352 else | |
5353 { | |
5354 //Error configuring thumbnail UCP | |
5355 TRACE_ERROR("Error configuring thumbnail UCP"); | |
5356 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5357 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5358 result = mfw_fm_imgThmb_destroy(); | |
5359 if(result != FM_UCP_NO_ERROR) | |
5360 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5361 } | |
5362 } | |
5363 else | |
5364 { | |
5365 //No files for thumbnail generation | |
5366 cur_dir->currentIndex=cur_dir->startIndex; | |
5367 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5368 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5369 result = mfw_fm_imgThmb_destroy(); | |
5370 if(result != FM_UCP_NO_ERROR) | |
5371 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5372 mmi_fm_imgThmbDraw_start(); | |
5373 } | |
5374 } | |
5375 /******************************************************************************* | |
5376 $Function: mmi_fm_imgThmbGen_start | |
5377 | |
5378 $Description: Generates thumbnail | |
5379 | |
5380 $Returns: None | |
5381 | |
5382 $Arguments: None | |
5383 ******************************************************************************/ | |
5384 void mmi_fm_imgThmbGen(void) | |
5385 { | |
5386 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5387 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5388 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5389 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5390 | |
5391 TRACE_FUNCTION ("mmi_fm_imgThmbGen()"); | |
5392 | |
5393 cur_dir->currentIndex++; | |
5394 //cur_dir->currentIndex would contain the index to the valid file for thumbnail generation | |
5395 mmi_fm_imgThmbGen_identifyFile(); | |
5396 if(cur_dir->currentIndex < cur_dir->num_objs) | |
5397 { | |
5398 displayMenuKeys(MENU_KEY_WAIT); | |
5399 fm_data->menu_list_data->block_keys = (BOOL)TRUE; | |
5400 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex]->name); | |
5401 mmi_fm_get_filename(curFilename); | |
5402 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5403 result= mfw_fm_imgThmb_setparams((char *)currFilePath,curFilename,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,fm_data->source); | |
5404 if(result == FM_UCP_NO_ERROR) | |
5405 { | |
5406 cur_dir->dirinfo.img.cmd=FM_UCP_THMB_GEN; | |
5407 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
5408 result = mfw_fm_imgThmb_generate(); | |
5409 if(result != FM_UCP_NO_ERROR) | |
5410 { | |
5411 //Error Generating thumbnails | |
5412 //Deinitialize the Thumbnail UCP and destroy it | |
5413 TRACE_ERROR("Error generating thumbnails"); | |
5414 cur_dir->dirinfo.img.cmd=FM_UCP_THMB_DEINIT; | |
5415 cur_dir->dirinfo.img.state=FM_UCP_ERROR; | |
5416 result = mfw_fm_imgThmb_deinit(); | |
5417 if(result != FM_UCP_NO_ERROR) | |
5418 { | |
5419 TRACE_ERROR("Error deinitializing the thumbnail UCP"); | |
5420 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
5421 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
5422 result = mfw_fm_imgThmb_destroy(); | |
5423 if(result != FM_UCP_NO_ERROR) | |
5424 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5425 } | |
5426 } | |
5427 } | |
5428 else | |
5429 { | |
5430 //Error configuring thumbnail UCP | |
5431 //Deinitialize the Thumbnail UCP and destroy it | |
5432 TRACE_ERROR("Error configuring thumbnail UCP"); | |
5433 cur_dir->dirinfo.img.cmd=FM_UCP_THMB_DEINIT; | |
5434 cur_dir->dirinfo.img.state=FM_UCP_ERROR; | |
5435 result = mfw_fm_imgThmb_deinit(); | |
5436 if(result != FM_UCP_NO_ERROR) | |
5437 { | |
5438 TRACE_ERROR("Error deinitializing the thumbnail UCP"); | |
5439 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
5440 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
5441 result = mfw_fm_imgThmb_destroy(); | |
5442 if(result != FM_UCP_NO_ERROR) | |
5443 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5444 } | |
5445 } | |
5446 } | |
5447 else | |
5448 { | |
5449 //No more thumbnails to genearte | |
5450 //Deinitialize the thumbnail UCP and start the Viewer UCP for drawing the thumbnails | |
5451 TRACE_EVENT("Thumbnail generation complete"); | |
5452 cur_dir->dirinfo.img.cmd=FM_UCP_THMB_DEINIT; | |
5453 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
5454 result = mfw_fm_imgThmb_deinit(); | |
5455 if(result != FM_UCP_NO_ERROR) | |
5456 { | |
5457 TRACE_ERROR("Error deinitializing the thumbnail UCP"); | |
5458 cur_dir->dirinfo.img.cmd=FM_UCP_NONE; | |
5459 cur_dir->dirinfo.img.state=FM_UCP_NONE; | |
5460 result = mfw_fm_imgThmb_destroy(); | |
5461 if(result != FM_UCP_NO_ERROR) | |
5462 TRACE_ERROR("Error destroying the thumbnail UCP"); | |
5463 } | |
5464 } | |
5465 } | |
5466 | |
5467 /******************************************************************************* | |
5468 $Function: mmi_fm_imgThmbDraw_identifyFile | |
5469 | |
5470 $Description: Identifies the valid image file which has thumbnail | |
5471 Index is updated in cur_dir->currentIndex | |
5472 | |
5473 $Returns: None | |
5474 | |
5475 $Arguments: None | |
5476 ******************************************************************************/ | |
5477 void mmi_fm_imgThmbDraw_identifyFile() | |
5478 { | |
5479 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5480 | |
5481 TRACE_FUNCTION ("mmi_fm_imgThmbDraw_identifyFile()"); | |
5482 | |
5483 while( (cur_dir->currentIndex < cur_dir->num_objs) ) | |
5484 { | |
5485 if( cur_dir->obj_list[cur_dir->currentIndex]->type == OBJECT_TYPE_IMAGE && | |
5486 cur_dir->obj_data[cur_dir->currentIndex]->image.thumbnail == TRUE ) | |
5487 { | |
5488 break; | |
5489 } | |
5490 cur_dir->currentIndex++; | |
5491 } | |
5492 } | |
5493 | |
5494 /******************************************************************************* | |
5495 $Function: mmi_fm_imgThmbDraw_start | |
5496 | |
5497 $Description: Starts the image display UCP | |
5498 | |
5499 $Returns: None | |
5500 | |
5501 $Arguments: None | |
5502 ******************************************************************************/ | |
5503 void mmi_fm_imgThmbDraw_start(void) | |
5504 { | |
5505 MfwMnuItem *menu_item; | |
5506 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5507 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5508 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5509 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5510 int x_offset=0, y_offset; | |
5511 | |
5512 TRACE_FUNCTION ("mmi_fm_imgThmbDraw_start()"); | |
5513 if(!cur_dir->dirinfo.img.ipMsl) | |
5514 cur_dir->dirinfo.img.ipMsl = aci_create(mslPrimHandler,NULL); | |
5515 | |
5516 | |
5517 //cur_dir->currentIndex would contain the index to the valid file for drawing the thumbnail | |
5518 mmi_fm_imgThmbDraw_identifyFile(); | |
5519 if( ((cur_dir->currentIndex - cur_dir->startIndex )< fm_data->menu_list_data->SnapshotSize) | |
5520 && cur_dir->currentIndex < cur_dir->num_objs) | |
5521 { | |
5522 displayMenuKeys(MENU_KEY_WAIT); | |
5523 fm_data->menu_list_data->block_keys = (BOOL)TRUE; | |
5524 menu_item = fm_data->menu_list_data->List; | |
5525 y_offset=menu_item[0].icon->area.py+ ((cur_dir->currentIndex % 3) * fm_data->lineheight ); | |
5526 if(cur_dir->dirinfo.img.cmd == FM_UCP_NONE && cur_dir->dirinfo.img.state == FM_UCP_NONE) | |
5527 { | |
5528 //Viewer UCP is not yet created, so create it and then draw the thumbnails | |
5529 result = mfw_fm_imgViewer_create(); | |
5530 if(result == FM_UCP_NO_ERROR) | |
5531 { | |
5532 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5533 mmi_fm_get_filename(curFilename); | |
5534 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5535 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_PREVIEW_WIDTH,FM_MFW_PREVIEW_HEIGHT,x_offset,y_offset, fm_data->source); | |
5536 if(result == FM_UCP_NO_ERROR) | |
5537 { | |
5538 result = mfw_fm_imgViewer_setcallback(); | |
5539 if(result == FM_UCP_NO_ERROR) | |
5540 { | |
5541 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_INIT; | |
5542 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5543 result = mfw_fm_imgViewer_init(); | |
5544 if(result != FM_UCP_NO_ERROR) | |
5545 { | |
5546 //Error initializing the Viewer UCP, destroy it | |
5547 TRACE_ERROR("Error initializing the Viewer UCP"); | |
5548 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5549 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5550 result = mfw_fm_imgViewer_destroy(); | |
5551 if(result != FM_UCP_NO_ERROR) | |
5552 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5553 } | |
5554 } | |
5555 else | |
5556 { | |
5557 //Error configuring the callback for Viewer UCP, Destroy it | |
5558 TRACE_ERROR("Error configuring the callback for Viewer UCP"); | |
5559 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5560 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5561 result = mfw_fm_imgViewer_destroy(); | |
5562 if(result != FM_UCP_NO_ERROR) | |
5563 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5564 } | |
5565 } | |
5566 else | |
5567 { | |
5568 //Error configuring the Viewer UCP, Destroy it | |
5569 TRACE_ERROR("Error configuring the Viewer UCP"); | |
5570 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5571 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5572 result = mfw_fm_imgViewer_destroy(); | |
5573 if(result != FM_UCP_NO_ERROR) | |
5574 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5575 } | |
5576 } | |
5577 else | |
5578 { | |
5579 //Error creating Viewer UCP | |
5580 TRACE_ERROR("Error creating Viewer UCP"); | |
5581 } | |
5582 } | |
5583 else if( (cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW || cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW) && | |
5584 cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
5585 { | |
5586 //Viewer UCP is already created, so draw the thumbnails | |
5587 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5588 mmi_fm_get_filename(curFilename); | |
5589 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5590 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_PREVIEW_WIDTH,FM_MFW_PREVIEW_HEIGHT,x_offset,y_offset, fm_data->source); | |
5591 if(result == FM_UCP_NO_ERROR) | |
5592 { | |
5593 cur_dir->dirinfo.img.cmd=FM_UCP_THMBIMG_DRAW; | |
5594 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5595 result = mfw_fm_imgViewer_view(); | |
5596 if(result != FM_UCP_NO_ERROR) | |
5597 { | |
5598 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
5599 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
5600 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_DEINIT; | |
5601 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
5602 result = mfw_fm_imgViewer_deinit(); | |
5603 if(result != FM_UCP_NO_ERROR) | |
5604 { | |
5605 //Error deinitializing the Viewer UCP, destroy it | |
5606 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
5607 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5608 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5609 result = mfw_fm_imgViewer_destroy(); | |
5610 if(result != FM_UCP_NO_ERROR) | |
5611 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5612 } | |
5613 } | |
5614 | |
5615 } | |
5616 else | |
5617 { | |
5618 //Error configuring the Viewer UCP, Destroy it | |
5619 TRACE_ERROR("Error configuring the Viewer UCP"); | |
5620 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5621 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5622 result = mfw_fm_imgViewer_destroy(); | |
5623 if(result != FM_UCP_NO_ERROR) | |
5624 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5625 } | |
5626 } | |
5627 else | |
5628 { | |
5629 TRACE_EVENT("UCP not valid state"); | |
5630 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
5631 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
5632 } | |
5633 } | |
5634 else | |
5635 { | |
5636 //No valid images to draw | |
5637 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
5638 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
5639 TRACE_EVENT("No Files to draw"); | |
5640 } | |
5641 } | |
5642 | |
5643 /******************************************************************************* | |
5644 $Function: mmi_fm_imgThmbDraw_resume | |
5645 | |
5646 $Description: Starts the image display UCP | |
5647 | |
5648 $Returns: None | |
5649 | |
5650 $Arguments: None | |
5651 ******************************************************************************/ | |
5652 void mmi_fm_imgThmbDraw_resume(void) | |
5653 { | |
5654 MfwMnuItem *menu_item; | |
5655 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5656 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5657 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5658 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5659 int x_offset=0, y_offset; | |
5660 | |
5661 TRACE_FUNCTION ("mmi_fm_imgThmbDraw_resume()"); | |
5662 | |
5663 cur_dir->currentIndex++; | |
5664 | |
5665 //cur_dir->currentIndex would contain the index to the valid file for drawing the thumbnail | |
5666 mmi_fm_imgThmbDraw_identifyFile(); | |
5667 if( ((cur_dir->currentIndex - cur_dir->startIndex )< fm_data->menu_list_data->SnapshotSize) | |
5668 && cur_dir->currentIndex < cur_dir->num_objs) | |
5669 { | |
5670 displayMenuKeys(MENU_KEY_WAIT); | |
5671 fm_data->menu_list_data->block_keys = (BOOL)TRUE; | |
5672 menu_item = fm_data->menu_list_data->List; | |
5673 y_offset=menu_item[0].icon->area.py+ ((cur_dir->currentIndex % 3) * fm_data->lineheight ); | |
5674 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5675 mmi_fm_get_filename(curFilename); | |
5676 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5677 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_PREVIEW_WIDTH,FM_MFW_PREVIEW_HEIGHT,x_offset,y_offset, fm_data->source); | |
5678 if(result == FM_UCP_NO_ERROR) | |
5679 { | |
5680 result = mfw_fm_imgViewer_setcallback(); | |
5681 if(result == FM_UCP_NO_ERROR) | |
5682 { | |
5683 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_INIT; | |
5684 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5685 result = mfw_fm_imgViewer_init(); | |
5686 if(result != FM_UCP_NO_ERROR) | |
5687 { | |
5688 //Error initializing the Viewer UCP, destroy it | |
5689 TRACE_ERROR("Error initializing the Viewer UCP"); | |
5690 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5691 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5692 result = mfw_fm_imgViewer_destroy(); | |
5693 if(result != FM_UCP_NO_ERROR) | |
5694 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5695 } | |
5696 } | |
5697 else | |
5698 { | |
5699 //Error configuring the callback for Viewer UCP, Destroy it | |
5700 TRACE_ERROR("Error configuring the callback for Viewer UCP"); | |
5701 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5702 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5703 result = mfw_fm_imgViewer_destroy(); | |
5704 if(result != FM_UCP_NO_ERROR) | |
5705 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5706 } | |
5707 } | |
5708 else | |
5709 { | |
5710 //Error configuring the Viewer UCP, Destroy it | |
5711 TRACE_ERROR("Error configuring the Viewer UCP"); | |
5712 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5713 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5714 result = mfw_fm_imgViewer_destroy(); | |
5715 if(result != FM_UCP_NO_ERROR) | |
5716 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5717 } | |
5718 } | |
5719 else | |
5720 { | |
5721 //No valid images to draw | |
5722 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
5723 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
5724 TRACE_EVENT("No Files to draw"); | |
5725 } | |
5726 } | |
5727 | |
5728 /******************************************************************************* | |
5729 $Function: mmi_fm_imgThmbGen_start | |
5730 | |
5731 $Description: Drawa thumbnails 48 X 48 | |
5732 | |
5733 $Returns: None | |
5734 | |
5735 $Arguments: None | |
5736 ******************************************************************************/ | |
5737 void mmi_fm_imgThmbDraw(void) | |
5738 { | |
5739 MfwMnuItem *menu_item; | |
5740 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5741 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5742 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5743 int x_offset=0, y_offset; | |
5744 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5745 | |
5746 TRACE_FUNCTION ("mmi_fm_imgThmbDraw()"); | |
5747 | |
5748 mmi_fm_imgThmbDraw_identifyFile(); | |
5749 if( ((cur_dir->currentIndex - cur_dir->startIndex )< fm_data->menu_list_data->SnapshotSize) | |
5750 && cur_dir->currentIndex < cur_dir->num_objs) | |
5751 { | |
5752 TRACE_EVENT("Inside if"); | |
5753 displayMenuKeys(MENU_KEY_WAIT); | |
5754 fm_data->menu_list_data->block_keys = (BOOL)TRUE; | |
5755 menu_item = fm_data->menu_list_data->List; | |
5756 y_offset=menu_item[0].icon->area.py + ((cur_dir->currentIndex % 3) * fm_data->lineheight ); | |
5757 if( (cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW || cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW) | |
5758 && cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
5759 { | |
5760 //Viewer UCP is already created, so draw the thumbnails | |
5761 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5762 mmi_fm_get_filename(curFilename); | |
5763 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5764 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_PREVIEW_WIDTH,FM_MFW_PREVIEW_HEIGHT,x_offset,y_offset,fm_data->source); | |
5765 if(result == FM_UCP_NO_ERROR) | |
5766 { | |
5767 cur_dir->dirinfo.img.cmd=FM_UCP_THMBIMG_DRAW; | |
5768 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5769 result = mfw_fm_imgViewer_view(); | |
5770 if(result != FM_UCP_NO_ERROR) | |
5771 { | |
5772 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
5773 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
5774 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_DEINIT; | |
5775 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
5776 result = mfw_fm_imgViewer_deinit(); | |
5777 if(result != FM_UCP_NO_ERROR) | |
5778 { | |
5779 //Error deinitializing the Viewer UCP, destroy it | |
5780 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
5781 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5782 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5783 result = mfw_fm_imgViewer_destroy(); | |
5784 if(result != FM_UCP_NO_ERROR) | |
5785 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5786 } | |
5787 } | |
5788 } | |
5789 else | |
5790 { | |
5791 //Error configuring the Viewer UCP, Destroy it | |
5792 TRACE_ERROR("Error configuring the Viewer UCP"); | |
5793 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5794 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5795 result = mfw_fm_imgViewer_destroy(); | |
5796 if(result != FM_UCP_NO_ERROR) | |
5797 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5798 } | |
5799 } | |
5800 else if (cur_dir->dirinfo.img.cmd == FM_UCP_NONE && cur_dir->dirinfo.img.state == FM_UCP_NONE) | |
5801 { | |
5802 //Viewer UCP is not yet created, so create it and then draw the thumbnails | |
5803 result = mfw_fm_imgViewer_create(); | |
5804 if(result == FM_UCP_NO_ERROR) | |
5805 { | |
5806 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5807 mmi_fm_get_filename(curFilename); | |
5808 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5809 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_PREVIEW_WIDTH,FM_MFW_PREVIEW_HEIGHT,x_offset,y_offset, fm_data->source); | |
5810 if(result == FM_UCP_NO_ERROR) | |
5811 { | |
5812 result = mfw_fm_imgViewer_setcallback(); | |
5813 if(result == FM_UCP_NO_ERROR) | |
5814 { | |
5815 cur_dir->dirinfo.img.cmd = FM_UCP_THMBIMG_INIT; | |
5816 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5817 result = mfw_fm_imgViewer_init(); | |
5818 if(result != FM_UCP_NO_ERROR) | |
5819 { | |
5820 //Error initializing the Viewer UCP, destroy it | |
5821 TRACE_ERROR("Error initializing the Viewer UCP"); | |
5822 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5823 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5824 result = mfw_fm_imgViewer_destroy(); | |
5825 if(result != FM_UCP_NO_ERROR) | |
5826 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5827 } | |
5828 } | |
5829 else | |
5830 { | |
5831 //Error configuring the callback for Viewer UCP, Destroy it | |
5832 TRACE_ERROR("Error configuring the callback for Viewer UCP"); | |
5833 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5834 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5835 result = mfw_fm_imgViewer_destroy(); | |
5836 if(result != FM_UCP_NO_ERROR) | |
5837 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5838 } | |
5839 } | |
5840 else | |
5841 { | |
5842 //Error configuring the Viewer UCP, Destroy it | |
5843 TRACE_ERROR("Error configuring the Viewer UCP"); | |
5844 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5845 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5846 result = mfw_fm_imgViewer_destroy(); | |
5847 if(result != FM_UCP_NO_ERROR) | |
5848 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5849 } | |
5850 } | |
5851 else | |
5852 { | |
5853 //Error creating Viewer UCP | |
5854 TRACE_ERROR("Error creating Viewer UCP"); | |
5855 } | |
5856 } | |
5857 else | |
5858 { | |
5859 TRACE_EVENT("UCP not valid state"); | |
5860 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
5861 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
5862 } | |
5863 } | |
5864 else | |
5865 { | |
5866 displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); | |
5867 fm_data->menu_list_data->block_keys = (BOOL)FALSE; | |
5868 TRACE_EVENT("No Valid File to draw"); | |
5869 } | |
5870 } | |
5871 | |
5872 /******************************************************************************* | |
5873 $Function: mmi_fm_imgThmbGen_start | |
5874 | |
5875 $Description: Drawa images in QCIF width and height | |
5876 | |
5877 $Returns: None | |
5878 | |
5879 $Arguments: None | |
5880 ******************************************************************************/ | |
5881 void mmi_fm_imgDraw(void) | |
5882 { | |
5883 char currFilePath[FM_MAX_DIR_PATH_LENGTH]; | |
5884 char curFilename[FM_MAX_OBJ_NAME_LENGTH]; | |
5885 T_FM_CURDIR *cur_dir = fm_data->cur_dir; | |
5886 T_FM_IMG_STATE result = FM_UCP_NO_ERROR; | |
5887 | |
5888 TRACE_FUNCTION ("mmi_fm_imgDraw()"); | |
5889 | |
5890 if( (cur_dir->dirinfo.img.cmd == FM_UCP_THMBIMG_DRAW || cur_dir->dirinfo.img.cmd == FM_UCP_QCIFIMG_DRAW ) && | |
5891 cur_dir->dirinfo.img.state == FM_UCP_NO_ERROR) | |
5892 { | |
5893 //Viewer UCP is already created, so draw the image | |
5894 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5895 mmi_fm_get_filename(curFilename); | |
5896 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5897 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,0,0,fm_data->source); | |
5898 if(result == FM_UCP_NO_ERROR) | |
5899 { | |
5900 cur_dir->dirinfo.img.cmd=FM_UCP_QCIFIMG_DRAW; | |
5901 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5902 result = mfw_fm_imgViewer_view(); | |
5903 if(result != FM_UCP_NO_ERROR) | |
5904 { | |
5905 //Error drawing thumbnail in the Viewer UCP, deinit and destroy it | |
5906 TRACE_ERROR("Error drawing thumbnail in the Viewer UCP"); | |
5907 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
5908 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
5909 result = mfw_fm_imgViewer_deinit(); | |
5910 if(result != FM_UCP_NO_ERROR) | |
5911 { | |
5912 //Error deinitializing the Viewer UCP, destroy it | |
5913 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
5914 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5915 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5916 result = mfw_fm_imgViewer_destroy(); | |
5917 if(result != FM_UCP_NO_ERROR) | |
5918 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5919 } | |
5920 } | |
5921 } | |
5922 else | |
5923 { | |
5924 //Error configuring the Viewer UCP, deinit and destroy it | |
5925 TRACE_ERROR("Error configuring Viewer UCP"); | |
5926 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_DEINIT; | |
5927 cur_dir->dirinfo.img.state = FM_UCP_ERROR; | |
5928 result = mfw_fm_imgViewer_deinit(); | |
5929 if(result != FM_UCP_NO_ERROR) | |
5930 { | |
5931 //Error deinitializing the Viewer UCP, destroy it | |
5932 TRACE_ERROR("Error deinitializing the Viewer UCP"); | |
5933 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5934 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5935 result = mfw_fm_imgViewer_destroy(); | |
5936 if(result != FM_UCP_NO_ERROR) | |
5937 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5938 } | |
5939 } | |
5940 } | |
5941 else if(cur_dir->dirinfo.img.cmd != FM_UCP_NONE) | |
5942 { | |
5943 //Viewer UCP is not yet created, so create it and then draw the thumbnails | |
5944 result = mfw_fm_imgViewer_create(); | |
5945 if(result == FM_UCP_NO_ERROR) | |
5946 { | |
5947 strcpy(curFilename,cur_dir->obj_list[cur_dir->currentIndex ]->name); | |
5948 mmi_fm_get_filename(curFilename); | |
5949 sprintf(currFilePath,"%s%s/",cur_dir->dir_path,cur_dir->dir_name); | |
5950 result = mfw_fm_imgViewer_setImageProperty((char *)currFilePath,curFilename,FM_MFW_QCIF_WIDTH,FM_MFW_QCIF_HEIGHT,0,0,fm_data->source); | |
5951 if(result == FM_UCP_NO_ERROR) | |
5952 { | |
5953 result = mfw_fm_imgViewer_setcallback(); | |
5954 if(result == FM_UCP_NO_ERROR) | |
5955 { | |
5956 cur_dir->dirinfo.img.cmd = FM_UCP_QCIFIMG_INIT; | |
5957 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5958 result = mfw_fm_imgViewer_init(); | |
5959 if(result != FM_UCP_NO_ERROR) | |
5960 { | |
5961 //Error initializing the Viewer UCP, destroy it | |
5962 TRACE_ERROR("Error initializing the Viewer UCP"); | |
5963 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5964 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5965 result = mfw_fm_imgViewer_destroy(); | |
5966 if(result != FM_UCP_NO_ERROR) | |
5967 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5968 } | |
5969 | |
5970 } | |
5971 else | |
5972 { | |
5973 //Error configuring the callback for Viewer UCP, Destroy it | |
5974 TRACE_ERROR("Error configuring the callback for Viewer UCP"); | |
5975 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5976 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5977 result = mfw_fm_imgViewer_destroy(); | |
5978 if(result != FM_UCP_NO_ERROR) | |
5979 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5980 } | |
5981 } | |
5982 else | |
5983 { | |
5984 //Error configuring the Viewer UCP, Destroy it | |
5985 TRACE_ERROR("Error configuring the Viewer UCP"); | |
5986 cur_dir->dirinfo.img.cmd = FM_UCP_NONE; | |
5987 cur_dir->dirinfo.img.state = FM_UCP_NONE; | |
5988 result = mfw_fm_imgViewer_destroy(); | |
5989 if(result != FM_UCP_NO_ERROR) | |
5990 TRACE_ERROR("Error destroying the Viewer UCP"); | |
5991 } | |
5992 } | |
5993 else | |
5994 { | |
5995 //Error creating Viewer UCP | |
5996 TRACE_ERROR("Error creating Viewer UCP"); | |
5997 } | |
5998 } | |
5999 } | |
6000 | |
6001 | |
6002 void mmi_fm_set_mmi_plane_to_front(void) | |
6003 { | |
6004 TRACE_FUNCTION ("mmi_fm_set_mmi_plane_to_front()"); | |
6005 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state3 %d",cur_dir->dirinfo.aud.state); | |
6006 dspl_set_mmi_to_idle_mode(); | |
6007 // TRACE_EVENT_P1("cur_dir->dirinfo.aud.state4 %d",cur_dir->dirinfo.aud.state); | |
6008 dspl_set_mmi_to_execute_mode(); | |
6009 //TRACE_EVENT_P1("cur_dir->dirinfo.aud.state5 %d",cur_dir->dirinfo.aud.state); | |
6010 | |
6011 } | |
6012 | |
6013 GLOBAL int mmi_pb_on_off(MfwMnu* m, MfwMnuItem* i) | |
6014 { | |
6015 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
6016 | |
6017 switch(m->lCursor[m->level]) | |
6018 { | |
6019 case 0: | |
6020 mmi_progress_bar = PB_ON; | |
6021 mmi_fm_app_show_info(parent_win,TxtMidiLoopOn,TxtNull,TxtNull,TxtNull,0,THREE_SECS, KEY_CLEAR); | |
6022 break; | |
6023 | |
6024 case 1: | |
6025 mmi_progress_bar = PB_OFF; | |
6026 mmi_fm_app_show_info(parent_win,TxtMidiLoopOff,TxtNull,TxtNull,TxtNull,0,THREE_SECS, KEY_CLEAR); | |
6027 break; | |
6028 } | |
6029 return 1; | |
6030 } | |
6031 | |
6032 /* Mar 29, 2007 DRT: OMAPS00122677 x0039928 */ | |
6033 /* Fix: Initialize root directories */ | |
6034 /******************************************************************************* | |
6035 $Function: mmi_fm_init | |
6036 | |
6037 $Description: Drawa images in QCIF width and height | |
6038 | |
6039 $Returns: None | |
6040 | |
6041 $Arguments: None | |
6042 ******************************************************************************/ | |
6043 void mmi_fm_init(void) | |
6044 { | |
6045 mfw_fm_createRootDir(FM_NOR_FLASH); | |
6046 mfw_fm_createRootDir(FM_NORMS_FLASH); | |
6047 mfw_fm_createRootDir(FM_NAND_FLASH); | |
6048 if(check_dev(NULL, NULL, NULL) == 0) | |
6049 mfw_fm_createRootDir(FM_T_FLASH); | |
6050 } | |
6051 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> Start*/ | |
6052 #ifdef FF_MMI_UNICODE_SUPPORT | |
6053 static void unicode_to_char_array(T_WCHAR *inp, char *out) | |
6054 { | |
6055 int i; | |
6056 int size = wstrlen(inp)+1; | |
6057 | |
6058 for (i=0; i<size; i++) | |
6059 { | |
6060 out[i*2] = (inp[i]&0xFF00)>>8; | |
6061 out[i*2+1] = (inp[i]&0x00FF); | |
6062 //out[i*2] = *(((char *) (inp+i)) + 1); | |
6063 //out[i*2+1] = *((char *) (inp+i)); | |
6064 } | |
6065 } | |
6066 #endif | |
6067 /* February 8, 2008 DRT:OMAPS00156759 (x0083025) For Unicode Support--> End*/ | |
6068 | |
6069 #endif |