diff --git a/packaging/install_list.xml b/packaging/install_list.xml index f4d9e6e09..efe56a9a7 100644 --- a/packaging/install_list.xml +++ b/packaging/install_list.xml @@ -7,18 +7,6 @@ - - - - - - - - - - - - diff --git a/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/FuMa1stOrder.vstpreset b/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/FuMa1stOrder.vstpreset deleted file mode 100644 index b8f176c77..000000000 Binary files a/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/FuMa1stOrder.vstpreset and /dev/null differ diff --git a/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/ambix1stOrder.vstpreset b/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/ambix1stOrder.vstpreset deleted file mode 100644 index a5ac84226..000000000 Binary files a/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/ambix1stOrder.vstpreset and /dev/null differ diff --git a/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/ambix2ndOrder.vstpreset b/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/ambix2ndOrder.vstpreset deleted file mode 100644 index ba8d11422..000000000 Binary files a/reaper-adm-extension/src/reaper_adm/ADMPresets/FB360/ambix2ndOrder.vstpreset and /dev/null differ diff --git a/reaper-adm-extension/src/reaper_adm/CMakeLists.txt b/reaper-adm-extension/src/reaper_adm/CMakeLists.txt index e4a1ffd85..c9d182061 100644 --- a/reaper-adm-extension/src/reaper_adm/CMakeLists.txt +++ b/reaper-adm-extension/src/reaper_adm/CMakeLists.txt @@ -59,8 +59,6 @@ set(EXTENSION_SOURCES pluginregistry.cpp pluginsuite.cpp pluginsuite_ear.cpp - pluginsuite_fb360.cpp - pluginsuite_visr.cpp projectelements.cpp projectnode.cpp projecttree.cpp @@ -139,8 +137,6 @@ set(EXTENSION_HEADERS pluginregistry.h pluginsuite.h pluginsuite_ear.h - pluginsuite_fb360.h - pluginsuite_visr.h projectelements.h projectnode.h projecttree.h @@ -259,6 +255,4 @@ if(WIN32) DESTINATION ${win_install_dir} OPTIONAL) -endif() - -install(DIRECTORY ADMPresets COMPONENT Extension DESTINATION $<$:${win_install_dir}>$<$:${macos_install_dir}>$<$:${linux_install_dir}>) +endif() \ No newline at end of file diff --git a/reaper-adm-extension/src/reaper_adm/exportaction_admsourcescontainer.cpp b/reaper-adm-extension/src/reaper_adm/exportaction_admsourcescontainer.cpp index f553396c0..85a9b0613 100644 --- a/reaper-adm-extension/src/reaper_adm/exportaction_admsourcescontainer.cpp +++ b/reaper-adm-extension/src/reaper_adm/exportaction_admsourcescontainer.cpp @@ -3,7 +3,6 @@ #include "exportaction_admsource-admvst.h" #include "exportaction_admsource-earvst.h" -#include "plugin_deprecation_warning.h" void AdmExportHandler::repopulate(ReaperAPI const & api) { @@ -68,10 +67,6 @@ std::vector AdmExportHandler::generateExportWarningStrings() auto admExportSources = getAdmExportSources(); std::vector msgs; - if (admExportVstSources && admExportVstSources->getAllFoundVsts()->size() > 0) { - msgs.push_back(pluginDeprecationMessage); - } - if(earSceneMasterVstSources && earSceneMasterVstSources->validForExport() && admExportVstSources && admExportVstSources->validForExport()) { msgs.push_back(std::string("Multiple Types of Export Source!")); } diff --git a/reaper-adm-extension/src/reaper_adm/plugin_deprecation_warning.h b/reaper-adm-extension/src/reaper_adm/plugin_deprecation_warning.h deleted file mode 100644 index fe127e855..000000000 --- a/reaper-adm-extension/src/reaper_adm/plugin_deprecation_warning.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "reaperapi.h" -#include "pluginsuite.h" -#include -#include - -const std::string pluginDeprecationMessage{ - "Support for FB360 and VISR plugin suites will be dropped in future versions of the EAR Production Suite." }; - -inline void pluginDeprecationWarning(const std::pair>& pluginSuite, ReaperAPI& api) { - if (pluginSuite.first != std::string("EAR")) { // a bit hacky, but this won't be in long-term so meh - std::string msgboxText{ "Please note:\n" }; - msgboxText += pluginDeprecationMessage; - api.ShowMessageBox(msgboxText.c_str(), "ADM Open", 0); - } -} \ No newline at end of file diff --git a/reaper-adm-extension/src/reaper_adm/pluginmain.cpp b/reaper-adm-extension/src/reaper_adm/pluginmain.cpp index 8b7991c97..5a19edb5d 100644 --- a/reaper-adm-extension/src/reaper_adm/pluginmain.cpp +++ b/reaper-adm-extension/src/reaper_adm/pluginmain.cpp @@ -12,7 +12,6 @@ #include "pluginsuite.h" #include "pluginregistry.h" #include "pluginsuite_ear.h" -#include "plugin_deprecation_warning.h" #include #include #include @@ -297,8 +296,6 @@ extern "C" { std::make_unique(hInstance, rec->hwnd_main, pluginSuite.second), [pluginSuite](ReaperAPI& api, ImportAction& importer) { - pluginDeprecationWarning(pluginSuite, api); - api.Main_openProject("template:"); // This will TRY to start a blank project, but it will replace the current project if successful, so the user is prompted with the save dialog: yes, no, CANCEL auto res = api.IsProjectDirty(nullptr); // If the project is still dirty (1), the user must have canceled! (yes/no would save/not save and start a new clean project) if(res == 0) { @@ -354,8 +351,6 @@ extern "C" { std::make_unique(hInstance, rec->hwnd_main, pluginSuite.second), [pluginSuite](ReaperAPI& api, ImportAction& importer) { - pluginDeprecationWarning(pluginSuite, api); - char filename[4096]; api.GetProjectPath(filename, 4096); auto filenameStr = std::string(filename); diff --git a/reaper-adm-extension/src/reaper_adm/pluginregistry.cpp b/reaper-adm-extension/src/reaper_adm/pluginregistry.cpp index d61c8e9e9..d56d23ad4 100644 --- a/reaper-adm-extension/src/reaper_adm/pluginregistry.cpp +++ b/reaper-adm-extension/src/reaper_adm/pluginregistry.cpp @@ -20,7 +20,7 @@ void admplug::PluginRegistry::repopulateInstalledPlugins(bool warnOnFailure, con std::string filePath{vstIniPath + fileName}; std::ifstream ifs{filePath}; - // Next, parse the fileName... CSV, 3 part; filename + "=" + uid??, uid???, name (e.g, VISR SceneMasterVST (visr) (64ch)) - we might need to do some lazy matching on that... (e.g, end bit probably isn't expected) + // Next, parse the fileName... CSV, 3 part; filename + "=" + uid??, uid???, name (e.g, EAR Object (EBU), EAR Binaural Monitoring (EBU) (128ch)) - we might need to do some lazy matching on that... (e.g, end bit probably isn't expected) if (ifs) { fileFound = true; std::string line; diff --git a/reaper-adm-extension/src/reaper_adm/pluginsuite.h b/reaper-adm-extension/src/reaper_adm/pluginsuite.h index b056a821c..926cdebeb 100644 --- a/reaper-adm-extension/src/reaper_adm/pluginsuite.h +++ b/reaper-adm-extension/src/reaper_adm/pluginsuite.h @@ -60,7 +60,7 @@ namespace admplug { class UniqueValueAssigner { // This class handles cases where each plugin should be assigned a unique value for a certain parameter - // (see objectId for VISR, or trackMapping for EAR) + // (e.g, trackMapping for EAR) public: struct SearchCandidate { diff --git a/reaper-adm-extension/src/reaper_adm/pluginsuite_ear.cpp b/reaper-adm-extension/src/reaper_adm/pluginsuite_ear.cpp index 7fef5372b..73bf8d6ed 100644 --- a/reaper-adm-extension/src/reaper_adm/pluginsuite_ear.cpp +++ b/reaper-adm-extension/src/reaper_adm/pluginsuite_ear.cpp @@ -331,7 +331,10 @@ void admplug::EARPluginSuite::onCreateObjectTrack(admplug::TrackElement & trackE { auto take = trackElement.getTakeElement(); TrackInfo trackInfo; - auto channelCount = static_cast(take->channelCount()); + int channelCount{ 0 }; + if (take) { + channelCount = static_cast(take->channelCount()); + } if(mapHasKey(takesOnTracks, take)) { trackInfo = getValueFromMap(takesOnTracks, take); @@ -359,7 +362,10 @@ void admplug::EARPluginSuite::onCreateObjectTrack(admplug::TrackElement & trackE } auto automationElements = trackElement.getAutomationElements(); - auto takeChannels = take->channelsOfOriginal(); + std::vector takeChannels; + if (take) { + takeChannels = take->channelsOfOriginal(); + } for(auto const& automationElement : automationElements) { auto aeChannelOfOriginal = automationElement->channel().channelOfOriginal(); for(int chOffset = 0; chOffset < takeChannels.size(); chOffset++) { diff --git a/reaper-adm-extension/src/reaper_adm/pluginsuite_fb360.cpp b/reaper-adm-extension/src/reaper_adm/pluginsuite_fb360.cpp deleted file mode 100644 index 95e90400c..000000000 --- a/reaper-adm-extension/src/reaper_adm/pluginsuite_fb360.cpp +++ /dev/null @@ -1,468 +0,0 @@ -#include "pluginsuite_fb360.h" - -#include -#include - -#include -#include "pluginsuite_fb360.h" -#include "pluginsuite.h" -#include "projectelements.h" -#include "reaperapi.h" -#include "pluginregistry.h" -#include "plugin.h" -#include "parameter.h" -#include "projectnode.h" -#include "color.h" -#include "admtraits.h" -#include "commontrackpool.h" -#include "admvstcontrol.h" -#include "mediatrackelement.h" -#include - -#include -#include -using namespace admplug; - -namespace { - - enum class FB360ObjectParameters { - AZIMUTH = 0, - ELEVATION, - DISTANCE, - NUM_PARAMETERS - }; - - std::vector> createAutomatedObjectPluginParameters() - { - std::vector> parameters; - - auto azimuthRange = ParameterRange{ -180.0, 180.0 }; - auto azimuthMap = map::sequence({ map::wrap(azimuthRange), - map::invert(), - map::normalise(azimuthRange) }); - parameters.push_back(createPluginParameter(static_cast(FB360ObjectParameters::AZIMUTH), - AdmParameter::OBJECT_AZIMUTH, - azimuthMap)); - parameters.push_back(createPluginParameter(static_cast(FB360ObjectParameters::AZIMUTH), - AdmParameter::SPEAKER_AZIMUTH, - azimuthMap)); - - auto elevationRange = ParameterRange{ -90.0, 90.0 }; - auto elevationMap = map::sequence({ map::normalise(elevationRange), - map::clip() }); - parameters.push_back(createPluginParameter(static_cast(FB360ObjectParameters::ELEVATION), - AdmParameter::OBJECT_ELEVATION, - elevationMap)); - parameters.push_back(createPluginParameter(static_cast(FB360ObjectParameters::ELEVATION), - AdmParameter::SPEAKER_ELEVATION, - elevationMap)); - - auto distanceRange = ParameterRange{ 0.0, 60.0 }; - auto distanceMap = map::sequence({ map::normalise(distanceRange), - map::clip() }); - parameters.push_back(createPluginParameter(static_cast(FB360ObjectParameters::DISTANCE), - AdmParameter::OBJECT_DISTANCE, - distanceMap)); - parameters.push_back(createPluginParameter(static_cast(FB360ObjectParameters::DISTANCE), - AdmParameter::SPEAKER_DISTANCE, - distanceMap)); - - return parameters; - } - - std::vector> createTrackParameters() { - std::vector> parameters; - auto gainRange = ParameterRange{0.0, 4.0}; - parameters.push_back(createTrackParameter(TrackParameterType::VOLUME, - AdmParameter::OBJECT_GAIN, - map::clip(gainRange))); - return parameters; - } - - void configureAdmExportVst(const AutomationElement& element, const Track& track, const ReaperAPI &api, int packFormatIdValueOverride = 0) { - auto packFormat = element.channel().packFormat(); - if (packFormat && AdmVst::isAvailable(api, false)) { - auto vst = AdmVst(track.get(), api); // Will attempt to wrap existing plugin or create new if missing - vst.setIncludeInRenderState(true); - - auto td = packFormat->get().get(); - vst.setAdmTypeDefinition(td); - - auto& admPresetDefinitions = AdmPresetDefinitionsHelper::getSingleton(); - auto pfData = admPresetDefinitions.getPackFormatData(packFormat); - if(packFormatIdValueOverride > 0) { - // Overridden - pull out correct pack - pfData = admPresetDefinitions.getPackFormatData(td, packFormatIdValueOverride); - } - - // Set PackFormat and ChannelFormat. Only supporting Preset Definitions. Set defaults if not Preset Definition. - vst.setAdmPackFormat(pfData ? pfData->idValue : ADM_VST_PACKFORMAT_UNSET_ID); - vst.setAdmChannelFormat(ADM_VST_CHANNELFORMAT_ALLCHANNELS_ID); - } - } - - int getHoaOrder(std::shared_ptr packFormat) { - int maxOrder = -1; - for(auto const& pf : packFormat->getReferences()) { - int pfMaxOrder = getHoaOrder(pf); - if(pfMaxOrder > maxOrder) maxOrder = pfMaxOrder; - } - for(auto const& cf : packFormat->getReferences()) { - for(auto const& bf : cf->getElements()) { - if(bf.has()) { - int bfOrder = bf.get().get(); - if(bfOrder > maxOrder) maxOrder = bfOrder; - } - - - } - } - return maxOrder; - } - -} -const char* Facebook360PluginSuite::OBJECT_METADATA_PLUGIN_NAME = "FB360 Spatialiser (ambiX)"; -const char* Facebook360PluginSuite::RENDERER_PLUGIN_NAME = "FB360 Control (ambiX)"; - -bool Facebook360PluginSuite::registered = PluginRegistry::getInstance()->registerSupportedPluginSuite("Facebook 360", std::make_shared()); - -Facebook360PluginSuite::Facebook360PluginSuite() : busTrack3D{ nullptr }, controlTrack{ nullptr } -{ -} - -Facebook360PluginSuite::~Facebook360PluginSuite() = default; - -bool Facebook360PluginSuite::pluginSuiteUsable(ReaperAPI const& api) -{ - std::vector requiredPlugins{ - std::string(OBJECT_METADATA_PLUGIN_NAME), - std::string(RENDERER_PLUGIN_NAME) - }; - return PluginRegistry::getInstance()->checkPluginsAvailable(requiredPlugins, api); -} - -void Facebook360PluginSuite::onCreateObjectTrack(TrackElement &trackElement, ReaperAPI const& api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - doGenericTrackSetup(*track); - AdmVst(mediaTrack, api); // Creates ADM VST before spatialiser - setupMetadataPlugin(*track, api); - setAsGroupsSlave(trackElement, *track); -} - -void Facebook360PluginSuite::setupMetadataPlugin(Track& track, ReaperAPI const& api) -{ - track.createPlugin(OBJECT_METADATA_PLUGIN_NAME); - track.routeTo(*busTrack3D, 16); -// api.activateAndShowTrackVolumeEnvelope(track.get()); -} - -void Facebook360PluginSuite::setAsGroupsSlave(TrackElement const& element, Track& track) -{ - auto groups = element.slaveOfGroups(); - for (auto& group : groups) { - track.setAsVCASlave(group); - } - if(!groups.empty()){ - track.setColor(groups.front().color()); // TODO - what if this belongs to more than one group? - } -} - -PluginParameter* admplug::Facebook360PluginSuite::getPluginParameterFor(AdmParameter admParameter) -{ - for(auto& param : automatedObjectPluginParameters()) { - if(param->admParameter() == admParameter) { - return param.get(); - } - } - return nullptr; -} - -TrackParameter * admplug::Facebook360PluginSuite::getTrackParameterFor(AdmParameter admParameter) -{ - for(auto& param : trackParameters()) { - if(param->admParameter() == admParameter) { - return param.get(); - } - } - return nullptr; -} - -Parameter* admplug::Facebook360PluginSuite::getParameterFor(AdmParameter admParameter) -{ - Parameter* param = getTrackParameterFor(admParameter); - if(param) return param; - return getPluginParameterFor(admParameter); -} - -std::optional admplug::Facebook360PluginSuite::getSpatialisationPluginNameForObjects() -{ - return std::optional(Facebook360PluginSuite::OBJECT_METADATA_PLUGIN_NAME); -} - -std::optional admplug::Facebook360PluginSuite::getSpatialisationPluginNameForDirectSpeakers() -{ - return std::optional(Facebook360PluginSuite::OBJECT_METADATA_PLUGIN_NAME); -} - -std::optional admplug::Facebook360PluginSuite::getSpatialisationPluginNameForHoa() -{ - return std::optional(Facebook360PluginSuite::OBJECT_METADATA_PLUGIN_NAME); -} - -void Facebook360PluginSuite::doGenericTrackSetup(Track& track) { - track.moveToBefore(trackInsertionIndex++); - track.setChannelCount(16); - track.disableMasterSend(); -} - -void Facebook360PluginSuite::onCreateDirectTrack(TrackElement &trackElement, const ReaperAPI &api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - track->moveToBefore(trackInsertionIndex++); - track->disableMasterSend(); - setAsGroupsSlave(trackElement, *track); -} - -void Facebook360PluginSuite::onCreateGroup(TrackElement &trackElement, const ReaperAPI &api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - doGenericTrackSetup(*track); - setAsGroupsSlave(trackElement, *track); - track->setAsVCAMaster(trackElement.masterOfGroup()); - track->setColor(trackElement.masterOfGroup().color()); -} - -void Facebook360PluginSuite::onCreateProject(const ProjectNode&, const ReaperAPI &api) -{ - if (!Track::trackPresent(controlTrack.get())) { - controlTrack = getControlTrack(api); - } - - if (!Track::trackPresent(controlTrack.get())) { - controlTrack = api.createTrack(); - controlTrack->hideFromTrackControlPanel(); - controlTrack->setChannelCount(16); - controlTrack->setName("3D MASTER"); - controlTrack->createPlugin(RENDERER_PLUGIN_NAME); - } - - trackInsertionIndex = api.getTrackIndexOfSelectedMediaItem(); - if (trackInsertionIndex <= 0) trackInsertionIndex = 1; - - busTrack3D = api.createTrack(); - busTrack3D->moveToBefore(trackInsertionIndex++); - busTrack3D->hideFromTrackControlPanel(); - busTrack3D->setChannelCount(16); - busTrack3D->setName("3D Sub-Master"); - busTrack3D->disableMasterSend(); - busTrack3D->routeTo(*controlTrack, 16); - - if(!commonTracks) { - commonTracks = std::make_unique(api); - } - commonTracks->removeDeletedTracks(); -} - -void Facebook360PluginSuite::onObjectAutomation(const ObjectAutomation &automationNode, const ReaperAPI &api) -{ - auto& track = *automationNode.getTrack(); - configureAdmExportVst(automationNode, track, api); - auto plugin = track.getPlugin(OBJECT_METADATA_PLUGIN_NAME); - if(plugin) { - applyParameters(automationNode, track, *plugin); - } -} - -void Facebook360PluginSuite::onDirectSpeakersAutomation(const DirectSpeakersAutomation & directAutomation, const ReaperAPI &api) -{ - auto track = directAutomation.getTrack(); - auto take = directAutomation.parentTake(); - auto trackWidth = static_cast(take->channelCount()); - track->setChannelCount(trackWidth); - - auto pfData = AdmPresetDefinitionsHelper::getSingleton().getPackFormatData(directAutomation.channel().packFormat()); - if (pfData) { - int fxNum = api.TrackFX_AddByActualName(track->get(), AdmVst::getVstNameStr()->c_str(), false, TrackFXAddMode::QueryPresence); - if(fxNum < 0) { - // Not yet configured ADM Export VST - configureAdmExportVst(directAutomation, *track, api); - } - if(directAutomation.channel().channelFormat()) { - auto& busTrack = getCommonTrack(directAutomation, api); - track->routeTo(busTrack, 1, directAutomation.channelIndex(), 0); - } - - } else { - // TODO: Warn user - We don't support non-preset-definition - } -} - -void Facebook360PluginSuite::onHoaAutomation(const HoaAutomation & hoaAutomation, const ReaperAPI &api){ - // NOTE: This is going to get called once for each channel in a HOA AudioObject! Make sure it doesn't duplicate actions - - auto track = hoaAutomation.getTrack(); - - // Check whether we already processed this track - no point duplicating effort - /// Need to check that the plugin hasn't already been removed (already processed and was unsuccessful) - int fxNum = api.TrackFX_AddByActualName(track->get(), OBJECT_METADATA_PLUGIN_NAME, false, TrackFXAddMode::QueryPresence); - if(fxNum < 0) return; - /// Need to check that a preset hasn't already been applied (already processed and was successful) - char presetname[255]; - if(api.TrackFX_GetPreset(track->get(), fxNum, presetname, 255)) { - auto presetLen = std::string(presetname).length(); - if(presetLen > 0) return; // Already processed this track - }; - - if(applyFXPreset(hoaAutomation, api)) { - - // Configure plug-ins - auto pfData = AdmPresetDefinitionsHelper::getSingleton().getPackFormatData(hoaAutomation.channel().packFormat()); - if (pfData) { - configureAdmExportVst(hoaAutomation, *track, api); - - } else { - // If it wasn't a preset definition, we can't use the ADM Export VST directly on the source. - // However the FB360 spat plugin outputs SN3D ACN, which are in common definitions! - // We can use this but we need to move the ADM Export VST post-FB360. - track->deletePlugin(AdmVst::getVstNameStr()->c_str(), true); - - // Find an appropriate common definition - FB360 does not upmix (even after adjusting pitch/yaw/roll), so use order according to incoming channel count; - // PackIdValues 1 to 6 are SN3D ACN - matches FB360 plug-in output (intermediate format) - int hoaOrder = getHoaOrder(hoaAutomation.channel().packFormat()); - if(hoaOrder < 1) hoaOrder = 1; - if(hoaOrder > 3) hoaOrder = 3; - configureAdmExportVst(hoaAutomation, *track, api, hoaOrder); // Creates a new instance - } - - } else { - // If we were unable to configure the spatialiser, should remove track sends and remove the plugins to avoid confusing the user - // - this matches the behaviour of plugin suites which don't support HOA at all (e.g, VISR, not inserting plugins in the first place) - track->deletePlugin(OBJECT_METADATA_PLUGIN_NAME, true); - track->deletePlugin(AdmVst::getVstNameStr()->c_str(), true); - while(api.GetTrackNumSends(track->get(), 0) > 0) { - if(!api.RemoveTrackSend(track->get(), 0, 0)) break; - } - } -} - -void Facebook360PluginSuite::onCreateHoaTrack(TrackElement &trackElement, const ReaperAPI &api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - doGenericTrackSetup(*track); - AdmVst(mediaTrack, api); // Creates ADM VST before spatialiser - setupMetadataPlugin(*track, api); - setAsGroupsSlave(trackElement, *track); -} - -void Facebook360PluginSuite::applyParameters(ObjectAutomation const& element, - Track const& track, - Plugin const& plugin) const { - for(auto& parameter : automatedObjectPluginParameters()) { - element.apply(*parameter, plugin); - } - - for(auto& parameter : trackParameters()) { - element.apply(*parameter, track); - } -} - -std::vector> const & admplug::Facebook360PluginSuite::automatedObjectPluginParameters() const -{ - auto static parameters = createAutomatedObjectPluginParameters(); - return parameters; -} - -std::vector> const & Facebook360PluginSuite::trackParameters() const { - auto static parameters = createTrackParameters(); - return parameters; -} - -Track& Facebook360PluginSuite::getCommonTrack(const DirectSpeakersAutomation& element, const ReaperAPI &api) -{ - auto onCreate = [&element, this, &api] (Track& newTrack) { - doGenericTrackSetup(newTrack); - setupMetadataPlugin(newTrack, api); - auto plugin = newTrack.getPlugin(OBJECT_METADATA_PLUGIN_NAME); - assert(plugin); - for(auto& parameter : automatedObjectPluginParameters()) { - element.apply(*parameter, *plugin); - } - }; - - return commonTracks->trackFor(element.channel(), onCreate); -} - -std::unique_ptr Facebook360PluginSuite::getControlTrack(const ReaperAPI &api) { - // We could cache this in a static, but that wouldn't work for saved projects that are reopened. - return api.firstTrackWithPluginNamed(RENDERER_PLUGIN_NAME); -} - -bool Facebook360PluginSuite::applyFXPreset(const HoaAutomation & hoaAutomation, const ReaperAPI &api){ - auto track = hoaAutomation.getTrack(); - auto hoaOrder = getHoaOrder(hoaAutomation.channel().packFormat()); - auto channelFormat = hoaAutomation.channel().channelFormat(); - if(!channelFormat) return false; - auto blocks = channelFormat->getElements(); - if(blocks.size() == 0) return false; - auto normalization = blocks.front().get(); - auto preset = "ambix1stOrder"; //Default according to BS.2076 - - if(hoaOrder == 1 && normalization == "FuMa"){ - preset = "Fuma1stOrder"; - } else if(hoaOrder == 1 && (normalization == "SN3D" || normalization == "N3D")){ - preset = "ambix1stOrder"; - } else if(hoaOrder == 2 && (normalization == "SN3D" || normalization == "N3D")){ - preset = "ambix2ndOrder"; - } else { - // FB360 does not support other formats - // TODO: Warn user - assert(false); - return false; - } - - int fxNum = api.TrackFX_AddByActualName(track->get(), OBJECT_METADATA_PLUGIN_NAME, false, TrackFXAddMode::QueryPresence); - std::vector pathOptions; - -#ifdef WIN32 - // UserPlugins could be in one of two locations on Windows! - if(auto pathPrefix = api.GetResourcePath()) // This is normally something like "C:\Users\username\AppData\Roaming\REAPER" - pathOptions.push_back(std::string(pathPrefix) + "\\UserPlugins\\ADMPresets\\FB360\\"); - if(auto pathPrefix = api.GetExePath()) // This is normally something like "C:\Program Files\REAPER (x64)" - pathOptions.push_back(std::string(pathPrefix) + "\\Plugins\\ADMPresets\\FB360\\"); -#else - if(auto pathPrefix = api.GetResourcePath()) // This is something like "/Users/username/Library/Application Support/REAPER" - pathOptions.push_back(std::string(pathPrefix) + "/UserPlugins/ADMPresets/FB360/"); -#endif - - for(auto& pathOption : pathOptions) { - std::string fullPath = pathOption + preset + ".vstpreset"; - if(api.TrackFX_SetPreset(track->get(), fxNum, fullPath.c_str())) { - return true; - } - } - - // TODO: Warn user - Preset not applied - assert(false); - return false; -} diff --git a/reaper-adm-extension/src/reaper_adm/pluginsuite_fb360.h b/reaper-adm-extension/src/reaper_adm/pluginsuite_fb360.h deleted file mode 100644 index 624dea746..000000000 --- a/reaper-adm-extension/src/reaper_adm/pluginsuite_fb360.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include -#include -#include -#include "pluginsuite.h" -#include "projectelements.h" - -namespace admplug { - class PluginParameter; - class TrackParameter; - class Plugin; - class PluginInstance; - class Track; - class CommonTrackPool; - - class Facebook360PluginSuite : public PluginSuite { - - public: - Facebook360PluginSuite(); - ~Facebook360PluginSuite(); - - void onCreateProject(const ProjectNode &rootNode, const ReaperAPI &api) override; - void onCreateObjectTrack(TrackElement &trackNode, const ReaperAPI &api) override; - void onCreateDirectTrack(TrackElement &trackNode, const ReaperAPI &api) override; - void onCreateGroup(TrackElement &trackNode, const ReaperAPI &api) override; - void onObjectAutomation(ObjectAutomation const&, ReaperAPI const& api) override; - void onDirectSpeakersAutomation(DirectSpeakersAutomation const&, ReaperAPI const& api) override; - void onHoaAutomation(HoaAutomation const&, ReaperAPI const& api) override; - void onCreateHoaTrack(TrackElement &trackNode, const ReaperAPI &api) override; - bool pluginSuiteUsable(ReaperAPI const& api) override; - bool applyFXPreset(const HoaAutomation &, const ReaperAPI &api) override; - PluginParameter* getPluginParameterFor(AdmParameter admParameter) override; - TrackParameter* getTrackParameterFor(AdmParameter admParameter) override; - Parameter* getParameterFor(AdmParameter admParameter) override; - const RequiresAdmExportVst pluginSuiteRequiresAdmExportVst() override { return RequiresAdmExportVst::PRE_SPATIALISATION; } // TODO - this might be type specific - e.g, HOA can be pre/post. - bool pluginUsesSphericalCoordinates(PluginInstance* pluginInst) override { return true; } - std::optional getSpatialisationPluginNameForObjects() override; - std::optional getSpatialisationPluginNameForDirectSpeakers() override; - std::optional getSpatialisationPluginNameForHoa() override; - private: - std::vector> const & automatedObjectPluginParameters() const; - std::vector> const & trackParameters() const; - void doGenericTrackSetup(Track& track); - void setupMetadataPlugin(Track& track, ReaperAPI const& api); - void applyParameters(const ObjectAutomation &element, - const Track &track, - const Plugin &plugin) const; - - Track& getCommonTrack(const DirectSpeakersAutomation &element, const ReaperAPI &api); - std::unique_ptr getControlTrack(const ReaperAPI &api); - void setAsGroupsSlave(const TrackElement &element, Track &track); - - std::unique_ptr busTrack3D; - std::unique_ptr controlTrack; - int trackInsertionIndex{ -1 }; - std::unique_ptr commonTracks; - - static const char* OBJECT_METADATA_PLUGIN_NAME; - static const char* RENDERER_PLUGIN_NAME; - - static bool registered; - }; - -} - diff --git a/reaper-adm-extension/src/reaper_adm/pluginsuite_visr.cpp b/reaper-adm-extension/src/reaper_adm/pluginsuite_visr.cpp deleted file mode 100644 index 5941ffc85..000000000 --- a/reaper-adm-extension/src/reaper_adm/pluginsuite_visr.cpp +++ /dev/null @@ -1,355 +0,0 @@ -#include "pluginsuite_visr.h" - -#include "reaperapi.h" -#include "reaperapivalues.h" -#include "pluginregistry.h" -#include "track.h" -#include "plugin.h" -#include "parameter.h" -#include "admtraits.h" -#include "commontrackpool.h" -#include "admvstcontrol.h" -#include "mediatrackelement.h" -#include - -using namespace admplug; - -#define OBJECT_ID_MIN 1 -#define OBJECT_ID_MAX 64 - -namespace { - - enum class VisrObjectParameters { - OBJECT_ID = 0, - AZIMUTH, - ELEVATION, - DISTANCE, - NUM_PARAMETERS - }; - - std::vector> createAutomatedObjectPluginParameters() - { - std::vector> parameters; - - auto azimuthRange = ParameterRange{ -180.0, 180.0 }; - auto azimuthMap = map::sequence({map::wrap(azimuthRange), - map::normalise(azimuthRange)}); - parameters.push_back(createPluginParameter(static_cast(VisrObjectParameters::AZIMUTH), - AdmParameter::OBJECT_AZIMUTH, - azimuthMap)); - parameters.push_back(createPluginParameter(static_cast(VisrObjectParameters::AZIMUTH), - AdmParameter::SPEAKER_AZIMUTH, - azimuthMap)); - - auto elevationRange = ParameterRange{-90.0, 90.0}; - auto elevationMap = map::sequence({map::normalise(elevationRange), - map::clip(elevationRange)}); - parameters.push_back(createPluginParameter(static_cast(VisrObjectParameters::ELEVATION), - AdmParameter::OBJECT_ELEVATION, - elevationMap)); - parameters.push_back(createPluginParameter(static_cast(VisrObjectParameters::ELEVATION), - AdmParameter::SPEAKER_ELEVATION, - elevationMap)); - - auto distanceRange = ParameterRange{0.01, 100.0}; - auto distanceMap = map::sequence({map::normalise(distanceRange), - map::clip(distanceRange)}); - parameters.push_back(createPluginParameter(static_cast(VisrObjectParameters::DISTANCE), - AdmParameter::OBJECT_DISTANCE, - elevationMap)); - parameters.push_back(createPluginParameter(static_cast(VisrObjectParameters::DISTANCE), - AdmParameter::SPEAKER_DISTANCE, - elevationMap)); - - return parameters; - } - - std::vector> createTrackParameters() { - std::vector> parameters; - auto gainRange = ParameterRange{0.0, 4.0}; - parameters.push_back(createTrackParameter(TrackParameterType::VOLUME, - AdmParameter::OBJECT_GAIN, - map::clip(gainRange))); - return parameters; - } - - void configureAdmExportVst(const AutomationElement& element, const Track& track, const ReaperAPI &api) { - auto packFormat = element.channel().packFormat(); - if (packFormat && AdmVst::isAvailable(api, false)) { - auto vst = AdmVst(track.get(), api); // Will attempt to wrap existing plugin or create new if missing - vst.setIncludeInRenderState(true); - - auto td = packFormat->get().get(); - vst.setAdmTypeDefinition(td); - - // Set PackFormat and ChannelFormat. Only supporting Preset Definitions. Set defaults if not Preset Definition. - auto pfData = AdmPresetDefinitionsHelper::getSingleton().getPackFormatData(packFormat); - vst.setAdmPackFormat(pfData ? pfData->idValue : ADM_VST_PACKFORMAT_UNSET_ID); - vst.setAdmChannelFormat(ADM_VST_CHANNELFORMAT_ALLCHANNELS_ID); - } - } - - std::vector determineUsedObjectId(PluginInstance& plugin) { - auto param = createPluginParameter(static_cast(VisrObjectParameters::OBJECT_ID), {OBJECT_ID_MIN, OBJECT_ID_MAX}); - auto objectId = plugin.getParameterWithConvertToInt(*(param.get())); - assert(objectId.has_value()); - if(objectId.has_value()) { - return std::vector{ *objectId }; - } - return std::vector{}; - } - -} -const char* VisrPluginSuite::OBJECT_METADATA_PLUGIN_NAME = "VISR ObjectEditor"; -const char* VisrPluginSuite::SCENEMASTER_PLUGIN_NAME = "VISR SceneMaster"; -const char* VisrPluginSuite::RENDERER_PLUGIN_NAME = "VISR LoudspeakerRenderer"; -const int VisrPluginSuite::MAX_CHANNEL_COUNT = 64; - -bool VisrPluginSuite::registered = PluginRegistry::getInstance()->registerSupportedPluginSuite("VISR", std::make_shared()); - -VisrPluginSuite::VisrPluginSuite() : objectIdParameter{ createPluginParameter(static_cast(VisrObjectParameters::OBJECT_ID), ParameterRange{OBJECT_ID_MIN, OBJECT_ID_MAX}) } -{ -} - -VisrPluginSuite::~VisrPluginSuite() -{ -} - -bool VisrPluginSuite::pluginSuiteUsable(ReaperAPI const& api) -{ - std::vector requiredPlugins{ - OBJECT_METADATA_PLUGIN_NAME, // The VISR plugin names prior to v0.11 have VST appended in the cache file - SCENEMASTER_PLUGIN_NAME, // so will no longer work with this pluginSuite - RENDERER_PLUGIN_NAME - }; - return PluginRegistry::getInstance()->checkPluginsAvailable(requiredPlugins, api); -} - -PluginParameter* admplug::VisrPluginSuite::getPluginParameterFor(AdmParameter admParameter) -{ - for(auto& param : automatedObjectPluginParameters()) { - if(param->admParameter() == admParameter) { - return param.get(); - } - } - return nullptr; -} - -TrackParameter * admplug::VisrPluginSuite::getTrackParameterFor(AdmParameter admParameter) -{ - for(auto& param : trackParameters()) { - if(param->admParameter() == admParameter) { - return param.get(); - } - } - return nullptr; -} - -Parameter* admplug::VisrPluginSuite::getParameterFor(AdmParameter admParameter) -{ - Parameter* param = getTrackParameterFor(admParameter); - if(param) return param; - return getPluginParameterFor(admParameter); -} - -std::optional admplug::VisrPluginSuite::getSpatialisationPluginNameForObjects() -{ - return std::optional(VisrPluginSuite::OBJECT_METADATA_PLUGIN_NAME); -} - -std::optional admplug::VisrPluginSuite::getSpatialisationPluginNameForDirectSpeakers() -{ - return std::optional(VisrPluginSuite::OBJECT_METADATA_PLUGIN_NAME); -} - -void VisrPluginSuite::setupTrackWithMetadataPlugin(Track& track, ReaperAPI const& api) -{ - doGenericTrackSetup(track); - - assert(objectIdAssigner); - auto objectId = objectIdAssigner->getNextAvailableValue(); - - if(objectId.has_value()) { - auto plugin = track.createPlugin(OBJECT_METADATA_PLUGIN_NAME); - plugin->setParameter(*objectIdParameter, objectIdParameter->forwardMap(*objectId)); - track.routeTo(*busTrack3D, 1, 0, *objectId - 1); //Object IDs are 1-based, channels are 0-based - - } else { - // TODO - need to warn user - no free object ID's available - } - -} - -void VisrPluginSuite::onCreateObjectTrack(TrackElement &trackElement, ReaperAPI const& api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - AdmVst(mediaTrack, api); // Creates ADM VST before spatialiser - setupTrackWithMetadataPlugin(*track, api); - - auto groups = trackElement.slaveOfGroups(); - for(auto& group : groups) { - track->setAsVCASlave(group); - } -} - -void VisrPluginSuite::onCreateDirectTrack(TrackElement &trackElement, const ReaperAPI &api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - track->moveToBefore(trackInsertionIndex++); - track->disableMasterSend(); - - auto groups = trackElement.slaveOfGroups(); - for(auto& group : groups) { - track->setAsVCASlave(group); - } -} - -void VisrPluginSuite::doGenericTrackSetup(Track& track) -{ - track.moveToBefore(trackInsertionIndex++); - track.setChannelCount(1); - track.disableMasterSend(); -} - -void VisrPluginSuite::onCreateGroup(TrackElement &trackElement, const ReaperAPI &api) -{ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - - doGenericTrackSetup(*track); - auto groups = trackElement.slaveOfGroups(); - for (auto& group : groups) { - track->setAsVCASlave(group); - } - track->setAsVCAMaster(trackElement.masterOfGroup()); -} - -void VisrPluginSuite::onCreateProject(const ProjectNode &, const ReaperAPI &api) -{ - - objectIdAssigner = std::make_unique(UniqueValueAssigner::SearchCandidate{ OBJECT_METADATA_PLUGIN_NAME, determineUsedObjectId }, OBJECT_ID_MIN, OBJECT_ID_MAX, api); - trackInsertionIndex = api.getTrackIndexOfSelectedMediaItem(); - if (trackInsertionIndex <= 0) trackInsertionIndex = 1; - - busTrack3D = std::make_unique(api.createTrackAtIndex(trackInsertionIndex++), api); - busTrack3D->hideFromTrackControlPanel(); - busTrack3D->setChannelCount(MAX_CHANNEL_COUNT); - busTrack3D->setName("3D MASTER"); - auto masterTrack = api.masterTrack(); - if(!masterTrack->getPlugin(SCENEMASTER_PLUGIN_NAME)) { - masterTrack->createPlugin(SCENEMASTER_PLUGIN_NAME); - } - busTrack3D->createPlugin(RENDERER_PLUGIN_NAME); - if(!commonTracks) { - commonTracks = std::make_unique(api); - } - commonTracks->removeDeletedTracks(); -} - -Track& VisrPluginSuite::getCommonTrack(const DirectSpeakersAutomation& element, const ReaperAPI &api) -{ - auto onCreate = [&element, this, &api] (Track& newTrack) { - setupTrackWithMetadataPlugin(newTrack, api); - auto plugin = newTrack.getPlugin(OBJECT_METADATA_PLUGIN_NAME); - if(plugin) { - for(auto& parameter : automatedObjectPluginParameters()) { - element.apply(*parameter, *plugin); - } - } - }; - return commonTracks->trackFor(element.channel(), onCreate); -} - -void VisrPluginSuite::onObjectAutomation(const ObjectAutomation &automationNode, const ReaperAPI &api) -{ - auto& track = *automationNode.getTrack(); - configureAdmExportVst(automationNode, track, api); - auto plugin = track.getPlugin(OBJECT_METADATA_PLUGIN_NAME); - if(plugin) { - for(auto& parameter : automatedObjectPluginParameters()) { - automationNode.apply(*parameter, *plugin); - } - for(auto& parameter : trackParameters()) { - automationNode.apply(*parameter, track); - } - } -} - -void VisrPluginSuite::onDirectSpeakersAutomation(DirectSpeakersAutomation const& automationNode, ReaperAPI const& api) { - auto track = automationNode.getTrack(); - auto take = automationNode.parentTake(); - auto trackWidth = static_cast(take->channelCount()); - track->setChannelCount(trackWidth); - configureAdmExportVst(automationNode, *track, api); - - if(automationNode.channel().channelFormat()) { - auto pfData = AdmPresetDefinitionsHelper::getSingleton().getPackFormatData(automationNode.channel().packFormat()); - if (pfData) { - auto& commonTrack = getCommonTrack(automationNode, api); - track->routeTo(commonTrack, 1, automationNode.channelIndex()); - - } else { - // Note: ADM VST currently has no support for non-preset-definitions - auto channel = automationNode.channel(); - auto channelTrack = api.createTrack(); - channelTrack->setName(channel.name()); - setupTrackWithMetadataPlugin(*channelTrack, api); - auto plugin = track->getPlugin(OBJECT_METADATA_PLUGIN_NAME); - if(plugin) { - for(auto& parameter : automatedObjectPluginParameters()) { - automationNode.apply(*parameter, *plugin); - } - track->routeTo(*channelTrack, 1, automationNode.channelIndex()); - } - } - } -} - -void VisrPluginSuite::onHoaAutomation(const HoaAutomation &, const ReaperAPI &api){ - -} - -void VisrPluginSuite::onCreateHoaTrack(TrackElement &trackElement, const ReaperAPI &api){ - auto mediaTrack = api.createTrackAtIndex(0, true); - assert(mediaTrack); - auto track = std::make_shared(mediaTrack, api); - trackElement.setTrack(track); - auto mte = dynamic_cast(&trackElement); - mte->nameTrackFromElementName(); - track->moveToBefore(trackInsertionIndex++); - track->disableMasterSend(); - - auto groups = trackElement.slaveOfGroups(); - for(auto& group : groups) { - track->setAsVCASlave(group); - } -} - -std::vector> const& VisrPluginSuite::automatedObjectPluginParameters() -{ - auto static parameters = createAutomatedObjectPluginParameters(); - return parameters; -} - -std::vector> const& VisrPluginSuite::trackParameters() { - auto static parameters = createTrackParameters(); - return parameters; -} - -bool VisrPluginSuite::applyFXPreset(const HoaAutomation &, const ReaperAPI &api) { - return true; -} diff --git a/reaper-adm-extension/src/reaper_adm/pluginsuite_visr.h b/reaper-adm-extension/src/reaper_adm/pluginsuite_visr.h deleted file mode 100644 index 6fad5a3af..000000000 --- a/reaper-adm-extension/src/reaper_adm/pluginsuite_visr.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include -#include -#include -#include "pluginsuite.h" -#include "projectelements.h" - -namespace admplug { - class PluginParameter; - class TrackParameter; - class Track; - class CommonTrackPool; - - class VisrPluginSuite : public PluginSuite { - - public: - VisrPluginSuite(); - ~VisrPluginSuite(); - - void onCreateProject(const ProjectNode &rootNode, const ReaperAPI &api) override; - void onCreateObjectTrack(TrackElement &trackNode, const ReaperAPI &api) override; - void onCreateDirectTrack(TrackElement &trackNode, const ReaperAPI &api) override; - void onCreateHoaTrack(TrackElement &trackNode, const ReaperAPI &api) override; - void onCreateGroup(TrackElement &trackNode, const ReaperAPI &api) override; - void onObjectAutomation(ObjectAutomation const&, ReaperAPI const& api) override; - void onDirectSpeakersAutomation(DirectSpeakersAutomation const&, ReaperAPI const& api) override; - void onHoaAutomation(HoaAutomation const&, ReaperAPI const& api) override; - bool pluginSuiteUsable(ReaperAPI const& api) override; - bool applyFXPreset(const HoaAutomation &, const ReaperAPI &api) override; - PluginParameter* getPluginParameterFor(AdmParameter admParameter) override; - TrackParameter* getTrackParameterFor(AdmParameter admParameter) override; - Parameter* getParameterFor(AdmParameter admParameter) override; - const RequiresAdmExportVst pluginSuiteRequiresAdmExportVst() override { return RequiresAdmExportVst::PRE_SPATIALISATION; } - bool pluginUsesSphericalCoordinates(PluginInstance* pluginInst) override { return true; } - std::optional getSpatialisationPluginNameForObjects() override; - std::optional getSpatialisationPluginNameForDirectSpeakers() override; - - private: - std::vector> const & automatedObjectPluginParameters(); - std::vector> const & trackParameters(); - std::shared_ptr objectIdParameter; - std::unique_ptr objectIdAssigner; - - void doGenericTrackSetup(Track& track); - void setupTrackWithMetadataPlugin(Track &track, ReaperAPI const& api); - Track &getCommonTrack(const DirectSpeakersAutomation &element, const ReaperAPI &api); - - std::unique_ptr busTrack3D; - std::unique_ptr commonTracks; - int trackInsertionIndex{ -1 }; - - static const char* OBJECT_METADATA_PLUGIN_NAME; - static const char* SCENEMASTER_PLUGIN_NAME; - static const char* RENDERER_PLUGIN_NAME; - static const int MAX_CHANNEL_COUNT; - - static bool registered; - }; - -} diff --git a/reaper-adm-extension/test/reaper_adm/CMakeLists.txt b/reaper-adm-extension/test/reaper_adm/CMakeLists.txt index 5468e777a..483841b89 100644 --- a/reaper-adm-extension/test/reaper_adm/CMakeLists.txt +++ b/reaper-adm-extension/test/reaper_adm/CMakeLists.txt @@ -46,9 +46,6 @@ target_include_directories(testreaper_adm set_property(TARGET testreaper_adm PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "../../../../reaper-adm-extension/test/reaper_adm/") -add_custom_command(TARGET testreaper_adm POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${REAPER_ADM_EXTENSION_SRC_DIR}/ADMPresets ${CMAKE_CURRENT_SOURCE_DIR}/data/UserPlugins/ADMPresets) - add_test( NAME reaper_admtest COMMAND testreaper_adm diff --git a/reaper-adm-extension/test/reaper_adm/acceptancetests.cpp b/reaper-adm-extension/test/reaper_adm/acceptancetests.cpp index a85eb245d..d04de6e5c 100644 --- a/reaper-adm-extension/test/reaper_adm/acceptancetests.cpp +++ b/reaper-adm-extension/test/reaper_adm/acceptancetests.cpp @@ -11,7 +11,6 @@ #include "admvstcontrol.h" #include "pluginregistry.h" #include "pluginsuite.h" -#include "pluginsuite_fb360.h" #include "pluginsuite_ear.h" #include "mocks/pluginsuite.h" #include "fakeptr.h" @@ -37,11 +36,6 @@ using ::testing::DoAll; using ::testing::SetArgumentPointee; namespace { - int constexpr SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX{ 0 }; - int constexpr SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX{ 1 }; - int constexpr SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX{ 2 }; - auto constexpr SPATIALISER_PLUGIN_NAME{ "FB360 Spatialiser (ambiX)" }; - auto constexpr CONTROL_PLUGIN_NAME{ "FB360 Control (ambiX)" }; int constexpr ADM_VST_COMMANDPORT_PARAMETER_INDEX{ 0 }; int constexpr ADM_VST_SAMPLESPORT_PARAMETER_INDEX{ 1 }; int constexpr ADM_VST_INCLUDEINADM_PARAMETER_INDEX{ 2 }; @@ -58,13 +52,10 @@ namespace { struct FakeTracks { explicit FakeTracks(FakePtrFactory& fakePtr) : renderer{fakePtr.get()}, - submix{fakePtr.get()}, - directSpeakers{fakePtr.get()} {} + submix{fakePtr.get()} {} MediaTrack* renderer{}; MediaTrack* submix{}; - - MediaTrack* directSpeakers{}; // Used as a bus of directspeakers channels by FB360 }; struct FakeEnvelopes { @@ -150,16 +141,12 @@ namespace { return contains(fake.tracksWithItems, tr); }); ON_CALL(api, AddTakeToMediaItem(fake.mediaItem)).WillByDefault(Return(fake.take)); - ON_CALL(api, getPluginEnvelope(_, _, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX)).WillByDefault(Return(fake.envelopeFor.azimuth)); - ON_CALL(api, getPluginEnvelope(_, _, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX)).WillByDefault(Return(fake.envelopeFor.elevation)); - ON_CALL(api, getPluginEnvelope(_, _, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX)).WillByDefault(Return(fake.envelopeFor.distance)); ON_CALL(api, SetMediaItemTake_Source(fake.take, fake.source)).WillByDefault(Return(true)); ON_CALL(api, CreateTrackSend(_, _)).WillByDefault(Return(fake.sendIndex)); ON_CALL(api, TrackFX_AddByActualName(_, StrEq(EAR_SCENE_PLUGIN_NAME), _, _)).WillByDefault(Return(0)); ON_CALL(api, TrackFX_AddByActualName(_, StrEq(EAR_OBJECT_PLUGIN_NAME), _, _)).WillByDefault(Return(0)); ON_CALL(api, TrackFX_AddByActualName(_, StrEq(EAR_DEFAULT_MONITORING_PLUGIN_NAME), _, _)).WillByDefault(Return(0)); ON_CALL(api, TrackFX_AddByActualName(_, StrEq(ADM_VST_PLUGIN_NAME), _, _)).WillByDefault(Return(0)); - ON_CALL(api, TrackFX_AddByActualName(_, StrEq(SPATIALISER_PLUGIN_NAME), _, _)).WillByDefault(Return(1)); ON_CALL(api, TrackFX_GetCount(_)).WillByDefault(Return(2)); // Object VST and ADM VST ON_CALL(api, GetTrackEnvelopeByName(_, StrEq("Volume"))).WillByDefault(Return(fake.envelopeFor.volume)); ON_CALL(api, CountTracks(_)).WillByDefault(Return(2)); @@ -177,164 +164,6 @@ namespace { } - - void setObjectImportExpectations(MockReaperAPI& api, FakeReaperObjects& fake, int expectedGroupTracks, int expectedTracks) { - ON_CALL(api, createTrack()).WillByDefault([&api](){ - return std::make_unique(api.createTrackAtIndex(0, false), api); - }); - - EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(AnyNumber()). - WillOnce(Return(fake.trackFor.renderer)). - WillOnce(Return(fake.trackFor.submix)). - WillRepeatedly([&fake](int index, bool fromEnd) { - return fake.generateFakeTrack(); - }); - - SECTION("Creates a submix, 3D render bus and expected number of Group and Media Tracks") { - if ((expectedGroupTracks + expectedTracks) > 0) { - EXPECT_CALL(api, createTrackAtIndex(0, _)).Times(2 + expectedGroupTracks + expectedTracks). - WillOnce(Return(fake.trackFor.submix)). - WillOnce(Return(fake.trackFor.renderer)). - WillRepeatedly([&fake](int index, bool fromEnd) { - return fake.generateFakeTrack(); - }); - } - else { - EXPECT_CALL(api, createTrackAtIndex(0, _)).Times(2). - WillOnce(Return(fake.trackFor.submix)). - WillOnce(Return(fake.trackFor.renderer)); - } - } - - SECTION("Instantiates a spatialiser plugin on the object track and a control plugin on the render bus") { - EXPECT_CALL(api, TrackFX_AddByActualName(_, _, _, TrackFXAddMode::QueryPresence)).Times(AnyNumber()); - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq(ADM_VST_PLUGIN_NAME), _, AnyOf(TrackFXAddMode::CreateNew, TrackFXAddMode::CreateIfMissing))).Times(expectedTracks * 2); // Once via MediaTrackElement::addAdmExportVst, again via MediaTakeElement::createProjectElements - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq(SPATIALISER_PLUGIN_NAME), _, AnyOf(TrackFXAddMode::CreateNew, TrackFXAddMode::CreateIfMissing))).Times(expectedTracks); - EXPECT_CALL(api, TrackFX_AddByActualName(fake.trackFor.renderer, StrEq(CONTROL_PLUGIN_NAME), _, AnyOf(TrackFXAddMode::CreateNew, TrackFXAddMode::CreateIfMissing))); - } - - SECTION("Sets the number of track channels to 16, disables object and submix track master sends") { - EXPECT_CALL(api, setTrackChannelCount(fake.trackFor.renderer, 16)).Times(1); - EXPECT_CALL(api, setTrackChannelCount(fake.trackFor.submix, 16)).Times(1); - for(int i = 0; i < (expectedGroupTracks + expectedTracks); ++i) { - EXPECT_CALL(api, setTrackChannelCount(fake.generatedTracks[i], 16)).Times(1); - EXPECT_CALL(api, disableTrackMasterSend(fake.generatedTracks[i])).Times(1); - } - EXPECT_CALL(api, disableTrackMasterSend(fake.trackFor.submix)).Times(1); - } - - SECTION("Adds a 16 channel send from the object track to the submix") { - EXPECT_CALL(api, RouteTrackToTrack(_,_,_,_,_,_,_)).Times(AnyNumber()); - EXPECT_CALL(api, RouteTrackToTrack(_,_,fake.trackFor.submix,_,16,_,_)).Times(expectedTracks); - } - - SECTION("Adds audio to the track") { - EXPECT_CALL(api, AddMediaItemToTrack(_)).Times(expectedTracks); - EXPECT_CALL(api, AddTakeToMediaItem(fake.mediaItem)).Times(expectedTracks); - EXPECT_CALL(api, SetMediaItemLength(fake.mediaItem, _, _)).Times(expectedTracks); - if (expectedTracks > 0) { - EXPECT_CALL(api, PCM_Source_CreateFromFile(_)).Times(expectedTracks).WillRepeatedly(Return(fake.source)); - } - else { - EXPECT_CALL(api, PCM_Source_CreateFromFile(_)).Times(0); - } - EXPECT_CALL(api, SetMediaItemTake_Source(fake.take, fake.source)).Times(expectedTracks); - } - } - - void setDirectSpeakersImportExpectations(MockReaperAPI& api, FakeReaperObjects& fake, int expectedDirectChannels) { - ON_CALL(api, createTrack()).WillByDefault([&api](){ - return std::make_unique(api.createTrackAtIndex(0, false), api); - }); - - EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(AnyNumber()). - WillOnce(Return(fake.trackFor.renderer)). - WillOnce(Return(fake.trackFor.submix)). - WillOnce(Return(fake.trackFor.directSpeakers)). - WillRepeatedly([&fake](int index, bool fromEnd) { - return fake.generateFakeTrack(); - }); - - SECTION("Creates a submix, 3D render bus and expected number of Group and Media Tracks") { - if(expectedDirectChannels > 0) { - EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(3 + expectedDirectChannels). - WillOnce(Return(fake.trackFor.submix)). - WillOnce(Return(fake.trackFor.renderer)). - WillOnce(Return(fake.trackFor.directSpeakers)). - WillRepeatedly([&fake](int index, bool fromEnd) { - return fake.generateFakeTrack(); - }); - } else { - EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(3). - WillOnce(Return(fake.trackFor.renderer)). - WillOnce(Return(fake.trackFor.submix)). - WillOnce(Return(fake.trackFor.directSpeakers)); - } - } - - SECTION("Instantiates a spatialiser plugin on the channel tracks and a control plugin on the render bus") { - if(expectedDirectChannels > 0) { - EXPECT_CALL(api, TrackFX_AddByActualName(fake.trackFor.directSpeakers, StrEq(ADM_VST_PLUGIN_NAME), false, TrackFXAddMode::QueryPresence)).WillOnce(Return(-1)).WillRepeatedly(Return(0)); - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrNe(ADM_VST_PLUGIN_NAME), _, TrackFXAddMode::QueryPresence)).Times(AnyNumber()); - EXPECT_CALL(api, TrackFX_AddByActualName(fake.trackFor.directSpeakers, StrEq(ADM_VST_PLUGIN_NAME), _, AnyOf(TrackFXAddMode::CreateNew, TrackFXAddMode::CreateIfMissing))).Times(1); - } - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq(SPATIALISER_PLUGIN_NAME) ,_ ,AnyOf(TrackFXAddMode::CreateNew, TrackFXAddMode::CreateIfMissing))).Times(expectedDirectChannels); - EXPECT_CALL(api, TrackFX_AddByActualName(fake.trackFor.renderer, StrEq(CONTROL_PLUGIN_NAME), _, AnyOf(TrackFXAddMode::CreateNew, TrackFXAddMode::CreateIfMissing))); - } - - SECTION("Sets the number of track channels to 16, disables directspeaker, common definition and submix track master sends") { - EXPECT_CALL(api, setTrackChannelCount(fake.trackFor.renderer, 16)).Times(1); - EXPECT_CALL(api, setTrackChannelCount(fake.trackFor.submix, 16)).Times(1); - if(expectedDirectChannels > 0) { - EXPECT_CALL(api, setTrackChannelCount(fake.trackFor.directSpeakers, expectedDirectChannels)).Times(AtLeast(1)); - } else { - EXPECT_CALL(api, setTrackChannelCount(fake.trackFor.directSpeakers, _)).Times(AtLeast(1)); - } - for(int i = 0; i < expectedDirectChannels; ++i) { - EXPECT_CALL(api, setTrackChannelCount(fake.generatedTracks[i], 16)).Times(1); - EXPECT_CALL(api, disableTrackMasterSend(fake.generatedTracks[i])).Times(1); - } - EXPECT_CALL(api, disableTrackMasterSend(fake.trackFor.directSpeakers)).Times(1); - EXPECT_CALL(api, disableTrackMasterSend(fake.trackFor.submix)).Times(1); - } - - SECTION("Sets sends from direct track to channels") { - EXPECT_CALL(api, RouteTrackToTrack(_, _, _, _, _, _,_)).Times(AnyNumber()); - EXPECT_CALL(api, RouteTrackToTrack(fake.trackFor.directSpeakers, _, _, _, 1, _, _)).Times(expectedDirectChannels); - EXPECT_CALL(api, RouteTrackToTrack(_, _, fake.trackFor.submix, _, 16, _, _)).Times(expectedDirectChannels); - } - - SECTION("Adds audio to the track") { - EXPECT_CALL(api, AddMediaItemToTrack(fake.trackFor.directSpeakers)).Times(1); - EXPECT_CALL(api, AddTakeToMediaItem(fake.mediaItem)).Times(1); - EXPECT_CALL(api, SetMediaItemLength(fake.mediaItem, _, _)).Times(1); - EXPECT_CALL(api, PCM_Source_CreateFromFile(_)).Times(1).WillRepeatedly(Return(fake.source)); - EXPECT_CALL(api, SetMediaItemTake_Source(fake.take, fake.source)).Times(1); - } - } - - void setHoaImportExpectations(MockReaperAPI& api, FakeReaperObjects& fake, int expectedHoaObjects){ - ON_CALL(api, createTrack()).WillByDefault([&api](){ - return std::make_unique(api.createTrackAtIndex(0, false), api); - }); - - EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(2 + expectedHoaObjects). - WillOnce(Return(fake.trackFor.renderer)). - WillOnce(Return(fake.trackFor.submix)). - WillRepeatedly([&fake](int index, bool fromEnd) { - return fake.generateFakeTrack(); - }); - - EXPECT_CALL(api, GetResourcePath()).WillRepeatedly(Return("../../test/reaper_adm/data")); - EXPECT_CALL(api, TrackFX_AddByActualName(_, _, _, _)).WillRepeatedly(Return(0)); - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq(SPATIALISER_PLUGIN_NAME), false, 0)).WillOnce(Return(1)).WillRepeatedly(Return(-1)); - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq(ADM_VST_PLUGIN_NAME), false, 0)).WillOnce(Return(0)).WillRepeatedly(Return(-1)); - const char* notNothing{ "not_nothing" }; - const char* isNothing{ "" }; - EXPECT_CALL(api, TrackFX_GetPreset(_, 1, _, _)).WillOnce(DoAll(SetArgumentPointee<2>(*isNothing), Return(true))).WillRepeatedly(DoAll(SetArgumentPointee<2>(*notNothing), Return(true))); - EXPECT_CALL(api, TrackFX_SetPreset(_, _, _)).Times(expectedHoaObjects); - } - template void doImport(std::string fileName, MockReaperAPI const& api) { auto fakePluginSuite = std::make_shared(); @@ -385,7 +214,7 @@ namespace { } } - SECTION("Instantiates a spatialiser plugin on the object track and a control plugin on the render bus") { + SECTION("Instantiates a Input plugin on the object track and a control plugin on the render bus") { EXPECT_CALL(api, TrackFX_AddByActualName(_, _, _, TrackFXAddMode::QueryPresence)).Times(AnyNumber()); EXPECT_CALL(api, TrackFX_AddByActualName(_, _, _, TrackFXAddMode::CreateIfMissing)).Times(AnyNumber()); EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq(EAR_OBJECT_PLUGIN_NAME), _, TrackFXAddMode::CreateNew)).Times(expectedObjectPlugins); @@ -440,12 +269,6 @@ TEST_CASE("Check required plug-ins are available") { // - it makes sure the dummy reaper-vstplugins64.ini data includes all the plug-ins we will need. // (otherwise it can be difficult to track down why tests are failing) std::vector reqPlugins{ - "FB360 Control (ambiX)", - "FB360 Converter (ambiX)", - "FB360 Spatialiser (ambiX)", - "VISR ObjectEditor", - "VISR SceneMaster", - "VISR LoudspeakerRenderer", "ADM Export Source" }; ASSERT_TRUE(registry->checkPluginsAvailable(reqPlugins, api)); @@ -455,394 +278,6 @@ TEST_CASE("Check required plug-ins are available") { } -TEST_CASE("Import object based panning noise using FB360 plugin suite", "[objects][FB360]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 0, 1); - - SECTION("Names the render bus 3D MASTER and the MediaTrack after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.generatedTracks[0], StrEq("Noise"))).Times(1); - } - - SECTION("Adds automation envelopes for object azimuth, elevation distance and volume") { - EXPECT_CALL(api, getPluginEnvelope(fake.generatedTracks[0], _, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX)).Times((AtLeast(1))); - // only 1 point so set directly - EXPECT_CALL(api, getPluginEnvelope(fake.generatedTracks[0], _, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX)).Times(0); - EXPECT_CALL(api, getPluginEnvelope(fake.generatedTracks[0], _, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX)).Times(0); - EXPECT_CALL(api, GetTrackEnvelopeByName(fake.generatedTracks[0], StrEq("Volume"))).Times(0); - } - - SECTION("Adds automation points to the envelopes (24 direct, 1 for start of first block as it has non-zero duration, 1 for handling azimuth discontinuity)") { - int const numBlocks = 24; - int const azimuthDiscontinuityPoints = 1; // Was previously 2 - new logic doesn't add ineffective point (duplicate of point data derived from audioBlockFormat) - EXPECT_CALL(api, InsertEnvelopePoint(fake.envelopeFor.azimuth, _, _, _, _, _, _)).Times(numBlocks*2 + azimuthDiscontinuityPoints - 1); // Final point becomes redundant - EXPECT_CALL(api, InsertEnvelopePoint(fake.envelopeFor.elevation, _, _, _, _, _, _)).Times(0); // Elevation never changes - EXPECT_CALL(api, InsertEnvelopePoint(fake.envelopeFor.distance, _, _, _, _, _, _)).Times(0); // Distance never changes - EXPECT_CALL(api, InsertEnvelopePoint(fake.envelopeFor.volume, _, _, _, _, _, _)).Times(0); // Gain never changes - } - - SECTION("Sets plugin values for azimuth elevation, distance and track volume") { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(AtLeast(1)); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(AtLeast(1)); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(AtLeast(1)); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(AnyNumber()); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(AnyNumber()); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(AnyNumber()); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[0], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(AnyNumber()); - } - - doImport("data/panned_noise_adm.wav", api); -} - -TEST_CASE("Import of nested pack formats of object type", "[objects][FB360][nesting]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 1, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("audObj"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("2nd CF (child pack)"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("1st CF (parent pack)"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 1; i < 3; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting1-1ao_with_1pf_reffing_1pf.wav", api); -} - -TEST_CASE("Import of audioobject referencing multiple pack formats of object type", "[objects][FB360][invalid]") { - // This is valid ADM but not compliant with EBU 3392 due to multiple packs referenced from an object. - - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 0, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.generatedTracks[0], StrEq("audObj"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.generatedTracks[1], StrEq("audObj"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 0; i < 2; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting2-1ao_with_2pf_each_with_1cf.wav", api); -} - -TEST_CASE("Import of nested audioobjects referencing object type packs", "[objects][FB360][nesting]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 0, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObjects") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Child AO 1"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Child AO 2"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 0; i < 2; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting3-1ao_reffing_2ao_each_with_1pf_with_1cf.wav", api); -} - -TEST_CASE("On import of two audioobjects of object type, one which references the other, ADMImporter") { - // This is valid ADM but not compliant with EBU 3392 due to both pack and object referenced from an object. - - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 0, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObjects") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Parent AO"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Child AO"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 0; i < 2; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting4-1ao_reffing_1ao_both_with_1pf_with_1cf.wav", api); -} - -TEST_CASE("Import object packformat with multiple channelformats", "[objects][FB360][nesting]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 1, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("audObj"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("1st CF"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("2nd CF"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 1; i < 3; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting5-1ao_with_1pf_with_2cf.wav", api); -} - -TEST_CASE("Importing audioobject with shared child object", "[objects][FB360]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 2, 1); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Parent AO 1"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Parent AO 2"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Child AO"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, TrackFX_SetParam(_, 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(_, 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(_, 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, StrEq("D_VOL"), _)).Times(1); - } - - doImport("data/nesting6-2ao_both_reffing_1ao_with_1pf_with_1cf.wav", api); -} - -TEST_CASE("Import of complex audioobject nesting: nesting6b-2ao_parents_1ao_child_shared_and_1ao_child_with_one_parent.wav", "[objects][FB360][nesting]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 2, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Parent AO 1"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Parent AO 2"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Shared Child AO"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("Child of AO 2"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, TrackFX_SetParam(_, 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(2); - EXPECT_CALL(api, TrackFX_SetParam(_, 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(2); - EXPECT_CALL(api, TrackFX_SetParam(_, 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(2); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(2); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(2); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(2); - EXPECT_CALL(api, TrackFX_SetParam(_, 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(2); - - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, StrEq("D_VOL"), _)).Times(2); - } - - doImport("data/nesting6b-2ao_parents_1ao_child_shared_and_1ao_child_with_one_parent.wav", api); -} - -TEST_CASE("Import of file with objects referencing different packs but common channelformat", "[objects][FB360][nesting]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 0, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("1st AO"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("2nd AO"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 0; i < 2; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting7-2ao_with_1pf_each_reffing_same_1cf.wav", api); -} - -TEST_CASE("On import of nesting example: nesting8-2ao_reffing_same_1pf_with_1cf.wav, ADMImporter") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setObjectImportExpectations(api, fake, 0, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("1st AO"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("2nd AO"))).Times(1); - } - - SECTION("Sets Azimuth, Elevation, distance and gain parameters") { - EXPECT_CALL(api, SetMediaTrackInfo_Value(_, _, _)).Times(AnyNumber()); - for(int i = 0; i < 2; i++) { - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 1, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_INCLUDEINADM_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMTYPEDEFINITION_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMPACKFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, TrackFX_SetParam(fake.generatedTracks[i], 0, ADM_VST_ADMCHANNELFORMAT_PARAMETER_INDEX, _)).Times(1); - EXPECT_CALL(api, SetMediaTrackInfo_Value(fake.generatedTracks[i], StrEq("D_VOL"), _)).Times(1); - } - } - - doImport("data/nesting8-2ao_reffing_same_1pf_with_1cf.wav", api); -} - -TEST_CASE("Importing mono directspeaker file to FB360 plugin suite", "[directspeaker][FB360]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setDirectSpeakersImportExpectations(api, fake, 1); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject and Speaker Channels") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.directSpeakers, StrEq("Main"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.generatedTracks[0], StrEq("FrontCentre"))).Times(1); - } - doImport("data/channels_mono_adm.wav", api); -} - -TEST_CASE("Importing stereo directspeaker file to FB360 plugin suite", "[directspeaker][FB360]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setDirectSpeakersImportExpectations(api, fake, 2); - - SECTION("Names the render bus 3D MASTER and the MediaTracks after the AudioObject and Speaker Channels") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.directSpeakers, StrEq("Main"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("FrontLeft"))).Times(1); - EXPECT_CALL(api, setTrackName(_, StrEq("FrontRight"))).Times(1); - } - doImport("data/channels_stereo_adm.wav", api); -} - -TEST_CASE("On import of directspeakers file with nested pack formats", "[directspeaker][FB360][nesting]") { - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setDirectSpeakersImportExpectations(api, fake, 0); // Note that this is not a common def DS pack, so we don't support it! - I.e, 0 direct channel tracks - - SECTION("Names the render bus 3D MASTER and the MediaTrack after the AudioObject. Does not create non-common-def Speaker Channels") { - EXPECT_CALL(api, setTrackName(fake.trackFor.renderer, StrEq("3D MASTER"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.submix, StrEq("3D Sub-Master"))).Times(1); - EXPECT_CALL(api, setTrackName(fake.trackFor.directSpeakers, StrEq("audObj"))).Times(1); - } - doImport("data/nesting1b-same_for_directspeakers.wav", api); -} - -TEST_CASE("Importing ambix1stOrder HOA file to FB360 plugin suite", "[hoa][FB360]"){ - NiceMock api; - FakeReaperObjects fake; - - setApiDefaults(api, fake); - setHoaImportExpectations(api, fake, 1); - EXPECT_CALL(api, TrackFX_Delete(_, 0)).WillOnce(Return(true)); // We expect the export vst to be moved because it's not a common def - - doImport("data/hoa_4ch_bwf_1stOrderAmbix.wav", api); -} - TEST_CASE("On import of AudioObject with multiple TrackUIDs, creates one track per TrackUID", "[ear]") { NiceMock api; FakeReaperObjects fake; diff --git a/reaper-adm-extension/test/reaper_adm/pluginsuitetests.cpp b/reaper-adm-extension/test/reaper_adm/pluginsuitetests.cpp index a82941537..e2aa6fd75 100644 --- a/reaper-adm-extension/test/reaper_adm/pluginsuitetests.cpp +++ b/reaper-adm-extension/test/reaper_adm/pluginsuitetests.cpp @@ -9,7 +9,7 @@ #include "mocks/reaperapi.h" #include "mocks/automationenvelope.h" #include "mocks/projectelements.h" -#include "pluginsuite_fb360.h" +#include "pluginsuite_ear.h" #include "mocks/track.h" using namespace admplug; @@ -28,286 +28,69 @@ using ::testing::InSequence; using namespace admplug::testing; -TEST_CASE("Facebook360 plugin suite") { - auto const SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX{ 0 }; - auto const SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX{ 1 }; - auto const SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX{ 2 }; +TEST_CASE("EAR plugin suite") { + EARPluginSuite pluginSuite; + NiceMock api; - Facebook360PluginSuite pluginSuite; - NiceMock api; + auto fakeRootElement = std::make_shared< NiceMock>(); + auto mockSceneTrackPtr = std::make_unique>(); + auto& mockSceneTrack = *mockSceneTrackPtr; + auto mockMonitorTrackPtr = std::make_unique>(); + auto& mockMonitorTrack = *mockMonitorTrackPtr; - auto fakeRootElement = std::make_shared< NiceMock>(); - auto mockControlTrackPtr = std::make_unique>(); - auto& mockControlTrack = *mockControlTrackPtr; - auto mockSubmixTrackPtr = std::make_unique>(); - auto& mockSubmixTrack = *mockSubmixTrackPtr; + SECTION("onProjectInit()") { + ON_CALL(api, GetDawChannelCount()).WillByDefault(Return(128)); - SECTION("onProjectInit()") { - EXPECT_CALL(api, createTrack()).Times(2). - WillOnce(Return(ByMove(std::move(mockControlTrackPtr)))). - WillOnce(Return(ByMove(std::move(mockSubmixTrackPtr)))); + EXPECT_CALL(api, createTrack()).Times(2). + WillOnce(Return(ByMove(std::move(mockSceneTrackPtr)))). + WillOnce(Return(ByMove(std::move(mockMonitorTrackPtr)))); - SECTION("3D Mix bus setup") { - EXPECT_CALL(mockControlTrack, setChannelCount(16)); - EXPECT_CALL(mockControlTrack, setName(StrEq("3D MASTER"))); - EXPECT_CALL(mockControlTrack, createPlugin(StrEq("FB360 Control (ambiX)"))); - } - - SECTION("Submix bus setup") { - EXPECT_CALL(mockSubmixTrack, setChannelCount(16)); - EXPECT_CALL(mockSubmixTrack, setName(StrEq("3D Sub-Master"))); - } - - SECTION("The submix is routed to the main 3D mix bus") { - EXPECT_CALL(mockSubmixTrack, route(Ref(mockControlTrack), 16, 0, 0)); - } - - pluginSuite.onCreateProject(ProjectNode{ fakeRootElement }, api); + SECTION("EAR Scene Bus setup") { + EXPECT_CALL(mockSceneTrack, setChannelCount(128)); + EXPECT_CALL(mockSceneTrack, setName(StrEq("EAR Scene Bus"))); + EXPECT_CALL(mockSceneTrack, createPlugin(StrEq("EAR Scene"))); } - SECTION("onTrackCreate()") { - auto fakeParentElement = std::make_shared>(); - std::vector admElements; - auto trackElement = ObjectTrack(admElements, fakeParentElement); - auto fakeTrackPtrVal{34}; - auto fakeTrackPtr = reinterpret_cast(&fakeTrackPtrVal); - static GUID guid{ 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}; - ON_CALL(api, GetTrackGUID(_)).WillByDefault(Return(&guid)); - ON_CALL(api, TrackFX_GetFXGUID(_, _)).WillByDefault(Return(&guid)); - ON_CALL(api, ValidatePtr(_, _)).WillByDefault(Return(true)); - ON_CALL(api, createTrackAtIndex(_, _)).WillByDefault(Return(fakeTrackPtr)); - ON_CALL(*fakeParentElement, masterOfGroup).WillByDefault(Return(TrackGroup(0))); - - EXPECT_CALL(api, createTrack()).Times(2). - WillOnce(Return(ByMove(std::move(mockControlTrackPtr)))). - WillOnce(Return(ByMove(std::move(mockSubmixTrackPtr)))); - - pluginSuite.onCreateProject(ProjectNode{ fakeRootElement }, api); - - SECTION("suite creates a track") { - EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(1); - pluginSuite.onCreateObjectTrack(trackElement, api); - REQUIRE(trackElement.getTrack().get() != nullptr); - } - SECTION("suite sets track channel count to 16") { - EXPECT_CALL(api, setTrackChannelCount(_, 16)); - SECTION("and track master send disabled") { - EXPECT_CALL(api, disableTrackMasterSend(_)); - } - pluginSuite.onCreateObjectTrack(trackElement, api); - } - SECTION("suite instatiates spatializer plugin and adm plugin") { - EXPECT_CALL(api, RouteTrackToTrack(_, 0, _, 0, 16, PostFaderPostFx, _)); - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq("FB360 Spatialiser (ambiX)"), false, _)); - EXPECT_CALL(api, TrackFX_AddByActualName(_, StrEq("ADM Export Source"), false, _)); - pluginSuite.onCreateObjectTrack(trackElement, api); - } - - + SECTION("EAR Monitor Bus setup") { + EXPECT_CALL(mockMonitorTrack, setChannelCount(128)); + EXPECT_CALL(mockMonitorTrack, setName(StrEq("EAR Monitor Bus"))); + EXPECT_CALL(mockMonitorTrack, createPlugin(StrEq("EAR Monitoring 0+2+0"))); } - SECTION("onObjectAutomation()") { -// SECTION("after onCreateObjectTrack()") { -// pluginSuite.onCreateObjectTrack(fakeElement, api); -// constexpr double CARTESIAN_ERROR_EPLISION {0.00001}; -// SECTION("Given the automation node has an initial cartesian block pointing straight forward") { -// auto blocks = ObjectTypeBlockRange{}.with(initialCartesianBlock().withRtime(0).withX(0).withY(1).withZ(0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A track FX envelope is added to the object track referencing the azimuth parameter it's spatializer plugin") { -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, Ne(SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX))).Times(AnyNumber()); -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX)).Times(AtLeast(1)); -// SECTION("And a point is added to the envelope with the correct position") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, _, DoubleEq(0.5), 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } -// } -// SECTION("Given the automation node has an initial cartesian block pointing 45 degrees to the left") { -// auto blocks = ObjectTypeBlockRange{}.with(initialCartesianBlock().withRtime(0).withX(-1).withY(1).withZ(0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A point is added to the envelope with the correct position") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, _, DoubleNear(0.375, CARTESIAN_ERROR_EPLISION), 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); - -// } -// } - -// SECTION("Given the automation node has an initial cartesian block pointing forward and 45 degrees up") { -// auto blocks = ObjectTypeBlockRange{}.with(initialCartesianBlock().withRtime(0).withX(0).withY(1).withZ(1)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A point is added to the envelope with the correct position") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeElevationEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeElevationEnvelope, _, DoubleNear(0.75, CARTESIAN_ERROR_EPLISION), 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has an initial cartesian block pointing forward at a distance of 2") { -// auto blocks = ObjectTypeBlockRange{}.with(initialCartesianBlock().withRtime(0).withX(0).withY(2).withZ(0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A point is added to the envelope with the correct position") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeDistanceEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeDistanceEnvelope, _, DoubleNear(2.00 / 60.0, CARTESIAN_ERROR_EPLISION), 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has an initial cartesian block pointing straigh up at the pole at a distance of 60") { -// auto blocks = ObjectTypeBlockRange{}.with(initialCartesianBlock().withRtime(0).withX(0).withY(0).withZ(60)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A point is added to the envelope with the correct position") { -// EXPECT_CALL(api, InsertEnvelopePoint(fakeGainEnvelope, _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, _, _, _, _, _, _)).Times(AnyNumber()); // it's undefined at the poles so anything -// EXPECT_CALL(api, InsertEnvelopePoint(fakeDistanceEnvelope, _, DoubleNear(1.0, CARTESIAN_ERROR_EPLISION), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeElevationEnvelope, _, DoubleNear(1.0, CARTESIAN_ERROR_EPLISION), 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has a 0 duration block with azimuth and rtime") { -// adm::SphericalPosition pos(adm::Azimuth{0.0f}); -// auto const BLOCK_RTIME = 1.0; -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withRtime(BLOCK_RTIME).withAzimuth(0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A track FX envelope is added to the object track referencing the azimuth parameter it's spatializer plugin") { -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, Ne(SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX))).Times(AnyNumber()); -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, SPATIALISER_PLUGIN_AZIMUTH_PARAMETER_INDEX)).Times(AtLeast(1)); -// SECTION("And a point is added to the envelope with the correct position") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, _, DoubleEq(0.5), 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// SECTION("And a point is added to the envelope at the rtime") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(BLOCK_RTIME), _, 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } -// SECTION("and a second block with azimuth and timing data") { -// auto twoBlocks = blocks.followedBy(SphericalCoordBlock{}.withDuration(1)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(twoBlocks)); -// SECTION("Two points are added to a track envelope") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, _, DoubleEq(0.5), 0, _, false, _)).Times(2); -// SECTION("And sorted") { -// EXPECT_CALL(api, Envelope_SortPoints(Ne(fakeAzimuthEnvelope))).Times(AnyNumber()); -// EXPECT_CALL(api, Envelope_SortPoints(fakeAzimuthEnvelope)).Times(AtLeast(1)); -// } -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } -// } -// SECTION("Given the automation node has a 0 duration block with azimuth, elevation, rtime and duration") { -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withAzimuth(0.0).withElevation(45.0).withRtime(1)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A track FX envelope is added to the object track referencing the elevation parameter of its spatializer plugin") { -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, Ne(SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX))).Times(AnyNumber()); -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, SPATIALISER_PLUGIN_ELEVATION_PARAMETER_INDEX)).Times(AtLeast(1)); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// SECTION("An automation point is added at 0.75") { -// EXPECT_CALL(api, InsertEnvelopePoint(fakeElevationEnvelope, _, DoubleEq(0.75), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeElevationEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } -// SECTION("Given the automation node has a 0 duration block with azimuth, elevation, distance, rtime and duration") { -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withDistance(6.0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A track FX envelope is added to the object track referencing the elevation parameter of its spatializer plugin") { -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, Ne(SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX))).Times(AnyNumber()); -// EXPECT_CALL(api, getPluginEnvelope(fakeObjectTrack, _, SPATIALISER_PLUGIN_DISTANCE_PARAMETER_INDEX)).Times(AtLeast(1)); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// SECTION("An automation point is added at 0.1") { -// EXPECT_CALL(api, InsertEnvelopePoint(fakeDistanceEnvelope, _, DoubleEq(0.1), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeDistanceEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has a non-zero block with azimuth and rtime") { -// auto blocks = ObjectTypeBlockRange{}.with(SphericalCoordBlock{}.withRtime(1).withDuration(1)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("The last envelope point is added at time rtime + duration") { -// { -// InSequence s; -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, _, _, 0, _, false, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(2.0), _, 0, _, false, _)).Times(1); -// } -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Givent the automation node has an initial block with a gain value") { -// double const GAIN_VAL = 0.5; -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withGain(GAIN_VAL)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("A gain automation point is added with the supplied value") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeGainEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeGainEnvelope, _, DoubleEq(GAIN_VAL), _, _, _, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has an initial block with a non-zero duration") { -// auto blocks = ObjectTypeBlockRange{}.with(SphericalCoordBlock{}.withRtime(0).withDuration(1)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("Azimuth automation points are added at the start and end of the block") { -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(1.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// SECTION("Distance automation points are added at the start and end of the block") { -// EXPECT_CALL(api, InsertEnvelopePoint(fakeDistanceEnvelope, DoubleEq(0.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeDistanceEnvelope, DoubleEq(1.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeDistanceEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has two blocks that when following the shortest path traverse an azimuth disconinuity from bottom to top") { -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withAzimuth(179.0)).followedBy(SphericalCoordBlock{}.withAzimuth(-179.0).withDuration(1.0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("two additional points are added at the time of the discontinuity") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.5), DoubleEq(0.0), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.5), DoubleEq(1.0), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(1.0), _, 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } - -// SECTION("Given the automation node has two blocks that do not start at rtime 0 and when following the shortest path, traverse an azimuth disconinuity from bottom to top") { -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withAzimuth(179.0).withRtime(1.0)).followedBy(SphericalCoordBlock{}.withAzimuth(-179.0).withDuration(1.0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("two additional points are added at the time of the discontinuity") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(1.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(1.5), DoubleEq(0.0), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(1.5), DoubleEq(1.0), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(2.0), _, 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } + SECTION("The EAR Scene Bus is routed to the EAR Monitor Bus") { + EXPECT_CALL(mockSceneTrack, route(Ref(mockMonitorTrack), 128, 0, 0)); + } -// SECTION("Given the automation node has two blocks that when following the shortest path traverse an azimuth disconinuity from top to bottom") { -// auto blocks = ObjectTypeBlockRange{}.with(initialSphericalBlock().withAzimuth(-179.0)).followedBy(SphericalCoordBlock{}.withAzimuth(179.0).withDuration(1.0)); -// ON_CALL(fakeAutoElement, blocks()).WillByDefault(Return(blocks)); -// SECTION("two additional points are added at the time of the discontinuity") { -// EXPECT_CALL(api, InsertEnvelopePoint(Ne(fakeAzimuthEnvelope), _, _, _, _, _, _)).Times(AnyNumber()); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.0), _, 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.5), DoubleEq(0.0), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(0.5), DoubleEq(1.0), 0, _, false, _)).Times(1); -// EXPECT_CALL(api, InsertEnvelopePoint(fakeAzimuthEnvelope, DoubleEq(1.0), _, 0, _, false, _)).Times(1); -// pluginSuite.onObjectAutomation(fakeAutoElement, api); -// } -// } -// } -} + pluginSuite.onCreateProject(ProjectNode{ fakeRootElement }, api); + } + + SECTION("onTrackCreate()") { + auto fakeParentElement = std::make_shared>(); + std::vector admElements; + auto trackElement = ObjectTrack(admElements, fakeParentElement); + auto fakeTrackPtrVal{ 34 }; + auto fakeTrackPtr = reinterpret_cast(&fakeTrackPtrVal); + static GUID guid{ 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} }; + ON_CALL(api, GetTrackGUID(_)).WillByDefault(Return(&guid)); + ON_CALL(api, TrackFX_GetFXGUID(_, _)).WillByDefault(Return(&guid)); + ON_CALL(api, ValidatePtr(_, _)).WillByDefault(Return(true)); + ON_CALL(api, createTrackAtIndex(_, _)).WillByDefault(Return(fakeTrackPtr)); + ON_CALL(*fakeParentElement, masterOfGroup).WillByDefault(Return(TrackGroup(0))); + ON_CALL(api, GetDawChannelCount()).WillByDefault(Return(128)); + + EXPECT_CALL(api, createTrack()).Times(2). + WillOnce(Return(ByMove(std::move(mockSceneTrackPtr)))). + WillOnce(Return(ByMove(std::move(mockMonitorTrackPtr)))); + + pluginSuite.onCreateProject(ProjectNode{ fakeRootElement }, api); + + SECTION("suite creates a track") { + EXPECT_CALL(api, createTrackAtIndex(_, _)).Times(1); + SECTION("and track master send disabled") { + EXPECT_CALL(api, disableTrackMasterSend(_)); + } + pluginSuite.onCreateObjectTrack(trackElement, api); + REQUIRE(trackElement.getTrack().get() != nullptr); + } + } } \ No newline at end of file diff --git a/tools/setup/CMakeLists.txt b/tools/setup/CMakeLists.txt index 4cb6f4c80..b982276da 100644 --- a/tools/setup/CMakeLists.txt +++ b/tools/setup/CMakeLists.txt @@ -125,10 +125,6 @@ if(APPLE AND NOT EPS_CI) COMMAND ${CMAKE_COMMAND} -E copy $ $/Resources/UserPlugins/$ ) - add_custom_command(TARGET setup POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/reaper-adm-extension/src/reaper_adm/ADMPresets $/Resources/UserPlugins/ADMPresets - ) - add_custom_command(TARGET setup POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/packaging/Templates $/Resources/Templates )