summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Levin <al.le@rockbox.org>2010-07-06 16:53:52 +0000
committerAlexander Levin <al.le@rockbox.org>2010-07-06 16:53:52 +0000
commit7d4c0c5e7ed2ef0a87008db2250d4ae5aff8609a (patch)
treec1d546a4ba3f1bdcf35381e689f2d0fe2293bd3d
parent76f2b9c6056d3b5dd29503fa77323aac5088e1e6 (diff)
downloadrockbox-7d4c0c5e7ed2ef0a87008db2250d4ae5aff8609a.tar.gz
rockbox-7d4c0c5e7ed2ef0a87008db2250d4ae5aff8609a.zip
Rename functions so that the code is easier to read
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27313 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/bookmark.c16
-rw-r--r--apps/bookmark.h2
-rw-r--r--apps/onplay.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index b8d41c7464..b2ff1aafbc 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -94,7 +94,7 @@ static const char* get_bookmark_info(int list_index,
94 char *buffer, 94 char *buffer,
95 size_t buffer_len); 95 size_t buffer_len);
96static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resume); 96static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resume);
97static bool system_check(void); 97static bool is_bookmarkable_state(void);
98static bool write_bookmark(bool create_bookmark_file, const char *bookmark); 98static bool write_bookmark(bool create_bookmark_file, const char *bookmark);
99static int get_bookmark_count(const char* bookmark_file_name); 99static int get_bookmark_count(const char* bookmark_file_name);
100 100
@@ -125,7 +125,7 @@ bool bookmark_create_menu(void)
125/* ----------------------------------------------------------------------- */ 125/* ----------------------------------------------------------------------- */
126bool bookmark_load_menu(void) 126bool bookmark_load_menu(void)
127{ 127{
128 if (system_check()) 128 if (is_bookmarkable_state())
129 { 129 {
130 char* name = playlist_get_name(NULL, global_temp_buffer, 130 char* name = playlist_get_name(NULL, global_temp_buffer,
131 sizeof(global_temp_buffer)); 131 sizeof(global_temp_buffer));
@@ -167,11 +167,11 @@ bool bookmark_autobookmark(bool prompt_ok)
167{ 167{
168 char* bookmark; 168 char* bookmark;
169 bool update = false; 169 bool update = false;
170 if (!system_check()) 170 if (!is_bookmarkable_state())
171 return false; 171 return false;
172 172
173 audio_pause(); /* first pause playback */ 173 audio_pause(); /* first pause playback */
174 if (global_settings.autoupdatebookmark && bookmark_exist()) 174 if (global_settings.autoupdatebookmark && bookmark_exists())
175 update = true; 175 update = true;
176 bookmark = create_bookmark(); 176 bookmark = create_bookmark();
177 /* Workaround for inability to speak when paused: all callers will 177 /* Workaround for inability to speak when paused: all callers will
@@ -324,7 +324,7 @@ static char* create_bookmark()
324 int resume_index = 0; 324 int resume_index = 0;
325 char *file; 325 char *file;
326 326
327 if (!system_check()) 327 if (!is_bookmarkable_state())
328 return NULL; /* something didn't happen correctly, do nothing */ 328 return NULL; /* something didn't happen correctly, do nothing */
329 329
330 /* grab the currently playing track */ 330 /* grab the currently playing track */
@@ -1063,11 +1063,11 @@ static bool generate_bookmark_file_name(const char *in)
1063/* ----------------------------------------------------------------------- */ 1063/* ----------------------------------------------------------------------- */
1064/* Returns true if a bookmark file exists for the current playlist */ 1064/* Returns true if a bookmark file exists for the current playlist */
1065/* ----------------------------------------------------------------------- */ 1065/* ----------------------------------------------------------------------- */
1066bool bookmark_exist(void) 1066bool bookmark_exists(void)
1067{ 1067{
1068 bool exist=false; 1068 bool exist=false;
1069 1069
1070 if(system_check()) 1070 if(is_bookmarkable_state())
1071 { 1071 {
1072 char* name = playlist_get_name(NULL, global_temp_buffer, 1072 char* name = playlist_get_name(NULL, global_temp_buffer,
1073 sizeof(global_temp_buffer)); 1073 sizeof(global_temp_buffer));
@@ -1084,7 +1084,7 @@ bool bookmark_exist(void)
1084/* Checks the current state of the system and returns true if it is in a */ 1084/* Checks the current state of the system and returns true if it is in a */
1085/* bookmarkable state. */ 1085/* bookmarkable state. */
1086/* ----------------------------------------------------------------------- */ 1086/* ----------------------------------------------------------------------- */
1087static bool system_check(void) 1087static bool is_bookmarkable_state(void)
1088{ 1088{
1089 int resume_index = 0; 1089 int resume_index = 0;
1090 1090
diff --git a/apps/bookmark.h b/apps/bookmark.h
index bde8e84697..4b61edba9b 100644
--- a/apps/bookmark.h
+++ b/apps/bookmark.h
@@ -29,7 +29,7 @@ bool bookmark_create_menu(void);
29bool bookmark_mrb_load(void); 29bool bookmark_mrb_load(void);
30bool bookmark_autoload(const char* file); 30bool bookmark_autoload(const char* file);
31bool bookmark_load(const char* file, bool autoload); 31bool bookmark_load(const char* file, bool autoload);
32bool bookmark_exist(void); 32bool bookmark_exists(void);
33 33
34#endif /* __BOOKMARK_H__ */ 34#endif /* __BOOKMARK_H__ */
35 35
diff --git a/apps/onplay.c b/apps/onplay.c
index 915f48e479..72912579f9 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -106,7 +106,7 @@ static int bookmark_menu_callback(int action,
106 case ACTION_REQUEST_MENUITEM: 106 case ACTION_REQUEST_MENUITEM:
107 if (this_item == &bookmark_load_menu_item) 107 if (this_item == &bookmark_load_menu_item)
108 { 108 {
109 if (bookmark_exist() == 0) 109 if (!bookmark_exists())
110 return ACTION_EXIT_MENUITEM; 110 return ACTION_EXIT_MENUITEM;
111 } 111 }
112 /* hide the bookmark menu if there is no playback */ 112 /* hide the bookmark menu if there is no playback */