-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
584 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright © 2016-2024 Synthstrom Audible Limited | ||
* | ||
* This file is part of The Synthstrom Audible Deluge Firmware. | ||
* | ||
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the | ||
* terms of the GNU General Public License as published by the Free Software Foundation, | ||
* either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "session.h" | ||
#include "gui/ui/keyboard/layout/column_controls.h" | ||
#include "gui/views/session_view.h" | ||
#include "gui/views/view.h" | ||
#include "hid/buttons.h" | ||
#include "playback/mode/session.h" | ||
|
||
using namespace deluge::gui::ui::keyboard::layout; | ||
|
||
namespace deluge::gui::ui::keyboard::controls { | ||
|
||
void SessionColumn::renderColumn(RGB image[][kDisplayWidth + kSideBarWidth], int32_t column) { | ||
bool armed = false; | ||
for (int32_t y = 0; y < kDisplayHeight; ++y) { | ||
armed |= sessionView.gridRenderMacros(column, y, false, image, nullptr); | ||
} | ||
if (armed) { | ||
view.flashPlayEnable(); | ||
} | ||
} | ||
|
||
bool SessionColumn::handleVerticalEncoder(int8_t pad, int32_t offset) { | ||
SessionMacro& m = currentSong->sessionMacros[pad]; | ||
int kindIndex = (int32_t)m.kind + offset; | ||
if (kindIndex >= SessionMacroKind::NUM_KINDS) { | ||
kindIndex = 0; | ||
} | ||
else if (kindIndex < 0) { | ||
kindIndex = SessionMacroKind::NUM_KINDS - 1; | ||
} | ||
|
||
m.kind = (SessionMacroKind)kindIndex; | ||
|
||
switch (m.kind) { | ||
case CLIP_LAUNCH: | ||
m.clip = getCurrentClip(); | ||
break; | ||
|
||
case OUTPUT_CYCLE: | ||
m.clip = nullptr; | ||
m.output = getCurrentOutput(); | ||
break; | ||
|
||
case SECTION: | ||
m.section = getCurrentClip()->section; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
void SessionColumn::handleLeavingColumn(ModelStackWithTimelineCounter* modelStackWithTimelineCounter, | ||
KeyboardLayout* layout){}; | ||
|
||
void SessionColumn::handlePad(ModelStackWithTimelineCounter* modelStackWithTimelineCounter, PressedPad pad, | ||
KeyboardLayout* layout) { | ||
|
||
SessionMacro& m = currentSong->sessionMacros[pad.y]; | ||
if (pad.active) {} | ||
else { | ||
sessionView.activateMacro(pad.y, pad.padPressHeld); | ||
} | ||
view.flashPlayEnable(); | ||
}; | ||
|
||
|
||
} // namespace deluge::gui::ui::keyboard::controls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright © 2016-2024 Synthstrom Audible Limited | ||
* | ||
* This file is part of The Synthstrom Audible Deluge Firmware. | ||
* | ||
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the | ||
* terms of the GNU General Public License as published by the Free Software Foundation, | ||
* either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "gui/ui/keyboard/column_controls/control_column.h" | ||
#include "model/song/song.h" | ||
|
||
namespace deluge::gui::ui::keyboard::controls { | ||
|
||
class SessionColumn : public ControlColumn { | ||
public: | ||
SessionColumn() = default; | ||
|
||
void renderColumn(RGB image[][kDisplayWidth + kSideBarWidth], int32_t column) override; | ||
bool handleVerticalEncoder(int8_t pad, int32_t offset) override; | ||
void handleLeavingColumn(ModelStackWithTimelineCounter* modelStackWithTimelineCounter, | ||
KeyboardLayout* layout) override; | ||
void handlePad(ModelStackWithTimelineCounter* modelStackWithTimelineCounter, PressedPad pad, | ||
KeyboardLayout* layout) override; | ||
|
||
void handleOutput(SessionMacro& m, PressedPad pad); | ||
Clip* findNextClipForOutput(SessionMacro& m, PressedPad pad); | ||
|
||
private: | ||
}; | ||
|
||
} // namespace deluge::gui::ui::keyboard::controls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.