/******************************************************************************/ /*! @addtogroup AL_Multimeidia_FileSystem * @{ ******************************************************************************/ /******************************************************************************/ /*! * @file AL_Multimeidia_FileSystem_IF.h * * @brief This file specifies the APIs used to control filesystem to provided\n * file, folder and partition list information. * * @note Copyright (c) 2013 S2 Technology Co., Ltd. \n * All rights reserved. ********************************************************************************/ #ifndef __AL_MULTIMEDIA_FILESYSTEM_IF_H__ #define __AL_MULTIMEDIA_FILESYSTEM_IF_H__ /******************************************************************************* * Header include ******************************************************************************/ #include "AL_Multimedia_FileSystem_Types.h" /******************************************************************************* * Marco ******************************************************************************/ #define FOLDER_DISPLAY_MAX (21) #define FILE_DISPLAY_MAX (21) #define ACTIVE_FOLDER_LAYER_INDEX_MAX (253) #define VIDEO_FILENAME_EXTENSION_MPG ".MPG\0" #define VIDEO_FILENAME_EXTENSION_MPEG ".MPEG\0" #define VIDEO_FILENAME_EXTENSION_AVI ".AVI\0" #define VIDEO_FILENAME_EXTENSION_DIVX ".DIVX\0" #define VIDEO_FILENAME_EXTENSION_VOB ".VOB\0" #define VIDEO_FILENAME_EXTENSION_DAT ".DAT\0" #define VIDEO_FILENAME_EXTENSION_M2V ".M2V\0" #define VIDEO_FILENAME_EXTENSION_M4V ".M4V\0" #define VIDEO_FILENAME_EXTENSION_MP4 ".MP4\0" #define VIDEO_FILENAME_EXTENSION_QT ".MOV\0" #define VIDEO_FILENAME_EXTENSION_ASF ".ASF\0" #define VIDEO_FILENAME_EXTENSION_MKV ".MKV\0" #define VIDEO_FILENAME_EXTENSION_WMV ".WMV\0" #define VIDEO_FILENAME_EXTENSION_FLV ".FLV\0" #define VIDEO_FILENAME_EXTENSION_SWF ".SWF\0" #define VIDEO_FILENAME_EXTENSION_RM ".RM\0" #define VIDEO_FILENAME_EXTENSION_RV ".RV\0" #define VIDEO_FILENAME_EXTENSION_RMVB ".RMVB\0" #define VIDEO_FILENAME_EXTENSION_TS ".TS\0" #define VIDEO_FILENAME_EXTENSION_TP ".TP\0" #define VIDEO_FILENAME_EXTENSION_TRP ".TRP\0" #define VIDEO_FILENAME_EXTENSION_M2TS ".M2TS\0" #define VIDEO_FILENAME_EXTENSION_MTS ".MTS\0" #define AUDIO_FILENAME_EXTENSION_MP3 ".MP3\0" #define AUDIO_FILENAME_EXTENSION_DTS ".DTS\0" #define AUDIO_FILENAME_EXTENSION_WMA ".WMA\0" #define AUDIO_FILENAME_EXTENSION_WAV ".WAV\0" #define AUDIO_FILENAME_EXTENSION_M4A ".M4A\0" #define PHOTO_FILENAME_EXTENSION_JPG ".JPG\0" #define PHOTO_FILENAME_EXTENSION_BMP ".BMP\0" #define PHOTO_FILENAME_EXTENSION_TIFF ".TIFF\0" #define PHOTO_FILENAME_EXTENSION_GIF ".GIF\0" #define PHOTO_FILENAME_EXTENSION_PNG ".PNG\0" #define PHOTO_FILENAME_EXTENSION_JPE ".JPE\0" #define PHOTO_FILENAME_EXTENSION_JPEG ".JPEG\0" #ifdef CONFIG_CIPLUS_SUPPORT_PVR #if 0 #define PVR_FILENAME_EXTENSION_PLT ".PLT\0" #endif #endif #define GAME_FILENAME_EXTENSION_SMF ".SMF\0" #define GAME_FILENAME_EXTENSION_NES ".NES\0" #define EBOOK_FILENAME_EXTENSION_TXT ".TXT\0" #define EBOOK_FILENAME_EXTENSION_EPUB ".EPUB\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_SRT ".SRT\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_SSA ".SSA\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_ASS ".ASS\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_PSB ".PSB\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_SMI ".SMI\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_TXT ".TXT\0" #define EXTERNAL_SUBTITLE_FILENAME_EXTENSION_SUB ".SUB\0" #define MUSIC_PLAYLIST_FILENAME_EXTENSION_M3U ".M3U\0" #define MUSIC_PLAYLIST_FILENAME_EXTENSION_CUE ".CUE\0" #define USB_LABEL_SIZE 64 /*VOLUME_ID_LABEL_SIZE*/ /******************************************************************************* * enumeration ******************************************************************************/ typedef enum { AL_FS_SUCCESS = 0, //! /sda1/Folder/a.mp3 * @param const char* const Folder_Path : Input Folder Path\n * const char* const File_Name : Input File Name\n * char* Full_Path_Buf : Output FullName\n * UINT16 Buf_Len : Buffer Size * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_CombineFolderPathAndFileName(const char* const Folder_Path, const char* const File_Name, char* Full_Path_Buf, UINT16 Buf_Len); /******************************************************************************/ /** * @brief Rename Selected File, if u want to display file list after call this func.\n * Please call AL_Multimedia_FileSystem_UpdateFiles() again. * @param char* const New_File_Name : New File Name\n * FileSystem_CodePage_Kind_t CodePage_Type : New File Name's CodePage, detial please ref. FileSystem_CodePage_Kind_t. * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_RenameSelectedFile(AL_FS_Handle_t Handle, char* const New_File_Name, FileSystem_CodePage_Kind_t CodePage_Type); /******************************************************************************/ /** * @brief Rename Folder, if u want to display folder list after call this func.\n * Please call AL_Multimedia_FileSystem_UpdateFolders() again. * @param UINT32 FolderIdx : Input Folder Index, that u want to rename this folde\n * char* const New_Folder_Name : New Folder Name\n * FileSystem_CodePage_Kind_t CodePage_Type : New File Name's CodePage, detial please ref. FileSystem_CodePage_Kind_t. * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_RenameFolder(AL_FS_Handle_t Handle, UINT32 FolderIdx, char* const New_Folder_Name, FileSystem_CodePage_Kind_t CodePage_Type); /******************************************************************************/ /** * @brief Delete specified file/folder. * it will cause this modile's environment reset to the root path, after u call this func. * @param char* const Full_Path : Full Path, that u want to delete. * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_DeleteData(char* const Full_Path); AL_FS_t AL_Multimedia_FileSystem_DeleteFileByName(AL_FS_Handle_t Handle, char* FileName); /******************************************************************************/ /** * @brief Delete Selected File * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_DeleteSelectedFile(AL_FS_Handle_t Handle); /******************************************************************************/ /** * @brief Delete Folder * @param UINT32 Folder_Index : Input Folder Index, that u want to delete * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_DeleteFolder(AL_FS_Handle_t Handle, UINT32 Folder_Index); /******************************************************************************/ /** * @brief Check the status of specified file. * @param char* const File_Path : Full File Path, that u want to check. * @return TRUE : File is exist\n * FALSE : File is not exist * ******************************************************************************/ BOOL AL_Multimedia_FileSystem_IsFileExist(char* const File_Path); /******************************************************************************/ /** * @brief Check Folder Path Exist * @param char* const Folder_Path : Folder Path * @return TRUE : Folder is exist\n * FALSE : Folder is not exist * ******************************************************************************/ BOOL AL_Multimedia_FileSystem_IsFolderExist(char* const Folder_Path); /******************************************************************************/ /** * @brief For decide folders and files sort mode and u can input new sort rule\n * @param FileSystem_File_Compare_Mode_t File_Sort_Mode : File sort rule, detail please ref. FileSystem_File_Compare_Mode_t * FileSystem_Folder_Compare_Mode_t Folder_Sort_Mode : Folder sort rule, detail please ref. FileSystem_Folder_Compare_Mode_t * FileSystem_Hook_Compare_Rule_t File_Expand_Compare_Rule : File Expand Sort Rule(Call back function) * UINT16 File_BufSize : (Can be 0)For Expand Sort Method Use, consider every item sort will use a lot of time to get some info. * So u can use a buffer to keep the information, after u get. * FileSystem_Hook_Compare_Rule_t Folder_Expand_Compare_Rule : Folder Expand Sort Rule(Call back function) * UINT16 Folder_BufSize : (Can be 0)For Expand Sort Method Use, consider every item sort will use a lot of time to get some info. * So u can use a buffer to keep the information, after u get. * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_SetSortRule(FileSystem_File_Compare_Mode_t File_Sort_Mode, FileSystem_Folder_Compare_Mode_t Folder_Sort_Mode, FileSystem_Hook_Compare_Rule_t File_Expand_Compare_Rule, UINT16 File_BufSize, FileSystem_Hook_Compare_Rule_t Folder_Expand_Compare_Rule, UINT16 Folder_BufSize); #ifdef FILESEARCH_SUPPORT /******************************************************************************/ /** * @brief Start searching FileSystem. If u call the function and the return value is AL_FS_SUCCESS, u MUST CALL AL_Multimedia_FileSystem_StopSearch() to STOP the searching task. * @param FileSystem_Search_Hook_Function_t* Search_Hook_Function : It contains four call back functions. the detail please ref. struct FileSystem_Search_Hook_Function_t. * char* const Start_Path : Input Start searching path. * UINT8 Search_Layer_Number : Input search layer number. If u want to search only current layer, please input 1. If you want to search all of layers under the start path, please input ACTIVE_FOLDER_LAYER_INDEX_MAX. * FileSystem_FileType_t File_Type : Input File Type. the detail please ref. struct FileSystem_FileType_t. * UINT32 Max_Search_Number : Input Max file number that u want to search * FileSystem_Search_Mode_t Search_Mode : Input Search_Mode. the detail please ref. struct FileSystem_Search_Mode_t. * char* const Last_Time_Search_Folder_Path : Input Folder path, which is found at last time search. If u don't hava this infomation, input NULL. * char* const Last_Time_Search_File_Name : Input File name, which is found at last time search . If u don't hava this infomation, input NULL. * * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_StartSearch(FileSystem_Search_Hook_Function_t* Search_Hook_Function, char* const Start_Path, UINT16 Search_Layer_Number, FileSystem_FileType_t File_Type, UINT32 Max_Search_Number, FileSystem_Search_Mode_t Search_Mode, char* const Last_Time_Search_Folder_Path, char* const Last_Time_Search_File_Name); /******************************************************************************/ /** * @brief U can ask the current search status information. * @param FileSystem_Search_Status_Info_t* Current_Search_Status_Info : Output current search status information, the detail please ref. struct FileSystem_Search_Status_Info_t * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Search_Status_Info_Post(FileSystem_Search_Status_Info_t* Current_Search_Status_Info); /******************************************************************************/ /** * @brief U can ask the current search status. * @param FileSystem_Search_Status_t* Current_Search_Status : Output current search status, the detail please ref. struct FileSystem_Search_Status_t * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Search_Status_Post(FileSystem_Search_Status_t* Current_Search_Status); /******************************************************************************/ /** * @brief Stop FileSystem searching Task, please call this func. after AL_Multimedia_FileSystem_StartSearch(). * But if AL_Multimedia_FileSystem_StartSearch() return value is not AL_FS_SUCCESS, do not call this func. * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_StopSearch(void); /******************************************************************************/ /** * @brief Pause FileSystem searching Task * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_PauseSearch(void); /******************************************************************************/ /** * @brief Resume FileSystem searching Task * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_ResumeSearch(void); #endif /******************************************************************************/ /** * @brief Set folder or file Attribute * @param char* const Full_Path : Full Path can be folder path or file path.\n * FileSystem_Attribute_t* const FileSystem_Attribute: Attribute that u want to set, detail please ref. FileSystem_Attribute_t * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Set_Data_Attribute(char* const Full_Path, FileSystem_Attribute_t* const FileSystem_Attribute); /******************************************************************************/ /** * @brief Get File Index in cache * @param char* const Folder_Path: [IN] folder path. * char* const File_Name: [IN] file name. * FileSystem_FileType_t FileType: [IN] Reference FileType.(If the filter table of filetype not define, it will use all type to count file index) * UINT32* File_Index: [OUT] file index. * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Get_File_Index(char* const Folder_Path, char* const File_Name, FileSystem_FileType_t FileType, UINT32* File_Index); /******************************************************************************/ /** * @brief Get Folder Index in cache * @param char* const Folder_Path : Input folder path\n * char* const Folder_Name : Input folder name\n * UINT32 Folder_Index : Ouput Folder Index\n * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid.\n * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Get_Folder_Index(char* const Folder_Path, char* const Folder_Name, UINT32* Folder_Index); /******************************************************************************/ /** * @brief Use to get partiton path length. * @param char* const File_Path: Input file path. * @return partiton path length. * ******************************************************************************/ UINT16 AL_Multimedia_FileSystem_GetFilePathPartitionLength(char* const File_Path); #ifdef FILECOPY_SUPPORT /******************************************************************************/ /** * @brief Copy selected file to another folder * @param UINT64 TotalSize : Copied file's total size * char* const Source_FolderPath : Copied file's folder path * char* const Source_FileName : Copied file's file name * char* const Destination_FolderPath : Copy destination folder path * char* const New_File_Name : If the selected file already existed, * give a new name for selected file * BOOL (*SendMsg_Func) : callback function for posting Msg * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid. * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Copy_File_Start(UINT64 TotalSize, char* const Source_FolderPath, char* const Source_FileName, char* const Destination_FolderPath, char* const New_File_Name, UINT8 *Copy_Buffer_Addr, UINT32 Copy_Buffer_Size, BOOL (*SendMsg_Func)(FileSystem_Copy_Event_Type_t, FileSystem_Copy_Status_Info_t *)); /******************************************************************************/ /** * @brief Use to stop srarch task that for copy application * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_FAILURE if Create Stop Fail * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Copy_File_Stop(void); /******************************************************************************/ /** * @brief Copy selected folder to another folder * @param UINT64 TotalSize : Folder's total size * char* const Source_FolderPath : Source folder path * char* const Destination_FolderPath : Copy destination folder path * char* const New_Folder_Name : If the selected folder already existed, * give a new name for selected folder * BOOL (*SendMsg_Func) : callback function for posting Msg * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid. * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Copy_Folder_Start(UINT64 TotalSize, char* const Source_FolderPath, char* const Destination_FolderPath, char* const New_Folder_Name, UINT8 *Copy_Buffer_Addr, UINT32 Copy_Buffer_Size, BOOL (*SendMsg_Func)(FileSystem_Copy_Event_Type_t, FileSystem_Copy_Status_Info_t *)); /******************************************************************************/ /** * @brief Use to stop srarch task that for copy application * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_FAILURE if Create Stop Fail * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Copy_Folder_Stop(void); /******************************************************************************/ /** * @brief Get the folder's total size * @param char* const Source_FolderPath : Folder path that want to get total size * BOOL (*SendMsg_Func) : callback function for posting Msg * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_INVALID_PARAM if parameters is invalid. * AL_FS_ERR_FAILURE if Exception Error occurred. * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Get_Folder_TotalSize_Start(char* const Source_FolderPath, BOOL (*SendMsg_Func)(FileSystem_Copy_Event_Type_t, FileSystem_Copy_Status_Info_t *)); /******************************************************************************/ /** * @brief Use to stop srarch task that for getting folder's total size * @return AL_FS_SUCCESS if successful\n * AL_FS_ERR_FAILURE if Create Stop Fail * ******************************************************************************/ AL_FS_t AL_Multimedia_FileSystem_Get_Folder_TotalSize_Stop(void); /******************************************************************************/ /** * @brief Report copy status info * Note: * If perform AL_Multimedia_FileSystem_Get_Folder_TotalSize_Start() to * get folder total size, must perform this API BEFORE performing * AL_Multimedia_FileSystem_Get_Folder_TotalSize_Stop() ! * Otherwise, the total size value will be clear. * @return copy status info, detail please ref. FileSystem_Copy_Status_Info_t. * ******************************************************************************/ const FileSystem_Copy_Status_Info_t* const AL_Multimedia_FileSystem_Get_Copy_Status_Info(void); #endif /******************************************************************************/ /** * @brief Use to get the USB Version * @param char* const UsbName : USB Mount Name * @return int : -1 fail >=0 USB Version typedef enum { USB_11 = 0, USB_20, USB_30, }USB_Version; * ******************************************************************************/ int AL_Multimedia_FileSystem_GetUsbVersionbyName(int index); /******************************************************************************/ /** * @brief Use to get Partition Type * @param int index : Device Index * @return FileSystem_Format_t : Partition Type * ******************************************************************************/ FileSystem_Format_t AL_Multimedia_FileSystem_GetPartitionType(int index); /******************************************************************************/ /** * @brief Use to get the USB Device Name * @param UINT8 devIndex : Device Index UINT8 *pDevName : Device Name Pointer, the array size need set to #define VOLUME_ID_LABEL_SIZE 64 INT32 DevNameSize : pDevName Array Size * @return int : Get USB Device Name Status * ******************************************************************************/ int AL_Multimedia_FileSystem_GetUsbDeviceName(UINT16 devIndex, char *pDevName, INT32 DevNameSize); AL_FS_t AL_Multimedia_FileSystem_Get_LongName(char* const File_Name); AL_FS_t AL_Multimedia_FileSystem_Get_ShortName(char* const File_Name); #endif /*! @} end of addtogroup AL_Multimeidia_FileSystem */