Fix button display

pull/1/head
asb2m10 11 years ago
parent f8eb2b09a5
commit 3e7b5f50a3
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 24
      Source/PluginParam.cpp
  3. 1
      Source/PluginParam.h
  4. 8
      Source/PluginProcessor.cpp
  5. 1
      Source/PluginProcessor.h

@ -79,7 +79,7 @@ void Ctrl::sliderValueChanged(Slider* moved) {
}
void Ctrl::buttonClicked(Button* clicked) {
publishValue(clicked->getToggleStateValue() == 1 ? 1 : 0);
publishValue(clicked->getToggleState());
}
void Ctrl::comboBoxChanged(ComboBox* combo) {
@ -160,10 +160,11 @@ String CtrlDX::getValueDisplay() {
void CtrlDX::publishValue(float value) {
Ctrl::publishValue(value / steps);
DexedAudioProcessorEditor *editor = (DexedAudioProcessorEditor *) parent->getActiveEditor();
if ( editor == NULL )
if ( editor == NULL ) {
return;
}
String msg;
msg << label << " = " << getValueDisplay();
editor->global.setParamMessage(msg);
@ -177,6 +178,10 @@ void CtrlDX::comboBoxChanged(ComboBox* combo) {
publishValue(combo->getSelectedId() - 1);
}
void CtrlDX::buttonClicked(Button *button) {
publishValue((int) button->getToggleState());
}
void CtrlDX::updateComponent() {
if (slider != NULL) {
slider->setValue(getValue() + displayValue,
@ -185,11 +190,9 @@ void CtrlDX::updateComponent() {
if (button != NULL) {
if (getValue() == 0) {
button->setToggleState(false,
dontSendNotification);
button->setToggleState(false, dontSendNotification);
} else {
button->setToggleState(true,
dontSendNotification);
button->setToggleState(true, dontSendNotification);
}
}
@ -418,6 +421,13 @@ void DexedAudioProcessor::setCurrentProgram(int index) {
lfo.reset(data + 137);
currentProgram = index;
triggerAsyncUpdate();
// reset parameter display
DexedAudioProcessorEditor *editor = (DexedAudioProcessorEditor *) getActiveEditor();
if ( editor == NULL ) {
return;
}
editor->global.setParamMessage("");
}
const String DexedAudioProcessor::getProgramName(int index) {

@ -96,6 +96,7 @@ public:
void sliderValueChanged (Slider* moved);
void comboBoxChanged (ComboBox* combo);
void buttonClicked (Button* buttonThatWasClicked);
void updateComponent();
};

@ -226,14 +226,6 @@ void DexedAudioProcessor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& mi
}
}
void DexedAudioProcessor::processSamples(int n_samples, float *buffer) {
int i;
extra_buf_size = i - n_samples;
}
//==============================================================================
// This creates new instances of the plugin..

@ -83,7 +83,6 @@ class DexedAudioProcessor : public AudioProcessor, public AsyncUpdater
void processMidiMessage(MidiMessage *msg);
void keydown(uint8_t pitch, uint8_t velo);
void keyup(uint8_t pitch);
void processSamples(int n_samples, float *buffer);
/**
* this is called from the Audio thread to tell

Loading…
Cancel
Save