feat(panel): add Insert as FX — ReaSampler 9000 onto the selected track, preloaded with the focused capture, over the existing instrument-drop body
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// insert_fx_enable — pure implementation. See insert_fx_enable.h.
|
||||
|
||||
#include "core/ui/insert_fx_enable.h"
|
||||
|
||||
namespace reasampler::ui {
|
||||
|
||||
InsertFxRefusal insertFxRefusal(int focusedCaptureCount, bool trackSelected) {
|
||||
if (focusedCaptureCount <= 0) return InsertFxRefusal::NoCapture;
|
||||
if (focusedCaptureCount > 1) return InsertFxRefusal::MultiCapture;
|
||||
if (!trackSelected) return InsertFxRefusal::NoTrack;
|
||||
return InsertFxRefusal::None;
|
||||
}
|
||||
|
||||
bool insertFxButtonEnabled(int focusedCaptureCount) {
|
||||
return insertFxRefusal(focusedCaptureCount, /*trackSelected=*/true) ==
|
||||
InsertFxRefusal::None;
|
||||
}
|
||||
|
||||
std::string insertFxRefusalMessage(InsertFxRefusal refusal) {
|
||||
switch (refusal) {
|
||||
case InsertFxRefusal::None:
|
||||
return {};
|
||||
case InsertFxRefusal::NoCapture:
|
||||
return "select a capture in the bank panel first, then insert it as an "
|
||||
"instrument on the selected track";
|
||||
case InsertFxRefusal::MultiCapture:
|
||||
return "select exactly ONE capture -- a ReaSampler 9000 instance holds one "
|
||||
"capture, so a multi-capture selection has no single sound to load";
|
||||
case InsertFxRefusal::NoTrack:
|
||||
return "select a track first -- the instrument is added to the selected "
|
||||
"track's FX chain";
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace reasampler::ui
|
||||
Reference in New Issue
Block a user