#include <string.h>
#include "conf_explorer.h"
#include "navigation.h"
#include "file.h"
#include "reader_txt.h"
#include "play_list.h"
Enumerations | |
enum | E_pl_type { E_PL_M3U, E_PL_PLS, E_PL_SMP } |
Type of playlist file. More... | |
Functions | |
bool | pl_main_close (void) |
This function saves the play list file. More... | |
bool | pl_main_ismodify (void) |
This function checks if the play list file is modified. More... | |
bool | pl_main_isopen (void) |
This function checks if a play list file is already opened. More... | |
bool | pl_main_modify (void) |
bool | pl_main_open (bool b_undo) |
This function opens the current selected file in the current navigator. More... | |
bool | pl_main_readline (readline_opt_t opt, uint8_t id_nav, FS_STRING *sz_path, uint16_t *u16_size_line) |
This function reads and checks the next line. More... | |
bool | pl_nav_eol (void) |
This function checks the end of the play list. More... | |
uint16_t | pl_nav_getnbfile (void) |
Return the number of files in play list. More... | |
uint16_t | pl_nav_getpos (void) |
Return the position in the play list. More... | |
bool | pl_nav_readentry (uint16_t u16_position, FS_STRING *sz_path, uint16_t *u16_size_line) |
This function read the playlist's entry at a specific position. More... | |
bool | pl_nav_setpos (uint16_t u16_position) |
This function goes to a position in the play list. More... | |
bool | pl_sel_isvalid (void) |
This function tests the valid path in list. More... | |
Variables | |
bool | pl_g_list_is_open = false |
play list file is opened More... | |
_MEM_TYPE_SLOW_ E_pl_type | pl_g_list_type |
Type of the play list. More... | |
_MEM_TYPE_SLOW_ uint16_t | pl_g_u16_list_sel = 0 |
Current file selected in play list (0= no file selected, 1= first file) More... | |
_MEM_TYPE_SLOW_ uint16_t | pl_g_u16_list_size = 0 |
Number of file included in play list. More... | |
enum E_pl_type |
bool pl_main_close | ( | void | ) |
This function saves the play list file.
This function closes the play list and selects this one in current navigator.
References _MEM_TYPE_SLOW_, file_close(), FS_NAME_GET, FS_NAV_ID_PLAYLIST, Is_unicode, nav_file_del(), nav_file_name(), nav_file_rename(), nav_get(), nav_getindex(), nav_gotoindex(), nav_select(), nav_string_length_disable(), nav_string_length_enable(), pl_g_list_is_open, pl_main_isopen(), PLAYLIST_BUF_ALLOC, and PLAYLIST_BUF_FREE.
Referenced by navauto_close().
bool pl_main_ismodify | ( | void | ) |
This function checks if the play list file is modified.
bool pl_main_isopen | ( | void | ) |
This function checks if a play list file is already opened.
References FS_ERR_PL_NOT_OPEN, fs_g_status, and pl_g_list_is_open.
Referenced by ai_usb_ms_specific_nav_getplaylistfile(), pl_main_close(), pl_main_open(), and pl_sel_isvalid().
bool pl_main_modify | ( | void | ) |
This function opens the current selected file in the current navigator.
b_undo | true to authorize the undo feature |
References E_PL_M3U, E_PL_PLS, E_PL_SMP, file_eof(), FS_NAV_ID_PLAYLIST, nav_copy(), nav_file_checkext(), nav_file_isreadonly(), nav_filelist_reset(), nav_get(), nav_select(), pl_g_list_is_open, pl_g_list_type, pl_g_u16_list_sel, pl_g_u16_list_size, pl_main_isopen(), pl_main_readline(), PL_MAIN_READLINE_OPT_CHECKLINE, reader_txt_beg(), and reader_txt_open().
Referenced by navauto_open().
bool pl_main_readline | ( | readline_opt_t | opt, |
uint8_t | id_nav, | ||
FS_STRING * | sz_path, | ||
uint16_t * | u16_size_line | ||
) |
This function reads and checks the next line.
opt | PL_MAIN_READLINE_OPT_CHECKLINE to check the next line in the file. PL_MAIN_READLINE_OPT_READSTRING to read the string in the text file. PL_MAIN_READLINE_OPT_GOTOPATH to read, check and goto the path. |
id_nav | ID navigator to update with the selected file (ignore if b_gotopatch == false) |
sz_path | Address of the string returned. It is used only if PL_MAIN_READLINE_OPT_READSTRING or PL_MAIN_READLINE_OPT_GOTOPATH options are specified. |
u16_size_line | The length of the path. If this parameter is NULL, then the length is not returned. |
References E_PL_M3U, E_PL_PLS, E_PL_SMP, file_getpos(), file_seek(), FS_NAV_ID_PLAYLIST, FS_SEEK_SET, FS_UNICODE, Is_unicode, nav_copy(), nav_filelist_reset(), nav_select(), nav_setcwd(), pl_g_list_type, PL_MAIN_READLINE_OPT_CHECKLINE, PL_MAIN_READLINE_OPT_READSTRING, PLAYLIST_BUF_ALLOC, and reader_txt_get_line().
Referenced by pl_main_open(), pl_nav_readentry(), and pl_nav_setpos().
bool pl_nav_eol | ( | void | ) |
This function checks the end of the play list.
References pl_g_u16_list_sel, and pl_g_u16_list_size.
uint16_t pl_nav_getnbfile | ( | void | ) |
Return the number of files in play list.
References pl_g_u16_list_size.
Referenced by navauto_mov_playlist(), and navauto_open().
uint16_t pl_nav_getpos | ( | void | ) |
Return the position in the play list.
References pl_g_u16_list_sel.
Referenced by navauto_mov_playlist().
This function read the playlist's entry at a specific position.
u16_position | Position in play list. |
sz_path | The address of the string where is stored the information. |
u16_size_line | The length of the path. |
References file_eof(), file_getpos(), file_seek(), FS_ERR_PL_OUT_LST, fs_g_status, FS_NAV_ID_PLAYLIST, FS_SEEK_SET, nav_get(), nav_select(), pl_g_u16_list_sel, pl_g_u16_list_size, pl_main_readline(), PL_MAIN_READLINE_OPT_CHECKLINE, PL_MAIN_READLINE_OPT_GOTOPATH, and reader_txt_beg().
bool pl_nav_setpos | ( | uint16_t | u16_position | ) |
This function goes to a position in the play list.
u16_position | position in play list to go |
References file_eof(), FS_ERR_PL_OUT_LST, fs_g_status, FS_NAV_ID_PLAYLIST, nav_filelist_reset(), nav_get(), nav_select(), pl_g_u16_list_sel, pl_g_u16_list_size, pl_main_readline(), PL_MAIN_READLINE_OPT_CHECKLINE, PL_MAIN_READLINE_OPT_GOTOPATH, PLAYLIST_BUF_FREE, and reader_txt_beg().
Referenced by navauto_mov_playlist(), and navauto_open().
bool pl_sel_isvalid | ( | void | ) |
This function tests the valid path in list.
References nav_filelist_validpos(), pl_g_u16_list_sel, and pl_main_isopen().
play list file is opened
Referenced by ai_usb_ms_specific_restore_navigator(), ai_usb_ms_specific_save_navigator(), pl_main_close(), pl_main_isopen(), and pl_main_open().
_MEM_TYPE_SLOW_ E_pl_type pl_g_list_type |
Type of the play list.
Referenced by pl_main_open(), and pl_main_readline().
_MEM_TYPE_SLOW_ uint16_t pl_g_u16_list_sel = 0 |
Current file selected in play list (0= no file selected, 1= first file)
Referenced by ai_usb_ms_specific_restore_navigator(), ai_usb_ms_specific_save_navigator(), pl_main_open(), pl_nav_eol(), pl_nav_getpos(), pl_nav_readentry(), pl_nav_setpos(), and pl_sel_isvalid().
_MEM_TYPE_SLOW_ uint16_t pl_g_u16_list_size = 0 |
Number of file included in play list.
Referenced by ai_usb_ms_specific_restore_navigator(), ai_usb_ms_specific_save_navigator(), pl_main_open(), pl_nav_eol(), pl_nav_getnbfile(), pl_nav_readentry(), and pl_nav_setpos().