summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 0358b6adc4..9d88e210f8 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -288,7 +288,7 @@ static void create_control(struct playlist_info* playlist)
288 { 288 {
289 if (check_rockboxdir()) 289 if (check_rockboxdir())
290 { 290 {
291 gui_syncsplash(HZ*2, true, (unsigned char *)"%s (%d)", 291 gui_syncsplash(HZ*2, (unsigned char *)"%s (%d)",
292 str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR), 292 str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
293 playlist->control_fd); 293 playlist->control_fd);
294 } 294 }
@@ -484,7 +484,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
484 lcd_setmargins(0, 0); 484 lcd_setmargins(0, 0);
485#endif 485#endif
486 486
487 gui_syncsplash(0, true, str(LANG_PLAYLIST_LOAD)); 487 gui_syncsplash(0, str(LANG_PLAYLIST_LOAD));
488 488
489 if (!buffer) 489 if (!buffer)
490 { 490 {
@@ -1348,9 +1348,9 @@ static int get_filename(struct playlist_info* playlist, int index, int seek,
1348 if (max < 0) 1348 if (max < 0)
1349 { 1349 {
1350 if (control_file) 1350 if (control_file)
1351 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1351 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1352 else 1352 else
1353 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 1353 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_ACCESS_ERROR));
1354 1354
1355 return max; 1355 return max;
1356 } 1356 }
@@ -1440,7 +1440,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion)
1440 1440
1441 if (ft_load(tc, (dir[0]=='\0')?"/":dir) < 0) 1441 if (ft_load(tc, (dir[0]=='\0')?"/":dir) < 0)
1442 { 1442 {
1443 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); 1443 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
1444 exit = true; 1444 exit = true;
1445 result = -1; 1445 result = -1;
1446 break; 1446 break;
@@ -1525,7 +1525,7 @@ static int check_subdir_for_music(char *dir, char *subdir)
1525 1525
1526 if (ft_load(tc, dir) < 0) 1526 if (ft_load(tc, dir) < 0)
1527 { 1527 {
1528 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); 1528 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
1529 return -2; 1529 return -2;
1530 } 1530 }
1531 1531
@@ -1578,7 +1578,7 @@ static int check_subdir_for_music(char *dir, char *subdir)
1578 1578
1579 /* we now need to reload our current directory */ 1579 /* we now need to reload our current directory */
1580 if(ft_load(tc, dir) < 0) 1580 if(ft_load(tc, dir) < 0)
1581 gui_syncsplash(HZ*2, true, 1581 gui_syncsplash(HZ*2,
1582 str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); 1582 str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
1583 } 1583 }
1584 1584
@@ -1663,7 +1663,7 @@ static void display_playlist_count(int count, const unsigned char *fmt)
1663 lcd_setmargins(0, 0); 1663 lcd_setmargins(0, 0);
1664#endif 1664#endif
1665 1665
1666 gui_syncsplash(0, true, fmt, count, 1666 gui_syncsplash(0, fmt, count,
1667#if CONFIG_KEYPAD == PLAYER_PAD 1667#if CONFIG_KEYPAD == PLAYER_PAD
1668 str(LANG_STOP_ABORT) 1668 str(LANG_STOP_ABORT)
1669#else 1669#else
@@ -1677,7 +1677,7 @@ static void display_playlist_count(int count, const unsigned char *fmt)
1677 */ 1677 */
1678static void display_buffer_full(void) 1678static void display_buffer_full(void)
1679{ 1679{
1680 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_BUFFER_FULL)); 1680 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_BUFFER_FULL));
1681} 1681}
1682 1682
1683/* 1683/*
@@ -1756,7 +1756,7 @@ static int flush_cached_control(struct playlist_info* playlist)
1756 else 1756 else
1757 { 1757 {
1758 result = -1; 1758 result = -1;
1759 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 1759 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
1760 } 1760 }
1761 1761
1762 return result; 1762 return result;
@@ -1943,11 +1943,11 @@ int playlist_resume(void)
1943 1943
1944 empty_playlist(playlist, true); 1944 empty_playlist(playlist, true);
1945 1945
1946 gui_syncsplash(0, true, str(LANG_WAIT)); 1946 gui_syncsplash(0, str(LANG_WAIT));
1947 playlist->control_fd = open(playlist->control_filename, O_RDWR); 1947 playlist->control_fd = open(playlist->control_filename, O_RDWR);
1948 if (playlist->control_fd < 0) 1948 if (playlist->control_fd < 0)
1949 { 1949 {
1950 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1950 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1951 return -1; 1951 return -1;
1952 } 1952 }
1953 playlist->control_created = true; 1953 playlist->control_created = true;
@@ -1955,7 +1955,7 @@ int playlist_resume(void)
1955 control_file_size = filesize(playlist->control_fd); 1955 control_file_size = filesize(playlist->control_fd);
1956 if (control_file_size <= 0) 1956 if (control_file_size <= 0)
1957 { 1957 {
1958 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1958 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1959 return -1; 1959 return -1;
1960 } 1960 }
1961 1961
@@ -1964,7 +1964,7 @@ int playlist_resume(void)
1964 PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen); 1964 PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen);
1965 if(nread <= 0) 1965 if(nread <= 0)
1966 { 1966 {
1967 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1967 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1968 return -1; 1968 return -1;
1969 } 1969 }
1970 1970
@@ -1990,7 +1990,7 @@ int playlist_resume(void)
1990 /* So a splash while we are loading. */ 1990 /* So a splash while we are loading. */
1991 if (current_tick - last_tick > HZ/4) 1991 if (current_tick - last_tick > HZ/4)
1992 { 1992 {
1993 gui_syncsplash(0, true, str(LANG_LOADING_PERCENT), 1993 gui_syncsplash(0, str(LANG_LOADING_PERCENT),
1994 (total_read+count)*100/control_file_size, 1994 (total_read+count)*100/control_file_size,
1995#if CONFIG_KEYPAD == PLAYER_PAD 1995#if CONFIG_KEYPAD == PLAYER_PAD
1996 str(LANG_STOP_ABORT) 1996 str(LANG_STOP_ABORT)
@@ -2264,7 +2264,7 @@ int playlist_resume(void)
2264 2264
2265 if (result < 0) 2265 if (result < 0)
2266 { 2266 {
2267 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_INVALID)); 2267 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_INVALID));
2268 return result; 2268 return result;
2269 } 2269 }
2270 2270
@@ -2273,7 +2273,7 @@ int playlist_resume(void)
2273 if ((total_read + count) >= control_file_size) 2273 if ((total_read + count) >= control_file_size)
2274 { 2274 {
2275 /* no newline at end of control file */ 2275 /* no newline at end of control file */
2276 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_INVALID)); 2276 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_INVALID));
2277 return -1; 2277 return -1;
2278 } 2278 }
2279 2279
@@ -2367,7 +2367,7 @@ int playlist_shuffle(int random_seed, int start_index)
2367 start_current = true; 2367 start_current = true;
2368 } 2368 }
2369 2369
2370 gui_syncsplash(0, true, str(LANG_PLAYLIST_SHUFFLE)); 2370 gui_syncsplash(0, str(LANG_PLAYLIST_SHUFFLE));
2371 2371
2372 randomise_playlist(playlist, random_seed, start_current, true); 2372 randomise_playlist(playlist, random_seed, start_current, true);
2373 2373
@@ -2859,7 +2859,7 @@ int playlist_insert_track(struct playlist_info* playlist, const char *filename,
2859 2859
2860 if (check_control(playlist) < 0) 2860 if (check_control(playlist) < 0)
2861 { 2861 {
2862 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 2862 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
2863 return -1; 2863 return -1;
2864 } 2864 }
2865 2865
@@ -2890,7 +2890,7 @@ int playlist_insert_directory(struct playlist_info* playlist,
2890 2890
2891 if (check_control(playlist) < 0) 2891 if (check_control(playlist) < 0)
2892 { 2892 {
2893 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 2893 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
2894 return -1; 2894 return -1;
2895 } 2895 }
2896 2896
@@ -2956,14 +2956,14 @@ int playlist_insert_playlist(struct playlist_info* playlist, char *filename,
2956 2956
2957 if (check_control(playlist) < 0) 2957 if (check_control(playlist) < 0)
2958 { 2958 {
2959 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 2959 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
2960 return -1; 2960 return -1;
2961 } 2961 }
2962 2962
2963 fd = open(filename, O_RDONLY); 2963 fd = open(filename, O_RDONLY);
2964 if (fd < 0) 2964 if (fd < 0)
2965 { 2965 {
2966 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 2966 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_ACCESS_ERROR));
2967 return -1; 2967 return -1;
2968 } 2968 }
2969 2969
@@ -3076,7 +3076,7 @@ int playlist_delete(struct playlist_info* playlist, int index)
3076 3076
3077 if (check_control(playlist) < 0) 3077 if (check_control(playlist) < 0)
3078 { 3078 {
3079 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 3079 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
3080 return -1; 3080 return -1;
3081 } 3081 }
3082 3082
@@ -3111,7 +3111,7 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
3111 3111
3112 if (check_control(playlist) < 0) 3112 if (check_control(playlist) < 0)
3113 { 3113 {
3114 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 3114 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
3115 return -1; 3115 return -1;
3116 } 3116 }
3117 3117
@@ -3374,7 +3374,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
3374 if (playlist->buffer_size < (int)(playlist->amount * sizeof(int))) 3374 if (playlist->buffer_size < (int)(playlist->amount * sizeof(int)))
3375 { 3375 {
3376 /* not enough buffer space to store updated indices */ 3376 /* not enough buffer space to store updated indices */
3377 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 3377 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_ACCESS_ERROR));
3378 return -1; 3378 return -1;
3379 } 3379 }
3380 3380
@@ -3390,7 +3390,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
3390 fd = open(path, O_CREAT|O_WRONLY|O_TRUNC); 3390 fd = open(path, O_CREAT|O_WRONLY|O_TRUNC);
3391 if (fd < 0) 3391 if (fd < 0)
3392 { 3392 {
3393 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 3393 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_ACCESS_ERROR));
3394 return -1; 3394 return -1;
3395 } 3395 }
3396 3396
@@ -3431,7 +3431,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
3431 3431
3432 if (fdprintf(fd, "%s\n", tmp_buf) < 0) 3432 if (fdprintf(fd, "%s\n", tmp_buf) < 0)
3433 { 3433 {
3434 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 3434 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_ACCESS_ERROR));
3435 result = -1; 3435 result = -1;
3436 break; 3436 break;
3437 } 3437 }
@@ -3518,7 +3518,7 @@ int playlist_directory_tracksearch(const char* dirname, bool recurse,
3518 3518
3519 if (ft_load(tc, dirname) < 0) 3519 if (ft_load(tc, dirname) < 0)
3520 { 3520 {
3521 gui_syncsplash(HZ*2, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); 3521 gui_syncsplash(HZ*2, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
3522 *(tc->dirfilter) = old_dirfilter; 3522 *(tc->dirfilter) = old_dirfilter;
3523 return -1; 3523 return -1;
3524 } 3524 }