webradio/favlist.h File Reference


Detailed Description

Configuration items.

 *
 * $Id$
 *
 * 

Definition in file favlist.h.

Go to the source code of this file.

Defines

#define MAX_FAVORITES   128
#define TOP_FAVORITE   0
#define LAST_FAVORITE   1

Functions

int FavListSet (int idx, CONST char *symbol, CONST char *uri)
 Set favorite list entry.
int FavListCopy (int src, int dst)
 Copy a favorites list entry.
int FavListSearch (int idx, int dir)
 Search favorite radio station.
size_t FavListSize (void)
 Calculate total size of the favorites list.
int FavListSave (void)
 Save favorites list in non-volatile memory.
int FavListLoad (void)
 Load favorites list from non-volatile memory.
void FavListResetFactory (void)
 Set pre-configured favorites list.

Variables

RADIOSTATION favlist [MAX_FAVORITES]


Define Documentation

#define MAX_FAVORITES   128

Definition at line 52 of file favlist.h.

Referenced by CgiFavoritesControl(), CgiShoutCastControl(), CgiStationFavorites(), ConfigSize(), FavListClear(), FavListLoad(), FavListResetFactory(), FavListSave(), FavListSearch(), FavListSet(), and FavListSize().

#define TOP_FAVORITE   0

Definition at line 58 of file favlist.h.

Referenced by CgiFavoritesControl(), CgiShoutCastControl(), main(), and UserIfMainMenu().

#define LAST_FAVORITE   1

Definition at line 59 of file favlist.h.

Referenced by CgiStationFavorites(), FavListLoad(), FavListResetFactory(), FavListSave(), FavListSearch(), FavListSet(), main(), and UserIfShowStatus().


Function Documentation

int FavListSet ( int  idx,
CONST char *  name,
CONST char *  uri 
)

Set favorite list entry.

Parameters:
idx Index of the entry. Use MAX_FAVORITES to add a new entry.
name Name of the station. Must be provided, if a new station is added. May be NULL when adding a URI. When used with an existing entry, the current name will be replaced.
uri URI of the stream, that will be added. If NULL, then all existing entries are cleared. If both, the name and the URI are NULL, then the list entry is cleared.
Returns:
Entry index on success, -1 otherwise.

Definition at line 123 of file favlist.c.

References LAST_FAVORITE, LOG_CONFIG, LogMsg(), MAX_FAVORITES, MAXNUM_STREAMS, RADIOSTATION::rs_name, RADIOSTATION::rs_streams, RADIOSTATION::rs_uri, and strdup().

Here is the call graph for this function:

LogMsgstrdup

int FavListCopy ( int  src,
int  dst 
)

Copy a favorites list entry.

Parameters:
src Index of the source entry.
dst Index of the destination entry.
Returns:
0 on success, -1 otherwise.

Definition at line 178 of file favlist.c.

References LOG_CONFIG, LogMsg(), RADIOSTATION::rs_name, RADIOSTATION::rs_streams, RADIOSTATION::rs_uri, and strdup().

Here is the call graph for this function:

LogMsgstrdup

int FavListSearch ( int  idx,
int  dir 
)

Search favorite radio station.

Parameters:
idx Start index.
dir Direction to search, 1 (forward) or -1 (backwards).
Returns:
Index of the new station or -1 if none available.

Definition at line 219 of file favlist.c.

References LAST_FAVORITE, LOG_CONFIG, LogMsg(), and MAX_FAVORITES.

Here is the call graph for this function:

LogMsg

size_t FavListSize ( void   ) 

Calculate total size of the favorites list.

Returns:
Number of bytes used.

Definition at line 249 of file favlist.c.

References MAX_FAVORITES, RADIOSTATION::rs_name, RADIOSTATION::rs_streams, and RADIOSTATION::rs_uri.

int FavListSave ( void   ) 

Save favorites list in non-volatile memory.

Returns:
0 on success, -1 otherwise.

Definition at line 275 of file favlist.c.

References ConfigFlush(), ConfigRewind(), ConfigSaveString(), FAVLIST_MAGIC, FAVLIST_SECTOR, LAST_FAVORITE, LOG_CONFIG, LogMsg(), MAX_FAVORITES, RADIOSTATION::rs_name, RADIOSTATION::rs_streams, and RADIOSTATION::rs_uri.

Here is the call graph for this function:

ConfigFlushConfigRewindConfigSaveStringLogMsg

int FavListLoad ( void   ) 

Load favorites list from non-volatile memory.

Returns:
0 on success, -1 otherwise.

Definition at line 316 of file favlist.c.

References ConfigLoadString(), ConfigRewind(), FAVLIST_MAGIC, FAVLIST_SECTOR, FavListClear(), LAST_FAVORITE, LOG_CONFIG, LogMsg(), MAX_FAVORITES, MAXNUM_STREAMS, RADIOSTATION::rs_name, RADIOSTATION::rs_streams, RADIOSTATION::rs_uri, and strdup().

Here is the call graph for this function:

ConfigLoadStringConfigRewindFavListClearLogMsgstrdup

void FavListResetFactory ( void   ) 

Set pre-configured favorites list.

Definition at line 356 of file favlist.c.

References FavListClear(), FavListCopy(), FavListSet(), LAST_FAVORITE, and MAX_FAVORITES.

Here is the call graph for this function:

FavListClearFavListCopyFavListSet


Variable Documentation

RADIOSTATION favlist[MAX_FAVORITES]

Definition at line 84 of file favlist.c.


© 2008 by egnite GmbH - visit www.ethernut.de