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

SD_PlayerSkeleton.hpp

Committer:
MikamiUitOpen
Date:
2016-10-02
Revision:
2:511479736d6e
Parent:
1:c7968701f7b3
Child:
4:d730d024ac32

File content as of revision 2:511479736d6e:

//--------------------------------------------------------------
//  SD プレーヤー用抽象基底クラス(ヘッダ)
//
//  2016/10/02, 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_; }

    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