4 Star 2 Fork 1

BLumia / PineappleSynth

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ADSRVisualizationControl.h 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
BLumia 提交于 2016-08-22 23:46 . a little work..
#pragma once
#include <vector>
#include "IControl.h"
class IPoint {
public:
double x;
double y;
bool operator < (const IPoint& point) const { return (this->x < point.x); };
bool operator >(const IPoint& point) const { return (this->x > point.x); };
};
class ADSRVisualizationControl : public IControl {
private:
IColor lineColor;
void initPoints();
float attack, sustain, decay, release;
IPoint startPoint, attackPoint, retainPoint, endPoint; //names should be changed.
void updatePointPosition();
protected:
double convertToGraphicX(double value);
double convertToPercentX(double value);
double convertToGraphicY(double value);
double convertToPercentY(double value);
public:
ADSRVisualizationControl(IPlugBase *pPlug, IRECT pR) : IControl(pPlug, pR),
lineColor(100, 0, 255, 0) {
initPoints();
};
~ADSRVisualizationControl() {};
void setColor(IColor color) { lineColor = color; };
void setADSR(float att, float dec, float sus, float rel);
//bool IsDirty() { return true; }; // Don't need this.
bool Draw(IGraphics *pGraphics);
};
C++
1
https://gitee.com/blumia/PineappleSynth.git
git@gitee.com:blumia/PineappleSynth.git
blumia
PineappleSynth
PineappleSynth
master

搜索帮助