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

@ -96,6 +96,7 @@ public:
void sliderValueChanged (Slider* moved); void sliderValueChanged (Slider* moved);
void comboBoxChanged (ComboBox* combo); void comboBoxChanged (ComboBox* combo);
void buttonClicked (Button* buttonThatWasClicked);
void updateComponent(); 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.. // This creates new instances of the plugin..

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

Loading…
Cancel
Save