2025-11-23 16:48:14 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "../src/memllib/interface/MIDIInOut.hpp"
|
|
|
|
|
#include "../ChannelStripAudioApp.hpp"
|
2025-11-24 12:29:33 +01:00
|
|
|
#include "../src/memllib/examples/InterfaceRL.hpp"
|
2025-11-23 16:48:14 +01:00
|
|
|
#include "MEMLNautMode.hpp"
|
2025-11-24 12:29:33 +01:00
|
|
|
#include "../src/memllib/PicoDefs.hpp"
|
2025-11-23 16:48:14 +01:00
|
|
|
#include <memory>
|
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
|
|
class MEMLNautModeChannelStrip {
|
|
|
|
|
public:
|
2025-12-10 17:40:00 +01:00
|
|
|
constexpr static size_t kN_InputParams = 4; // joystick x, y, left and right joysticks
|
2025-11-23 16:48:14 +01:00
|
|
|
ChannelStripAudioApp<> audioAppChannelStrip;
|
|
|
|
|
std::array<String, ChannelStripAudioApp<>::nVoiceSpaces> voiceSpaceList;
|
2025-11-24 12:29:33 +01:00
|
|
|
InterfaceRL interface;
|
|
|
|
|
std::shared_ptr<InterfaceRL> interfacePtr;
|
2025-11-28 15:59:36 +01:00
|
|
|
std::shared_ptr<BlockSelectView> bypassView;
|
2025-11-24 12:29:33 +01:00
|
|
|
|
|
|
|
|
void setupInterface() {
|
|
|
|
|
interface.setup(kN_InputParams, ChannelStripAudioApp<>::kN_Params);
|
2025-12-10 17:40:00 +01:00
|
|
|
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK, true); //set 4D joystick
|
2026-03-29 17:45:53 +02:00
|
|
|
interface.setModeInfo("chstrip", "ChannelStrip");
|
|
|
|
|
interfacePtr = make_non_owning(interface);
|
2025-12-10 17:40:00 +01:00
|
|
|
}
|
2025-11-23 16:48:14 +01:00
|
|
|
|
|
|
|
|
String getHelpTitle() {
|
|
|
|
|
return "Channel Strip Mode";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__force_inline stereosample_t process(stereosample_t x) {
|
|
|
|
|
return audioAppChannelStrip.Process(x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setupMIDI(std::shared_ptr<MIDIInOut> midi_interf) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addViews() {
|
2025-11-28 15:59:36 +01:00
|
|
|
bypassView = std::make_shared<BlockSelectView>("Bypasses", TFT_YELLOW, 5, 80, 70, TFT_BLACK,
|
|
|
|
|
std::vector<String>{ "All", "EQ", "Comp", "PPG", "InFilt" });
|
|
|
|
|
bypassView->SetOnSelectCallback([this] (size_t id) {
|
|
|
|
|
Serial.println("Bypass toggled: " + String(id));
|
2025-12-10 18:35:48 +01:00
|
|
|
bypassView->toggleAlt(id-1);
|
2025-11-28 15:59:36 +01:00
|
|
|
queue_t& audioAppQ = audioAppChannelStrip.controlMessageQueue;
|
|
|
|
|
switch(id) {
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
|
|
|
|
auto msg = ChannelStripAudioApp<>::controlMessages::MSG_BYPASS_ALL;
|
|
|
|
|
queue_try_add(&audioAppQ, &msg);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
auto msg = ChannelStripAudioApp<>::controlMessages::MSG_BYPASS_EQ;
|
|
|
|
|
queue_try_add(&audioAppQ, &msg);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
|
|
|
|
auto msg = ChannelStripAudioApp<>::controlMessages::MSG_BYPASS_COMP;
|
|
|
|
|
queue_try_add(&audioAppQ, &msg);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
auto msg = ChannelStripAudioApp<>::controlMessages::MSG_BYPASS_PREPOSTGAIN;
|
|
|
|
|
queue_try_add(&audioAppQ, &msg);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
{
|
|
|
|
|
auto msg = ChannelStripAudioApp<>::controlMessages::MSG_BYPASS_INFILTERS;
|
|
|
|
|
queue_try_add(&audioAppQ, &msg);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
MEMLNaut::Instance()->disp->AddView(bypassView);
|
|
|
|
|
|
2025-11-24 12:29:33 +01:00
|
|
|
std::shared_ptr<VoiceSpaceSelectView> voiceSpaceSelectView;
|
|
|
|
|
voiceSpaceSelectView = std::make_shared<VoiceSpaceSelectView>("Voice Spaces");
|
|
|
|
|
|
|
|
|
|
MEMLNaut::Instance()->disp->InsertViewAfter(interface.rlStatsView, voiceSpaceSelectView);
|
|
|
|
|
voiceSpaceSelectView->setOptions(voiceSpaceList); //set by core 1 on startup
|
|
|
|
|
voiceSpaceSelectView->setNewVoiceCallback(
|
|
|
|
|
[this](size_t idx) {
|
|
|
|
|
audioAppChannelStrip.setVoiceSpace(idx);
|
|
|
|
|
});
|
2025-11-23 16:48:14 +01:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-24 12:29:33 +01:00
|
|
|
void setupAudio(float sample_rate) {
|
|
|
|
|
audioAppChannelStrip.Setup(sample_rate, interfacePtr);
|
2025-11-23 16:48:14 +01:00
|
|
|
voiceSpaceList = audioAppChannelStrip.getVoiceSpaceNames();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__force_inline void loop() {
|
|
|
|
|
audioAppChannelStrip.loop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t getNMIDICtrlOutputs() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2025-11-24 12:29:33 +01:00
|
|
|
|
|
|
|
|
inline void processAnalysisParams() {}
|
2025-11-23 16:48:14 +01:00
|
|
|
|
2025-11-28 15:59:36 +01:00
|
|
|
void analyse(stereosample_t) {}
|
|
|
|
|
|
2026-03-05 23:25:21 +01:00
|
|
|
void loopCore0() {}
|
2025-11-28 15:59:36 +01:00
|
|
|
|
2025-11-23 16:48:14 +01:00
|
|
|
};
|