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
Diff: SD_PlayerSkeleton.hpp
- Revision:
- 0:d310bb78455d
- Child:
- 1:c7968701f7b3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SD_PlayerSkeleton.hpp Mon Aug 15 04:38:45 2016 +0000
@@ -0,0 +1,64 @@
+//--------------------------------------------------------------
+// SD プレーヤー用抽象基底クラス(ヘッダ)
+//
+// 2016/07/17, Copyright (c) 2016 MIKAMI, Naoki
+//--------------------------------------------------------------
+
+#ifndef F746_SD_PLAYER_SKELETON_HPP
+#define F746_SD_PLAYER_SKELETON_HPP
+
+#include "SAI_InOut.hpp"
+#include "ButtonGroup.hpp"
+#include "FileSelectorWav.hpp"
+#include "SD_WavReader.hpp"
+
+using namespace Mikami;
+
+namespace Mikami
+{
+ class SD_PlayerSkeleton
+ {
+ public:
+ SD_PlayerSkeleton(string str, int fs);
+ virtual ~SD_PlayerSkeleton() {}
+ 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_; }
+
+ private:
+ string fileName_; // 選択されたファイル名
+ Label title_; // 上部に表示されるタイトル
+ FileSelector selector_;
+ ButtonGroup menu_;
+
+ // SD カードのファイルのオープン
+ int32_t SD_Open();
+ // ファイルの選択
+ void SelectFile();
+
+ //-------------------------------------
+ // 以下は仮想関数
+ //-------------------------------------
+ // 1フレーム分の信号処理の実行
+ virtual void SignalProcessing() = 0;
+ // サウンドエフェクタのパラメータ変更など
+ virtual void Modefy() {}
+ // 曲の再生中に表示する
+ virtual void Display() {}
+ // サウンドエフェクタ処理のデータ等のクリア
+ virtual void Clear() {}
+ };
+}
+#endif // F746_SD_PLAYER_SKELETON_HPP