revised version of F746_SD_GraphicEqualizer

Dependencies:   BSP_DISCO_F746NG F746_GUI F746_SAI_IO FrequencyResponseDrawer LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed

Fork of F746_SD_GraphicEqualizer by 不韋 呂

Files at this revision

API Documentation at this revision

Comitter:
edamame22
Date:
Thu Jul 07 05:58:52 2016 +0000
Parent:
11:2286f2668e8c
Commit message:
added highlighted line for track selection

Changed in this revision

MyClasses_Functions/FileSelectorWav.hpp Show annotated file Show diff for this revision Revisions of this file
MyClasses_Functions/MyFunctions.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2286f2668e8c -r 87f6955b5a80 MyClasses_Functions/FileSelectorWav.hpp
--- a/MyClasses_Functions/FileSelectorWav.hpp	Wed Jun 22 03:59:21 2016 +0000
+++ b/MyClasses_Functions/FileSelectorWav.hpp	Thu Jul 07 05:58:52 2016 +0000
@@ -138,7 +138,7 @@
         }
 
         // ファイルの一覧の表示
-        void DisplayFileList(bool sort = true)
+        void DisplayFileList(int highlighted, bool sort = true)
         {
             for (int n=0; n<fileCount_; n++)
                 sortedFileNames_[n] = fileNames_[n];
@@ -149,6 +149,11 @@
             rect_->DrawAll();
             for (int n=0; n<fileCount_; n++)
                 fileNameLabels_[n]->Draw(GetFileNameNoExt(n));
+            if((highlighted>-1) && (highlighted < fileCount_))
+            {
+              fileNameLabels_[highlighted]->Draw(GetFileNameNoExt(highlighted), TOUCHED_COLOR_);
+              prev_ = highlighted;
+            }
         }
 
         void Erase(uint16_t x, uint16_t y, uint16_t width, uint16_t height,
diff -r 2286f2668e8c -r 87f6955b5a80 MyClasses_Functions/MyFunctions.cpp
--- a/MyClasses_Functions/MyFunctions.cpp	Wed Jun 22 03:59:21 2016 +0000
+++ b/MyClasses_Functions/MyFunctions.cpp	Thu Jul 07 05:58:52 2016 +0000
@@ -45,7 +45,7 @@
 void SelectFile(ButtonGroup &menu, FileSelector &selector,
                 Label &msg, string fileList[], int *selected)
 {
-    selector.DisplayFileList();   
+    selector.DisplayFileList(*selected);   
     msg.Draw("Select file");
     do
     {
diff -r 2286f2668e8c -r 87f6955b5a80 main.cpp
--- a/main.cpp	Wed Jun 22 03:59:21 2016 +0000
+++ b/main.cpp	Thu Jul 07 05:58:52 2016 +0000
@@ -27,7 +27,7 @@
     SD_WavReader sdReader(mySai.GetLength());   // SD カード読み込み用オブジェクト
     const int MAX_FILES = 7;
     string PlayList[MAX_FILES];
-    int list_id = 0;
+    int list_id = -9;   // if <0 then doesn't highlight any track in the list 
     FileSelector selector(4, 26, MAX_FILES, 37, sdReader);
     if (!selector.CreateTable())
         BlinkLabel errLabel(240, 100, "SD CARD ERROR", Label::CENTER);
@@ -160,7 +160,7 @@
                 int touch10;
                 while (!menu.GetTouchedNumber(touch10))
                     ModifyFilter(drawerObj, myBars, hn, flat, onOff, on);
-                if (touch10 == 0)
+                if (touch10 == 0)        //  OPEN タッチしたら
                     SelectFile(menu, selector, myLabel1, PlayList, &list_id);
                 ui_mode = SELECTED_PREPARE_PALY;
                 break;