Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

surge-fx: delete AccSlider #7950

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions src/surge-fx/SurgeFXEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,60 +114,6 @@ class SurgefxAudioProcessorEditor : public juce::AudioProcessorEditor,
std::vector<std::unique_ptr<KnobSource>> sources;

private:
struct AccSlider : public juce::Slider
{
AccSlider() { setWantsKeyboardFocus(true); }
juce::String getTextFromValue(double v) override
{
// std::cout << "GTFV " << v << std::endl;
// return juce::Slider::getTextFromValue(v);
// This is a bit of a hack to externalize this but
return tv;
}

juce::String tv;
void setTextValue(juce::String s)
{
tv = s;
if (auto *handler = getAccessibilityHandler())
{
handler->notifyAccessibilityEvent(juce::AccessibilityEvent::valueChanged);
}
}
bool keyPressed(const juce::KeyPress &key) override
{
float amt = 0.05;
if (key.getModifiers().isShiftDown())
amt = 0.01;
if (key.getKeyCode() == juce::KeyPress::upKey)
{
setValue(std::clamp(getValue() + amt, 0., 1.),
juce::NotificationType::sendNotification);
return true;
}

if (key.getKeyCode() == juce::KeyPress::downKey)
{
setValue(std::clamp(getValue() - amt, 0., 1.),
juce::NotificationType::sendNotification);
return true;
}

if (key.getKeyCode() == juce::KeyPress::homeKey)
{
setValue(1., juce::NotificationType::sendNotification);
return true;
}

if (key.getKeyCode() == juce::KeyPress::endKey)
{
setValue(0., juce::NotificationType::sendNotification);
return true;
}
return false;
}
};

SurgeFXParamDisplay fxParamDisplay[n_fx_params];
SurgeTempoSyncSwitch fxTempoSync[n_fx_params];
SurgeTempoSyncSwitch fxDeactivated[n_fx_params];
Expand Down
Loading