nav_automatic.c File Reference


Detailed Description

Navigation automatic Services.

Automatic navigation has been developed for the player and viewer. The plug-in provides a specific "file list". The "file list" contains all files included in a playlist or it is built with the following user specifications :

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file nav_automatic.c.

#include "conf_explorer.h"
#include "nav_automatic.h"
#include "file.h"
#include "ctrl_access.h"
#include <string.h>

Go to the source code of this file.

Defines

#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.

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

U16 navauto_close (void)
 This function closes the file list.
Navauto_mode navauto_getmode (void)
 This function returns the directory limitation of the file list.
U16 navauto_getnb (void)
 This function returns the file list size.
U16 navauto_getpos (void)
 This function returns the current position in the file list.
Navauto_rand navauto_getrand (void)
 This function returns the random state used.
void navauto_init (const FS_STRING sz_filterext)
 This function initializes the file extension filter used to create the file list.
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.
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.
static __inline__ U8 navauto_mov_explorer_is_dir (Bool b_direction, navauto_mov_options_t options)
static __inline__ U8 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.
static __inline__ U8 navauto_mov_explorer_new_dir (Bool b_direction, navauto_mov_options_t options)
static U8 navauto_mov_explorer_rec (Bool b_direction, navauto_mov_options_t options)
 This function selects a file in EXPLORER mode.
void navauto_mov_explorer_reset (void)
 This function goes to the beginning of file list.
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.
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.
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.
static __inline__ U8 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.
Bool navauto_open (Bool b_playlist, U16 pos)
 This function opens a file list at the current position in navigator.
U16 navauto_rand_choose (void)
 This function returns a random position not already used.
void navauto_rand_init (void)
 This function resets the random bit table.
Bool navauto_setmode (Navauto_mode exp_mode)
 This function sets the directory limitation of the file list.
Bool navauto_setpos (U16 u16_pos)
 This function selects a new position in fiel list.
void navauto_setrand (Navauto_rand rand)
 This function changes the random state.

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.
_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 ).
_MEM_TYPE_SLOW_ FS_STRING g_navauto_filter
 File extension filter used to create the file list (ignored if g_navauto_b_playlist = TRUE ).
_MEM_TYPE_SLOW_ Navauto_rand g_navauto_rand = NAVAUTO_RAND_OFF
 Flag the random state.
_MEM_TYPE_SLOW_ U8 g_navauto_rand_tab [NAVAUTO_MAX_RANGE_RAND]
 Bit table used to random the file list. This one flag each files already selected.
_MEM_TYPE_SLOW_ U16 g_navauto_u16_dir_level
 Directory level of selected file (if play list file used then always 0).
_MEM_TYPE_SLOW_ U16 g_navauto_u16_dir_level_root
_MEM_TYPE_SLOW_ U16 g_navauto_u16_nb = 0
 Number of file included in file list (correct only if define FS_NAV_AUTOMATIC_NBFILE enabled).
_MEM_TYPE_SLOW_ U16 g_navauto_u16_pos
 Position of selected file in fiel list.
_MEM_TYPE_SLOW_ U16 g_navauto_u16_rand_pos
 Offset of bit table "g_navauto_rand_tab" in file list.
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.
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.
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".
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.


Define Documentation

#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.

Definition at line 74 of file nav_automatic.c.


Typedef Documentation

Definition at line 93 of file nav_automatic.c.


Enumeration Type Documentation

Enumerator:
NAVAUTO_MOV_EXPLORER_OK 
NAVAUTO_MOV_EXPLORER_ERROR 
NAVAUTO_MOV_EXPLORER_RECURSIVE 

Definition at line 79 of file nav_automatic.c.


Function Documentation

U16 navauto_close ( void   ) 

This function closes the file list.

Returns:
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)
//! 

Definition at line 516 of file nav_automatic.c.

References g_navauto_b_playlist, g_navauto_u16_dir_level, g_navauto_u16_pos, and pl_main_close().

00517 {
00518    if( g_navauto_b_playlist )
00519    {
00520       pl_main_close();
00521       return g_navauto_u16_pos;
00522    }
00523    return g_navauto_u16_dir_level;
00524 }

Navauto_mode navauto_getmode ( void   ) 

This function returns the directory limitation of the file list.

Returns:
Used navigation mode (NAVAUTO_MODE_DISKS, NAVAUTO_MODE_DIRONLY, NAVAUTO_MODE_DIRSUB)
//! This parameter is ignored then a play list file is selected
//! 

Definition at line 167 of file nav_automatic.c.

References g_navauto_exp_mode.

00168 {
00169    return g_navauto_exp_mode;
00170 }

U16 navauto_getnb ( void   ) 

This function returns the file list size.

Definition at line 529 of file nav_automatic.c.

References g_navauto_u16_nb.

00530 {
00531    return g_navauto_u16_nb;
00532 }

U16 navauto_getpos ( void   ) 

This function returns the current position in the file list.

Definition at line 536 of file nav_automatic.c.

References g_navauto_u16_pos.

00537 {
00538    return g_navauto_u16_pos;
00539 }

Navauto_rand navauto_getrand ( void   ) 

This function returns the random state used.

Returns:
random used

Definition at line 200 of file nav_automatic.c.

References g_navauto_rand.

Referenced by navauto_open(), and navauto_setpos().

00201 {
00202    return g_navauto_rand;
00203 }

void navauto_init ( const FS_STRING  sz_filterext  ) 

This function initializes the file extension filter used to create the file list.

