Skip to content

Commit

Permalink
Group operators for accessiblity
Browse files Browse the repository at this point in the history
  • Loading branch information
asb2m10 committed Aug 15, 2024
1 parent 800748f commit 947ffa5
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 139 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,35 @@ the original machine.
Dexed is licensed on the GPL v3. The msfa component (acronym for music synthesizer for android, see msfa
in the source folder) stays on the Apache 2.0 license to able to collaborate between projects.

Donation
--------
As a maintainer of this 10 year old project, donations are welcomed. This also applies for the Apple users
to cover for the notarization of this software in the comming years. Thank you!

https://www.paypal.com/paypalme/asb2m10

Dexed Forks
-----------
* [MiniDexed](https://github.com/probonopd/MiniDexed) Run a DX7 bare metal from a Raspberry Pi
* [SIMD-optimized](https://github.com/risicle/dexed/tree/ris-highway) CPU optimized version with [highway](https://github.com/google/highway/tree/master)

Changelog
---------
#### Version 0.9.8 (in development)
* Accessibility implementation
* Cartridge Manager UI refactoring (e.g. display .syx cartridge name)
* Mono/Poly parameter is now a plugin parameter
* Fix Logic startup issue

#### Version 0.9.7
* [MTS-ESP](https://oddsound.com/index.php) microtuning support
* [CLAP](https://github.com/free-audio/clap) plugin support (sadly scaling is not available for now, but we are working on this)
* Scalable UI upgrade (better resolution), optimized UI redraw
* More accurate VU meter. Thanks @FulopNandor
* Releases are now notarized for mac OS
* Releases are now notarized for macOS
* Fix for VST3 automation (again)
* For developers: cmake is now the built system


#### Version 0.9.6
* Apple Silicon M1 builds
* Fix VST3 automation issues
Expand Down
6 changes: 5 additions & 1 deletion Source/DXComponents.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright (c) 2014 Pascal Gauthier.
* Copyright (c) 2014-2024 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
Expand Down Expand Up @@ -71,6 +71,10 @@ class ComboBoxImage : public ComboBox {

class ProgramSelector : public ComboBox {
public:
ProgramSelector() {
setWantsKeyboardFocus(true);
setTitle("Program selector");
}
virtual void mouseDown(const MouseEvent &event) override;
virtual void mouseEnter(const MouseEvent &event) override { accum_wheel = 0; }
virtual void mouseWheelMove(const MouseEvent &event, const MouseWheelDetails &wheel) override;
Expand Down
3 changes: 3 additions & 0 deletions Source/GlobalEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ GlobalEditor::GlobalEditor ()

background = lookAndFeel->imageGlobal;
imageLight = lookAndFeel->imageLight;
setTitle("Global Parameters");
setFocusContainerType(FocusContainerType::focusContainer);
aboutButton->setTitle("About DEXED");
//[/Constructor]
}

Expand Down
3 changes: 3 additions & 0 deletions Source/OperatorEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ OperatorEditor::OperatorEditor ()
background = lookAndFeel->imageOperator;

opSwitch->setTitle("Operator switch");
opMode->setTitle("Operator Mode");
kbdLeftCurve->setTitle("Keyboard Left Curve");
kbdRightCurve->setTitle("Keyboard Right Curve");

Expand Down Expand Up @@ -556,6 +557,8 @@ void OperatorEditor::bind(DexedAudioProcessor *parent, int op) {

opNum << op + 1;
internalOp = 5-op;
setTitle("Operator " + opNum);
setFocusContainerType(FocusContainerType::focusContainer);
}

void OperatorEditor::updateGain(float v) {
Expand Down
5 changes: 5 additions & 0 deletions Source/PluginData.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ class Cartridge {
dest.add( normalizePgmName(getRawVoice() + ((i * 128) + 118)) );
}

String getProgramName(int idx) {
jassert(idx >= 0 && idx < 32);
return normalizePgmName(getRawVoice() + ((idx * 128) + 118));
}

Cartridge operator =(const Cartridge other) {
memcpy(voiceData, other.voiceData, SYSEX_SIZE);
memcpy(perfData, other.perfData, SYSEX_SIZE);
Expand Down
243 changes: 122 additions & 121 deletions Source/PluginParam.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright (c) 2013-2017 Pascal Gauthier.
* Copyright (c) 2013-2024 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
Expand Down Expand Up @@ -40,6 +40,127 @@ class CtrlUpdate : public CallbackMessage {
}
};

// ************************************************************************
//
Ctrl::Ctrl(String name) {
label << name;
slider = NULL;
button = NULL;
comboBox = NULL;
}

void Ctrl::bind(Slider *s) {
slider = s;
updateComponent();
s->addListener(this);
s->addMouseListener(this, true);
s->setVelocityModeParameters (0.1, 1, 0.05, 1, ModifierKeys::shiftModifier);
s->setTitle(label);
s->textFromValueFunction = [this](double value) { return this->getValueDisplay(); };
s->setWantsKeyboardFocus(true);
}

void Ctrl::bind(Button *b) {
button = b;
updateComponent();
b->addListener(this);
b->addMouseListener(this, true);
}

void Ctrl::bind(ComboBox *c) {
comboBox = c;
updateComponent();
c->addListener(this);
c->addMouseListener(this, true);
}

void Ctrl::unbind() {
if (slider != NULL) {
slider->removeListener(this);
slider->removeMouseListener(this);
slider = NULL;
}

if (button != NULL) {
button->removeListener(this);
button->removeMouseListener(this);
button = NULL;
}

if (comboBox != NULL) {
comboBox->removeListener(this);
comboBox->removeMouseListener(this);
comboBox = NULL;
}
}

void Ctrl::publishValueAsync(float value) {
CtrlUpdate *update = new CtrlUpdate(this, value);
update->post();
}

void Ctrl::publishValue(float value) {
parent->beginParameterChangeGesture(idx);
parent->setParameterNotifyingHost(idx, value);
parent->endParameterChangeGesture(idx);
}

void Ctrl::sliderValueChanged(Slider* moved) {
publishValue(moved->getValue());
}

void Ctrl::buttonClicked(Button* clicked) {
publishValue(clicked->getToggleState());
}

void Ctrl::comboBoxChanged(ComboBox* combo) {
publishValue((combo->getSelectedId() - 1) / combo->getNumItems());
}

void Ctrl::mouseEnter(const juce::MouseEvent &event) {
updateDisplayName();
}

void Ctrl::mouseDown(const juce::MouseEvent &event) {
if ( event.mods.isPopupMenu()) {
PopupMenu popup;

if ( parent->mappedMidiCC.containsValue(this) ) {
popup.addItem(3, "Re-Map controller to midi CC for: " + String(label));
popup.addSeparator();
popup.addItem(1, "Remove midi CC mapping for this controller");
} else {
popup.addItem(3, "Map controller to midi CC for: " + String(label));
popup.addSeparator();
}
popup.addItem(2, "Clear midi CC mapping");

switch(popup.show()) {
case 1:
parent->mappedMidiCC.removeValue(this);
parent->savePreference();
break;
case 2:
if ( AlertWindow::showYesNoCancelBox(AlertWindow::WarningIcon, "Confirm", "Clear midi mapping for all controller change (CC) messages?", "YES", "NO", "CANCEL") ) {
parent->mappedMidiCC.clear();
parent->savePreference();
}
break;
case 3:
AudioProcessorEditor *editor = parent->getActiveEditor();
if ( editor == NULL ) {
return;
}
DexedAudioProcessorEditor *dexedEditor = (DexedAudioProcessorEditor *) editor;
dexedEditor->discoverMidiCC(this);
break;
}
}
}

void Ctrl::updateDisplayName() {
}

// ************************************************************************
// Custom displays

Expand Down Expand Up @@ -228,126 +349,6 @@ class CtrlMonoPoly : public Ctrl {
}
};

// ************************************************************************
//
Ctrl::Ctrl(String name) {
label << name;
slider = NULL;
button = NULL;
comboBox = NULL;
}

void Ctrl::bind(Slider *s) {
slider = s;
updateComponent();
s->addListener(this);
s->addMouseListener(this, true);
s->setVelocityModeParameters (0.1, 1, 0.05, 1, ModifierKeys::shiftModifier);
s->textFromValueFunction = [this](double value) { return this->label + this->getValueDisplay(); };
s->setWantsKeyboardFocus(true);
}

void Ctrl::bind(Button *b) {
button = b;
updateComponent();
b->addListener(this);
b->addMouseListener(this, true);
}

void Ctrl::bind(ComboBox *c) {
comboBox = c;
updateComponent();
c->addListener(this);
c->addMouseListener(this, true);
}

void Ctrl::unbind() {
if (slider != NULL) {
slider->removeListener(this);
slider->removeMouseListener(this);
slider = NULL;
}

if (button != NULL) {
button->removeListener(this);
button->removeMouseListener(this);
button = NULL;
}

if (comboBox != NULL) {
comboBox->removeListener(this);
comboBox->removeMouseListener(this);
comboBox = NULL;
}
}

void Ctrl::publishValueAsync(float value) {
CtrlUpdate *update = new CtrlUpdate(this, value);
update->post();
}

void Ctrl::publishValue(float value) {
parent->beginParameterChangeGesture(idx);
parent->setParameterNotifyingHost(idx, value);
parent->endParameterChangeGesture(idx);
}

void Ctrl::sliderValueChanged(Slider* moved) {
publishValue(moved->getValue());
}

void Ctrl::buttonClicked(Button* clicked) {
publishValue(clicked->getToggleState());
}

void Ctrl::comboBoxChanged(ComboBox* combo) {
publishValue((combo->getSelectedId() - 1) / combo->getNumItems());
}

void Ctrl::mouseEnter(const juce::MouseEvent &event) {
updateDisplayName();
}

void Ctrl::mouseDown(const juce::MouseEvent &event) {
if ( event.mods.isPopupMenu()) {
PopupMenu popup;

if ( parent->mappedMidiCC.containsValue(this) ) {
popup.addItem(3, "Re-Map controller to midi CC for: " + String(label));
popup.addSeparator();
popup.addItem(1, "Remove midi CC mapping for this controller");
} else {
popup.addItem(3, "Map controller to midi CC for: " + String(label));
popup.addSeparator();
}
popup.addItem(2, "Clear midi CC mapping");

switch(popup.show()) {
case 1:
parent->mappedMidiCC.removeValue(this);
parent->savePreference();
break;
case 2:
if ( AlertWindow::showYesNoCancelBox(AlertWindow::WarningIcon, "Confirm", "Clear midi mapping for all controller change (CC) messages?", "YES", "NO", "CANCEL") ) {
parent->mappedMidiCC.clear();
parent->savePreference();
}
break;
case 3:
AudioProcessorEditor *editor = parent->getActiveEditor();
if ( editor == NULL ) {
return;
}
DexedAudioProcessorEditor *dexedEditor = (DexedAudioProcessorEditor *) editor;
dexedEditor->discoverMidiCC(this);
break;
}
}
}

void Ctrl::updateDisplayName() {
}

// ************************************************************************
// CtrlFloat - control float values
CtrlFloat::CtrlFloat(String name, float *storageValue) : Ctrl(name) {
Expand Down
2 changes: 1 addition & 1 deletion Source/ProgramListBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ bool ProgramListBox::keyPressed(const KeyPress &key, Component *originatingCompo

repaint();
return true;
}
}
15 changes: 1 addition & 14 deletions Source/ProgramListBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,7 @@ class ProgramListBox : public Component, public DragAndDropTarget, public KeyLis

bool keyPressed (const KeyPress& key, Component* originatingComponent) override;

struct ProgramListBoxAH : public juce::AccessibilityHandler {
explicit ProgramListBoxAH(ProgramListBox *s): od(s), juce::AccessibilityHandler(*s, juce::AccessibilityRole::table,
juce::AccessibilityActions().addAction(juce::AccessibilityActionType::focus,
[this]() { })) {
}

ProgramListBox *od;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ProgramListBoxAH);
};


std::unique_ptr< AccessibilityHandler > createAccessibilityHandler(ProgramListBox *programListBox) {
return std::make_unique<ProgramListBoxAH>(programListBox);
}
std::unique_ptr< AccessibilityHandler > createAccessibilityHandler(ProgramListBox *programListBox);
};


Expand Down

0 comments on commit 947ffa5

Please sign in to comment.