Skip to content

Commit 6163978

Browse files
committed
ReBalance AI
1 parent 1655998 commit 6163978

22 files changed

Lines changed: 2475 additions & 17 deletions

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ assets/rebalance/models/demucs/
5252
assets/rebalance/models/openunmix_umxhq_spec_onnx/rebalance_umx4.json
5353
assets/rebalance/models/openunmix_umxhq_spec_onnx/vx_rebalance_umx4.tar.gz
5454
assets/rebalance/models/vx_rebalance_spleeter5.onnx
55+
ThirdParty/onnxruntime/
56+
ThirdParty/stemgenrt/model/
5557

5658
# Render output directories (generated, not source)
5759
data/voice_corpus/renders/

‎CMakeLists.txt‎

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,158 @@ target_link_libraries(VXRebalance PRIVATE VxStudioFramework juce::juce_dsp)
699699
add_custom_target(VXRebalancePlugin ALL DEPENDS VXRebalance_VST3)
700700
vxstudio_stage_vst3_bundle(VXRebalance_VST3 "VXRebalance")
701701

702+
juce_add_plugin(VxRebalanceAI
703+
VERSION ${VXSTUDIO_PLUGIN_VERSION_VXREBALANCE}
704+
BUILD_VERSION ${VXSTUDIO_PLUGIN_VERSION_VXREBALANCE}
705+
FORMATS VST3
706+
COMPANY_NAME "VX Suite"
707+
BUNDLE_ID "com.vxstudio.vxrebalanceai"
708+
IS_SYNTH FALSE
709+
NEEDS_MIDI_INPUT FALSE
710+
NEEDS_MIDI_OUTPUT FALSE
711+
IS_MIDI_EFFECT FALSE
712+
PLUGIN_MANUFACTURER_CODE "VXS1"
713+
PLUGIN_CODE "VRAI"
714+
)
715+
target_compile_definitions(VxRebalanceAI PRIVATE
716+
JUCE_VST3_CAN_REPLACE_VST2=0
717+
JUCE_FORCE_USE_LEGACY_PARAM_IDS=0
718+
JUCE_IGNORE_VST3_MISMATCHED_PARAMETER_ID_WARNING=1
719+
JUCE_WEB_BROWSER=0
720+
VXSTUDIO_REBALANCE_AI_VARIANT=1
721+
)
722+
juce_generate_juce_header(VxRebalanceAI)
723+
target_sources(VxRebalanceAI PRIVATE
724+
Source/vxstudio/products/rebalance/VxRebalanceEditor.cpp
725+
Source/vxstudio/products/rebalance/VxRebalanceProcessor.cpp
726+
Source/vxstudio/products/rebalance/ai/OnnxStemgenBackend.cpp
727+
Source/vxstudio/products/rebalance/ai/VxRealtimeStemSplitter.cpp
728+
Source/vxstudio/products/rebalance/dsp/VxRebalanceDsp.cpp
729+
)
730+
target_include_directories(VxRebalanceAI PRIVATE Source)
731+
target_link_libraries(VxRebalanceAI PRIVATE VxStudioFramework juce::juce_dsp)
732+
733+
set(VXSTUDIO_REBALANCE_AI_ORT_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/onnxruntime")
734+
set(VXSTUDIO_REBALANCE_AI_MODEL_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/stemgenrt/model")
735+
set(VXSTUDIO_REBALANCE_AI_MODEL_ONNX "${VXSTUDIO_REBALANCE_AI_MODEL_DIR}/model.onnx")
736+
set(VXSTUDIO_REBALANCE_AI_MODEL_DATA "${VXSTUDIO_REBALANCE_AI_MODEL_DIR}/model.onnx.data")
737+
find_library(VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_LIBRARY
738+
NAMES onnxruntime
739+
PATHS "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/lib"
740+
NO_DEFAULT_PATH
741+
)
742+
set(VXSTUDIO_REBALANCE_AI_SPLITTER_ENABLED FALSE)
743+
if(VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_LIBRARY
744+
AND EXISTS "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/include"
745+
AND EXISTS "${VXSTUDIO_REBALANCE_AI_MODEL_ONNX}"
746+
AND EXISTS "${VXSTUDIO_REBALANCE_AI_MODEL_DATA}")
747+
set(VXSTUDIO_REBALANCE_AI_SPLITTER_ENABLED TRUE)
748+
message(STATUS "VxRebalanceAI realtime splitter enabled")
749+
target_sources(VxRebalanceAI PRIVATE
750+
ThirdParty/stemgenrt/plugin/source/OnnxRuntime.cpp
751+
)
752+
target_include_directories(VxRebalanceAI PRIVATE
753+
ThirdParty/stemgenrt/plugin/include
754+
"${VXSTUDIO_REBALANCE_AI_ORT_DIR}/include"
755+
)
756+
target_link_libraries(VxRebalanceAI PRIVATE "${VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_LIBRARY}")
757+
target_compile_definitions(VxRebalanceAI PRIVATE
758+
VXSTUDIO_REBALANCE_AI_HAS_STEMGENRT=1
759+
STEMGENRT_USE_ONNXRUNTIME=1
760+
VXSTUDIO_REBALANCE_AI_MODEL_PATH="${VXSTUDIO_REBALANCE_AI_MODEL_ONNX}"
761+
)
762+
763+
if(APPLE)
764+
get_filename_component(VXSTUDIO_REBALANCE_AI_ORT_REALPATH
765+
"${VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_LIBRARY}" REALPATH)
766+
get_filename_component(VXSTUDIO_REBALANCE_AI_ORT_BASENAME
767+
"${VXSTUDIO_REBALANCE_AI_ORT_REALPATH}" NAME)
768+
set_property(TARGET VxRebalanceAI_VST3 APPEND PROPERTY BUILD_RPATH "@loader_path/../Frameworks")
769+
add_custom_command(TARGET VxRebalanceAI_VST3 POST_BUILD
770+
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../Frameworks"
771+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
772+
"${VXSTUDIO_REBALANCE_AI_ORT_REALPATH}"
773+
"$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../Frameworks/${VXSTUDIO_REBALANCE_AI_ORT_BASENAME}"
774+
COMMAND install_name_tool -id
775+
"@rpath/${VXSTUDIO_REBALANCE_AI_ORT_BASENAME}"
776+
"$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../Frameworks/${VXSTUDIO_REBALANCE_AI_ORT_BASENAME}"
777+
COMMAND install_name_tool -change
778+
"${VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_LIBRARY}"
779+
"@rpath/${VXSTUDIO_REBALANCE_AI_ORT_BASENAME}"
780+
"$<TARGET_FILE:VxRebalanceAI_VST3>" || true
781+
COMMAND ${CMAKE_COMMAND} -E make_directory
782+
"${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3/Contents/Frameworks"
783+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
784+
"${VXSTUDIO_REBALANCE_AI_ORT_REALPATH}"
785+
"${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3/Contents/Frameworks/${VXSTUDIO_REBALANCE_AI_ORT_BASENAME}"
786+
VERBATIM)
787+
elseif(WIN32)
788+
find_file(VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_DLL
789+
NAMES onnxruntime.dll
790+
PATHS "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/lib" "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/bin"
791+
NO_DEFAULT_PATH
792+
)
793+
find_file(VXSTUDIO_REBALANCE_AI_DIRECTML_DLL
794+
NAMES DirectML.dll
795+
PATHS "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/lib" "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/bin"
796+
NO_DEFAULT_PATH
797+
)
798+
file(GLOB VXSTUDIO_REBALANCE_AI_ORT_PROVIDER_DLLS
799+
"${VXSTUDIO_REBALANCE_AI_ORT_DIR}/lib/onnxruntime_providers_*.dll"
800+
"${VXSTUDIO_REBALANCE_AI_ORT_DIR}/bin/onnxruntime_providers_*.dll"
801+
)
802+
set(VXSTUDIO_REBALANCE_AI_RUNTIME_DLLS "")
803+
if(VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_DLL)
804+
list(APPEND VXSTUDIO_REBALANCE_AI_RUNTIME_DLLS "${VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_DLL}")
805+
endif()
806+
if(VXSTUDIO_REBALANCE_AI_DIRECTML_DLL)
807+
list(APPEND VXSTUDIO_REBALANCE_AI_RUNTIME_DLLS "${VXSTUDIO_REBALANCE_AI_DIRECTML_DLL}")
808+
endif()
809+
list(APPEND VXSTUDIO_REBALANCE_AI_RUNTIME_DLLS ${VXSTUDIO_REBALANCE_AI_ORT_PROVIDER_DLLS})
810+
811+
foreach(runtime_dll IN LISTS VXSTUDIO_REBALANCE_AI_RUNTIME_DLLS)
812+
get_filename_component(runtime_dll_name "${runtime_dll}" NAME)
813+
add_custom_command(TARGET VxRebalanceAI_VST3 POST_BUILD
814+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
815+
"${runtime_dll}"
816+
"$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/${runtime_dll_name}"
817+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
818+
"${runtime_dll}"
819+
"${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3/Contents/x86_64-win/${runtime_dll_name}"
820+
VERBATIM)
821+
endforeach()
822+
endif()
823+
824+
add_custom_command(TARGET VxRebalanceAI_VST3 POST_BUILD
825+
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../Resources"
826+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
827+
"${VXSTUDIO_REBALANCE_AI_MODEL_ONNX}"
828+
"$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../Resources/model.onnx"
829+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
830+
"${VXSTUDIO_REBALANCE_AI_MODEL_DATA}"
831+
"$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../Resources/model.onnx.data"
832+
COMMAND ${CMAKE_COMMAND} -E make_directory
833+
"${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3/Contents/Resources"
834+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
835+
"${VXSTUDIO_REBALANCE_AI_MODEL_ONNX}"
836+
"${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3/Contents/Resources/model.onnx"
837+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
838+
"${VXSTUDIO_REBALANCE_AI_MODEL_DATA}"
839+
"${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3/Contents/Resources/model.onnx.data"
840+
VERBATIM)
841+
else()
842+
message(STATUS "VxRebalanceAI realtime splitter disabled; install ThirdParty/onnxruntime and ThirdParty/stemgenrt/model")
843+
endif()
844+
add_custom_target(VxRebalanceAIPlugin ALL DEPENDS VxRebalanceAI_VST3)
845+
vxstudio_stage_vst3_bundle(VxRebalanceAI_VST3 "VxRebalanceAI")
846+
if(VXSTUDIO_REBALANCE_AI_SPLITTER_ENABLED AND APPLE)
847+
add_custom_command(TARGET VxRebalanceAI_VST3 POST_BUILD
848+
COMMAND /usr/bin/codesign --force --sign - "$<TARGET_FILE_DIR:VxRebalanceAI_VST3>/../.."
849+
COMMAND /usr/bin/codesign --force --sign - "${VXSTUDIO_VST3_STAGE_DIR}/VxRebalanceAI.vst3"
850+
COMMENT "Signing VxRebalanceAI.vst3 after bundling realtime splitter resources"
851+
VERBATIM)
852+
endif()
853+
702854
juce_add_plugin(VXStudioAnalyser
703855
VERSION ${VXSTUDIO_PLUGIN_VERSION_VXSTUDIOANALYSER}
704856
BUILD_VERSION ${VXSTUDIO_PLUGIN_VERSION_VXSTUDIOANALYSER}
@@ -791,6 +943,7 @@ add_custom_target(VXSuite_VST3
791943
VXRefine_VST3
792944
VXLeveler_VST3
793945
VXRebalance_VST3
946+
VxRebalanceAI_VST3
794947
VXStudioAnalyser_VST3
795948
VXRepair_VST3
796949
VXDeverbStage
@@ -805,6 +958,7 @@ add_custom_target(VXSuite_VST3
805958
VXRefineStage
806959
VXLevelerStage
807960
VXRebalanceStage
961+
VxRebalanceAIStage
808962
VXStudioAnalyserStage
809963
VXRepairStage
810964
COMMENT "Building all VX Suite VST3 products")
@@ -893,6 +1047,38 @@ target_link_libraries(VXRebalanceMeasure PRIVATE
8931047
target_compile_definitions(VXRebalanceMeasure PRIVATE VXSTUDIO_DISABLE_PLUGIN_ENTRYPOINT=1)
8941048
vxstudio_add_executable_test(VXRebalanceMeasure)
8951049

1050+
if(VXSTUDIO_REBALANCE_AI_SPLITTER_ENABLED)
1051+
add_executable(VxRebalanceAISmokeTest
1052+
tests/VxRebalanceAISmokeTest.cpp
1053+
Source/vxstudio/products/rebalance/ai/OnnxStemgenBackend.cpp
1054+
Source/vxstudio/products/rebalance/ai/VxRealtimeStemSplitter.cpp
1055+
Source/vxstudio/products/rebalance/dsp/VxRebalanceDsp.cpp
1056+
ThirdParty/stemgenrt/plugin/source/OnnxRuntime.cpp
1057+
)
1058+
target_include_directories(VxRebalanceAISmokeTest PRIVATE
1059+
Source
1060+
tests
1061+
ThirdParty/stemgenrt/plugin/include
1062+
"${VXSTUDIO_REBALANCE_AI_ORT_DIR}/include"
1063+
)
1064+
target_link_libraries(VxRebalanceAISmokeTest PRIVATE
1065+
VxStudioFramework
1066+
juce::juce_dsp
1067+
juce::juce_audio_basics
1068+
"${VXSTUDIO_REBALANCE_AI_ONNXRUNTIME_LIBRARY}"
1069+
)
1070+
target_compile_definitions(VxRebalanceAISmokeTest PRIVATE
1071+
VXSTUDIO_REBALANCE_AI_HAS_STEMGENRT=1
1072+
STEMGENRT_USE_ONNXRUNTIME=1
1073+
VXSTUDIO_REBALANCE_AI_MODEL_PATH="${VXSTUDIO_REBALANCE_AI_MODEL_ONNX}"
1074+
)
1075+
if(APPLE)
1076+
set_property(TARGET VxRebalanceAISmokeTest APPEND PROPERTY
1077+
BUILD_RPATH "${VXSTUDIO_REBALANCE_AI_ORT_DIR}/lib")
1078+
endif()
1079+
vxstudio_add_executable_test(VxRebalanceAISmokeTest)
1080+
endif()
1081+
8961082
add_executable(VxStudioVoiceAnalysisTests
8971083
tests/VxStudioVoiceAnalysisTests.cpp
8981084
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
3+
#include "../../../ThirdParty/resampler/Resampler.hpp"
4+
5+
namespace vxsuite {
6+
7+
template <int inputChannelCount, int outputChannelCount>
8+
using StreamingResampler = Resampler<inputChannelCount, outputChannelCount>;
9+
10+
} // namespace vxsuite

‎Source/vxstudio/products/deepfilternet/dsp/VxDeepFilterNetService.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ bool DeepFilterService::prepareChannel(ChannelState& channel, const RuntimeBundl
412412
if (channel.runtime == nullptr)
413413
return false;
414414

415-
channel.resampler = std::make_unique<Resampler<1, 1>>(bundle.sampleRate, kEngineSampleRate);
415+
channel.resampler = std::make_unique<StreamingResampler<1, 1>>(bundle.sampleRate, kEngineSampleRate);
416416
channel.inputFifo.reset(kFifoCapacity48k);
417417
channel.outputFifo.reset(kFifoCapacity48k);
418418

‎Source/vxstudio/products/deepfilternet/dsp/VxDeepFilterNetService.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "../third_party/df.h"
44
#include "../third_party/df2.h"
5-
#include "../../../../../ThirdParty/resampler/Resampler.hpp"
5+
#include "../../../framework/VxStudioStreamingResampler.h"
66

77
#include <array>
88
#include <atomic>
@@ -96,7 +96,7 @@ class DeepFilterService {
9696

9797
struct ChannelState {
9898
void* runtime = nullptr;
99-
std::unique_ptr<Resampler<1, 1>> resampler;
99+
std::unique_ptr<StreamingResampler<1, 1>> resampler;
100100
SampleFifo inputFifo;
101101
SampleFifo outputFifo;
102102

‎Source/vxstudio/products/rebalance/VxRebalanceEditor.cpp‎

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ juce::Colour sourceColour(const int source) {
2828

2929
constexpr int kUiRefreshHz = 15;
3030
constexpr float kDefaultShellScale = 0.82f;
31+
#if VXSTUDIO_REBALANCE_AI_VARIANT
32+
constexpr const char* kAiModeParam = "aiMode";
33+
#endif
3134

3235
} // namespace
3336

@@ -38,6 +41,18 @@ class VXRebalanceEditor::DebugPanel final : public juce::Component {
3841
repaint();
3942
}
4043

44+
#if VXSTUDIO_REBALANCE_AI_VARIANT
45+
void setAiSnapshot(const vxsuite::rebalance::ai::RealtimeStemSplitter::DebugSnapshot& next) {
46+
aiSnapshot = next;
47+
repaint();
48+
}
49+
50+
void setAiStatusText(juce::String next) {
51+
aiStatusText = std::move(next);
52+
repaint();
53+
}
54+
#endif
55+
4156
void paint(juce::Graphics& g) override {
4257
auto bounds = getLocalBounds().reduced(12);
4358
g.setColour(juce::Colour(0xff141722));
@@ -56,6 +71,24 @@ class VXRebalanceEditor::DebugPanel final : public juce::Component {
5671
+ juce::String(snapshot.frameCounter),
5772
header, juce::Justification::centredRight, false);
5873

74+
#if VXSTUDIO_REBALANCE_AI_VARIANT
75+
auto aiRow = bounds.removeFromTop(18);
76+
g.setColour(juce::Colours::white.withAlpha(0.52f));
77+
g.setFont(juce::FontOptions(11.0f));
78+
const juce::String aiState = aiSnapshot.available
79+
? (aiSnapshot.hasFrame ? "AI Mask" : "AI Waiting")
80+
: "AI Standby";
81+
auto aiText = aiState
82+
+ " Conf " + juce::String(aiSnapshot.latestConfidence * 100.0f, 0) + "%"
83+
+ " In " + juce::String(static_cast<juce::int64>(aiSnapshot.submittedFrames))
84+
+ " Done " + juce::String(static_cast<juce::int64>(aiSnapshot.completedFrames))
85+
+ " Fail " + juce::String(static_cast<juce::int64>(aiSnapshot.failedFrames))
86+
+ " Drop " + juce::String(static_cast<juce::int64>(aiSnapshot.droppedFrames));
87+
if (aiStatusText.isNotEmpty())
88+
aiText += " | " + aiStatusText;
89+
g.drawText(aiText, aiRow, juce::Justification::centredLeft, true);
90+
#endif
91+
5992
auto legend = bounds.removeFromTop(20);
6093
constexpr std::array<const char*, vxsuite::rebalance::Dsp::kSourceCount> labels {
6194
"Vox", "Drums", "Bass", "Gtr", "Other"
@@ -105,6 +138,10 @@ class VXRebalanceEditor::DebugPanel final : public juce::Component {
105138

106139
private:
107140
vxsuite::rebalance::Dsp::DebugSnapshot snapshot;
141+
#if VXSTUDIO_REBALANCE_AI_VARIANT
142+
vxsuite::rebalance::ai::RealtimeStemSplitter::DebugSnapshot aiSnapshot;
143+
juce::String aiStatusText;
144+
#endif
108145
};
109146

110147
VXRebalanceEditor::VXRebalanceEditor(VXRebalanceAudioProcessor& processorToUse)
@@ -120,6 +157,22 @@ VXRebalanceEditor::VXRebalanceEditor(VXRebalanceAudioProcessor& processorToUse)
120157
updateLayout();
121158
};
122159
addAndMakeVisible(diagnosticsToggleButton);
160+
#if VXSTUDIO_REBALANCE_AI_VARIANT
161+
aiModeLabel.setText("AI Mode", juce::dontSendNotification);
162+
aiModeLabel.setJustificationType(juce::Justification::centredRight);
163+
aiModeLabel.setColour(juce::Label::textColourId, juce::Colours::white.withAlpha(0.70f));
164+
aiModeBox.addItem("Classic", 1);
165+
aiModeBox.addItem("AI Assist", 2);
166+
aiModeBox.addItem("AI Strong", 3);
167+
aiModeBox.setJustificationType(juce::Justification::centred);
168+
aiModeBox.setColour(juce::ComboBox::backgroundColourId, juce::Colour(0xff171018));
169+
aiModeBox.setColour(juce::ComboBox::outlineColourId, juce::Colours::white.withAlpha(0.16f));
170+
aiModeBox.setColour(juce::ComboBox::textColourId, juce::Colours::white.withAlpha(0.88f));
171+
aiModeAttachment = std::make_unique<juce::AudioProcessorValueTreeState::ComboBoxAttachment>(
172+
processor.getValueTreeState(), kAiModeParam, aiModeBox);
173+
addAndMakeVisible(aiModeLabel);
174+
addAndMakeVisible(aiModeBox);
175+
#endif
123176
addAndMakeVisible(*debugPanel);
124177
setResizable(true, false);
125178
setResizeLimits(juce::roundToInt(920.0f * kDefaultShellScale),
@@ -159,7 +212,13 @@ void VXRebalanceEditor::resized() {
159212

160213
const int mainHeight = getHeight() - footerHeight;
161214
auto footer = juce::Rectangle<int>(0, mainHeight, getWidth(), footerHeight).reduced(12, 8);
162-
diagnosticsToggleButton.setBounds(footer.removeFromTop(toggleHeight).removeFromRight(170));
215+
auto topRow = footer.removeFromTop(toggleHeight);
216+
diagnosticsToggleButton.setBounds(topRow.removeFromRight(170));
217+
#if VXSTUDIO_REBALANCE_AI_VARIANT
218+
topRow.removeFromRight(12);
219+
aiModeBox.setBounds(topRow.removeFromRight(132));
220+
aiModeLabel.setBounds(topRow.removeFromRight(74));
221+
#endif
163222
debugPanel->setVisible(diagnosticsExpanded);
164223
if (diagnosticsExpanded)
165224
debugPanel->setBounds(footer.withTrimmedTop(6));
@@ -174,6 +233,10 @@ void VXRebalanceEditor::setScaleFactor(const float newScale) {
174233

175234
void VXRebalanceEditor::timerCallback() {
176235
debugPanel->setSnapshot(processor.getDebugSnapshot());
236+
#if VXSTUDIO_REBALANCE_AI_VARIANT
237+
debugPanel->setAiSnapshot(processor.getAiDebugSnapshot());
238+
debugPanel->setAiStatusText(processor.getAiStatusText());
239+
#endif
177240
}
178241

179242
void VXRebalanceEditor::updateLayout() {

‎Source/vxstudio/products/rebalance/VxRebalanceEditor.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ class VXRebalanceEditor final : public juce::AudioProcessorEditor,
3030
std::unique_ptr<vxsuite::EditorBase> mainEditor;
3131
std::unique_ptr<DebugPanel> debugPanel;
3232
juce::TextButton diagnosticsToggleButton;
33+
#if VXSTUDIO_REBALANCE_AI_VARIANT
34+
juce::Label aiModeLabel;
35+
juce::ComboBox aiModeBox;
36+
std::unique_ptr<juce::AudioProcessorValueTreeState::ComboBoxAttachment> aiModeAttachment;
37+
#endif
3338
bool diagnosticsExpanded = false;
3439
float uiScale = 1.0f;
3540
};

0 commit comments

Comments
 (0)