@@ -873,7 +873,7 @@ void SetMediaAutoMount() {
873873}
874874
875875inline uint16_t nr_sd_menu_items () {
876- return _MIN (card.get_num_Files () + !card.flag .workDirIsRoot , MENU_MAX_ITEMS);
876+ return _MIN (card.get_num_items () + !card.flag .workDirIsRoot , MENU_MAX_ITEMS);
877877}
878878
879879void make_name_without_ext (char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) {
@@ -920,7 +920,7 @@ void onClickSDItem() {
920920 if (hasUpDir && CurrentMenu->selected == 1 ) return SDCard_Up ();
921921 else {
922922 const uint16_t filenum = CurrentMenu->selected - 1 - hasUpDir;
923- card.getfilename_sorted ( SD_ORDER ( filenum, card. get_num_Files ()) );
923+ card.selectFileByIndexSorted ( filenum);
924924
925925 // Enter that folder!
926926 if (card.flag .filenameIsDir ) return SDCard_Folder (card.filename );
@@ -963,7 +963,7 @@ void onClickSDItem() {
963963 last_itemselected = selected;
964964 if (selected >= 1 + hasUpDir) {
965965 const int8_t filenum = selected - 1 - hasUpDir; // Skip "Back" and ".."
966- card.getfilename_sorted ( SD_ORDER ( filenum, card. get_num_Files ()) );
966+ card.selectFileByIndexSorted ( filenum);
967967 make_name_without_ext (shift_name, card.longest_filename (), LONG_FILENAME_LENGTH);
968968 shift_len = strlen (shift_name);
969969 shift_amt = 0 ;
@@ -991,7 +991,7 @@ void onDrawFileName(MenuItemClass* menuitem, int8_t line) {
991991 }
992992 else {
993993 uint8_t icon;
994- card.getfilename_sorted ( SD_ORDER ( menuitem->pos - is_subdir - 1 , card. get_num_Files ()) );
994+ card.selectFileByIndexSorted ( menuitem->pos - is_subdir - 1 );
995995 make_name_without_ext (shift_name, card.longest_filename ());
996996 icon = card.flag .filenameIsDir ? ICON_Folder : card.fileIsBinary () ? ICON_Binary : ICON_File;
997997 Draw_Menu_Line (line, icon, shift_name);
0 commit comments