diff options
-rw-r--r-- | apps/playlist_viewer.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 293577b124..cd90572b95 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -608,6 +608,34 @@ static enum themable_icons playlist_callback_icons(int selected_item, | |||
608 | return Icon_NOICON; | 608 | return Icon_NOICON; |
609 | } | 609 | } |
610 | 610 | ||
611 | static int playlist_callback_voice(int selected_item, void * data) | ||
612 | { | ||
613 | struct playlist_viewer * local_viewer = (struct playlist_viewer *)data; | ||
614 | |||
615 | int track_num = get_track_num(local_viewer, selected_item); | ||
616 | struct playlist_entry *track = | ||
617 | playlist_buffer_get_track(&(local_viewer->buffer), track_num); | ||
618 | |||
619 | bool enqueue = false; | ||
620 | |||
621 | if (global_settings.talk_file_clip || global_settings.talk_file == 2) | ||
622 | { | ||
623 | if (global_settings.playlist_viewer_indices) | ||
624 | { | ||
625 | talk_number(track->display_index, false); | ||
626 | enqueue = true; | ||
627 | } | ||
628 | talk_file_or_spell(NULL, track->name, NULL, enqueue); | ||
629 | } | ||
630 | else if (global_settings.talk_file == 1) /* as numbers */ | ||
631 | { | ||
632 | talk_id(VOICE_FILE, false); | ||
633 | talk_number(track->display_index, true); | ||
634 | } | ||
635 | |||
636 | return 0; | ||
637 | } | ||
638 | |||
611 | /* Main viewer function. Filename identifies playlist to be viewed. If NULL, | 639 | /* Main viewer function. Filename identifies playlist to be viewed. If NULL, |
612 | view current playlist. */ | 640 | view current playlist. */ |
613 | enum playlist_viewer_result playlist_viewer_ex(const char* filename) | 641 | enum playlist_viewer_result playlist_viewer_ex(const char* filename) |
@@ -621,6 +649,7 @@ enum playlist_viewer_result playlist_viewer_ex(const char* filename) | |||
621 | 649 | ||
622 | gui_synclist_init(&playlist_lists, playlist_callback_name, | 650 | gui_synclist_init(&playlist_lists, playlist_callback_name, |
623 | &viewer, false, 1, NULL); | 651 | &viewer, false, 1, NULL); |
652 | gui_synclist_set_voice_callback(&playlist_lists, playlist_callback_voice); | ||
624 | gui_synclist_set_icon_callback(&playlist_lists, | 653 | gui_synclist_set_icon_callback(&playlist_lists, |
625 | global_settings.playlist_viewer_icons? | 654 | global_settings.playlist_viewer_icons? |
626 | &playlist_callback_icons:NULL); | 655 | &playlist_callback_icons:NULL); |
@@ -628,6 +657,7 @@ enum playlist_viewer_result playlist_viewer_ex(const char* filename) | |||
628 | gui_synclist_set_title(&playlist_lists, str(LANG_PLAYLIST), Icon_Playlist); | 657 | gui_synclist_set_title(&playlist_lists, str(LANG_PLAYLIST), Icon_Playlist); |
629 | gui_synclist_select_item(&playlist_lists, viewer.selected_track); | 658 | gui_synclist_select_item(&playlist_lists, viewer.selected_track); |
630 | gui_synclist_draw(&playlist_lists); | 659 | gui_synclist_draw(&playlist_lists); |
660 | gui_synclist_speak_item(&playlist_lists); | ||
631 | while (!exit) | 661 | while (!exit) |
632 | { | 662 | { |
633 | int track; | 663 | int track; |