123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949 |
- /******************************************************************************/
- /*! @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, //!<uccessful
- AL_FS_ERR_FAILURE = 1, //!< operation failed
- AL_FS_ERR_INVALID_PARAM = 2,//!< invalid parameter
- AL_FS_ERR_FREE_SPACE_LACK = 3,
- } AL_FS_t;
- typedef enum
- {
- ALL_PATH_ILLEGAL = 0x00,
- ONLY_ACTIVE_PATH_VALID = 0x01,
- ONLY_BG_MUSIC_PATH_VALID = 0x02,
- ALL_PATH_VALID = 0x03,
- } Path_Vaild_Status_t;
- typedef enum
- {
- FS_COPY_FILE = 0,
- FS_COPY_FOLDER = 1,
- } FileSystem_Copy_Type_t;
- typedef enum
- {
- FS_COPY_STATUS_STOP = 0,
- FS_COPY_STATUS_CHECKING,
- FS_COPY_STATUS_COPYING,
- FS_COPY_STATUS_FINISH,
- FS_COPY_STATUS_FREE_SPACE_LACK,
- FS_COPY_STATUS_ERROR,
- } FileSystem_Copy_Status_t;
- typedef enum
- {
- FS_COPY_EVENT_STATUS = 0,
- FS_COPY_EVENT_PROGRESS_TOTAL_FILE_NUM,
- FS_COPY_EVENT_PROGRESS_TOTAL_FILE_SIZE,
- FS_COPY_EVENT_PROGRESS_COPIED_FILE_NUM,
- FS_COPY_EVENT_PROGRESS_COPIED_FILE_SIZE,
- FS_COPY_EVENT_PROGRESS_COPIED_FILE_NAME,
- } FileSystem_Copy_Event_Type_t;
- /*******************************************************************************
- * Structure
- ******************************************************************************/
- typedef UINT16 AL_FS_Handle_t;
- typedef struct
- {
- char Name[MAX_FULL_PATH]; //!<File Name
- } FileName_t;
- typedef struct
- {
- FileDetail_t FileList[FILE_DISPLAY_MAX];
- FileSystem_FileType_t u8FileType; //!<File List Type, eg. if u8FileType = PHOTO_FILETYPE, this means that all of the file list are photo
- UINT32 u32StartIdx; //!<File Name[0] 's Index in Storage device
- UINT16 ValidCount; /*!<Total File Number in this File List Struct Max(ValidCount) = FILE_DISPLAY_MAX,\n
- It's not equal to Total File Number in the Storage Driver.*/
- } FileSystem_File_t;
- typedef struct
- {
- FileName_t FolderName[FOLDER_DISPLAY_MAX]; //!<Folder Name(Short Name)
- UINT32 u32StartIdx; //!<Folder Name[0] 's Index in Storage device
- UINT16 ValidCount; /*!<Total Folder Number in this Folder List Struct Max(ValidCount) = FOLDER_DISPLAY_MAX,\n
- It's not equal to Total Folder Number in the Storage Driver.*/
- } FileSystem_Folder_t;
- typedef struct
- {
- UINT32 Size;
- FileSystem_Cache_t* Addr;
- } FileSystem_Cache_Info_t;
- typedef struct
- {
- FileSystem_Cache_Info_t Cache;
- UINT16 Max_External_Subtitle_Num;
- UINT16 Max_FileSystem_Number;
- FileSystem_Preference_Setup_t Preference_Setup;
- } FileSystem_Config_Parameter_t;
- typedef struct
- {
- UINT32 TotalFileNum;
- UINT32 CopiedFileNum;
- UINT64 TotalSize;
- UINT64 CopiedSize;
- char CopiedFileName[MAX_FULL_PATH];
- } FileSystem_Copy_Progress_Info_t;
- typedef struct
- {
- FileSystem_Copy_Status_t Status;
- FileSystem_Copy_Progress_Info_t Progress;
- } FileSystem_Copy_Status_Info_t;
- /*******************************************************************************
- * Program
- ******************************************************************************/
- /******************************************************************************/
- /**
- * @brief FileSystem Initial
- * @param FileSystem_Config_Parameter_t* const Setup : Initial Setup, Detail please ref. FileSystem_Config_Parameter_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_Init(FileSystem_Config_Parameter_t* const Setup);
- AL_FS_t AL_Multimedia_FileSystem_Create(AL_FS_Handle_t* Handle);
- AL_FS_t AL_Multimedia_FileSystem_Destory(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief FileSystem Uninitial
- ******************************************************************************/
- void AL_Multimedia_FileSystem_Uninit(Boolean bFreeFS);
- /******************************************************************************/
- /**
- * @brief Use to copy the file system environment to the other file system mode
- * @param FileSystem_Mode_t Src_Mode: Source File System Mode
- * FileSystem_Mode_t Dest_Mode: Destination File System Mode
- ******************************************************************************/
- void AL_Multimedia_FileSystem_Copy_FileSystem_Environment(AL_FS_Handle_t Src_Handle, AL_FS_Handle_t Dest_Handle);
- /******************************************************************************/
- /**
- * @brief Get Partition List Information, eg. total partition number, and partition name\n
- * please call this func. after AL_Multimedia_FileSystem_UpdatePartitions().
- * @return Partition List Information, the detail please ref. struct PartitionName_t.
- *
- ******************************************************************************/
- const FileSystem_Partition_t* AL_Multimedia_FileSystem_GetPartitionList(void);
- /******************************************************************************/
- /**
- * @brief Get Folder List Information, eg. total Folder number in this Folder list, and Folder name, Folder's index in the storage device.
- * @return Folder List Information, the detail please ref. struct FileSystem_Folder_t.
- *
- ******************************************************************************/
- const FileSystem_Folder_t* AL_Multimedia_FileSystem_GetFolderList(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Get File List Information, eg. total file number in this file list, and file name, file's index in the storage device and file type.
- * @return File List Information, the detail please ref. struct FileSystem_File_t.
- *
- ******************************************************************************/
- const FileSystem_File_t* AL_Multimedia_FileSystem_GetFileList(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Get Select File name(Short Name)
- * @return File name(Short Name), eg. APPLE_~1.MP4
- *
- ******************************************************************************/
- const char* AL_Multimedia_FileSystem_GetSelectedFileName(AL_FS_Handle_t Handle);
- const FileDetail_t* AL_Multimedia_FileSystem_GetSelectedFileDetails(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Get Active Folder Path
- * @return Full Folder Path(Short Name), eg. /sda1/DECODE~1/SUNPLUS
- *
- ******************************************************************************/
- const char* AL_Multimedia_FileSystem_GetActiveFolderPath(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Update the selected video file's External Subtitle information\n
- * @param char* const Folder_Path: Target Video File's Folder Path
- * char* const Video_File_Name: Target Video File Name
- * @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.
- ******************************************************************************/
- void AL_Multimedia_FIleSystem_Update_External_Subtitle_Info(char* const Folder_Path, char* const Video_File_Name);
- /******************************************************************************/
- /**
- * @brief Get Selected Video File's External Subtitle File Number
- * @return Selected Video File's External Subtitle File Number
- *
- ******************************************************************************/
- UINT16 AL_Multimedia_FileSystem_GetExternalSubtitleFileNumber(void);
- /******************************************************************************/
- /**
- * @brief Get Selected Video File's External Subtitle File Name
- * @param UINT8 External_Subtitle_Idx: External Subtitle File Index, must be lesss than Total Subtitle File Number
- * @return Selected Video File's External Subtitle File Name\n
- * when selected video file without the subtitle file it will report NULL
- *
- ******************************************************************************/
- const char* AL_Multimedia_FileSystem_GetExternalSubtitleFileName(UINT16 External_Subtitle_Idx);
- /******************************************************************************/
- /**
- * @brief Get Previously Folder Index
- * @return Previously Folder Index, it be stored before u into folder/partition.
- *
- ******************************************************************************/
- UINT32 AL_Multimedia_FileSystem_GetPrevFolderIndex(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Register File System's File Type Filter
- * @param FileSystem_FileType_t FileType : Register's File Type, detail please ref. FileSystem_FileType_t\n
- * const char* const FilterTable : Filter Table\n
- * UINT8 TableSize : Filter Table Size\n
- * UINT8 Extension_Len : File Extension's Length
- * @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_RegisterFileTypeFilter(FileSystem_FileType_t FileType, const char* const FilterTable, UINT16 TableSize, UINT16 Extension_Len);
- /******************************************************************************/
- /**
- * @brief Get Active Fodler Layer, root = 0, eg. if Active Folder Path = /sda1/MUSIC/SUNPLUS then Active Layer = 3
- * @return Get Active Fodler Layer Number
- *
- ******************************************************************************/
- UINT16 AL_Multimedia_FileSystem_GetActiveLayer(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Get Select File Type
- * @return File Type, the detail please ref. struct FileSystem_FileType_t.
- *
- ******************************************************************************/
- FileSystem_FileType_t AL_Multimedia_FileSystem_GetSelectedFileType(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Get File Type
- * @param UINT32 File_Index : Input File Number, that u want to know the file type.\n
- * FileSystem_FileType_t* const FileType : Output File Type, detail please ref. FileSystem_FileType_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_GetFileType(AL_FS_Handle_t Handle, UINT32 File_Index, FileSystem_FileType_t* const File_Type);
- /******************************************************************************/
- /**
- * @brief Update FileSystem Data, It is only be used in USB, when any storage device mount success.
- *
- ******************************************************************************/
- void AL_Multimedia_FileSystem_UpdateEnvironmentSetting(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Clear FileSystem Data, It is be used in USB and FileSystem, when storage device remove, or exit partition.
- *
- ******************************************************************************/
- void AL_Multimedia_FileSystem_ClearEnvironmentSetting(AL_FS_Handle_t Handle);
- /*ports begin*/
- /******************************************************************************/
- /**
- * @brief ports api
- *
- ******************************************************************************/
- const FileSystem_Partition_t* AL_Multimedia_FileSystem_GetPartitionsListByPath(UINT8 *cpath, UINT32 pathlen);
- /******************************************************************************/
- /**
- * @brief ports api
- *
- ******************************************************************************/
- const FileSystem_PortsLayer_t* AL_Multimedia_FileSystem_GetUsbPortsListByPath(UINT8 *cpath, LayerType flag, UINT32 pathlen);
- /******************************************************************************/
- /**
- * @brief ports api
- *
- ******************************************************************************/
- int AL_Multimedia_FileSystem_GetUsbDeviceNameByPartitionName(const char *PartitionName,char *pDevName, INT32 DevNameSize);
- /******************************************************************************/
- /**
- * @brief ports api
- *
- ******************************************************************************/
- AL_FS_t AL_Multimedia_FileSystem_SetIntoPartitionByPort(AL_FS_Handle_t Handle,const FileSystem_Partition_t *Partitions, UINT16 Partition_Index);
- /*ports end*/
- /******************************************************************************/
- /**
- * @brief Updata FileSystem Partition List Information.
- * @param UINT8* const Get_Partition_Number : Output Total GetPartitionNum, if u don't want to get it, please set this param = NULL
- *
- ******************************************************************************/
- void AL_Multimedia_FileSystem_UpdatePartitions(UINT16* const Get_Partition_Number);
- AL_FS_t AL_Multimedia_FileSystem_GetPartitionFreeSize(char* const Partition_Name, UINT64* Free_Size);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to Into Partition.
- * @param UINT8 Partition_Index : Input Partition Number, that u want to into.
- *
- ******************************************************************************/
- AL_FS_t AL_Multimedia_FileSystem_SetIntoPartition(AL_FS_Handle_t Handle, UINT16 Partition_Index);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to exit Partition.
- *
- ******************************************************************************/
- void AL_Multimedia_FileSystem_SetExitPartition(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Get Total Partition Number
- * @return FileSystem can support the total partition number of Storage Device
- *
- ******************************************************************************/
- UINT16 AL_Multimedia_FileSystem_GetTotalPartitionCount(void);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to update Folder List Information.
- * @param UINT32 Folder_Start_Index : Input the first Folder Index in the storage device, u want to get\n
- * UINT8 Total_Number : Input how many folder information u want to get, this vale must < FOLDER_DISPLAY_MAX.\n
- * UINT8* const Get_Folder_Number : Output total folder list number be obtained .
- * @return AL_FS_SUCCESS if successful\n
- * AL_FS_ERR_INVALID_PARAM if parameters is invalid.
- *
- ******************************************************************************/
- AL_FS_t AL_Multimedia_FileSystem_UpdateFolders(AL_FS_Handle_t Handle, UINT32 Folder_Start_Index, UINT16 Total_Number, UINT16* const Get_Folder_Number);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to Into Folder.
- * @param UINT32 Folder_Index : Input Folder Index, that u want to into.
- * @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_SetIntoFolder(AL_FS_Handle_t Handle, UINT32 Folder_Index);
- /******************************************************************************/
- /**
- * @brief Direct into folder that u want.
- * @param char* const Full_Folder_Path : Input folder path\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_SetIntoFolder_By_Path(AL_FS_Handle_t Handle, char* const Full_Folder_Path);
- /******************************************************************************/
- /**
- * @brief Direct into folder that u want.
- * @param char* const Full_Folder_Path : Input Partition path\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_SetPartitionRoot_By_Path(AL_FS_Handle_t Handle, char* const Full_Folder_Path);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to exit Folder.
- * @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_SetExitFolder(AL_FS_Handle_t Handle);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to exit Folder.
- * @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_GetTotalFolderCount(AL_FS_Handle_t Handle, UINT32* const u32TotalFolderCount);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to update File List Information.
- * @param UINT32 File_Start_Index : Input the first File Index in the storage device, u want to get\n
- * UINT8 Total_Number : Input how many file information u want to get, this vale must < FILE_DISPLAY_MAX.\n
- * UINT8* const Get_File_Number : Output total file list number be obtained .
- * @return AL_FS_SUCCESS if successful\n
- * AL_FS_ERR_INVALID_PARAM if parameters is invalid.
- *
- ******************************************************************************/
- AL_FS_t AL_Multimedia_FileSystem_UpdateFiles(AL_FS_Handle_t Handle, UINT32 File_Start_Index, UINT16 Total_Number, UINT16* const Get_File_Number);
- /******************************************************************************/
- /**
- * @brief Select File.
- * @param UINT32 File_Index : Input File Number, that u want to Select.
- * @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_SetSelectFile(AL_FS_Handle_t Handle, UINT32 File_Index);
- /******************************************************************************/
- /**
- * @brief Get Total File Number in the avtive path of the storage device.
- * @param UINT32* const Total_File_Number :Output Total File Number in the avtive path of the storage device.
- * @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_GetTotalFileCount(AL_FS_Handle_t Handle, UINT32* const Total_File_Number);
- /******************************************************************************/
- /**
- * @brief Get file size of FS file details.
- * @param char* const FolderPath : folder path
- * char* const FileName : file name
- * UINT64* FileSize : return file size
- * If get file size fail that FileSize will return 0x0
- * @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_FileSize(char* const FolderPath, char* const FileName, UINT64* FileSize);
- /******************************************************************************/
- /**
- * @brief Get file date of FS file details.
- * @param char* FolderPath : folder path
- * char* FileName : file name
- * struct tm* UTC_time : return Last file status change time
- * struct tm* UTM_time : return Last data modification time
- * If get date info fail that UTC_time and UTM_time will return 0x0
- * @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_FileDate(char* FolderPath, char* FileName, struct tm* UTC_time, struct tm* UTM_time);
- /******************************************************************************/
- /**
- * @brief Control FileSystem to Filter File Type. If u want to get Video File List only please set Mediamode = VIDEO_FILETYPE
- * @param FileSystem_FileType_t File_Type : Input File Type. the detail please ref. struct FileSystem_FileType_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_SetMediaMode(AL_FS_Handle_t Handle, FileSystem_FileType_t File_Type);
- /******************************************************************************/
- /**
- * @brief Analyse File Type.
- * @param const char* const FileName : Input File Name.
- * @return File Type Information, detail please ref. FileSystem_FileType_t.
- *
- ******************************************************************************/
- FileSystem_FileType_t AL_Multimedia_FileSystem_FileTypeAnalyze(const char* const FileName);
- /******************************************************************************/
- /**
- * @brief Combine FolderPath and FileName.\n
- * eg. /sda1/Folder + a.mp3 => /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 */
|