Initialize MixerEngine on startup (BB-6)
Add MixerEngine creation and wiring after model.Load() in main.cpp. The mixer engine now gets created with current audio settings (sample rate, buffer size from JackServerSettings), activated, and attached to the model. This enables WebSocket mixer commands (mixerGetState, mixerAddChannel, mixerAddBus, etc.) to work through /pipedal endpoint. Missing initialization was the root cause of 'Invalid format' errors when sending mixer commands via WebSocket.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "WebServerConfig.hpp"
|
||||
#include <execinfo.h>
|
||||
#include "PiPedalSocket.hpp"
|
||||
#include "MixerEngine.hpp"
|
||||
#include "PluginHost.hpp"
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <filesystem>
|
||||
@@ -451,6 +452,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
model.Load();
|
||||
|
||||
// Initialize Band-in-a-Box mixer engine
|
||||
{
|
||||
auto mixerEngine = std::make_shared<MixerEngine>();
|
||||
// Configure with current audio settings
|
||||
auto jackSettings = model.GetJackServerSettings();
|
||||
mixerEngine->setSampleRate((uint32_t)jackSettings.GetSampleRate());
|
||||
mixerEngine->setMaxBufferSize((size_t)jackSettings.GetBufferSize());
|
||||
mixerEngine->Activate();
|
||||
model.SetMixerEngine(mixerEngine);
|
||||
Lv2Log::info("MixerEngine initialized (BB-6)");
|
||||
}
|
||||
|
||||
auto pipedalSocketFactory = MakePiPedalSocketFactory(model);
|
||||
|
||||
server->AddSocketFactory(pipedalSocketFactory);
|
||||
|
||||
Reference in New Issue
Block a user