* * $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 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().
int FavListSet | ( | int | idx, | |
CONST char * | name, | |||
CONST char * | uri | |||
) |
Set favorite list entry.
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. |
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().
int FavListCopy | ( | int | src, | |
int | dst | |||
) |
Copy a favorites list entry.
src | Index of the source entry. | |
dst | Index of the destination entry. |
Definition at line 178 of file favlist.c.
References LOG_CONFIG, LogMsg(), RADIOSTATION::rs_name, RADIOSTATION::rs_streams, RADIOSTATION::rs_uri, and strdup().
int FavListSearch | ( | int | idx, | |
int | dir | |||
) |
Search favorite radio station.
idx | Start index. | |
dir | Direction to search, 1 (forward) or -1 (backwards). |
Definition at line 219 of file favlist.c.
References LAST_FAVORITE, LOG_CONFIG, LogMsg(), and MAX_FAVORITES.
size_t FavListSize | ( | void | ) |
Calculate total size of the favorites list.
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.
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.
int FavListLoad | ( | void | ) |
Load favorites list from non-volatile memory.
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().
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.
RADIOSTATION favlist[MAX_FAVORITES] |