diff options
-rw-r--r-- | apps/tree.c | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/apps/tree.c b/apps/tree.c index c7a6c012b7..435ea8880a 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -808,7 +808,21 @@ static bool dirbrowse(void) | |||
808 | TIME_AFTER(current_tick, thumbnail_time)) | 808 | TIME_AFTER(current_tick, thumbnail_time)) |
809 | { /* a delayed hovering thumbnail is due now */ | 809 | { /* a delayed hovering thumbnail is due now */ |
810 | int res; | 810 | int res; |
811 | if (dircache[lasti].attr & ATTR_DIRECTORY) | 811 | int attr; |
812 | char* name; | ||
813 | |||
814 | if (id3db) | ||
815 | { | ||
816 | attr = tagtree_get_attr(&tc); | ||
817 | name = tagtree_get_entry(&tc, lasti)->name; | ||
818 | } | ||
819 | else | ||
820 | { | ||
821 | attr = dircache[lasti].attr; | ||
822 | name = dircache[lasti].name; | ||
823 | } | ||
824 | |||
825 | if (attr & ATTR_DIRECTORY) | ||
812 | { | 826 | { |
813 | DEBUGF("Playing directory thumbnail: %s", currdir); | 827 | DEBUGF("Playing directory thumbnail: %s", currdir); |
814 | res = ft_play_dirname(lasti); | 828 | res = ft_play_dirname(lasti); |
@@ -821,11 +835,11 @@ static bool dirbrowse(void) | |||
821 | else | 835 | else |
822 | { | 836 | { |
823 | DEBUGF("Playing file thumbnail: %s/%s%s\n", | 837 | DEBUGF("Playing file thumbnail: %s/%s%s\n", |
824 | currdir, dircache[lasti].name, | 838 | currdir, name, |
825 | file_thumbnail_ext); | 839 | file_thumbnail_ext); |
826 | /* no fallback necessary, we knew in advance | 840 | /* no fallback necessary, we knew in advance |
827 | that the file exists */ | 841 | that the file exists */ |
828 | ft_play_filename(currdir, dircache[lasti].name); | 842 | ft_play_filename(currdir, name); |
829 | } | 843 | } |
830 | thumbnail_time = -1; /* job done */ | 844 | thumbnail_time = -1; /* job done */ |
831 | } | 845 | } |
@@ -939,12 +953,26 @@ static bool dirbrowse(void) | |||
939 | if ( numentries > 0 ) { | 953 | if ( numentries > 0 ) { |
940 | /* Voice the file if changed */ | 954 | /* Voice the file if changed */ |
941 | if(lasti != tc.selected_item || restore) { | 955 | if(lasti != tc.selected_item || restore) { |
956 | int attr; | ||
957 | char* name; | ||
958 | |||
942 | lasti = tc.selected_item; | 959 | lasti = tc.selected_item; |
943 | thumbnail_time = -1; /* Cancel whatever we were | 960 | thumbnail_time = -1; /* Cancel whatever we were |
944 | about to say */ | 961 | about to say */ |
945 | 962 | ||
963 | if (id3db) | ||
964 | { | ||
965 | attr = tagtree_get_attr(&tc); | ||
966 | name = tagtree_get_entry(&tc, tc.selected_item)->name; | ||
967 | } | ||
968 | else | ||
969 | { | ||
970 | attr = dircache[tc.selected_item].attr; | ||
971 | name = dircache[tc.selected_item].name; | ||
972 | } | ||
973 | |||
946 | /* Directory? */ | 974 | /* Directory? */ |
947 | if (dircache[tc.selected_item].attr & ATTR_DIRECTORY) | 975 | if (attr & ATTR_DIRECTORY) |
948 | { | 976 | { |
949 | /* play directory thumbnail */ | 977 | /* play directory thumbnail */ |
950 | switch (global_settings.talk_dir) { | 978 | switch (global_settings.talk_dir) { |
@@ -954,8 +982,7 @@ static bool dirbrowse(void) | |||
954 | break; | 982 | break; |
955 | 983 | ||
956 | case 2: /* dirs spelled */ | 984 | case 2: /* dirs spelled */ |
957 | talk_spell(dircache[tc.selected_item].name, | 985 | talk_spell(name, false); |
958 | false); | ||
959 | break; | 986 | break; |
960 | 987 | ||
961 | case 3: /* thumbnail clip */ | 988 | case 3: /* thumbnail clip */ |
@@ -974,25 +1001,21 @@ static bool dirbrowse(void) | |||
974 | case 1: /* files as numbers */ | 1001 | case 1: /* files as numbers */ |
975 | ft_play_filenumber( | 1002 | ft_play_filenumber( |
976 | tc.selected_item-tc.dirsindir+1, | 1003 | tc.selected_item-tc.dirsindir+1, |
977 | dircache[tc.selected_item].attr & | 1004 | attr & TREE_ATTR_MASK); |
978 | TREE_ATTR_MASK); | ||
979 | break; | 1005 | break; |
980 | 1006 | ||
981 | case 2: /* files spelled */ | 1007 | case 2: /* files spelled */ |
982 | talk_spell(dircache[tc.selected_item].name, | 1008 | talk_spell(name, false); |
983 | false); | ||
984 | break; | 1009 | break; |
985 | 1010 | ||
986 | case 3: /* thumbnail clip */ | 1011 | case 3: /* thumbnail clip */ |
987 | /* "schedule" a thumbnail, to have a little | 1012 | /* "schedule" a thumbnail, to have a little |
988 | delay */ | 1013 | delay */ |
989 | if (dircache[tc.selected_item].attr & | 1014 | if (attr & TREE_ATTR_THUMBNAIL) |
990 | TREE_ATTR_THUMBNAIL) | ||
991 | thumbnail_time = current_tick + HOVER_DELAY; | 1015 | thumbnail_time = current_tick + HOVER_DELAY; |
992 | else | 1016 | else |
993 | /* spell the number as fallback */ | 1017 | /* spell the number as fallback */ |
994 | talk_spell(dircache[tc.selected_item].name, | 1018 | talk_spell(name, false); |
995 | false); | ||
996 | break; | 1019 | break; |
997 | 1020 | ||
998 | default: | 1021 | default: |