Skip to content

Commit

Permalink
replace calls to new button with shift button (SynthstromAudible#1786)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-m-adams authored Apr 28, 2024
1 parent 50fb996 commit 8f68c2c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/deluge/gui/ui/keyboard/keyboard_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ ActionResult KeyboardScreen::buttonAction(deluge::hid::Button b, bool on, bool i
else if (b == KIT && currentUIMode == UI_MODE_NONE) {
if (on) {
bool result;
if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
result = createNewInstrument(OutputType::KIT);
}
else {
Expand All @@ -508,7 +508,7 @@ ActionResult KeyboardScreen::buttonAction(deluge::hid::Button b, bool on, bool i
else if (b == SYNTH && currentUIMode == UI_MODE_NONE) {
if (on) {
bool result;
if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
result = createNewInstrument(OutputType::SYNTH);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/deluge/gui/ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void nullifyUIs() {

void renderUIsForOled() {
int32_t u = numUIsOpen - 1;
while (u && uiNavigationHierarchy[u]->oledShowsUIUnderneath) {
while ((u > 0) && uiNavigationHierarchy[u]->oledShowsUIUnderneath) {
u--;
}

Expand Down
4 changes: 2 additions & 2 deletions src/deluge/gui/views/automation_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ void AutomationView::handleKitButtonAction(OutputType outputType, bool on) {
initParameterSelection();
resetParameterShortcutBlinking();
}
if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
instrumentClipView.createNewInstrument(OutputType::KIT);
}
else {
Expand All @@ -1706,7 +1706,7 @@ void AutomationView::handleSynthButtonAction(OutputType outputType, bool on) {
resetParameterShortcutBlinking();
}
// this gets triggered when you change an existing clip to synth / create a new synth clip in song mode
if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
instrumentClipView.createNewInstrument(OutputType::SYNTH);
}
// this gets triggered when you change clip type to synth from within inside clip view
Expand Down
4 changes: 2 additions & 2 deletions src/deluge/gui/views/instrument_clip_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ ActionResult InstrumentClipView::buttonAction(deluge::hid::Button b, bool on, bo
return ActionResult::REMIND_ME_OUTSIDE_CARD_ROUTINE;
}

if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
createNewInstrument(OutputType::KIT);
}
else {
Expand All @@ -460,7 +460,7 @@ ActionResult InstrumentClipView::buttonAction(deluge::hid::Button b, bool on, bo
}

if (currentUIMode == UI_MODE_NONE) {
if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
createNewInstrument(OutputType::SYNTH);
}
else {
Expand Down
8 changes: 0 additions & 8 deletions src/deluge/hid/buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,6 @@ bool shiftHasChanged() {
return toReturn;
}

bool isNewOrShiftButtonPressed() {
#ifdef BUTTON_NEW_X
return buttonStates[BUTTON_NEW_X][BUTTON_NEW_Y];
#else
return buttonStates[shiftButtonCoord.x][shiftButtonCoord.y];
#endif
}

// Correct any misunderstandings
void noPressesHappening(bool inCardRoutine) {
for (int32_t x = 0; x < NUM_BUTTON_COLS; x++) {
Expand Down
1 change: 0 additions & 1 deletion src/deluge/hid/buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace Buttons {
ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine);
bool isButtonPressed(deluge::hid::Button b);
bool isShiftButtonPressed();
bool isNewOrShiftButtonPressed();
void noPressesHappening(bool inCardRoutine);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/deluge/model/clip/instrument_clip_minder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ ActionResult InstrumentClipMinder::buttonAction(deluge::hid::Button b, bool on,
// Which-instrument-type buttons
else if (b == SYNTH) {
if (on && currentUIMode == UI_MODE_NONE) {
if (Buttons::isNewOrShiftButtonPressed()) {
if (Buttons::isShiftButtonPressed()) {
createNewInstrument(OutputType::SYNTH);
}
else {
Expand Down

0 comments on commit 8f68c2c

Please sign in to comment.