Library for Skeleton of SD card player. SD カードプレーヤのための骨組みとして使うためのライブラリ.このライブラリを登録した際のプログラム:「F746_SD_Player_Demo」
Dependencies: SDFileSystem_Warning_Fixed
Dependents: F746_SD_Player_Demo F746_SD_VarableFilter F746_SD_GraphicEqualizer F746_MySoundMachine ... more
Diff: FileSelectorWav.hpp
- Revision:
- 2:511479736d6e
- Parent:
- 0:d310bb78455d
- Child:
- 3:dd3b8a21417b
diff -r c7968701f7b3 -r 511479736d6e FileSelectorWav.hpp --- a/FileSelectorWav.hpp Mon Aug 15 06:06:52 2016 +0000 +++ b/FileSelectorWav.hpp Sun Oct 02 03:26:52 2016 +0000 @@ -2,7 +2,7 @@ // FileSelector class ---- Header ---- // SD カード内のファイル名の一覧を表示し,ファイルを選択する // -// 2016/07/27, Copyright (c) 2016 MIKAMI, Naoki +// 2016/10/02, Copyright (c) 2016 MIKAMI, Naoki //-------------------------------------------------------------- #ifndef FILE_SELECTOR_HPP @@ -19,16 +19,9 @@ { public: FileSelector(uint8_t x0, uint8_t y0, int maxFiles, - int maxNameLength, SD_WavReader &reader) - : X_(x0), Y_(y0), W_H_(24), V_L_(36), - MAX_FILES_(maxFiles), MAX_NAME_LENGTH_(maxNameLength), - BASE_COLOR_(0xFF80FFA0), TOUCHED_COLOR_(0xFF80FFFF), - fileNames_(maxFiles), - rect_(NULL), lcd_(GuiBase::GetLcdPtr()), - sdReader_(reader), prevFileCount_(0), prev_(-1) {} + int maxNameLength, SD_WavReader &reader); - virtual ~FileSelector() - { delete rect_; } + virtual ~FileSelector(); bool CreateTable(); @@ -43,27 +36,30 @@ uint32_t color = GuiBase::ENUM_BACK); private: - const uint8_t X_, Y_, W_H_, V_L_; + static const int MAX_LIST_PAGE_ = 6; // 1ページに表示するファイル数の最大値 + static const uint8_t W_H_ = 24; + static const uint8_t V_L_ = 36; + static const uint32_t BASE_COLOR_ = 0xFF80FFA0; + static const uint32_t TOUCHED_COLOR_ = 0xFF80FFFF; + const uint8_t X_, Y_; const int MAX_FILES_; const int MAX_NAME_LENGTH_; - const uint32_t BASE_COLOR_; - const uint32_t TOUCHED_COLOR_; Array<string> fileNames_; + Array<Label *> fileNameLabels_; ButtonGroup *rect_; - Array<Label *> fileNameLabels_; + ButtonGroup next_; + Label pageLabel_; LCD_DISCO_F746NG *lcd_; SD_WavReader &sdReader_; - int fileCount_, prevFileCount_; - int prev_; - - // Label を生成 - void CreateLabels(); + int page_; // 現在のページ,最初のページは 1 + int maxPage_; + int fileCount_; // 拡張子を削除した文字列を取得 string GetFileNameNoExt(int n); - // disallow copy constructor and assignment operator + // コピー・コンストラクタとオブジェクトの代入演算子は使用禁止 FileSelector(const FileSelector&); FileSelector& operator=(const FileSelector&); };