Parameters:
sz_filterext file extension filter
//! This parameter is ignored then a play list file is selected
//! 

Definition at line 298 of file nav_automatic.c.

References g_navauto_filter, g_navauto_u16_dir_level_root, and g_navauto_u16_nb.

00299 {
00300    g_navauto_filter = sz_filterext;
00301    g_navauto_u16_dir_level_root = 0;
00302    g_navauto_u16_nb = 0;
00303 }

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.

Parameters:
b_direction jump direction (FS_FIND_NEXT or FS_FIND_PREV)
options jump direction (FS_FIND_NEXT or FS_FIND_PREV)
Returns:
the status of the action
//! When the random is ON, the direction is ignored
//! 

Definition at line 580 of file nav_automatic.c.

References g_navauto_b_playlist, navauto_mov_explorer(), and navauto_mov_playlist().

Referenced by navauto_open(), and navauto_setpos().

00581 {
00582    if( g_navauto_b_playlist )
00583       return navauto_mov_playlist( b_direction );
00584    else
00585       return navauto_mov_explorer( b_direction, options );
00586 }

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.

Parameters:
b_direction jump direction (FS_FIND_NEXT or FS_FIND_PREV)
options define extra modes for this function
Returns:
the status of the action
//! This routine is not autorized then a play list file is opened
//! When the random is ON, the direction is ignored
//! 

Definition at line 890 of file nav_automatic.c.

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, and Navauto_mov_state::status.

Referenced by navauto_mov(), and navauto_open().

00891 {
00892   Navauto_mov_state state;
00893   U16 u16_mov_pos = 0;
00894   size_t nb_loops = 1;
00895 
00896   // Reset the bitfield status
00897   memset(&bitfield_status, 0, sizeof(bitfield_status));
00898 
00899   // Random implementation
00900   if (g_navauto_rand == NAVAUTO_RAND_ON)
00901   {
00902     u16_mov_pos = navauto_rand_choose();
00903     if (!u16_mov_pos)
00904     {
00905       navauto_rand_init();
00906       // navauto_mov_explorer_reset();
00907       u16_mov_pos = navauto_rand_choose();
00908       if(!u16_mov_pos)
00909       {
00910         state.bitfield.all = bitfield_status.all;
00911         state.status = NAVAUTO_MOV_EMPTY;
00912         return state;  // Error system
00913       }
00914     }
00915     // To avoid end of loop (NAVAUTO_MOV_OK_LOOP state)
00916     b_direction = (u16_mov_pos > g_navauto_u16_pos)?FS_FIND_NEXT:FS_FIND_PREV;
00917     nb_loops = (u16_mov_pos > g_navauto_u16_pos)?(u16_mov_pos-g_navauto_u16_pos):(g_navauto_u16_pos-u16_mov_pos);
00918 
00919     // Approximation used for the "stay in current directory" bit,
00920     // it reduces the number of loops in large file systems.
00921     if ( (options & NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR)
00922       || (g_navauto_exp_mode == NAVAUTO_MODE_DIRONLY))
00923       nb_loops %= nav_filelist_nb(FS_FILE);
00924 
00925     // Set u16_mov_pos to the current position to compare it with current and to make sure the
00926     // new file selected is not the same as the last one.
00927     u16_mov_pos = g_navauto_u16_pos;
00928   }
00929 
00930   // This loop is done, so that the random method is not a problem once a NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR option is set to 1.
00931   while(nb_loops--)
00932   {
00933     // Compute the recursive function
00934     state.status = navauto_mov_explorer_rec(b_direction, options);
00935     // Check its returning state
00936     switch(state.status)
00937     {
00938 
00939     // If the function is at the end of the loop
00940     case NAVAUTO_MOV_OK_LOOP:
00941 
00942       // Update g_navauto_u16_pos counter
00943       if (b_direction == FS_FIND_NEXT)
00944       {
00945         g_navauto_u16_nb = g_navauto_u16_pos + 1;
00946         g_navauto_u16_pos = 0;
00947       }
00948       else
00949         g_navauto_u16_pos = g_navauto_u16_nb - 1;
00950 
00951       // Means it reached the tail or the begining of the playlist.
00952       // Then set the pointer to a limit of the "playlist"
00953       // should be at the begining for a NEXT and at end for a PREVIOUS command.
00954       switch(limit_process_fct[(b_direction == FS_FIND_NEXT)?1:0](b_direction))
00955       {
00956 
00957       case NAVAUTO_MOV_EXPLORER_RECURSIVE:
00958         // If it returns NAVAUTO_MOV_OK_LOOP, it means it reached two times a row the end of the playlist,
00959         // therefore, this is an empty disk!
00960         if (navauto_mov_explorer_rec(b_direction, options) == NAVAUTO_MOV_OK_LOOP)
00961         {
00962           state.bitfield.all = bitfield_status.all;
00963           state.status = NAVAUTO_MOV_EMPTY;
00964           return state;
00965         }
00966         break;
00967 
00968       default:
00969         break;
00970       }
00971 
00972       state.bitfield.all = bitfield_status.all;
00973       state.status = NAVAUTO_MOV_OK_LOOP;
00974       return state;
00975 
00976     // If a file is correctly selected
00977     case NAVAUTO_MOV_OK:
00978       // Update g_navauto_u16_pos counter
00979       g_navauto_u16_pos += (b_direction == FS_FIND_NEXT)?(1):(-1);
00980       // if the selection is the same as last one, then get next file
00981       if (g_navauto_rand == NAVAUTO_RAND_ON && u16_mov_pos == g_navauto_u16_pos && !nb_loops)
00982       {
00983         state.status = navauto_mov_explorer_rec(b_direction, options);
00984         state.bitfield.all = bitfield_status.all;
00985         return state;
00986       }
00987       break;
00988 
00989     default:
00990       state.bitfield.all = bitfield_status.all;
00991       return state;
00992     }
00993   }
00994 
00995   state.status = NAVAUTO_MOV_OK;
00996   state.bitfield.all = bitfield_status.all;
00997   return state;
00998 }

