不韋 呂 / F746_SD_GraphicEqualizer

Dependencies:   F746_GUI F746_SAI_IO SD_PlayerSkeleton FrequencyResponseDrawer

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GrEqDesignerDrawer.hpp Source File

GrEqDesignerDrawer.hpp

00001 //------------------------------------------------------------------------------
00002 //  イコライザ用フィルタのパラメータを設定し,その周波数特性を描画するためのクラス -- Header
00003 //  
00004 //  2016/04/10, Copyright (c) 2017 MIKAMI, Naoki
00005 //------------------------------------------------------------------------------
00006 
00007 #ifndef F746_GREQ_DISIGNER_AND_DRAWER_HPP
00008 #define F746_GREQ_DISIGNER_AND_DRAWER_HPP
00009 
00010 #include "NumericLabel.hpp"
00011 #include "FrquencyResponseDrawer.hpp"
00012 #include "GrEqParamsCalculator.hpp"
00013 #include "GrEqualizerFrqResp.hpp"
00014 
00015 namespace Mikami
00016 {
00017     class GrEqDesignerDrawer
00018     {
00019     public:
00020         // Constructor
00021         GrEqDesignerDrawer(uint16_t x0, uint16_t y0, float db1,
00022                            int bands, float f0, int fs);
00023 
00024         virtual ~GrEqDesignerDrawer() {};
00025 
00026         // 周波数特性の描画
00027         void DrawResponse();
00028 
00029         // 周波数特性の平坦化と描画
00030         void DrawFlat();
00031 
00032         // 特定のバンドのイコライザ用フィルタのパラメータの設定と周波数特性の再描画
00033         void DesignAndRedraw(float gainDb, int n);
00034 
00035         BiquadGrEq::Coefs GetCoefficient(int n) { return ck_[n]; }
00036 
00037         uint16_t GetX0()
00038         {   return drawerObj_.X(f0_[0]); }
00039         
00040         uint16_t GetSpaceX()
00041         {   return (uint16_t)(drawerObj_.X(f0_[1])
00042                             - drawerObj_.X(f0_[0])); }
00043 
00044         int GetBands() { return BANDS_; }
00045 
00046     private:
00047         const uint16_t X0_, Y0_;
00048         const int BANDS_;
00049         const float Q_VAL_;
00050 
00051         Array<float> f0_;   // 中心周波数を格納する配列のポインタ
00052         Array<BiquadGrEq::Coefs> ck_;   // フィルタの係数
00053         GrEqParams calculator_;
00054         GrEqualizerFrqResp frqResp_;    // フィルタの周波数応答に対応するオブジェクト
00055         FrqRespDrawer drawerObj_;
00056     };
00057 }
00058 #endif  // F746_GREQ_DISIGNER_AND_DRAWER_HPP