You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dexed/Source/PluginParam.h

122 lines
3.3 KiB

11 years ago
/**
*
* Copyright (c) 2013 Pascal Gauthier.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef PLUGINPARAM_H_INCLUDED
#define PLUGINPARAM_H_INCLUDED
#include "../JuceLibraryCode/JuceHeader.h"
class DexedAudioProcessor;
class Ctrl : public SliderListener, public ButtonListener, public ComboBoxListener {
protected:
/**
* Binded components of the UI
*/
Slider *slider;
Button *button;
ComboBox *comboBox;
public:
11 years ago
String label;
11 years ago
11 years ago
Ctrl(String name);
11 years ago
void bind(Slider *s);
void bind(Button *b);
void bind(ComboBox *c);
void unbind();
// use this to signal a parameter change to the host
void publishValue(float value);
11 years ago
/**
* Host value is related 0.0 to 1.0 values
*/
virtual void setValueHost(float f) = 0;
virtual float getValueHost() = 0;
11 years ago
virtual String getValueDisplay() = 0;
11 years ago
virtual void updateComponent() = 0;
void comboBoxChanged (ComboBox* combo);
void sliderValueChanged (Slider* moved);
void buttonClicked (Button* buttonThatWasClicked);
11 years ago
/**
* Index of this parameter
*/
int idx;
11 years ago
DexedAudioProcessor *parent;
};
class CtrlFloat : public Ctrl {
float *vPointer;
public:
CtrlFloat(String name, float *storageValue);
void setValueHost(float f);
float getValueHost();
String getValueDisplay();
void updateComponent();
};
// CtrlDX is a controller that is related to DX parameters
class CtrlDX : public Ctrl {
int dxValue;
11 years ago
int steps;
int dxOffset;
11 years ago
int displayValue;
11 years ago
public:
11 years ago
CtrlDX(String name, int steps, int offset = -1, int displayValue = 0);
void setValueHost(float f);
float getValueHost();
void publishValue(float value);
11 years ago
11 years ago
void setValue(int value);
int getValue();
11 years ago
String getValueDisplay();
int getOffset();
11 years ago
void sliderValueChanged (Slider* moved);
void comboBoxChanged (ComboBox* combo);
void updateComponent();
};
struct OperatorCtrl {
ScopedPointer<CtrlDX> egRate[4];
ScopedPointer<CtrlDX> egLevel[4];
ScopedPointer<CtrlDX> level;
ScopedPointer<CtrlDX> opMode;
ScopedPointer<CtrlDX> coarse;
ScopedPointer<CtrlDX> fine;
ScopedPointer<CtrlDX> detune;
ScopedPointer<CtrlDX> sclBrkPt;
ScopedPointer<CtrlDX> sclLeftDepth;
ScopedPointer<CtrlDX> sclRightDepth;
ScopedPointer<CtrlDX> sclLeftCurve;
ScopedPointer<CtrlDX> sclRightCurve;
ScopedPointer<CtrlDX> sclRate;
ScopedPointer<CtrlDX> ampModSens;
ScopedPointer<CtrlDX> velModSens;
11 years ago
};
#endif // PLUGINPARAM_H_INCLUDED