static __inline__ U8 navauto_mov_explorer_is_dir ( Bool  b_direction,
navauto_mov_options_t  options 
) [static]

Definition at line 761 of file nav_automatic.c.

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, and navauto_mov_ok_loop().

Referenced by navauto_mov_explorer_rec().

00762 {
00763   Bool status;
00764 
00765   // Look for the next/previous directory in the current directory
00766   if ((status = nav_filelist_set(0, b_direction)))
00767     status = nav_file_isdir();
00768 
00769   // If status == FALSE, it means it reached a limit
00770   if (!status)
00771   {
00772     switch(is_dir_process_fct[(b_direction == FS_FIND_NEXT)?1:0](b_direction))
00773     {
00774     case NAVAUTO_MOV_EXPLORER_RECURSIVE:
00775       return navauto_mov_explorer_rec(b_direction, options);
00776     case NAVAUTO_MOV_EXPLORER_OK:
00777       return NAVAUTO_MOV_OK;
00778     default:
00779       break;
00780     }
00781   }
00782   else
00783   {
00784     g_navauto_u16_dir_level++;
00785     // Enter in this new directory
00786     nav_dir_cd();
00787     // Set folder change bit
00788     bitfield_status.folder_change = 1;
00789 
00790     return navauto_mov_explorer_rec(b_direction, options);
00791   }
00792 
00793   // At this point, there is no directory available and the limit function
00794   // returns ERROR
00795   if (navauto_mov_explorer_updir(b_direction) == NAVAUTO_MOV_EXPLORER_RECURSIVE)
00796     return navauto_mov_explorer_rec(b_direction, options);
00797 
00798   return navauto_mov_ok_loop(b_direction, options);
00799 }

static __inline__ U8 navauto_mov_explorer_is_file ( Bool  b_direction,
navauto_mov_options_t  options 
) [static]

Definition at line 801 of file nav_automatic.c.

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

00802 {
00803   // Look for the next playable file in the current directory
00804   while(nav_filelist_set(0, b_direction))
00805   {
00806     if (nav_file_isdir())
00807       break;
00808     if (!nav_file_checkext(g_navauto_filter))
00809       continue;
00810     return NAVAUTO_MOV_OK;
00811   }
00812 
00813   // In case it needs to stay in the current directory,
00814   if ( (options & NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR)
00815     || (g_navauto_exp_mode == NAVAUTO_MODE_DIRONLY))
00816   {
00817     // Update g_navauto_u16_pos
00818     while(nav_filelist_set(0, !b_direction))
00819     {
00820       if (nav_file_isdir())
00821         break;
00822       if (!nav_file_checkext(g_navauto_filter))
00823         continue;
00824       g_navauto_u16_pos += (!b_direction == FS_FIND_NEXT)?(1):(-1);
00825     }
00826     // Go to the first/last file
00827     if (navauto_mov_explorer_select_limit_file_cur_folder(b_direction) == NAVAUTO_MOV_EXPLORER_OK)
00828     {
00829       if (options & NAVAUTO_MOV_OPTS_STAY_CURRENT_DIR)
00830         return NAVAUTO_MOV_OK;
00831       else
00832         return NAVAUTO_MOV_OK_LOOP;
00833     }
00834     return NAVAUTO_MOV_EMPTY;
00835   }
00836 
00837   // At this point, it means it reached a limit, there is no more playable files
00838   switch(is_file_process_fct[(b_direction == FS_FIND_NEXT)?1:0](b_direction))
00839   {
00840   case NAVAUTO_MOV_EXPLORER_RECURSIVE:
00841     return navauto_mov_explorer_rec(b_direction, options);
00842   case NAVAUTO_MOV_EXPLORER_OK:
00843     return NAVAUTO_MOV_OK;
00844   default:
00845     break;
00846   }
00847 
00848   // At this point, there is no directory available and the limit function
00849   // returns ERROR
00850   if (navauto_mov_explorer_updir(b_direction) == NAVAUTO_MOV_EXPLORER_RECURSIVE)
00851     return navauto_mov_explorer_rec(b_direction, options);
00852 
00853   return navauto_mov_ok_loop(b_direction, options);
00854 }

static navauto_mov_explorer_rec_t navauto_mov_explorer_limit ( Bool  b_direction  )  [static]

This function sets the pointer to a limit.

Parameters:
b_direction direction of navigation (FS_FIND_NEXT or FS_FIND_PREV)
Returns:
TRUE if a file is selected FALSE otherwize

Definition at line 598 of file nav_automatic.c.

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

00599 {
00600   // Reset the selection
00601   nav_filelist_reset();
00602   // Goes to the root directory
00603   while(navauto_mov_explorer_updir(b_direction) != NAVAUTO_MOV_EXPLORER_ERROR);
00604   // Update directory level
00605   g_navauto_u16_dir_level = g_navauto_u16_dir_level_root;
00606   // Call back the recusrive function
00607   return NAVAUTO_MOV_EXPLORER_RECURSIVE;
00608 }

