#include "conf_explorer.h"
#include "nav_automatic.h"
#include "file.h"
#include <LIB_CTRLACCESS>
#include <LIB_MEM>
Macros | |
#define | FS_NAV_AUTOMATIC_NBFILE DISABLE |
The FS_NAV_AUTOMATIC_NBFILE define changes the rule to create a file list from directories When this define is enabled, the files from a directory are included before files from sub directories. More... | |
Typedefs | |
typedef navauto_mov_explorer_rec_t(* | navauto_mov_explorer_process_fct_t )(bool) |
Enumerations | |
enum | navauto_mov_explorer_rec_t { NAVAUTO_MOV_EXPLORER_OK, NAVAUTO_MOV_EXPLORER_ERROR, NAVAUTO_MOV_EXPLORER_RECURSIVE } |
Functions | |
uint16_t | navauto_close (void) |
This function closes the file list. More... | |
Navauto_mode | navauto_getmode (void) |
This function returns the directory limitation of the file list. More... | |
uint16_t | navauto_getnb (void) |
This function returns the file list size. More... | |
uint16_t | navauto_getpos (void) |
This function returns the current position in the file list. More... | |
Navauto_rand | navauto_getrand (void) |
This function returns the random state used. More... | |
void | navauto_init (const FS_STRING sz_filterext) |
This function initializes the file extension filter used to create the file list. More... | |
Navauto_mov_state | navauto_mov (bool b_direction, navauto_mov_options_t options) |
This function jumps to the next or previous file in file list. More... | |
Navauto_mov_state | navauto_mov_explorer (bool b_direction, navauto_mov_options_t options) |
This function jumps to the next or previous file in file list included in directories. More... | |
static __inline__ uint8_t | navauto_mov_explorer_is_dir (bool b_direction, navauto_mov_options_t options) |
static __inline__ uint8_t | navauto_mov_explorer_is_file (bool b_direction, navauto_mov_options_t options) |
static navauto_mov_explorer_rec_t | navauto_mov_explorer_limit (bool b_direction) |
This function sets the pointer to a limit. More... | |
static __inline__ uint8_t | navauto_mov_explorer_new_dir (bool b_direction, navauto_mov_options_t options) |
static uint8_t | navauto_mov_explorer_rec (bool b_direction, navauto_mov_options_t options) |
This function selects a file in EXPLORER mode. More... | |
void | navauto_mov_explorer_reset (void) |
This function goes to the beginning of file list. More... | |
static navauto_mov_explorer_rec_t | navauto_mov_explorer_select_limit_dir_cur_folder (bool b_direction) |
This function selects the first or the last directory on the current folder and enters in it. More... | |
static navauto_mov_explorer_rec_t | navauto_mov_explorer_select_limit_file_cur_folder (bool b_direction) |
This function selects the first or the last playable file on the current folder. More... | |
static navauto_mov_explorer_rec_t | navauto_mov_explorer_updir (bool b_direction) |
This function moves back to the parent directory and selects this directory. More... | |
static __inline__ uint8_t | navauto_mov_ok_loop (bool b_direction, navauto_mov_options_t options) |
Navauto_mov_state | navauto_mov_playlist (bool b_direction) |
This function jumps to the next or previous file in file list corresponding at a play list file. More... | |
bool | navauto_open (bool b_playlist, uint16_t pos) |
This function opens a file list at the current position in navigator. More... | |
uint16_t | navauto_rand_choose (void) |
This function returns a random position not already used. More... | |
void | navauto_rand_init (void) |
This function resets the random bit table. More... | |
bool | navauto_setmode (Navauto_mode exp_mode) |
This function sets the directory limitation of the file list. More... | |
bool | navauto_setpos (uint16_t u16_pos) |
This function selects a new position in file list. More... | |
void | navauto_setrand (Navauto_rand rand) |
This function changes the random state. More... | |
Variables | |
static Navauto_mov_bitfield_status | bitfield_status |
bool | g_navauto_b_playlist |
If true, then the file list contains files from play list file, else the file list contains files included in directories. More... | |
_MEM_TYPE_SLOW_ Navauto_mode | g_navauto_exp_mode = NAVAUTO_MODE_DISKS |
Define the directory limitation of the file list (ignored if g_navauto_b_playlist = true ) More... | |
_MEM_TYPE_SLOW_ FS_STRING | g_navauto_filter |
File extension filter used to create the file list (ignored if g_navauto_b_playlist = true ) More... | |
_MEM_TYPE_SLOW_ Navauto_rand | g_navauto_rand = NAVAUTO_RAND_OFF |
Flag the random state. More... | |
_MEM_TYPE_SLOW_ uint8_t | g_navauto_rand_tab [NAVAUTO_MAX_RANGE_RAND] |
Bit table used to random the file list. This one flag each files already selected. More... | |
_MEM_TYPE_SLOW_ uint16_t | g_navauto_u16_dir_level |
Directory level of selected file (if play list file used then always 0) More... | |
_MEM_TYPE_SLOW_ uint16_t | g_navauto_u16_dir_level_root |
_MEM_TYPE_SLOW_ uint16_t | g_navauto_u16_nb = 0 |
Number of file included in file list (correct only if define FS_NAV_AUTOMATIC_NBFILE enabled) More... | |
_MEM_TYPE_SLOW_ uint16_t | g_navauto_u16_pos |
Position of selected file in file list. More... | |
_MEM_TYPE_SLOW_ uint16_t | g_navauto_u16_rand_pos |
Offset of bit table "g_navauto_rand_tab" in file list. More... | |
static const navauto_mov_explorer_process_fct_t | is_dir_process_fct [2] |
This table describes what to do once the navigator reaches a limit while browsing directories. More... | |
static const navauto_mov_explorer_process_fct_t | is_file_process_fct [2] |
This table describes what to do once the navigator reaches a limit while browsing files. More... | |
static const navauto_mov_explorer_process_fct_t | limit_process_fct [2] |
This table describes what to do once the navigator reaches the limit of the "playlist". More... | |
static const navauto_mov_explorer_process_fct_t | new_dir_process_fct [] |
This table describes what the action list to process one a new folder is accessed. More... | |
#define FS_NAV_AUTOMATIC_NBFILE DISABLE |
The FS_NAV_AUTOMATIC_NBFILE define changes the rule to create a file list from directories When this define is enabled, the files from a directory are included before files from sub directories.
typedef navauto_mov_explorer_rec_t(* navauto_mov_explorer_process_fct_t)(bool) |
uint16_t navauto_close | ( | void | ) |
This function closes the file list.
@return If a play list file is open then it is the last position in the file list else it is the directory level corresponding at the last selected file
//! At the end of this routine, the selected file of current navigator is : //! - the play list file (in case of a play list file has been opened) //! - the last selected file (in other case) //!
References g_navauto_b_playlist, g_navauto_u16_dir_level, g_navauto_u16_pos, and pl_main_close().
Referenced by ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_nav_eof_occur(), ai_usb_ms_audio_nav_mov(), ai_usb_ms_audio_nav_playfile(), and ai_usb_ms_specific_audio_nav_playlist_play_link().
Navauto_mode navauto_getmode | ( | void | ) |
This function returns the directory limitation of the file list.
@return Used navigation mode (NAVAUTO_MODE_DISKS, NAVAUTO_MODE_DIRONLY, NAVAUTO_MODE_DIRSUB)
//! This parameter is ignored then a play list file is selected //!
References g_navauto_exp_mode.
Referenced by ai_usb_ms_audio_context_save(), and ai_usb_ms_audio_nav_expmode_get().
uint16_t navauto_getnb | ( | void | ) |
This function returns the file list size.
References g_navauto_u16_nb.
Referenced by ai_usb_ms_audio_nav_nb().
uint16_t navauto_getpos | ( | void | ) |
This function returns the current position in the file list.
References g_navauto_u16_pos.
Referenced by ai_usb_ms_audio_nav_getpos(), and ai_usb_ms_specific_audio_nav_playlist_play_link().
Navauto_rand navauto_getrand | ( | void | ) |
This function returns the random state used.
References g_navauto_rand.
Referenced by ai_usb_ms_specific_audio_nav_playlist_play_link(), navauto_open(), and navauto_setpos().
void navauto_init | ( | const FS_STRING | sz_filterext | ) |
This function initializes the file extension filter used to create the file list.
@param sz_filterext file extension filter
//! This parameter is ignored then a play list file is selected //!
References g_navauto_filter, g_navauto_u16_dir_level_root, and g_navauto_u16_nb.
Referenced by ai_usb_ms_init_drive().
Navauto_mov_state navauto_mov | ( | bool | b_direction, |
navauto_mov_options_t | options | ||
) |
This function jumps to the next or previous file in file list.
@param b_direction jump direction (FS_FIND_NEXT or FS_FIND_PREV) @param options jump direction (FS_FIND_NEXT or FS_FIND_PREV) @return the status of the action
//! When the random is ON, the direction is ignored //!
References g_navauto_b_playlist, navauto_mov_explorer(), and navauto_mov_playlist().
Referenced by ai_usb_ms_audio_nav_eof_occur(), ai_usb_ms_audio_nav_mov(), navauto_open(), and navauto_setpos().
Navauto_mov_state navauto_mov_explorer | ( | bool | b_direction, |
navauto_mov_options_t | options | ||
) |
This function jumps to the next or previous file in file list included in directories.
@param b_direction jump direction (FS_FIND_NEXT or FS_FIND_PREV) @param options define extra modes for this function @return the status of the action
//! This routine is not authorized then a play list file is opened //! When the random is ON, the direction is ignored //!
References Navauto_mov_bitfield_status::all, Navauto_mov_state::bitfield, FS_FILE, FS_FIND_NEXT, FS_FIND_PREV, g_navauto_exp_mode, g_navauto_rand, g_navauto_u16_nb, g_navauto_u16_pos, limit_process_fct, nav_filelist_nb(), NAVAUTO_MODE_DIRONLY, NAVAUTO_MOV_EMPTY, navauto_mov_explorer_rec(), NAVAUTO_MOV_EXPLORER_RECURSIVE, NAVAUTO_MOV_OK, NAVAUTO_MOV_OK_LOOP, NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR, navauto_rand_choose(), navauto_rand_init(), NAVAUTO_RAND_ON, state, and Navauto_mov_state::status.
Referenced by navauto_mov(), and navauto_open().
|
static |
References Navauto_mov_bitfield_status::folder_change, FS_FIND_NEXT, g_navauto_u16_dir_level, is_dir_process_fct, nav_dir_cd(), nav_file_isdir(), nav_filelist_set(), NAVAUTO_MOV_EXPLORER_OK, navauto_mov_explorer_rec(), NAVAUTO_MOV_EXPLORER_RECURSIVE, navauto_mov_explorer_updir(), NAVAUTO_MOV_OK, navauto_mov_ok_loop(), and status.
Referenced by navauto_mov_explorer_rec().
|
static |
References FS_FIND_NEXT, g_navauto_exp_mode, g_navauto_filter, g_navauto_u16_pos, is_file_process_fct, nav_file_checkext(), nav_file_isdir(), nav_filelist_set(), NAVAUTO_MODE_DIRONLY, NAVAUTO_MOV_EMPTY, NAVAUTO_MOV_EXPLORER_OK, navauto_mov_explorer_rec(), NAVAUTO_MOV_EXPLORER_RECURSIVE, navauto_mov_explorer_select_limit_file_cur_folder(), navauto_mov_explorer_updir(), NAVAUTO_MOV_OK, NAVAUTO_MOV_OK_LOOP, navauto_mov_ok_loop(), and NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR.
Referenced by navauto_mov_explorer_rec().
|
static |
This function sets the pointer to a limit.
b_direction | direction of navigation (FS_FIND_NEXT or FS_FIND_PREV) |
References g_navauto_u16_dir_level, g_navauto_u16_dir_level_root, nav_filelist_reset(), NAVAUTO_MOV_EXPLORER_ERROR, NAVAUTO_MOV_EXPLORER_RECURSIVE, and navauto_mov_explorer_updir().
|
static |
|
static |
This function selects a file in EXPLORER mode.
b_direction | direction of navigation (FS_FIND_NEXT or FS_FIND_PREV) |
options | define extra modes for this function |
References nav_file_isdir(), nav_filelist_validpos(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_is_file(), and navauto_mov_explorer_new_dir().
Referenced by navauto_mov_explorer(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_is_file(), navauto_mov_explorer_new_dir(), and navauto_mov_ok_loop().
void navauto_mov_explorer_reset | ( | void | ) |
This function goes to the beginning of file list.
//! This routine is not authorized then a play list file is opened //!
References g_navauto_exp_mode, g_navauto_u16_dir_level, g_navauto_u16_dir_level_root, g_navauto_u16_nb, g_navauto_u16_pos, nav_dir_root(), nav_drive_set(), NAVAUTO_MODE_DISK, and NAVAUTO_MODE_DISKS.
Referenced by navauto_open().
|
static |
This function selects the first or the last directory on the current folder and enters in it.
b_direction | direction of navigation (FS_FIND_NEXT or FS_FIND_PREV) |
References Navauto_mov_bitfield_status::folder_change, FS_DIR, FS_FIND_NEXT, g_navauto_u16_dir_level, nav_dir_cd(), nav_filelist_first(), nav_filelist_last(), NAVAUTO_MOV_EXPLORER_ERROR, and NAVAUTO_MOV_EXPLORER_RECURSIVE.
|
static |
This function selects the first or the last playable file on the current folder.
b_direction | direction of navigation (FS_FIND_NEXT or FS_FIND_PREV) |
References FS_FILE, FS_FIND_NEXT, g_navauto_filter, nav_file_checkext(), nav_filelist_first(), nav_filelist_last(), nav_filelist_set(), NAVAUTO_MOV_EXPLORER_ERROR, and NAVAUTO_MOV_EXPLORER_OK.
Referenced by navauto_mov_explorer_is_file().
|
static |
This function moves back to the parent directory and selects this directory.
b_direction | direction of navigation (FS_FIND_NEXT or FS_FIND_PREV) |
References Navauto_mov_bitfield_status::folder_change, g_navauto_exp_mode, g_navauto_u16_dir_level, g_navauto_u16_dir_level_root, nav_dir_gotoparent(), NAVAUTO_MODE_DIRONLY, NAVAUTO_MODE_DIRSUB, NAVAUTO_MOV_EXPLORER_ERROR, and NAVAUTO_MOV_EXPLORER_RECURSIVE.
Referenced by navauto_mov_explorer_is_dir(), navauto_mov_explorer_is_file(), navauto_mov_explorer_limit(), and navauto_mov_explorer_new_dir().
|
static |
Navauto_mov_state navauto_mov_playlist | ( | bool | b_direction | ) |
This function jumps to the next or previous file in file list corresponding at a play list file.
@param b_direction jump direction (FS_FIND_NEXT or FS_FIND_PREV) @return The status of the action
//! This routine is not authorized then a play list file is not opened //!
References Navauto_mov_bitfield_status::all, Navauto_mov_state::bitfield, FS_FIND_NEXT, g_navauto_rand, g_navauto_u16_pos, nav_filelist_validpos(), NAVAUTO_MOV_DISKERROR, NAVAUTO_MOV_OK, NAVAUTO_MOV_OK_LOOP, navauto_rand_choose(), navauto_rand_init(), NAVAUTO_RAND_ON, pl_nav_getnbfile(), pl_nav_getpos(), pl_nav_setpos(), state, and Navauto_mov_state::status.
Referenced by navauto_mov().
This function opens a file list at the current position in navigator.
b_playlist | if true then the current selected file is a play list file to open else create a file list with files included in a disk part |
pos | If b_playlist true, then position in the play list to start else folder level of the current position |
References FS_FIND_NEXT, FS_FIND_PREV, g_navauto_b_playlist, g_navauto_filter, g_navauto_u16_dir_level, g_navauto_u16_dir_level_root, g_navauto_u16_nb, g_navauto_u16_pos, index, nav_dir_gotoparent(), nav_file_checkext(), nav_filelist_reset(), nav_filelist_set(), nav_filelist_validpos(), nav_getindex(), nav_gotoindex(), navauto_getrand(), navauto_mov(), navauto_mov_explorer(), navauto_mov_explorer_reset(), NAVAUTO_MOV_OK, NAVAUTO_MOV_OK_LOOP, NAVAUTO_MOV_OPTS_NONE, navauto_rand_init(), NAVAUTO_RAND_OFF, navauto_setrand(), pl_main_open(), pl_nav_getnbfile(), pl_nav_setpos(), state, status, Navauto_mov_state::status, Fs_index::u16_entry_pos_sel_file, Fs_index::u32_cluster_sel_dir, and Fs_index::u8_lun.
Referenced by ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_specific_audio_nav_playlist_play_link(), and navauto_setmode().
uint16_t navauto_rand_choose | ( | void | ) |
This function returns a random position not already used.
References g_navauto_rand_tab, g_navauto_u16_nb, g_navauto_u16_pos, and g_navauto_u16_rand_pos.
Referenced by navauto_mov_explorer(), and navauto_mov_playlist().
void navauto_rand_init | ( | void | ) |
This function resets the random bit table.
References g_navauto_rand_tab, and g_navauto_u16_rand_pos.
Referenced by navauto_mov_explorer(), navauto_mov_playlist(), navauto_open(), and navauto_setrand().
bool navauto_setmode | ( | Navauto_mode | exp_mode | ) |
This function sets the directory limitation of the file list.
@param exp_mode mode to select (NAVAUTO_MODE_DISKS, NAVAUTO_MODE_DIRONLY, NAVAUTO_MODE_DIRSUB) @return true, mode changed @return false, mode can't be changed (note: the selected file must be close)
//! This parameter is ignored then a play list file is selected //! When the mode change, the folder level is reseted at the current position. //!
References g_navauto_b_playlist, g_navauto_exp_mode, and navauto_open().
Referenced by ai_usb_ms_audio_context_restore(), and ai_usb_ms_audio_nav_expmode_set().
bool navauto_setpos | ( | uint16_t | u16_pos | ) |
This function selects a new position in file list.
u16_pos | new position to select |
References FS_FIND_NEXT, FS_FIND_PREV, g_navauto_u16_pos, navauto_getrand(), navauto_mov(), NAVAUTO_MOV_OK, NAVAUTO_MOV_OPTS_NONE, navauto_setrand(), state, and Navauto_mov_state::status.
Referenced by ai_usb_ms_audio_nav_setpos().
void navauto_setrand | ( | Navauto_rand | rand | ) |
This function changes the random state.
rand | random mode to use |
References g_navauto_rand, g_navauto_rand_tab, g_navauto_u16_pos, and navauto_rand_init().
Referenced by ai_usb_ms_audio_nav_shuffle_set(), ai_usb_ms_new_connection(), ai_usb_ms_specific_audio_nav_playlist_play_link(), navauto_open(), and navauto_setpos().
|
static |
bool g_navauto_b_playlist |
If true, then the file list contains files from play list file, else the file list contains files included in directories.
Referenced by ai_usb_ms_audio_context_save(), navauto_close(), navauto_mov(), navauto_open(), and navauto_setmode().
_MEM_TYPE_SLOW_ Navauto_mode g_navauto_exp_mode = NAVAUTO_MODE_DISKS |
Define the directory limitation of the file list (ignored if g_navauto_b_playlist = true )
Referenced by navauto_getmode(), navauto_mov_explorer(), navauto_mov_explorer_is_file(), navauto_mov_explorer_reset(), navauto_mov_explorer_updir(), navauto_mov_ok_loop(), and navauto_setmode().
_MEM_TYPE_SLOW_ FS_STRING g_navauto_filter |
File extension filter used to create the file list (ignored if g_navauto_b_playlist = true )
Referenced by navauto_init(), navauto_mov_explorer_is_file(), navauto_mov_explorer_select_limit_file_cur_folder(), and navauto_open().
_MEM_TYPE_SLOW_ Navauto_rand g_navauto_rand = NAVAUTO_RAND_OFF |
Flag the random state.
Referenced by navauto_getrand(), navauto_mov_explorer(), navauto_mov_playlist(), and navauto_setrand().
_MEM_TYPE_SLOW_ uint8_t g_navauto_rand_tab[NAVAUTO_MAX_RANGE_RAND] |
Bit table used to random the file list. This one flag each files already selected.
Referenced by navauto_rand_choose(), navauto_rand_init(), and navauto_setrand().
_MEM_TYPE_SLOW_ uint16_t g_navauto_u16_dir_level |
Directory level of selected file (if play list file used then always 0)
Referenced by ai_usb_ms_audio_context_save(), navauto_close(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_limit(), navauto_mov_explorer_reset(), navauto_mov_explorer_select_limit_dir_cur_folder(), navauto_mov_explorer_updir(), and navauto_open().
_MEM_TYPE_SLOW_ uint16_t g_navauto_u16_dir_level_root |
_MEM_TYPE_SLOW_ uint16_t g_navauto_u16_nb = 0 |
Number of file included in file list (correct only if define FS_NAV_AUTOMATIC_NBFILE enabled)
Referenced by navauto_getnb(), navauto_init(), navauto_mov_explorer(), navauto_mov_explorer_reset(), navauto_open(), and navauto_rand_choose().
_MEM_TYPE_SLOW_ uint16_t g_navauto_u16_pos |
Position of selected file in file list.
Referenced by ai_usb_ms_audio_context_save(), navauto_close(), navauto_getpos(), navauto_mov_explorer(), navauto_mov_explorer_is_file(), navauto_mov_explorer_reset(), navauto_mov_playlist(), navauto_open(), navauto_rand_choose(), navauto_setpos(), and navauto_setrand().
_MEM_TYPE_SLOW_ uint16_t g_navauto_u16_rand_pos |
Offset of bit table "g_navauto_rand_tab" in file list.
Referenced by navauto_rand_choose(), and navauto_rand_init().
|
static |
This table describes what to do once the navigator reaches a limit while browsing directories.
Referenced by navauto_mov_explorer_is_dir().
|
static |
This table describes what to do once the navigator reaches a limit while browsing files.
Referenced by navauto_mov_explorer_is_file().
|
static |
This table describes what to do once the navigator reaches the limit of the "playlist".
Referenced by navauto_mov_explorer().
|
static |
This table describes what the action list to process one a new folder is accessed.
Referenced by navauto_mov_explorer_new_dir().