![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
revised version of F746_SD_GraphicEqualizer
Dependencies: BSP_DISCO_F746NG F746_GUI F746_SAI_IO FrequencyResponseDrawer LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed
Fork of F746_SD_GraphicEqualizer by
MyClasses_Functions/DesignerDrawer.hpp@12:87f6955b5a80, 2016-07-07 (annotated)
- Committer:
- edamame22
- Date:
- Thu Jul 07 05:58:52 2016 +0000
- Revision:
- 12:87f6955b5a80
- Parent:
- 8:12aa05f3cc24
added highlighted line for track selection
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 8:12aa05f3cc24 | 1 | //------------------------------------------------------------------------------ |
MikamiUitOpen | 8:12aa05f3cc24 | 2 | // イコライザ用フィルタのパラメータを設定し,その周波数特性を描画するためのクラス -- Header |
MikamiUitOpen | 8:12aa05f3cc24 | 3 | // |
MikamiUitOpen | 8:12aa05f3cc24 | 4 | // 2016/05/09, Copyright (c) 2016 MIKAMI, Naoki |
MikamiUitOpen | 8:12aa05f3cc24 | 5 | //------------------------------------------------------------------------------ |
MikamiUitOpen | 8:12aa05f3cc24 | 6 | |
MikamiUitOpen | 8:12aa05f3cc24 | 7 | #ifndef F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 8:12aa05f3cc24 | 8 | #define F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 8:12aa05f3cc24 | 9 | |
MikamiUitOpen | 8:12aa05f3cc24 | 10 | #include "NumericLabel.hpp" |
MikamiUitOpen | 8:12aa05f3cc24 | 11 | #include "FrquencyResponseDrawer.hpp" |
MikamiUitOpen | 8:12aa05f3cc24 | 12 | #include "GrEqParamsCalculator.hpp" |
MikamiUitOpen | 8:12aa05f3cc24 | 13 | #include "GrEqualizerFrqResp.hpp" |
MikamiUitOpen | 8:12aa05f3cc24 | 14 | |
MikamiUitOpen | 8:12aa05f3cc24 | 15 | namespace Mikami |
MikamiUitOpen | 8:12aa05f3cc24 | 16 | { |
MikamiUitOpen | 8:12aa05f3cc24 | 17 | class DesignerDrawer |
MikamiUitOpen | 8:12aa05f3cc24 | 18 | { |
MikamiUitOpen | 8:12aa05f3cc24 | 19 | public: |
MikamiUitOpen | 8:12aa05f3cc24 | 20 | // Constructor |
MikamiUitOpen | 8:12aa05f3cc24 | 21 | DesignerDrawer(uint16_t x0, uint16_t y0, |
MikamiUitOpen | 8:12aa05f3cc24 | 22 | int stages, float f0, int fs, float db1); |
MikamiUitOpen | 8:12aa05f3cc24 | 23 | |
MikamiUitOpen | 8:12aa05f3cc24 | 24 | ~DesignerDrawer(); |
MikamiUitOpen | 8:12aa05f3cc24 | 25 | |
MikamiUitOpen | 8:12aa05f3cc24 | 26 | // 周波数特性の描画 |
MikamiUitOpen | 8:12aa05f3cc24 | 27 | void DrawResponse(); |
MikamiUitOpen | 8:12aa05f3cc24 | 28 | |
MikamiUitOpen | 8:12aa05f3cc24 | 29 | // 周波数特性の平坦化と描画 |
MikamiUitOpen | 8:12aa05f3cc24 | 30 | void DrawFlat(); |
MikamiUitOpen | 8:12aa05f3cc24 | 31 | |
MikamiUitOpen | 8:12aa05f3cc24 | 32 | // 特定のバンドのイコライザ用フィルタのパラメータの設定と周波数特性の再描画 |
MikamiUitOpen | 8:12aa05f3cc24 | 33 | void DesignAndRedraw(float gainDb, int n); |
MikamiUitOpen | 8:12aa05f3cc24 | 34 | |
MikamiUitOpen | 8:12aa05f3cc24 | 35 | void GetCoefficients(BiquadGrEq::Coefs ck[]) |
MikamiUitOpen | 8:12aa05f3cc24 | 36 | { for (int n=0; n<BANDS_; n++) ck[n] = ck_[n]; } |
MikamiUitOpen | 8:12aa05f3cc24 | 37 | |
MikamiUitOpen | 8:12aa05f3cc24 | 38 | BiquadGrEq::Coefs GetCoefficient(int n) { return ck_[n]; } |
MikamiUitOpen | 8:12aa05f3cc24 | 39 | |
MikamiUitOpen | 8:12aa05f3cc24 | 40 | uint16_t GetX0() |
MikamiUitOpen | 8:12aa05f3cc24 | 41 | { return drawerObj_->X(f0_[0]); } |
MikamiUitOpen | 8:12aa05f3cc24 | 42 | |
MikamiUitOpen | 8:12aa05f3cc24 | 43 | uint16_t GetSpaceX() |
MikamiUitOpen | 8:12aa05f3cc24 | 44 | { return (uint16_t)(drawerObj_->X(f0_[1]) |
MikamiUitOpen | 8:12aa05f3cc24 | 45 | - drawerObj_->X(f0_[0])); } |
MikamiUitOpen | 8:12aa05f3cc24 | 46 | |
MikamiUitOpen | 8:12aa05f3cc24 | 47 | int GetStages() { return BANDS_; } |
MikamiUitOpen | 8:12aa05f3cc24 | 48 | |
MikamiUitOpen | 8:12aa05f3cc24 | 49 | private: |
MikamiUitOpen | 8:12aa05f3cc24 | 50 | LCD_DISCO_F746NG *lcd_; |
MikamiUitOpen | 8:12aa05f3cc24 | 51 | TS_DISCO_F746NG *ts_; |
MikamiUitOpen | 8:12aa05f3cc24 | 52 | |
MikamiUitOpen | 8:12aa05f3cc24 | 53 | const uint16_t X0_, Y0_; |
MikamiUitOpen | 8:12aa05f3cc24 | 54 | const int BANDS_; |
MikamiUitOpen | 8:12aa05f3cc24 | 55 | const float Q_VAL_; |
MikamiUitOpen | 8:12aa05f3cc24 | 56 | |
MikamiUitOpen | 8:12aa05f3cc24 | 57 | float *f0_; // 中心周波数を格納する配列のポインタ |
MikamiUitOpen | 8:12aa05f3cc24 | 58 | GrEqParams *calculator_; |
MikamiUitOpen | 8:12aa05f3cc24 | 59 | GrEqualizerFrqResp *frqResp_; // フィルタの周波数応答に対応するオブジェクト |
MikamiUitOpen | 8:12aa05f3cc24 | 60 | BiquadGrEq::Coefs *ck_; // フィルタの係数 |
MikamiUitOpen | 8:12aa05f3cc24 | 61 | FrqRespDrawer *drawerObj_; |
MikamiUitOpen | 8:12aa05f3cc24 | 62 | }; |
MikamiUitOpen | 8:12aa05f3cc24 | 63 | } |
MikamiUitOpen | 8:12aa05f3cc24 | 64 | #endif // F746_DISIGNER_AND_DRAWER_HPP |