static __inline__ U8 navauto_mov_explorer_new_dir ( Bool  b_direction,
navauto_mov_options_t  options 
) [static]

Definition at line 732 of file nav_automatic.c.

References FS_FIND_NEXT, NAVAUTO_MOV_EMPTY, NAVAUTO_MOV_EXPLORER_OK, navauto_mov_explorer_rec(), NAVAUTO_MOV_EXPLORER_RECURSIVE, navauto_mov_explorer_updir(), NAVAUTO_MOV_OK, and new_dir_process_fct.

Referenced by navauto_mov_explorer_rec().

00733 {
00734   int i;
00735   // Process
00736   i = (b_direction == FS_FIND_NEXT)?0:(sizeof(new_dir_process_fct)/sizeof(navauto_mov_explorer_process_fct_t)-1);
00737   while(i >= 0 && i < sizeof(new_dir_process_fct)/sizeof(navauto_mov_explorer_process_fct_t))
00738   {
00739     switch(new_dir_process_fct[i](b_direction))
00740     {
00741     case NAVAUTO_MOV_EXPLORER_RECURSIVE:
00742       return navauto_mov_explorer_rec(b_direction, options);
00743     case NAVAUTO_MOV_EXPLORER_OK:
00744       return NAVAUTO_MOV_OK;
00745     default:
00746       break;
00747     }
00748     // Index
00749     i += (b_direction == FS_FIND_NEXT)?(1):(-1);
00750   }
00751 
00752   // Else means directory empty!
00753   // Needs to up dir
00754   if (navauto_mov_explorer_updir(b_direction) == NAVAUTO_MOV_EXPLORER_RECURSIVE)
00755     return navauto_mov_explorer_rec(b_direction, options);
00756 
00757   // If it fails, means the pointer is on the root
00758   return NAVAUTO_MOV_EMPTY;
00759 }

static U8 navauto_mov_explorer_rec ( Bool  b_direction,
navauto_mov_options_t  options 
) [static]

This function selects a file in EXPLORER mode.

Parameters:
b_direction direction of navigation (FS_FIND_NEXT or FS_FIND_PREV)
options define extra modes for this function
Returns:
the status of the action

Definition at line 865 of file nav_automatic.c.

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

00866 {
00867   // If no file is selected - new directory
00868   if (!nav_filelist_validpos())
00869     return navauto_mov_explorer_new_dir(b_direction, options);
00870 
00871   // If the selection is on a directory
00872   if (nav_file_isdir())
00873     return navauto_mov_explorer_is_dir(b_direction, options);
00874   else // The selection is set on a file
00875     return navauto_mov_explorer_is_file(b_direction, options);
00876 }

void navauto_mov_explorer_reset ( void   ) 

This function goes to the beginning of file list.

//! This routine is not autorized then a play list file is opened
//! 

Definition at line 473 of file nav_automatic.c.

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

00474 {
00475    g_navauto_u16_nb = 0;
00476 
00477    switch( g_navauto_exp_mode )
00478    {
00479       case NAVAUTO_MODE_DISKS :  // Go to the root of the first disk
00480       g_navauto_u16_dir_level = 0;
00481       g_navauto_u16_dir_level_root = 0;
00482       nav_drive_set(0);
00483       nav_dir_root();            // Ignore error, because this one is managed by routine next file
00484       break;
00485 
00486       case NAVAUTO_MODE_DISK :   // Go to the root of the current disk
00487       g_navauto_u16_dir_level = 0;
00488       g_navauto_u16_dir_level_root = 0;
00489       nav_dir_root();            // Ignore error, because this one is managed by routine next file
00490       break;
00491 
00492       default:
00493       g_navauto_u16_dir_level = 0;
00494       g_navauto_u16_dir_level_root = 0;
00495       nav_dir_root();
00496   //    nav_filelist_reset();      // Reset directory = no selected file
00497       break;
00498    }
00499    // Here the navigator is at the beginning of file list
00500    // and no file is selected
00501    g_navauto_u16_pos = (U16) -1;
00502 }

static navauto_mov_explorer_rec_t navauto_mov_explorer_select_limit_dir_cur_folder ( Bool  b_direction  )  [static]

This function selects the first or the last directory on the current folder and enters in it.

Parameters:
b_direction direction of navigation (FS_FIND_NEXT or FS_FIND_PREV)
Returns:
The state of the function

Definition at line 640 of file nav_automatic.c.

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.

00641 {
00642   if (!((b_direction == FS_FIND_NEXT)?nav_filelist_first(FS_DIR):nav_filelist_last(FS_DIR)))
00643     return NAVAUTO_MOV_EXPLORER_ERROR;
00644 
00645   // Update directory level
00646   g_navauto_u16_dir_level++;
00647   // Enter in this new directory
00648   nav_dir_cd();
00649 
00650   // Set folder change bit
00651   bitfield_status.folder_change = 1;
00652 
00653   return NAVAUTO_MOV_EXPLORER_RECURSIVE;
00654 }

static navauto_mov_explorer_rec_t navauto_mov_explorer_select_limit_file_cur_folder ( Bool  b_direction  )  [static]

This function selects the first or the last playable file on the current folder.

Parameters:
b_direction direction of navigation (FS_FIND_NEXT or FS_FIND_PREV)
Returns:
TRUE if a file is selected FALSE otherwize

Definition at line 616 of file nav_automatic.c.

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

