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
SD_PlayerSkeleton.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2016-11-07
- Revision:
- 4:d730d024ac32
- Parent:
- 2:511479736d6e
- Child:
- 5:7c8f0fc9dfb6
File content as of revision 4:d730d024ac32:
//--------------------------------------------------------------
// SD プレーヤー用抽象基底クラス(ヘッダ)
//
// 2016/11/07, Copyright (c) 2016 MIKAMI, Naoki
//--------------------------------------------------------------
#ifndef F746_SD_PLAYER_SKELETON_HPP
#define F746_SD_PLAYER_SKELETON_HPP
#include "SAI_InOut.hpp"
#include "F746_GUI.hpp"
#include "FileSelectorWav.hpp"
#include "SD_WavReader.hpp"
using namespace Mikami;
namespace Mikami
{
class SD_PlayerSkeleton
{
public:
// リセット・ボタンを使う場合は reset を true とする
SD_PlayerSkeleton(string str, int fs, bool reset = false);
virtual ~SD_PlayerSkeleton() { if (reset_ != NULL) delete reset_; }
void Execute();
protected:
// ボタン用の定数
static const uint16_t BG_LEFT_ = 414;
static const uint16_t BG_WIDTH_ = 66;
static const uint16_t BG_HEIGHT_ = 36;
const int32_t FRAME_SIZE_; // フレームバッファのサイズ
Array<int16_t> sn_; // フレームバッファ
SaiIO mySai_;
SD_WavReader sdReader_; // SD カード読み込み用オブジェクト
string GetFileName() { return fileName_; }
string GetFileNameNoExt();
private:
string fileName_; // 選択されたファイル名
Label title_; // 上部に表示されるタイトル
FileSelector selector_;
ButtonGroup menu_;
ResetButton *reset_;
bool resetActive_;
// SD カードのファイルのオープン
int32_t SD_Open();
// ファイルの選択
void SelectFile();
// パネル操作のチェック
void CheckCtrl();
// コピー・コンストラクタとオブジェクトの代入演算子は使用禁止
SD_PlayerSkeleton(const SD_PlayerSkeleton&);
SD_PlayerSkeleton& operator=(const SD_PlayerSkeleton&);
//-------------------------------------
// 以下は仮想関数
//-------------------------------------
// 1フレーム分の信号処理の実行
virtual void SignalProcessing() = 0;
// サウンドエフェクタのパラメータ変更など
virtual void Modefy() {}
// 曲の再生中に表示する
virtual void Display() {}
// サウンドエフェクタ処理のデータ等のクリア
virtual void Clear() {}
};
}
#endif // F746_SD_PLAYER_SKELETON_HPP