AudioPlayerWalk.h
7.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* AudioPlayerWalk.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* Audio player walk header file
*
* Author:
* -------
* -------
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
#ifdef __MMI_AUDPLY_WALK_PLAY__
#ifndef __AUDIO_PLAYER_WALK_H__
#define __AUDIO_PLAYER_WALK_H__
#include "AudioPlayerPlayList.h"
#define MMI_AUDPLY_WALK_DEFAULT_PATH SRV_FMGR_CARD_DRV//SRV_FMGR_PUBLIC_DRV
#define MMI_AUDPLY_WALK_PATH_SIZE ((SRV_FMGR_PATH_MAX_LEN+1) + 1)
#define MMI_AUDPLY_WALK_MAX_DEPTH_DIRECTORY (4)
#define MMI_AUDPLY_CACHE_NUM 50 //Cache Count
#define MMI_AUDPLY_RECACHE_NUM 10 //Temp Cache count
#define CACHE_JOB_NUM 15 //Job number
#define SEARCH_PREV_FOLDER_INDEX 60
typedef enum
{
AUDPLY_PLAY_STYLE_BY_FILE_ORDER,
AUDPLY_PLAY_STYLE_BY_PLAYLIST
} audply_play_style;
typedef enum
{
CACHE_VALIDATION_SUCCESS,
CACHE_VALIDATION_FAIL,
CACHE_VALIDATION_BREAK_POINT_NOT_EXIST
}mmi_audply_cache_validation_result;
typedef enum
{
AUDPLY_WALK_FOLDER_RESULT_FAIL,
AUDPLY_WALK_FOLDER_RESULT_SUCCESS,
AUDPLY_WALK_FOLDER_RESULT_CONTINUE
} mmi_audply_walk_folder_result_enum;
typedef enum
{
AUDPLY_WALK_PREV_FOLDER_RESULT_FAIL,
AUDPLY_WALK_PREV_FOLDER_RESULT_SUCCESS,
AUDPLY_WALK_PREV_FOLDER_RESULT_CONTINUE
} mmi_audply_walk_prev_folder_result_enum;
typedef enum
{
AUDPLY_WALK_CACHE_STATE_NONE,
AUDPLY_WALK_CACHE_STATE_CACHING,
AUDPLY_WALK_CACHE_STATE_FINISH
}audply_walk_cache_state;
/*
** stack node structure
*/
typedef struct
{
U16 fs_index; /* fs index for FS_FindFirst(). */
} mmi_audply_walk_stack_node_struct;
typedef struct
{
UI_character_type Cache_file_path[(SRV_FMGR_PATH_MAX_LEN+1) + 1];
S32 FS_Index;
S16 Next_valid_index;
}audply_walk_cache_struct;
typedef struct
{
audply_walk_cache_struct cache_buffer[MMI_AUDPLY_CACHE_NUM];
S16 Cache_header_index;
S16 Cache_footer_index;
audply_walk_cache_state cache_state;
S32 Cache_index;
}audply_walk_cache_int_struct;
typedef struct
{
audply_walk_cache_struct cache_buffer[MMI_AUDPLY_RECACHE_NUM];
S16 Cache_header_index;
S16 Cache_footer_index;
audply_walk_cache_state cache_state;
S32 Cache_index;
}audply_walk_cache_int_temp_struct;
typedef struct
{
UI_character_type file_path[(SRV_FMGR_PATH_MAX_LEN+1) + 1];
mmi_audply_walk_stack_node_struct stack[MMI_AUDPLY_WALK_MAX_DEPTH_DIRECTORY];
FS_HANDLE current_file_handler;
}audply_walk_cache_service_work_struct;
typedef struct
{
UI_character_type file_path[(SRV_FMGR_PATH_MAX_LEN+1) + 1];
FS_HANDLE current_file_handler;
}audply_walk_temp_cache_service_work_struct;
typedef struct
{
U16 fs_index; /* fs index for FS_FindFirst(). */
} audply_new_cache_stack_struct;
typedef struct
{
CHAR *file_path;
audply_new_cache_stack_struct *stack;
}audply_new_cache_context_struct;
typedef struct
{
mmi_audply_walk_stack_node_struct temp_stack[MMI_AUDPLY_WALK_MAX_DEPTH_DIRECTORY];
UI_character_type previous_folder_path[(SRV_FMGR_PATH_MAX_LEN+1) + 1];
}audply_new_cache_temp_out_context_struct;
typedef enum
{
AUDPLY_WALK_STATE_NONE,
AUDPLY_WALK_STATE_PREV,
AUDPLY_WALK_STATE_NEXT
} audply_walk_state;
/*
** Structure for walking all media files under root
*/
typedef struct
{
MMI_BOOL auto_walk_done; //to make sure only one auto walk each time
MMI_BOOL searching;
MMI_BOOL correcting_stack; //whether correcting stack
U16 total;
//U32 sort_type;
S32 last_error_code;
U32 footer_pattern_offset;
FS_HANDLE search_handle;
audply_walk_state state;
//U16 phase;
U16 stack_index; /* folder level & stack level. */
U8 *filefullname; /* point to g_audply.filefullname */
UI_character_type path_cache[MMI_AUDPLY_WALK_PATH_SIZE];
//mmi_audply_walk_cache_struct cache;
mmi_audply_walk_stack_node_struct stack[MMI_AUDPLY_WALK_MAX_DEPTH_DIRECTORY];
} mmi_audply_walk_struct;
extern void mmi_audply_walk_init(void);
extern MMI_BOOL mmi_audply_walk_get_prev(U8 *filefullname);
extern MMI_BOOL mmi_audply_walk_get_next(U8 *filefullname);
extern void mmi_audply_walk_search_cancel_hdlr(void);
extern mmi_ret mmi_audply_walk_proc(mmi_event_struct *evt);
extern MMI_BOOL mmi_audply_check_is_the_first_file(CHAR *file_path);
extern MMI_BOOL mmi_audply_add_cache(CHAR *file_path);
extern MMI_BOOL mmi_audply_add_cache_previous_folder(CHAR *file_path);
extern mmi_audply_walk_prev_folder_result_enum mmi_audply_get_prev_media_file_folder(CHAR *full_file_path);
extern mmi_audply_walk_prev_folder_result_enum mmi_audply_get_prev_media_file_folder_ext(CHAR *full_file_path, mmi_audply_walk_stack_node_struct *stack);
extern MMI_BOOL mmi_audply_add_cache_temp(CHAR *file_path);
extern void mmi_audply_walk_get_stack_info_by_path(CHAR *path);
extern MMI_BOOL mmi_audply_add_temp_cache_previous_folder(CHAR *file_path);
extern void mmi_audply_walk_cache_init(void);
extern void* mmi_audply_query_cache_cntx_pointer();
extern void* mmi_audply_query_cache_cntx_stack_pointer();
extern void mmi_audply_cache_set_caching_state(void);
extern MMI_BOOL mmi_audply_walk_is_audio_file(CHAR *filename);
#endif //__AUDIO_PLAYER_WALK_H__
#endif //__MMI_AUDPLY_WALK_PLAY__