00617 {
00618   if ((b_direction == FS_FIND_NEXT)?nav_filelist_first(FS_FILE):nav_filelist_last(FS_FILE))
00619   {
00620     // Look for the 1st or the last playable file in the current directory
00621     // Find the 1st or the last valid file
00622     while(!nav_file_checkext(g_navauto_filter))
00623     {
00624       if (!nav_filelist_set(0, b_direction))
00625         return NAVAUTO_MOV_EXPLORER_ERROR;
00626     }
00627     return NAVAUTO_MOV_EXPLORER_OK;
00628   }
00629   else
00630     return NAVAUTO_MOV_EXPLORER_ERROR;
00631 }

static navauto_mov_explorer_rec_t navauto_mov_explorer_updir ( Bool  b_direction  )  [static]

This function moves back to the parent directory and selects this directory.

Parameters:
b_direction direction of navigation (FS_FIND_NEXT or FS_FIND_PREV)
Returns:
The state of the function

Definition at line 662 of file nav_automatic.c.

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

00663 {
00664   // To support directory only mode
00665   if (g_navauto_exp_mode == NAVAUTO_MODE_DIRONLY)
00666     return NAVAUTO_MOV_EXPLORER_ERROR;
00667 
00668   // To Support subdirectories mode
00669   if (g_navauto_exp_mode == NAVAUTO_MODE_DIRSUB)
00670   {
00671     // If the selection is on the root level
00672     if (g_navauto_u16_dir_level <= g_navauto_u16_dir_level_root)
00673       return NAVAUTO_MOV_EXPLORER_ERROR;
00674   }
00675 
00676   if (nav_dir_gotoparent())
00677   {
00678     // Set folder change bit
00679     bitfield_status.folder_change = 1;
00680 
00681     g_navauto_u16_dir_level--;
00682     return NAVAUTO_MOV_EXPLORER_RECURSIVE;
00683   }
00684   else // If it fails, means the pointer is on the root
00685     return NAVAUTO_MOV_EXPLORER_ERROR;
00686 }

static __inline__ U8 navauto_mov_ok_loop ( Bool  b_direction,
navauto_mov_options_t  options 
) [static]

Definition at line 688 of file nav_automatic.c.

References FS_FIND_NEXT, g_navauto_exp_mode, nav_drive_get(), nav_drive_nb(), nav_drive_set(), nav_partition_mount(), NAVAUTO_MODE_DISKS, navauto_mov_explorer_rec(), and NAVAUTO_MOV_OK_LOOP.

Referenced by navauto_mov_explorer_is_dir(), and navauto_mov_explorer_is_file().

00689 {
00690   Bool b_ok_loop = FALSE;
00691 
00692   // If mode DiskS, it should go to the next/previous disk
00693   if (g_navauto_exp_mode == NAVAUTO_MODE_DISKS)
00694   {
00695     // Mount the next/previous disk
00696     do
00697     {
00698       if (b_direction == FS_FIND_NEXT)
00699       {
00700         // Go to the next drive
00701         if (!nav_drive_set(nav_drive_get() + 1))
00702         {
00703           nav_drive_set(0);
00704           b_ok_loop = TRUE;
00705         }
00706       }
00707       else // direction PREVIOUS
00708       {
00709         // Go to the previous drive
00710         if (!nav_drive_set(nav_drive_get() - 1))
00711         {
00712           nav_drive_set(nav_drive_nb() - 1);
00713           b_ok_loop = TRUE;
00714         }
00715       }
00716     }while(!nav_partition_mount());
00717 
00718     // If it reached a limit
00719     if (b_ok_loop)
00720     {
00721       navauto_mov_explorer_rec(b_direction, options);
00722       return NAVAUTO_MOV_OK_LOOP;
00723     }
00724 
00725     // Else return the result of the recursive function
00726     return navauto_mov_explorer_rec(b_direction, options);
00727   }
00728 
00729   return NAVAUTO_MOV_OK_LOOP;
00730 }

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.

Parameters:
b_direction jump direction (FS_FIND_NEXT or FS_FIND_PREV)
Returns:
The status of the action
//! This routine is not autorized then a play list file is not opened
//! 

Definition at line 1010 of file nav_automatic.c.

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(), and Navauto_mov_state::status.

Referenced by navauto_mov().

01011 {
01012    Bool b_endof_loop;
01013    b_endof_loop = FALSE;
01014    Navauto_mov_state state;
01015 
01016    state.bitfield.all = 0;
01017    while( 1 )
01018    {
01019       if( NAVAUTO_RAND_ON == g_navauto_rand )
01020       {
01021          g_navauto_u16_pos = navauto_rand_choose();
01022          if( 0 == g_navauto_u16_pos )
01023          {
01024             // Loop finish, then reset random and choose other value
01025             if( b_endof_loop )
01026             {
01027                state.status = NAVAUTO_MOV_DISKERROR;
01028                return state;
01029             }
01030             b_endof_loop = TRUE;
01031             navauto_rand_init();
01032             g_navauto_u16_pos = navauto_rand_choose();
01033          }
01034          pl_nav_setpos( g_navauto_u16_pos );
01035       }
01036       else
01037       {
01038          g_navauto_u16_pos += (FS_FIND_NEXT==b_direction)? 1 : -1;
01039          if( !pl_nav_setpos( g_navauto_u16_pos ) )
01040          {
01041             // Loop finish or error
01042             if( b_endof_loop )
01043             {
01044                state.status = NAVAUTO_MOV_DISKERROR;
01045                return state;
01046             }
01047             b_endof_loop = TRUE;
01048             if( FS_FIND_NEXT == b_direction )
01049             {
01050                g_navauto_u16_pos = 1-1;                  // end of list then go to the beginning
01051             }else{
01052                g_navauto_u16_pos = pl_nav_getnbfile()+1; // beginning of list then go to the end
01053             }
01054          }
01055       }
01056       if( nav_filelist_validpos() )
01057          break;
01058       // Here it is a DEAD path or to large for system memory
01059    }
01060    g_navauto_u16_pos = pl_nav_getpos();
01061    if( b_endof_loop )
01062    {
01063       state.status = NAVAUTO_MOV_OK_LOOP;
01064       return state;
01065    }
01066    state.status = NAVAUTO_MOV_OK;
01067    return state;
01068 }

