Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem_Warning_Fixed
FileSelectorWav.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2017-03-15
- Revision:
- 11:c33c711a5712
- Parent:
- 3:dd3b8a21417b
- Child:
- 12:f73e11831c1c
File content as of revision 11:c33c711a5712:
//--------------------------------------------------------------
// FileSelector class ---- Header ----
// SD カード内のファイル名の一覧を表示し,ファイルを選択する
//
// 2016/10/02, Copyright (c) 2016 MIKAMI, Naoki
//--------------------------------------------------------------
#ifndef FILE_SELECTOR_HPP
#define FILE_SELECTOR_HPP
#include "F746_GUI.hpp"
#include "SD_WavReader.hpp"
#include <algorithm> // sort() で使用
#include <string>
namespace Mikami
{
class FileSelector
{
public:
FileSelector(uint8_t x0, uint8_t y0, int maxFiles,
int maxNameLength, SD_WavReader &reader);
virtual ~FileSelector();
bool CreateTable();
// ファイルを選択する
bool Select(string &fileName);
// ファイルの一覧の表示
void DisplayFileList(bool sortEnable = true);
// ファイルの一覧の消去
void Erase(uint16_t x, uint16_t y, uint16_t width, uint16_t height,
uint32_t color = GuiBase::ENUM_BACK);
private:
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_;
Array<string> fileNames_;
Array<Label *> fileNameLabels_;
ButtonGroup *rect_;
ButtonGroup next_;
Label pageLabel_;
LCD_DISCO_F746NG *lcd_;
SD_WavReader &sdReader_;
int page_; // 現在のページ,最初のページは 1
int maxPage_;
int fileCount_;
// 拡張子を削除したファイル名を取得
string GetFileNameNoExt(int n);
// コピー・コンストラクタとオブジェクトの代入演算子は使用禁止
FileSelector(const FileSelector&);
FileSelector& operator=(const FileSelector&);
};
}
#endif // FILE_SELECTOR_HPP