summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 31e3040b60..1b6c65245d 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -238,7 +238,7 @@ static int add_indices_to_playlist(void)
238 lcd_setmargins(0, 0); 238 lcd_setmargins(0, 0);
239#endif 239#endif
240 240
241 splash(0, 0, true, str(LANG_PLAYLIST_LOAD)); 241 splash(0, true, str(LANG_PLAYLIST_LOAD));
242 242
243 /* use mp3 buffer for maximum load speed */ 243 /* use mp3 buffer for maximum load speed */
244 buflen = (mp3end - mp3buf); 244 buflen = (mp3end - mp3buf);
@@ -404,7 +404,7 @@ static int add_track_to_playlist(char *filename, int position, bool queue,
404 404
405 if (result < 0) 405 if (result < 0)
406 { 406 {
407 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 407 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
408 return result; 408 return result;
409 } 409 }
410 } 410 }
@@ -437,7 +437,7 @@ static int add_directory_to_playlist(char *dirname, int *position, bool queue,
437 437
438 if(!files) 438 if(!files)
439 { 439 {
440 splash(HZ*2, 0, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); 440 splash(HZ*2, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
441 return 0; 441 return 0;
442 } 442 }
443 443
@@ -578,7 +578,7 @@ static int remove_track_from_playlist(int position, bool write)
578 578
579 if (result < 0) 579 if (result < 0)
580 { 580 {
581 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 581 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
582 return result; 582 return result;
583 } 583 }
584 } 584 }
@@ -824,10 +824,10 @@ static int get_filename(int seek, bool control_file, char *buf,
824 if (max < 0) 824 if (max < 0)
825 { 825 {
826 if (control_file) 826 if (control_file)
827 splash(HZ*2, 0, true, 827 splash(HZ*2, true,
828 str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 828 str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
829 else 829 else
830 splash(HZ*2, 0, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 830 splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR));
831 831
832 return max; 832 return max;
833 } 833 }
@@ -919,11 +919,13 @@ static void display_playlist_count(int count, char *fmt)
919 lcd_setmargins(0, 0); 919 lcd_setmargins(0, 0);
920#endif 920#endif
921 921
922 splash(0, true, fmt, count,
922#ifdef HAVE_PLAYER_KEYPAD 923#ifdef HAVE_PLAYER_KEYPAD
923 splash(0, 0, true, fmt, count, str(LANG_STOP_ABORT)); 924 str(LANG_STOP_ABORT)
924#else 925#else
925 splash(0, 0, true, fmt, count, str(LANG_OFF_ABORT)); 926 str(LANG_OFF_ABORT)
926#endif 927#endif
928 );
927} 929}
928 930
929/* 931/*
@@ -981,7 +983,7 @@ static int flush_pending_control(void)
981 983
982 if (result < 0) 984 if (result < 0)
983 { 985 {
984 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 986 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
985 return result; 987 return result;
986 } 988 }
987 } 989 }
@@ -1026,7 +1028,7 @@ int playlist_create(char *dir, char *file)
1026 1028
1027 playlist.control_fd = open(PLAYLIST_CONTROL_FILE, O_RDWR); 1029 playlist.control_fd = open(PLAYLIST_CONTROL_FILE, O_RDWR);
1028 if (playlist.control_fd < 0) 1030 if (playlist.control_fd < 0)
1029 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1031 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1030 1032
1031 if (!file) 1033 if (!file)
1032 { 1034 {
@@ -1046,7 +1048,7 @@ int playlist_create(char *dir, char *file)
1046 PLAYLIST_CONTROL_FILE_VERSION, dir, file) > 0) 1048 PLAYLIST_CONTROL_FILE_VERSION, dir, file) > 0)
1047 fsync(playlist.control_fd); 1049 fsync(playlist.control_fd);
1048 else 1050 else
1049 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 1051 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
1050 } 1052 }
1051 1053
1052 /* load the playlist file */ 1054 /* load the playlist file */
@@ -1091,7 +1093,7 @@ int playlist_resume(void)
1091 playlist.control_fd = open(PLAYLIST_CONTROL_FILE, O_RDWR); 1093 playlist.control_fd = open(PLAYLIST_CONTROL_FILE, O_RDWR);
1092 if (playlist.control_fd < 0) 1094 if (playlist.control_fd < 0)
1093 { 1095 {
1094 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1096 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1095 return -1; 1097 return -1;
1096 } 1098 }
1097 1099
@@ -1100,7 +1102,7 @@ int playlist_resume(void)
1100 PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen); 1102 PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen);
1101 if(nread <= 0) 1103 if(nread <= 0)
1102 { 1104 {
1103 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1105 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1104 return -1; 1106 return -1;
1105 } 1107 }
1106 1108
@@ -1375,7 +1377,7 @@ int playlist_resume(void)
1375 1377
1376 if (result < 0) 1378 if (result < 0)
1377 { 1379 {
1378 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_INVALID)); 1380 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_INVALID));
1379 return result; 1381 return result;
1380 } 1382 }
1381 1383
@@ -1458,7 +1460,7 @@ int playlist_insert_track(char *filename, int position, bool queue)
1458 1460
1459 if (playlist.control_fd < 0) 1461 if (playlist.control_fd < 0)
1460 { 1462 {
1461 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1463 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1462 return -1; 1464 return -1;
1463 } 1465 }
1464 1466
@@ -1485,7 +1487,7 @@ int playlist_insert_directory(char *dirname, int position, bool queue,
1485 1487
1486 if (playlist.control_fd < 0) 1488 if (playlist.control_fd < 0)
1487 { 1489 {
1488 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1490 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1489 return -1; 1491 return -1;
1490 } 1492 }
1491 1493
@@ -1523,14 +1525,14 @@ int playlist_insert_playlist(char *filename, int position, bool queue)
1523 1525
1524 if (playlist.control_fd < 0) 1526 if (playlist.control_fd < 0)
1525 { 1527 {
1526 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1528 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1527 return -1; 1529 return -1;
1528 } 1530 }
1529 1531
1530 fd = open(filename, O_RDONLY); 1532 fd = open(filename, O_RDONLY);
1531 if (fd < 0) 1533 if (fd < 0)
1532 { 1534 {
1533 splash(HZ*2, 0, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 1535 splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR));
1534 return -1; 1536 return -1;
1535 } 1537 }
1536 1538
@@ -1623,7 +1625,7 @@ int playlist_delete(int index)
1623 1625
1624 if (playlist.control_fd < 0) 1626 if (playlist.control_fd < 0)
1625 { 1627 {
1626 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1628 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1627 return -1; 1629 return -1;
1628 } 1630 }
1629 1631
@@ -1730,7 +1732,7 @@ int playlist_shuffle(int random_seed, int start_index)
1730 start_current = true; 1732 start_current = true;
1731 } 1733 }
1732 1734
1733 splash(0, 0, true, str(LANG_PLAYLIST_SHUFFLE)); 1735 splash(0, true, str(LANG_PLAYLIST_SHUFFLE));
1734 1736
1735 randomise_playlist(random_seed, start_current, true); 1737 randomise_playlist(random_seed, start_current, true);
1736 1738
@@ -1885,7 +1887,7 @@ int playlist_next(int steps)
1885 1887
1886 if (result < 0) 1888 if (result < 0)
1887 { 1889 {
1888 splash(HZ*2, 0, true, 1890 splash(HZ*2, true,
1889 str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 1891 str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
1890 return result; 1892 return result;
1891 } 1893 }
@@ -1990,7 +1992,7 @@ int playlist_save(char *filename)
1990 1992
1991 if (playlist.control_fd < 0) 1993 if (playlist.control_fd < 0)
1992 { 1994 {
1993 splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); 1995 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
1994 return -1; 1996 return -1;
1995 } 1997 }
1996 1998
@@ -2005,7 +2007,7 @@ int playlist_save(char *filename)
2005 fd = open(tmp_buf, O_CREAT|O_WRONLY|O_TRUNC); 2007 fd = open(tmp_buf, O_CREAT|O_WRONLY|O_TRUNC);
2006 if (fd < 0) 2008 if (fd < 0)
2007 { 2009 {
2008 splash(HZ*2, 0, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 2010 splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR));
2009 return -1; 2011 return -1;
2010 } 2012 }
2011 2013
@@ -2041,7 +2043,7 @@ int playlist_save(char *filename)
2041 2043
2042 if (fprintf(fd, "%s\n", tmp_buf) < 0) 2044 if (fprintf(fd, "%s\n", tmp_buf) < 0)
2043 { 2045 {
2044 splash(HZ*2, 0, true, 2046 splash(HZ*2, true,
2045 str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); 2047 str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
2046 result = -1; 2048 result = -1;
2047 break; 2049 break;