Bool navauto_open ( Bool  b_playlist,
U16  pos 
)

This function opens a file list at the current position in navigator.

Parameters:
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
Returns:
FALSE, in case of error or file list empty

Definition at line 315 of file nav_automatic.c.

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, 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(), Navauto_mov_state::status, Fs_index::u16_entry_pos_sel_file, Fs_index::u32_cluster_sel_dir, and Fs_index::u8_lun.

Referenced by navauto_setmode().

00316 {
00317    Navauto_mov_state state;
00318 
00319    g_navauto_b_playlist     = b_playlist;
00320    g_navauto_u16_dir_level_root = 0;
00321    g_navauto_u16_nb = 0;
00322 
00323    if( b_playlist )
00324    {
00325       g_navauto_u16_pos        = pos;
00326       if( !pl_main_open(FALSE) )
00327          return FALSE;
00328       g_navauto_u16_nb = pl_nav_getnbfile();
00329       if( 0 == g_navauto_u16_nb )
00330          return FALSE;
00331       if( NAVAUTO_RAND_OFF == navauto_getrand() )
00332       {
00333          if( pl_nav_setpos( g_navauto_u16_pos ))
00334          {
00335             if( nav_filelist_validpos() )
00336                return TRUE;
00337          }
00338       }else{
00339          navauto_rand_init();
00340       }
00341       // Error position then restart at the beginning
00342       g_navauto_u16_pos = 0;
00343    }
00344    else
00345    {
00346 #if( FS_NAV_AUTOMATIC_NBFILE == ENABLE )
00347       Fs_index       index;         
00348       Fs_index       index2;         
00349       Navauto_rand   rand_mode;
00350       U16            u16_current_pos=0;
00351 
00352       index.u8_lun = 0xFF;    // Reset index (by default no valid selected file)
00353       g_navauto_u16_dir_level  = pos;
00354       
00355       rand_mode = navauto_getrand();               // Save random mode
00356       navauto_setrand( NAVAUTO_RAND_OFF );
00357 
00358       // If no valid file then found the first valid file
00359       if( !nav_file_checkext( g_navauto_filter ))
00360       {
00361          // Go to previous position because "navauto_mov_explorer()" execute a next before search valid file
00362          if( !nav_filelist_set( 0 , FS_FIND_PREV ) )
00363            nav_filelist_reset();
00364          state = navauto_mov_explorer(FS_FIND_NEXT, NAVAUTO_MOV_OPTS_NONE);
00365          if((NAVAUTO_MOV_OK_LOOP != state.status)
00366          && (NAVAUTO_MOV_OK      != state.status) )
00367          {
00368            navauto_setrand(rand_mode);
00369            return FALSE;  // List empty
00370          }
00371       }
00372       index = nav_getindex();
00373 
00374       // Compute the size of file list and search the position of selected file
00375       navauto_mov_explorer_reset();                // Go to begining of loop
00376       // Note: the number of file is updated in navauto_mov_explorer() routine when the end of list is detected
00377 
00378       while( navauto_mov_explorer( FS_FIND_NEXT, NAVAUTO_MOV_OPTS_NONE ).status == NAVAUTO_MOV_OK )
00379       {
00380          index2 = nav_getindex();
00381          // Check the current position with the selected file
00382          if( (index.u8_lun == index2.u8_lun)
00383          &&  (index.u32_cluster_sel_dir == index2.u32_cluster_sel_dir)
00384          &&  (index.u16_entry_pos_sel_file == index2.u16_entry_pos_sel_file) )
00385          {
00386             u16_current_pos = g_navauto_u16_pos;   // Save the position number found
00387             g_navauto_u16_dir_level_root = g_navauto_u16_dir_level;
00388          }
00389       }
00390 
00391       navauto_setrand(rand_mode);                  // Restore random mode
00392       if( 0 == g_navauto_u16_nb )
00393          return FALSE;  // loop empty
00394 
00395       // Go to a file from file list
00396       if( NAVAUTO_RAND_OFF == navauto_getrand() )
00397       {
00398          if( 0xFF != index.u8_lun )
00399          {
00400             // Reselect the file selected at startup
00401             nav_gotoindex( &index );               // Go to this one
00402             g_navauto_u16_dir_level  = g_navauto_u16_dir_level_root;        // Update position file
00403             g_navauto_u16_pos = u16_current_pos;   // Update folder level corresponding at file
00404          }
00405          // Else, the first file is already selected at the end of "compute file list size" loop
00406          return TRUE;
00407       }else{
00408          navauto_rand_init();
00409       }
00410 #else
00411       Fs_index       index;
00412       Navauto_rand   rand_mode;
00413 
00414       rand_mode = navauto_getrand();
00415       navauto_setrand(NAVAUTO_RAND_OFF);
00416 
00417       // If no valid file then find the first valid file
00418       if( !nav_file_checkext( g_navauto_filter ))
00419       {
00420          // Go to previous position because "navauto_mov_explorer()" execute a next before search valid file
00421          if( !nav_filelist_set( 0 , FS_FIND_PREV ) )
00422            nav_filelist_reset();
00423          state = navauto_mov_explorer(FS_FIND_NEXT, NAVAUTO_MOV_OPTS_NONE);
00424          if((NAVAUTO_MOV_OK_LOOP != state.status)
00425          && (NAVAUTO_MOV_OK      != state.status) )
00426          {
00427            navauto_setrand(rand_mode);
00428            return FALSE;  // List empty
00429          }
00430       }
00431       index = nav_getindex();
00432 
00433       navauto_setrand(rand_mode);
00434       
00435       navauto_mov_explorer_reset();
00436       // Compute directory level
00437       g_navauto_u16_dir_level = 0;
00438       while(nav_dir_gotoparent())
00439         g_navauto_u16_dir_level++;
00440       g_navauto_u16_dir_level_root = g_navauto_u16_dir_level;
00441       //g_navauto_u16_dir_level  = pos;
00442       // Restore index
00443       nav_gotoindex(&index);
00444 
00445       g_navauto_u16_nb = 0xFFFF;
00446 
00447       if( NAVAUTO_RAND_OFF == navauto_getrand() )
00448         navauto_rand_init();
00449       
00450       if( nav_file_checkext( g_navauto_filter ))
00451       {
00452         // Valid file then update position with the first position but it is not the first !
00453         g_navauto_u16_pos = 1;
00454         return TRUE;
00455       }
00456 #endif
00457    }
00458    // Find first file or use the random feature
00459    state = navauto_mov(FS_FIND_NEXT, NAVAUTO_MOV_OPTS_NONE);
00460    if((NAVAUTO_MOV_OK_LOOP != state.status)
00461    && (NAVAUTO_MOV_OK      != state.status) )
00462       return FALSE;  // List empty
00463    return TRUE;
00464 }

