diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index e4733fba53..9dab34c283 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include "settings.h" | 41 | #include "settings.h" |
42 | #include "status.h" | 42 | #include "status.h" |
43 | #include "playlist_viewer.h" | 43 | #include "playlist_viewer.h" |
44 | #include "talk.h" | ||
44 | #include "onplay.h" | 45 | #include "onplay.h" |
45 | 46 | ||
46 | static char* selected_file = NULL; | 47 | static char* selected_file = NULL; |
@@ -147,6 +148,7 @@ static bool playlist_options(void) | |||
147 | if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) | 148 | if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) |
148 | { | 149 | { |
149 | menu[i].desc = str(LANG_VIEW); | 150 | menu[i].desc = str(LANG_VIEW); |
151 | menu[i].voice_id = LANG_VIEW; | ||
150 | menu[i].function = view_playlist; | 152 | menu[i].function = view_playlist; |
151 | i++; | 153 | i++; |
152 | pstart++; | 154 | pstart++; |
@@ -155,31 +157,37 @@ static bool playlist_options(void) | |||
155 | if (mpeg_status() & MPEG_STATUS_PLAY) | 157 | if (mpeg_status() & MPEG_STATUS_PLAY) |
156 | { | 158 | { |
157 | menu[i].desc = str(LANG_INSERT); | 159 | menu[i].desc = str(LANG_INSERT); |
160 | menu[i].voice_id = LANG_INSERT; | ||
158 | args[i].position = PLAYLIST_INSERT; | 161 | args[i].position = PLAYLIST_INSERT; |
159 | args[i].queue = false; | 162 | args[i].queue = false; |
160 | i++; | 163 | i++; |
161 | 164 | ||
162 | menu[i].desc = str(LANG_INSERT_FIRST); | 165 | menu[i].desc = str(LANG_INSERT_FIRST); |
166 | menu[i].voice_id = LANG_INSERT_FIRST; | ||
163 | args[i].position = PLAYLIST_INSERT_FIRST; | 167 | args[i].position = PLAYLIST_INSERT_FIRST; |
164 | args[i].queue = false; | 168 | args[i].queue = false; |
165 | i++; | 169 | i++; |
166 | 170 | ||
167 | menu[i].desc = str(LANG_INSERT_LAST); | 171 | menu[i].desc = str(LANG_INSERT_LAST); |
172 | menu[i].voice_id = LANG_INSERT_LAST; | ||
168 | args[i].position = PLAYLIST_INSERT_LAST; | 173 | args[i].position = PLAYLIST_INSERT_LAST; |
169 | args[i].queue = false; | 174 | args[i].queue = false; |
170 | i++; | 175 | i++; |
171 | 176 | ||
172 | menu[i].desc = str(LANG_QUEUE); | 177 | menu[i].desc = str(LANG_QUEUE); |
178 | menu[i].voice_id = LANG_QUEUE; | ||
173 | args[i].position = PLAYLIST_INSERT; | 179 | args[i].position = PLAYLIST_INSERT; |
174 | args[i].queue = true; | 180 | args[i].queue = true; |
175 | i++; | 181 | i++; |
176 | 182 | ||
177 | menu[i].desc = str(LANG_QUEUE_FIRST); | 183 | menu[i].desc = str(LANG_QUEUE_FIRST); |
184 | menu[i].voice_id = LANG_QUEUE_FIRST; | ||
178 | args[i].position = PLAYLIST_INSERT_FIRST; | 185 | args[i].position = PLAYLIST_INSERT_FIRST; |
179 | args[i].queue = true; | 186 | args[i].queue = true; |
180 | i++; | 187 | i++; |
181 | 188 | ||
182 | menu[i].desc = str(LANG_QUEUE_LAST); | 189 | menu[i].desc = str(LANG_QUEUE_LAST); |
190 | menu[i].voice_id = LANG_QUEUE_LAST; | ||
183 | args[i].position = PLAYLIST_INSERT_LAST; | 191 | args[i].position = PLAYLIST_INSERT_LAST; |
184 | args[i].queue = true; | 192 | args[i].queue = true; |
185 | i++; | 193 | i++; |
@@ -188,6 +196,7 @@ static bool playlist_options(void) | |||
188 | (selected_file_attr & ATTR_DIRECTORY)) | 196 | (selected_file_attr & ATTR_DIRECTORY)) |
189 | { | 197 | { |
190 | menu[i].desc = str(LANG_INSERT); | 198 | menu[i].desc = str(LANG_INSERT); |
199 | menu[i].voice_id = LANG_INSERT; | ||
191 | args[i].position = PLAYLIST_INSERT; | 200 | args[i].position = PLAYLIST_INSERT; |
192 | args[i].queue = false; | 201 | args[i].queue = false; |
193 | i++; | 202 | i++; |
@@ -283,6 +292,8 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes) | |||
283 | int orig_fd, fd; | 292 | int orig_fd, fd; |
284 | char tmpname[MAX_PATH]; | 293 | char tmpname[MAX_PATH]; |
285 | 294 | ||
295 | talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ | ||
296 | |||
286 | snprintf(tmpname, MAX_PATH, "%s.tmp", fname); | 297 | snprintf(tmpname, MAX_PATH, "%s.tmp", fname); |
287 | 298 | ||
288 | orig_fd = open(fname, O_RDONLY); | 299 | orig_fd = open(fname, O_RDONLY); |
@@ -384,6 +395,8 @@ static bool vbr_fix(void) | |||
384 | return onplay_result; | 395 | return onplay_result; |
385 | } | 396 | } |
386 | 397 | ||
398 | talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ | ||
399 | |||
387 | lcd_clear_display(); | 400 | lcd_clear_display(); |
388 | lcd_puts_scroll(0, 0, selected_file); | 401 | lcd_puts_scroll(0, 0, selected_file); |
389 | lcd_update(); | 402 | lcd_update(); |
@@ -552,17 +565,20 @@ int onplay(char* file, int attr) | |||
552 | ((attr & TREE_ATTR_MASK) == TREE_ATTR_M3U)) | 565 | ((attr & TREE_ATTR_MASK) == TREE_ATTR_M3U)) |
553 | { | 566 | { |
554 | menu[i].desc = str(LANG_PLAYINDICES_PLAYLIST); | 567 | menu[i].desc = str(LANG_PLAYINDICES_PLAYLIST); |
568 | menu[i].voice_id = LANG_PLAYINDICES_PLAYLIST; | ||
555 | menu[i].function = playlist_options; | 569 | menu[i].function = playlist_options; |
556 | i++; | 570 | i++; |
557 | } | 571 | } |
558 | 572 | ||
559 | menu[i].desc = str(LANG_RENAME); | 573 | menu[i].desc = str(LANG_RENAME); |
574 | menu[i].voice_id = LANG_RENAME; | ||
560 | menu[i].function = rename_file; | 575 | menu[i].function = rename_file; |
561 | i++; | 576 | i++; |
562 | 577 | ||
563 | if (!(attr & ATTR_DIRECTORY)) | 578 | if (!(attr & ATTR_DIRECTORY)) |
564 | { | 579 | { |
565 | menu[i].desc = str(LANG_DELETE); | 580 | menu[i].desc = str(LANG_DELETE); |
581 | menu[i].voice_id = LANG_DELETE; | ||
566 | menu[i].function = delete_file; | 582 | menu[i].function = delete_file; |
567 | i++; | 583 | i++; |
568 | } | 584 | } |
@@ -570,12 +586,14 @@ int onplay(char* file, int attr) | |||
570 | if ((attr & TREE_ATTR_MASK) == TREE_ATTR_MPA) | 586 | if ((attr & TREE_ATTR_MASK) == TREE_ATTR_MPA) |
571 | { | 587 | { |
572 | menu[i].desc = str(LANG_VBRFIX); | 588 | menu[i].desc = str(LANG_VBRFIX); |
589 | menu[i].voice_id = LANG_VBRFIX; | ||
573 | menu[i].function = vbr_fix; | 590 | menu[i].function = vbr_fix; |
574 | i++; | 591 | i++; |
575 | } | 592 | } |
576 | } | 593 | } |
577 | 594 | ||
578 | menu[i].desc = str(LANG_CREATE_DIR); | 595 | menu[i].desc = str(LANG_CREATE_DIR); |
596 | menu[i].voice_id = LANG_CREATE_DIR; | ||
579 | menu[i].function = create_dir; | 597 | menu[i].function = create_dir; |
580 | i++; | 598 | i++; |
581 | 599 | ||