Microchip® Advanced Software Framework

nav_automatic.h File Reference
#include "fs_com.h"
#include "fat.h"
#include "navigation.h"
#include "play_list.h"

Data Structures

union  Navauto_mov_bitfield_status
 
struct  Navauto_mov_state
 Structure to store the status from function navauto_mov() More...
 

Macros

Definition of the directory limitations of the file list
#define NAVAUTO_MODE_DISKS   0
 
#define NAVAUTO_MODE_DISK   1
 
#define NAVAUTO_MODE_DIRONLY   2
 
#define NAVAUTO_MODE_DIRSUB   3
 
#define NAVAUTO_MODE_NB   4
 
Definition of the random states
#define NAVAUTO_RAND_OFF   0
 
#define NAVAUTO_RAND_ON   1
 
Status list of function navauto_mov()
#define NAVAUTO_MOV_OK   0
 
#define NAVAUTO_MOV_OK_LOOP   1
 
#define NAVAUTO_MOV_EMPTY   2
 
#define NAVAUTO_MOV_DISKNOPRESENT   3
 
#define NAVAUTO_MOV_DISKERROR   4
 

Typedefs

typedef uint8_t Navauto_mode
 Structure to store the directory limitation of the file list. More...
 
typedef uint8_t Navauto_rand
 Structure to store the random state. More...
 

Enumerations

enum  navauto_mov_options_t {
  NAVAUTO_MOV_OPTS_NONE = 0,
  NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR = 1
}
 

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...
 
bool navauto_open (bool b_playlist, uint16_t pos)
 This function opens a file list at the current position in navigator. 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...
 

#define NAVAUTO_MODE_NB   4
#define NAVAUTO_MOV_DISKERROR   4

Referenced by navauto_mov_playlist().

#define NAVAUTO_MOV_DISKNOPRESENT   3
#define NAVAUTO_MOV_EMPTY   2

typedef uint8_t Navauto_mode

Structure to store the directory limitation of the file list.

typedef uint8_t Navauto_rand

Structure to store the random state.

Enumerator
NAVAUTO_MOV_OPTS_NONE 
NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR 

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.

Returns
random 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, 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().

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.

Parameters
u16_posnew position to select
Returns
false in case of error

References FS_FIND_NEXT, FS_FIND_PREV, g_navauto_u16_pos, navauto_getrand(), navauto_mov(), NAVAUTO_MOV_OK, NAVAUTO_MOV_OPTS_NONE, navauto_setrand(), 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.

Parameters
randrandom mode to use

References g_navauto_rand, navauto_rand_init(), and shuffle_set.

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().