U16 navauto_rand_choose ( void   ) 

This function returns a random position not already used.

Definition at line 236 of file nav_automatic.c.

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

00237 {
00238    U16 u16_i;
00239    U16 u16_nb_file_rand;
00240    U16 u16_pos_file_rand;
00241    
00242 navauto_rand_choose_restart:
00243    if( g_navauto_u16_nb == g_navauto_u16_rand_pos )
00244       return 0;   // All files have been selected, then and of random
00245 
00246    // Compute the range used in the bit table
00247    if( (g_navauto_u16_nb-g_navauto_u16_rand_pos) < (NAVAUTO_MAX_RANGE_RAND*8) )
00248       u16_nb_file_rand = g_navauto_u16_nb-g_navauto_u16_rand_pos;
00249    else
00250       u16_nb_file_rand = NAVAUTO_MAX_RANGE_RAND*8;
00251 
00252    // Table full ?
00253    u16_i = 0;
00254    while( 1 )
00255    {
00256       if( u16_nb_file_rand == u16_i )
00257       {
00258          // Table full then reset table and go to next part of file list
00259          memset( g_navauto_rand_tab , 0 , NAVAUTO_MAX_RANGE_RAND );
00260          g_navauto_u16_rand_pos += u16_nb_file_rand;
00261          goto navauto_rand_choose_restart;
00262       }
00263       if( 0 == (g_navauto_rand_tab[u16_i/8] & (1<<(u16_i%8))) )
00264          break;   // Not used position found
00265       u16_i++;
00266    }
00267 
00268    // Get random value
00269    NAVAUTO_GET_RAND(u16_i);
00270    if( u16_i == 0 ) u16_i = 1;
00271 
00272    // Compute the current position in rand table
00273    u16_pos_file_rand = g_navauto_u16_pos-g_navauto_u16_rand_pos-1;
00274 
00275    // Search not used position
00276    while( 0 != u16_i )
00277    {
00278       u16_pos_file_rand++;
00279       if( u16_pos_file_rand >= u16_nb_file_rand )
00280          u16_pos_file_rand = 0;
00281       if( 0 == (g_navauto_rand_tab[u16_pos_file_rand/8] & (1<<(u16_pos_file_rand%8))) )
00282          u16_i--;
00283    }
00284    // Position not used found
00285    g_navauto_rand_tab[u16_pos_file_rand/8] |= 1<<(u16_pos_file_rand%8); // Update table
00286    return (g_navauto_u16_rand_pos+u16_pos_file_rand+1);                // Send position
00287 }

void navauto_rand_init ( void   ) 

This function resets the random bit table.

Definition at line 226 of file nav_automatic.c.

References g_navauto_rand_tab, and g_navauto_u16_rand_pos.

Referenced by navauto_mov_explorer(), navauto_mov_playlist(), navauto_open(), and navauto_setrand().

00227 {
00228    // Init rand table
00229    memset( g_navauto_rand_tab , 0 , NAVAUTO_MAX_RANGE_RAND );
00230    g_navauto_u16_rand_pos = 0;
00231 }

Bool navauto_setmode ( Navauto_mode  exp_mode  ) 

This function sets the directory limitation of the file list.

