forked from len0rd/rockbox
Const police raid.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17474 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8ea9b94cd9
commit
ad95df2cab
11 changed files with 32 additions and 29 deletions
|
@ -552,7 +552,7 @@ int ft_enter(struct tree_context* c)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
char* plugin;
|
const char* plugin;
|
||||||
|
|
||||||
if (global_settings.party_mode) {
|
if (global_settings.party_mode) {
|
||||||
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE));
|
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE));
|
||||||
|
|
|
@ -518,5 +518,5 @@ int filetype_load_plugin(const char* plugin, char* file)
|
||||||
return PLUGIN_ERROR;
|
return PLUGIN_ERROR;
|
||||||
snprintf(plugin_name, MAX_PATH, "%s/%s.%s",
|
snprintf(plugin_name, MAX_PATH, "%s/%s.%s",
|
||||||
PLUGIN_DIR, filetypes[i].plugin, ROCK_EXTENSION);
|
PLUGIN_DIR, filetypes[i].plugin, ROCK_EXTENSION);
|
||||||
return plugin_load(plugin_name,file);
|
return plugin_load(plugin_name, file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ void read_color_theme_file(void);
|
||||||
/* Return the attribute (FILE_ATTR_*) of the file */
|
/* Return the attribute (FILE_ATTR_*) of the file */
|
||||||
int filetype_get_attr(const char* file);
|
int filetype_get_attr(const char* file);
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
int filetype_get_color(const char * name, int attr);
|
int filetype_get_color(const char* name, int attr);
|
||||||
#endif
|
#endif
|
||||||
int filetype_get_icon(int attr);
|
int filetype_get_icon(int attr);
|
||||||
/* return the plugin filename associated with the file */
|
/* return the plugin filename associated with the file */
|
||||||
|
|
|
@ -42,7 +42,7 @@ static bool main_backdrop_valid = false;
|
||||||
static bool wps_backdrop_valid = false;
|
static bool wps_backdrop_valid = false;
|
||||||
|
|
||||||
/* load a backdrop into a buffer */
|
/* load a backdrop into a buffer */
|
||||||
static bool load_backdrop(char* filename, fb_data* backdrop_buffer)
|
static bool load_backdrop(const char* filename, fb_data* backdrop_buffer)
|
||||||
{
|
{
|
||||||
struct bitmap bm;
|
struct bitmap bm;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -62,13 +62,13 @@ static bool load_backdrop(char* filename, fb_data* backdrop_buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool load_main_backdrop(char* filename)
|
bool load_main_backdrop(const char* filename)
|
||||||
{
|
{
|
||||||
main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]);
|
main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]);
|
||||||
return main_backdrop_valid;
|
return main_backdrop_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool load_wps_backdrop(char* filename)
|
bool load_wps_backdrop(const char* filename)
|
||||||
{
|
{
|
||||||
wps_backdrop_valid = load_backdrop(filename, &wps_backdrop[0][0]);
|
wps_backdrop_valid = load_backdrop(filename, &wps_backdrop[0][0]);
|
||||||
return wps_backdrop_valid;
|
return wps_backdrop_valid;
|
||||||
|
@ -104,7 +104,7 @@ void show_wps_backdrop(void)
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
||||||
|
|
||||||
static bool load_remote_backdrop(char* filename, fb_remote_data* backdrop_buffer)
|
static bool load_remote_backdrop(const char* filename, fb_remote_data* backdrop_buffer)
|
||||||
{
|
{
|
||||||
struct bitmap bm;
|
struct bitmap bm;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
|
|
||||||
bool load_main_backdrop(char* filename);
|
bool load_main_backdrop(const char* filename);
|
||||||
bool load_wps_backdrop(char* filename);
|
bool load_wps_backdrop(const char* filename);
|
||||||
|
|
||||||
void unload_main_backdrop(void);
|
void unload_main_backdrop(void);
|
||||||
void unload_wps_backdrop(void);
|
void unload_wps_backdrop(void);
|
||||||
|
@ -37,7 +37,7 @@ void show_wps_backdrop(void);
|
||||||
#endif /* LCD_DEPTH > 1 */
|
#endif /* LCD_DEPTH > 1 */
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
||||||
bool load_remote_wps_backdrop(char* filename);
|
bool load_remote_wps_backdrop(const char* filename);
|
||||||
void unload_remote_wps_backdrop(void);
|
void unload_remote_wps_backdrop(void);
|
||||||
void show_remote_wps_backdrop(void);
|
void show_remote_wps_backdrop(void);
|
||||||
void show_remote_main_backdrop(void); /* only clears the wps backdrop */
|
void show_remote_main_backdrop(void); /* only clears the wps backdrop */
|
||||||
|
|
|
@ -179,7 +179,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion);
|
||||||
static int get_previous_directory(char *dir);
|
static int get_previous_directory(char *dir);
|
||||||
static int check_subdir_for_music(char *dir, char *subdir);
|
static int check_subdir_for_music(char *dir, char *subdir);
|
||||||
static int format_track_path(char *dest, char *src, int buf_length, int max,
|
static int format_track_path(char *dest, char *src, int buf_length, int max,
|
||||||
char *dir);
|
const char *dir);
|
||||||
static void display_playlist_count(int count, const unsigned char *fmt,
|
static void display_playlist_count(int count, const unsigned char *fmt,
|
||||||
bool final);
|
bool final);
|
||||||
static void display_buffer_full(void);
|
static void display_buffer_full(void);
|
||||||
|
@ -317,24 +317,26 @@ static void empty_playlist(struct playlist_info* playlist, bool resume)
|
||||||
static void new_playlist(struct playlist_info* playlist, const char *dir,
|
static void new_playlist(struct playlist_info* playlist, const char *dir,
|
||||||
const char *file)
|
const char *file)
|
||||||
{
|
{
|
||||||
|
const char *fileused = file;
|
||||||
|
const char *dirused = dir;
|
||||||
empty_playlist(playlist, false);
|
empty_playlist(playlist, false);
|
||||||
|
|
||||||
if (!file)
|
if (!fileused)
|
||||||
{
|
{
|
||||||
file = "";
|
fileused = "";
|
||||||
|
|
||||||
if (dir && playlist->current) /* !current cannot be in_ram */
|
if (dirused && playlist->current) /* !current cannot be in_ram */
|
||||||
playlist->in_ram = true;
|
playlist->in_ram = true;
|
||||||
else
|
else
|
||||||
dir = ""; /* empty playlist */
|
dirused = ""; /* empty playlist */
|
||||||
}
|
}
|
||||||
|
|
||||||
update_playlist_filename(playlist, dir, file);
|
update_playlist_filename(playlist, dirused, fileused);
|
||||||
|
|
||||||
if (playlist->control_fd >= 0)
|
if (playlist->control_fd >= 0)
|
||||||
{
|
{
|
||||||
update_control(playlist, PLAYLIST_COMMAND_PLAYLIST,
|
update_control(playlist, PLAYLIST_COMMAND_PLAYLIST,
|
||||||
PLAYLIST_CONTROL_FILE_VERSION, -1, dir, file, NULL);
|
PLAYLIST_CONTROL_FILE_VERSION, -1, dirused, fileused, NULL);
|
||||||
sync_control(playlist, false);
|
sync_control(playlist, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1676,7 +1678,7 @@ static int check_subdir_for_music(char *dir, char *subdir)
|
||||||
* Returns absolute path of track
|
* Returns absolute path of track
|
||||||
*/
|
*/
|
||||||
static int format_track_path(char *dest, char *src, int buf_length, int max,
|
static int format_track_path(char *dest, char *src, int buf_length, int max,
|
||||||
char *dir)
|
const char *dir)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int j;
|
int j;
|
||||||
|
@ -2953,13 +2955,13 @@ int playlist_insert_directory(struct playlist_info* playlist,
|
||||||
/*
|
/*
|
||||||
* Insert all tracks from specified playlist into dynamic playlist.
|
* Insert all tracks from specified playlist into dynamic playlist.
|
||||||
*/
|
*/
|
||||||
int playlist_insert_playlist(struct playlist_info* playlist, char *filename,
|
int playlist_insert_playlist(struct playlist_info* playlist, const char *filename,
|
||||||
int position, bool queue)
|
int position, bool queue)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int max;
|
int max;
|
||||||
char *temp_ptr;
|
char *temp_ptr;
|
||||||
char *dir;
|
const char *dir;
|
||||||
unsigned char *count_str;
|
unsigned char *count_str;
|
||||||
char temp_buf[MAX_PATH+1];
|
char temp_buf[MAX_PATH+1];
|
||||||
char trackname[MAX_PATH+1];
|
char trackname[MAX_PATH+1];
|
||||||
|
|
|
@ -142,7 +142,7 @@ int playlist_insert_track(struct playlist_info* playlist, const char *filename,
|
||||||
int playlist_insert_directory(struct playlist_info* playlist,
|
int playlist_insert_directory(struct playlist_info* playlist,
|
||||||
const char *dirname, int position, bool queue,
|
const char *dirname, int position, bool queue,
|
||||||
bool recurse);
|
bool recurse);
|
||||||
int playlist_insert_playlist(struct playlist_info* playlist, char *filename,
|
int playlist_insert_playlist(struct playlist_info* playlist, const char *filename,
|
||||||
int position, bool queue);
|
int position, bool queue);
|
||||||
void playlist_skip_entry(struct playlist_info *playlist, int steps);
|
void playlist_skip_entry(struct playlist_info *playlist, int steps);
|
||||||
int playlist_delete(struct playlist_info* playlist, int index);
|
int playlist_delete(struct playlist_info* playlist, int index);
|
||||||
|
|
|
@ -323,7 +323,7 @@ static int add_track_to_playlist(char* filename, void* context)
|
||||||
|
|
||||||
/* Add "sel" file into specified "playlist". How to insert depends on type
|
/* Add "sel" file into specified "playlist". How to insert depends on type
|
||||||
of file */
|
of file */
|
||||||
static int add_to_playlist(const char* playlist, char* sel, int sel_attr)
|
static int add_to_playlist(const char* playlist, const char* sel, int sel_attr)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int result = -1;
|
int result = -1;
|
||||||
|
@ -419,7 +419,7 @@ bool catalog_view_playlists(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool catalog_add_to_a_playlist(char* sel, int sel_attr,
|
bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
|
||||||
bool new_playlist, char *m3u8name)
|
bool new_playlist, char *m3u8name)
|
||||||
{
|
{
|
||||||
char playlist[MAX_PATH];
|
char playlist[MAX_PATH];
|
||||||
|
|
|
@ -35,7 +35,7 @@ bool catalog_view_playlists(void);
|
||||||
* m3u8name : filename to save the playlist to, NULL to show the keyboard
|
* m3u8name : filename to save the playlist to, NULL to show the keyboard
|
||||||
* ret : true if the file was successfully added
|
* ret : true if the file was successfully added
|
||||||
*/
|
*/
|
||||||
bool catalog_add_to_a_playlist(char* sel, int sel_attr,
|
bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
|
||||||
bool new_playlist, char* m3u8name);
|
bool new_playlist, char* m3u8name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -116,7 +116,7 @@ static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer
|
||||||
int index);
|
int index);
|
||||||
|
|
||||||
static bool playlist_viewer_init(struct playlist_viewer * viewer,
|
static bool playlist_viewer_init(struct playlist_viewer * viewer,
|
||||||
char* filename, bool reload);
|
const char* filename, bool reload);
|
||||||
|
|
||||||
static void format_name(char* dest, const char* src);
|
static void format_name(char* dest, const char* src);
|
||||||
static void format_line(const struct playlist_entry* track, char* str,
|
static void format_line(const struct playlist_entry* track, char* str,
|
||||||
|
@ -271,7 +271,7 @@ static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer
|
||||||
|
|
||||||
/* Initialize the playlist viewer. */
|
/* Initialize the playlist viewer. */
|
||||||
static bool playlist_viewer_init(struct playlist_viewer * viewer,
|
static bool playlist_viewer_init(struct playlist_viewer * viewer,
|
||||||
char* filename, bool reload)
|
const char* filename, bool reload)
|
||||||
{
|
{
|
||||||
char* buffer;
|
char* buffer;
|
||||||
size_t buffer_size;
|
size_t buffer_size;
|
||||||
|
@ -304,7 +304,8 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Viewing playlist on disk */
|
/* Viewing playlist on disk */
|
||||||
char *dir, *file, *temp_ptr;
|
const char *dir, *file;
|
||||||
|
char *temp_ptr;
|
||||||
char *index_buffer = NULL;
|
char *index_buffer = NULL;
|
||||||
ssize_t index_buffer_size = 0;
|
ssize_t index_buffer_size = 0;
|
||||||
|
|
||||||
|
@ -591,7 +592,7 @@ static int playlist_callback_icons(int selected_item, void *data)
|
||||||
|
|
||||||
/* Main viewer function. Filename identifies playlist to be viewed. If NULL,
|
/* Main viewer function. Filename identifies playlist to be viewed. If NULL,
|
||||||
view current playlist. */
|
view current playlist. */
|
||||||
bool playlist_viewer_ex(char* filename)
|
bool playlist_viewer_ex(const char* filename)
|
||||||
{
|
{
|
||||||
bool ret = false; /* return value */
|
bool ret = false; /* return value */
|
||||||
bool exit=false; /* exit viewer */
|
bool exit=false; /* exit viewer */
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#define _PLAYLIST_VIEWER_H_
|
#define _PLAYLIST_VIEWER_H_
|
||||||
|
|
||||||
bool playlist_viewer(void);
|
bool playlist_viewer(void);
|
||||||
bool playlist_viewer_ex(char* filename);
|
bool playlist_viewer_ex(const char* filename);
|
||||||
bool search_playlist(void);
|
bool search_playlist(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue