Skip to content

Commit

Permalink
NavigationView initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
todd-gochenour committed Jan 29, 2025
1 parent 76d14f4 commit 374d3ed
Show file tree
Hide file tree
Showing 11 changed files with 750 additions and 41 deletions.
10 changes: 8 additions & 2 deletions src/deluge/gui/ui/keyboard/keyboard_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "gui/views/arranger_view.h"
#include "gui/views/automation_view.h"
#include "gui/views/instrument_clip_view.h"
#include "gui/views/navigation_view.h"
#include "gui/views/session_view.h"
#include "gui/views/view.h"
#include "hid/buttons.h"
Expand Down Expand Up @@ -727,8 +728,13 @@ void KeyboardScreen::selectLayout(int8_t offset) {
}

getCurrentInstrumentClip()->keyboardState.currentLayout = (KeyboardLayoutType)nextLayout;
if (getCurrentInstrumentClip()->keyboardState.currentLayout != lastLayout) {
display->displayPopup(l10n::get(layoutList[getCurrentInstrumentClip()->keyboardState.currentLayout]->name()));
const char* name = l10n::get(layoutList[getCurrentInstrumentClip()->keyboardState.currentLayout]->name());
if (naviview.useNavigationView()) {
naviview.textBuffer = name;
naviview.drawDashboard();
}
else if (getCurrentInstrumentClip()->keyboardState.currentLayout != lastLayout) {
display->displayPopup(name);
}

// Ensure scale mode is as expected
Expand Down
17 changes: 17 additions & 0 deletions src/deluge/gui/views/arranger_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "gui/views/audio_clip_view.h"
#include "gui/views/automation_view.h"
#include "gui/views/instrument_clip_view.h"
#include "gui/views/navigation_view.h"
#include "gui/views/session_view.h"
#include "gui/views/view.h"
#include "gui/waveform/waveform_renderer.h"
Expand Down Expand Up @@ -494,6 +495,9 @@ void ArrangerView::clearArrangement() {
}

uiNeedsRendering(this, 0xFFFFFFFF, 0);
if (naviview.useNavigationView()) {
naviview.drawDashboard();
}
}

bool ArrangerView::opened() {
Expand Down Expand Up @@ -2910,6 +2914,9 @@ ActionResult ArrangerView::horizontalScrollOneSquare(int32_t direction) {
}

uiNeedsRendering(this, 0xFFFFFFFF, 0);
if (naviview.useNavigationView()) {
naviview.drawDashboard();
}
reassessWhetherDoingAutoScroll();
}

Expand Down Expand Up @@ -3136,6 +3143,9 @@ void ArrangerView::graphicsRoutine() {
if (currentUIMode != UI_MODE_HORIZONTAL_ZOOM) {
uiNeedsRendering(ui, 0xFFFFFFFF, 0);
}
if (naviview.useNavigationView()) {
naviview.drawDashboard();
}
}
}

Expand Down Expand Up @@ -3174,6 +3184,10 @@ void ArrangerView::graphicsRoutine() {

PadLEDs::setTickSquares(tickSquares, colours);
lastTickSquare = newTickSquare;

if (naviview.useNavigationView()) {
naviview.drawDashboard();
}
}
}

