summaryrefslogtreecommitdiff
path: root/apps/bookmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 785a8cf2d9..969371eeeb 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -73,8 +73,7 @@ static bool parse_bookmark(const char *bookmark,
73 int* ms, 73 int* ms,
74 int * repeat_mode, 74 int * repeat_mode,
75 bool *shuffle, 75 bool *shuffle,
76 char* file_name, 76 char* file_name);
77 unsigned int max_file_name_size);
78static char* select_bookmark(const char* bookmark_file_name); 77static char* select_bookmark(const char* bookmark_file_name);
79static bool system_check(void); 78static bool system_check(void);
80static bool write_bookmark(bool create_bookmark_file); 79static bool write_bookmark(bool create_bookmark_file);
@@ -84,6 +83,7 @@ static char global_temp_buffer[MAX_PATH+1];
84static char global_bookmark_file_name[MAX_PATH]; 83static char global_bookmark_file_name[MAX_PATH];
85static char global_read_buffer[MAX_BOOKMARK_SIZE]; 84static char global_read_buffer[MAX_BOOKMARK_SIZE];
86static char global_bookmark[MAX_BOOKMARK_SIZE]; 85static char global_bookmark[MAX_BOOKMARK_SIZE];
86static char global_filename[MAX_PATH];
87 87
88/* ----------------------------------------------------------------------- */ 88/* ----------------------------------------------------------------------- */
89/* Displays the bookmark menu options for the user to decide. This is an */ 89/* Displays the bookmark menu options for the user to decide. This is an */
@@ -162,7 +162,7 @@ static bool bookmark_load_menu(void)
162 NULL, 162 NULL,
163 &global_settings.repeat_mode, 163 &global_settings.repeat_mode,
164 &global_settings.playlist_shuffle, 164 &global_settings.playlist_shuffle,
165 NULL, 0); 165 global_filename);
166 } 166 }
167 else 167 else
168 { 168 {
@@ -171,7 +171,8 @@ static bool bookmark_load_menu(void)
171 } 171 }
172 172
173 if (success) 173 if (success)
174 bookmark_play(global_temp_buffer, index, offset, seed); 174 bookmark_play(global_temp_buffer, index, offset, seed,
175 global_filename);
175 } 176 }
176 177
177 return success; 178 return success;
@@ -203,10 +204,11 @@ bool bookmark_mrb_load()
203 NULL, 204 NULL,
204 &global_settings.repeat_mode, 205 &global_settings.repeat_mode,
205 &global_settings.playlist_shuffle, 206 &global_settings.playlist_shuffle,
206 NULL, 0); 207 global_filename);
207 208
208 if (success) 209 if (success)
209 bookmark_play(global_temp_buffer, index, offset, seed); 210 bookmark_play(global_temp_buffer, index, offset, seed,
211 global_filename);
210 212
211 return success; 213 return success;
212} 214}
@@ -442,7 +444,7 @@ static bool check_bookmark(const char* bookmark)
442 return parse_bookmark(bookmark, 444 return parse_bookmark(bookmark,
443 NULL,NULL,NULL, NULL, 445 NULL,NULL,NULL, NULL,
444 NULL,0,NULL,NULL, 446 NULL,0,NULL,NULL,
445 NULL, NULL, 0); 447 NULL, NULL);
446} 448}
447 449
448/* ----------------------------------------------------------------------- */ 450/* ----------------------------------------------------------------------- */
@@ -566,12 +568,13 @@ bool bookmark_load(const char* file, bool autoload)
566 NULL, 568 NULL,
567 &global_settings.repeat_mode, 569 &global_settings.repeat_mode,
568 &global_settings.playlist_shuffle, 570 &global_settings.playlist_shuffle,
569 NULL, 0); 571 global_filename);
570 572
571 } 573 }
572 574
573 if(success) 575 if(success)
574 bookmark_play(global_temp_buffer,index,offset,seed); 576 bookmark_play(global_temp_buffer, index, offset, seed,
577 global_filename);
575 578
576 return success; 579 return success;
577} 580}
@@ -778,7 +781,6 @@ static void display_bookmark(const char* bookmark,
778 int ms = 0; 781 int ms = 0;
779 int repeat_mode = 0; 782 int repeat_mode = 0;
780 bool playlist_shuffle = false; 783 bool playlist_shuffle = false;
781 char MP3_file_name[45];
782 int len; 784 int len;
783 char *dot; 785 char *dot;
784 786
@@ -786,7 +788,7 @@ static void display_bookmark(const char* bookmark,
786 parse_bookmark(bookmark, 788 parse_bookmark(bookmark,
787 &resume_index, NULL, NULL, NULL, NULL, 0, 789 &resume_index, NULL, NULL, NULL, NULL, 0,
788 &ms, &repeat_mode, &playlist_shuffle, 790 &ms, &repeat_mode, &playlist_shuffle,
789 MP3_file_name, sizeof(MP3_file_name)); 791 global_filename);
790 792
791 lcd_clear_display(); 793 lcd_clear_display();
792 lcd_stop_scroll(); 794 lcd_stop_scroll();
@@ -807,14 +809,14 @@ static void display_bookmark(const char* bookmark,
807 statusbar_icon_shuffle(); 809 statusbar_icon_shuffle();
808 810
809 /* File Name */ 811 /* File Name */
810 len=strlen(MP3_file_name); 812 len=strlen(global_filename);
811 if (len>3) 813 if (len>3)
812 dot=strrchr(MP3_file_name + len - 4, '.'); 814 dot=strrchr(global_filename + len - 4, '.');
813 else 815 else
814 dot=NULL; 816 dot=NULL;
815 if (dot) 817 if (dot)
816 *dot='\0'; 818 *dot='\0';
817 lcd_puts_scroll(0, 0, MP3_file_name); 819 lcd_puts_scroll(0, 0, global_filename);
818 if (dot) 820 if (dot)
819 *dot='.'; 821 *dot='.';
820 822
@@ -854,9 +856,9 @@ static void display_bookmark(const char* bookmark,
854 lcd_puts_scroll(0, 6, str(LANG_BOOKMARK_SELECT_DELETE)); 856 lcd_puts_scroll(0, 6, str(LANG_BOOKMARK_SELECT_DELETE));
855#else 857#else
856 (void)bookmark_id; 858 (void)bookmark_id;
857 len=strlen(MP3_file_name); 859 len=strlen(global_filename);
858 if (len>3) 860 if (len>3)
859 dot=strrchr(MP3_file_name+len-4,'.'); 861 dot=strrchr(global_filename+len-4,'.');
860 else 862 else
861 dot=NULL; 863 dot=NULL;
862 if (dot) 864 if (dot)
@@ -868,7 +870,7 @@ static void display_bookmark(const char* bookmark,
868 (bookmark_count+1), 870 (bookmark_count+1),
869 ms / 60000, 871 ms / 60000,
870 ms % 60000 / 1000, 872 ms % 60000 / 1000,
871 MP3_file_name); 873 global_filename);
872 } 874 }
873 else 875 else
874 { 876 {
@@ -878,7 +880,7 @@ static void display_bookmark(const char* bookmark,
878 ms / 60000, 880 ms / 60000,
879 ms % 3600000 / 60000, 881 ms % 3600000 / 60000,
880 ms % 60000 / 1000, 882 ms % 60000 / 1000,
881 MP3_file_name); 883 global_filename);
882 } 884 }
883 885
884 status_draw(false); 886 status_draw(false);
@@ -907,7 +909,7 @@ static void say_bookmark(const char* bookmark,
907 NULL, NULL, NULL, 909 NULL, NULL, NULL,
908 dir, sizeof(dir), 910 dir, sizeof(dir),
909 &ms, NULL, NULL, 911 &ms, NULL, NULL,
910 NULL, 0); 912 NULL);
911/* disabled, because transition between talkbox and voice UI clip is not nice */ 913/* disabled, because transition between talkbox and voice UI clip is not nice */
912#if 0 914#if 0
913 if (global_settings.talk_dir >= 3) 915 if (global_settings.talk_dir >= 3)
@@ -987,8 +989,7 @@ static bool parse_bookmark(const char *bookmark,
987 unsigned int resume_file_size, 989 unsigned int resume_file_size,
988 int* ms, 990 int* ms,
989 int * repeat_mode, bool *shuffle, 991 int * repeat_mode, bool *shuffle,
990 char* file_name, 992 char* file_name)
991 unsigned int max_file_name_size)
992{ 993{
993 /* First check to see if a valid line was passed in. */ 994 /* First check to see if a valid line was passed in. */
994 int bookmark_len = strlen(bookmark); 995 int bookmark_len = strlen(bookmark);
@@ -1097,9 +1098,8 @@ static bool parse_bookmark(const char *bookmark,
1097 1098
1098 if (file_name && local_file_name) 1099 if (file_name && local_file_name)
1099 { 1100 {
1100 strncpy(file_name, local_file_name, 1101 strncpy(file_name, local_file_name,MAX_PATH-1);
1101 MIN(strlen(local_file_name),max_file_name_size-1)); 1102 file_name[MAX_PATH-1] = 0;
1102 file_name[MIN(strlen(local_file_name),max_file_name_size-1)]=0;
1103 } 1103 }
1104 1104
1105 return true; 1105 return true;