Parameters:
exp_mode mode to select (NAVAUTO_MODE_DISKS, NAVAUTO_MODE_DIRONLY, NAVAUTO_MODE_DIRSUB)
Returns:
TRUE, mode changed

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.
//! 

Definition at line 185 of file nav_automatic.c.

References g_navauto_b_playlist, g_navauto_exp_mode, and navauto_open().

00186 {
00187    if( g_navauto_exp_mode == exp_mode )
00188       return TRUE;
00189    g_navauto_exp_mode = exp_mode;      
00190    if( g_navauto_b_playlist )
00191       return TRUE;
00192    return navauto_open( FALSE , 0 );   // Reopen navigation to recompute the file list size
00193 }

Bool navauto_setpos ( U16  u16_pos  ) 

This function selects a new position in fiel list.

Parameters:
u16_pos new position to select
Returns:
FALSE in case of error

Definition at line 548 of file nav_automatic.c.

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.

00549 {
00550    Bool b_direction;
00551    Navauto_rand rand_mode;
00552    Navauto_mov_state state;
00553    
00554    rand_mode = navauto_getrand();               // Save random mode
00555    state.status = NAVAUTO_MOV_OK;
00556    
00557    while( (u16_pos != g_navauto_u16_pos ) )
00558    {
00559      b_direction = ( u16_pos > g_navauto_u16_pos )? FS_FIND_NEXT : FS_FIND_PREV;
00560      state = navauto_mov( b_direction, NAVAUTO_MOV_OPTS_NONE );
00561    }
00562 
00563    navauto_setrand(rand_mode);                  // Restore random mode
00564 
00565    return (NAVAUTO_MOV_OK == state.status);
00566 }

void navauto_setrand ( Navauto_rand  rand  ) 

This function changes the random state.

Parameters:
rand random mode to use

Definition at line 210 of file nav_automatic.c.

References g_navauto_rand, g_navauto_rand_tab, g_navauto_u16_pos, and navauto_rand_init().

Referenced by navauto_open(), and navauto_setpos().

00211 {
00212    g_navauto_rand = rand;
00213    navauto_rand_init();
00214    // If current file in rand table
00215    if( g_navauto_u16_pos <= (NAVAUTO_MAX_RANGE_RAND*8) )
00216    {
00217       // Set current position in rand table
00218       U8 u8_pos_rand = g_navauto_u16_pos-1;
00219       g_navauto_rand_tab[u8_pos_rand/8] |= 1<<(u8_pos_rand%8);
00220    }
00221 }


Variable Documentation

Definition at line 151 of file nav_automatic.c.

If TRUE, then the file list contains files from play list file, else the file list contains files included in directories.

Definition at line 60 of file nav_automatic.c.

Referenced by 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 ).

Definition at line 61 of file nav_automatic.c.

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

Definition at line 67 of file nav_automatic.c.

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.

Definition at line 62 of file nav_automatic.c.

Referenced by navauto_getrand(), navauto_mov_explorer(), navauto_mov_playlist(), and navauto_setrand().

_MEM_TYPE_SLOW_ U8 g_navauto_rand_tab[NAVAUTO_MAX_RANGE_RAND]

Bit table used to random the file list. This one flag each files already selected.

Definition at line 69 of file nav_automatic.c.

Referenced by navauto_rand_choose(), navauto_rand_init(), and navauto_setrand().

_MEM_TYPE_SLOW_ U16 g_navauto_u16_dir_level

_MEM_TYPE_SLOW_ U16 g_navauto_u16_dir_level_root

_MEM_TYPE_SLOW_ U16 g_navauto_u16_nb = 0

Number of file included in file list (correct only if define FS_NAV_AUTOMATIC_NBFILE enabled).

Definition at line 63 of file nav_automatic.c.

Referenced by navauto_getnb(), navauto_init(), navauto_mov_explorer(), navauto_mov_explorer_reset(), navauto_open(), and navauto_rand_choose().

_MEM_TYPE_SLOW_ U16 g_navauto_u16_pos

_MEM_TYPE_SLOW_ U16 g_navauto_u16_rand_pos

Offset of bit table "g_navauto_rand_tab" in file list.

Definition at line 68 of file nav_automatic.c.

Referenced by navauto_rand_choose(), and navauto_rand_init().

Initial value:

This table describes what to do once the navigator reaches a limit while browsing directories.


  • is_dir_process_fct[0] is the function called on a previous command.
  • is_dir_process_fct[1] is the function called on a next command.

Definition at line 117 of file nav_automatic.c.

Referenced by navauto_mov_explorer_is_dir().

Initial value:

This table describes what to do once the navigator reaches a limit while browsing files.


  • is_file_process_fct[0] is the function called on a previous command.
  • is_file_process_fct[1] is the function called on a next command.

Definition at line 132 of file nav_automatic.c.

Referenced by navauto_mov_explorer_is_file().

Initial value:

This table describes what to do once the navigator reaches the limit of the "playlist".

  • is_file_process_fct[0] is the function called on a previous command.
  • is_file_process_fct[1] is the function called on a next command.

Definition at line 146 of file nav_automatic.c.

Referenced by navauto_mov_explorer().

Initial value:

This table describes what the action list to process one a new folder is accessed.


  • is_dir_process_fct[0] = first action
  • is_dir_process_fct[1] = second action
  • ...

Definition at line 102 of file nav_automatic.c.

Referenced by navauto_mov_explorer_new_dir().


Generated on Fri Feb 19 02:29:45 2010 for AVR32 UC3 - FSACCESS Services by  doxygen 1.5.5