Expand Down Expand Up @@ -3231,6 +3245,9 @@ void ArrangerView::autoScrollOnPlaybackEnd() {
sharpJump:
currentSong->xScroll[NAVIGATION_ARRANGEMENT] = newScrollPos;
uiNeedsRendering(this, 0xFFFFFFFF, 0);
if (naviview.useNavigationView()) {
naviview.drawDashboard();
}
}
}
}
Expand Down
55 changes: 49 additions & 6 deletions src/deluge/gui/views/automation_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "gui/views/arranger_view.h"
#include "gui/views/audio_clip_view.h"
#include "gui/views/instrument_clip_view.h"
#include "gui/views/navigation_view.h"
#include "gui/views/session_view.h"
#include "gui/views/timeline_view.h"
#include "gui/views/view.h"
Expand Down Expand Up @@ -1276,6 +1277,12 @@ void AutomationView::renderAutomationOverviewDisplayOLED(deluge::hid::display::o
deluge::hid::display::OLED::drawPermanentPopupLookingText(overviewText);
}
else {
if (naviview.useNavigationView()) {
naviview.drawDashboard();
naviview.drawMainboard();
naviview.drawBaseboard();
return;
}
overviewText = l10n::get(l10n::String::STRING_FOR_AUTOMATION_OVERVIEW);
canvas.drawStringCentred(overviewText, yPos, kTextSpacingX, kTextSpacingY);
}
Expand All @@ -1293,7 +1300,15 @@ void AutomationView::renderAutomationEditorDisplayOLED(deluge::hid::display::ole
#else
int32_t yPos = OLED_MAIN_TOPMOST_PIXEL + 3;
#endif
canvas.drawStringCentredShrinkIfNecessary(parameterName.c_str(), yPos, kTextSpacingX, kTextSpacingY);
if (naviview.useNavigationView()) {
naviview.parameterName.clear();
naviview.parameterName.append(parameterName.c_str());
naviview.knobPosLeft = knobPosLeft;
naviview.knobPosRight = knobPosRight;
}
else {
canvas.drawStringCentredShrinkIfNecessary(parameterName.c_str(), yPos, kTextSpacingX, kTextSpacingY);
}

// display automation status
yPos = yPos + 12;
Expand Down Expand Up @@ -1326,12 +1341,22 @@ void AutomationView::renderAutomationEditorDisplayOLED(deluge::hid::display::ole
}
}

canvas.drawStringCentred(isAutomated, yPos, kTextSpacingX, kTextSpacingY);
if (naviview.useNavigationView()) {
naviview.isAutomated = isAutomated;
naviview.drawDashboard();
naviview.drawMainboard();
}
else {
canvas.drawStringCentred(isAutomated, yPos, kTextSpacingX, kTextSpacingY);
}

// display parameter value
yPos = yPos + 12;

if (knobPosRight != kNoSelection) {
if (naviview.useNavigationView()) {
naviview.drawBaseboard();
}
else if (knobPosRight != kNoSelection) {
char bufferLeft[10];
bufferLeft[0] = 'L';
bufferLeft[1] = ':';
Expand Down Expand Up @@ -1367,7 +1392,16 @@ void AutomationView::renderNoteEditorDisplayOLED(deluge::hid::display::oled_canv
#else
int32_t yPos = OLED_MAIN_TOPMOST_PIXEL + 3;
#endif
canvas.drawStringCentredShrinkIfNecessary(parameterName.c_str(), yPos, kTextSpacingX, kTextSpacingY);
if (naviview.useNavigationView()) {
naviview.parameterName.clear();
naviview.parameterName.append(parameterName.c_str());
naviview.knobPosLeft = knobPosLeft;
naviview.knobPosRight = knobPosRight;
naviview.drawDashboard();
}
else {
canvas.drawStringCentredShrinkIfNecessary(parameterName.c_str(), yPos, kTextSpacingX, kTextSpacingY);
}

// display note / drum name
yPos = yPos + 12;
Expand Down Expand Up @@ -1407,12 +1441,21 @@ void AutomationView::renderNoteEditorDisplayOLED(deluge::hid::display::oled_canv
}
}

canvas.drawStringCentred(noteRowName, yPos, kTextSpacingX, kTextSpacingY);
if (naviview.useNavigationView()) {
strncpy(naviview.noteRowName, noteRowName, 49);
naviview.drawMainboard();
}
else {
canvas.drawStringCentred(noteRowName, yPos, kTextSpacingX, kTextSpacingY);
}

// display parameter value
yPos = yPos + 12;

if (automationParamType == AutomationParamType::NOTE_VELOCITY) {
if (naviview.useNavigationView()) {
naviview.drawBaseboard();
}
else if (automationParamType == AutomationParamType::NOTE_VELOCITY) {
if (knobPosRight != kNoSelection) {
char bufferLeft[10];
bufferLeft[0] = 'L';
Expand Down
Loading

0 comments on commit 374d3ed

Please sign in to comment.