Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Builds/VisualStudio2017/
.vs/
*.exe

.vscode

JuceLibraryCode/
Builds/
assets/
Expand Down
2 changes: 2 additions & 0 deletions Documentation/KeyboardShortcuts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
X = Octave down\
C = Octave up
1 change: 1 addition & 0 deletions Source/CartManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ void CartManager::initialFocus() {
}

bool CartManager::keyPressed(const KeyPress& key, Component* originatingComponent) {
// Keycode 13 is enter.
if ( key.getKeyCode() == 13 ) {
File file = cartBrowser->getSelectedFile();
if ( file.isDirectory() )
Expand Down
20 changes: 20 additions & 0 deletions Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
cartManager(this)
{
setSize(WINDOW_SIZE_X, (ownerFilter->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94));

setWantsKeyboardFocus(true);
addKeyListener(this);

processor = ownerFilter;

Expand Down Expand Up @@ -441,3 +444,20 @@ void DexedAudioProcessorEditor::filesDropped (const StringArray &files, int x, i
processor->applyKBMMapping( File( fn ) );
}
}

bool DexedAudioProcessorEditor::keyPressed(const KeyPress &key, Component *originatingComponent) {
if (key.getTextDescription() == "X") {
if (processor->octaveShift > 0) {
processor->octaveShift -= 1;
midiKeyboard.setKeyPressBaseOctave(processor->octaveShift);
}
return true;
} else if (key.getTextDescription() == "C") {
if (processor->octaveShift < 10) {
processor->octaveShift += 1;
midiKeyboard.setKeyPressBaseOctave(processor->octaveShift);
}
return true;
}
return false;
}
3 changes: 2 additions & 1 deletion Source/PluginEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
*/
class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox::Listener, public Timer,
public FileDragAndDropTarget {
public FileDragAndDropTarget, public juce::KeyListener {
MidiKeyboardComponent midiKeyboard;
OperatorEditor operators[6];
Colour background;
Expand Down Expand Up @@ -62,6 +62,7 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox:

virtual bool isInterestedInFileDrag (const StringArray &files) override;
virtual void filesDropped (const StringArray &files, int x, int y ) override;
virtual bool keyPressed (const KeyPress &key, Component *originatingComponent);

static const int WINDOW_SIZE_X = 866;
static const int WINDOW_SIZE_Y = 674;
Expand Down
2 changes: 2 additions & 0 deletions Source/PluginProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ public :
std::unique_ptr<CtrlFloat> output;
std::unique_ptr<Ctrl> tune;

int octaveShift = 5;

void loadCartridge(Cartridge &cart);
void setDxValue(int offset, int v);

Expand Down