From 4bd2de2f72484c25617ef37b27b61319646f316f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 25 Feb 2024 02:38:08 +0100 Subject: [PATCH] Vapor: prepare for additional meta-data --- libs/ardour/ardour/surround_pannable.h | 3 +++ libs/ardour/ardour/types.h | 3 +++ libs/ardour/ardour/uri_map.h | 3 +++ libs/ardour/automatable.cc | 6 ++++++ libs/ardour/enums.cc | 3 +++ libs/ardour/event_type_map.cc | 12 +++++++++++- libs/ardour/luabindings.cc | 3 +++ libs/ardour/parameter_descriptor.cc | 19 +++++++++++++++++++ libs/ardour/surround_pannable.cc | 9 +++++++++ libs/ardour/uri_map.cc | 3 +++ 10 files changed, 63 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/surround_pannable.h b/libs/ardour/ardour/surround_pannable.h index ae465be2b6..ea17b68abc 100644 --- a/libs/ardour/ardour/surround_pannable.h +++ b/libs/ardour/ardour/surround_pannable.h @@ -49,6 +49,9 @@ public: std::shared_ptr pan_size; std::shared_ptr pan_snap; std::shared_ptr binaural_render_mode; + std::shared_ptr sur_elevation_enable; + std::shared_ptr sur_zones; + std::shared_ptr sur_ramp; void set_automation_state (AutoState); AutoState automation_state() const { return _auto_state; } diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 13451917d0..efcc77f0cb 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -182,6 +182,9 @@ enum AutomationType { PanSurroundSize, PanSurroundSnap, BinauralRenderMode, + PanSurroundElevationEnable, + PanSurroundZones, + PanSurroundRamp, /* used only by Controllable Descriptor to access send parameters */ diff --git a/libs/ardour/ardour/uri_map.h b/libs/ardour/ardour/uri_map.h index 7c38e00e5f..d109aa6867 100644 --- a/libs/ardour/ardour/uri_map.h +++ b/libs/ardour/ardour/uri_map.h @@ -108,6 +108,9 @@ public: uint32_t surr_PosZ; uint32_t surr_Size; uint32_t surr_Snap; + uint32_t surr_ElevEn; + uint32_t surr_Zones; + uint32_t surr_Ramp; uint32_t surr_Settings; uint32_t surr_BinauralRenderMode; uint32_t surr_ChannelCount; diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 8529d4e0bb..83871d7baa 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -222,6 +222,12 @@ Automatable::describe_parameter (Evoral::Parameter param) return _("Snap to Speaker"); } else if (param.type() == BinauralRenderMode) { return _("Binaural Render mode"); + } else if (param.type() == PanSurroundElevationEnable) { + return X_("hidden"); + } else if (param.type() == PanSurroundZones) { + return X_("hidden"); + } else if (param.type() == PanSurroundRamp) { + return X_("hidden"); } else if (param.type() == PhaseAutomation) { return _("Polarity Invert"); } else if (param.type() == MidiVelocityAutomation) { diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index b24f945608..1ddc562f6a 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -216,6 +216,9 @@ setup_enum_writer () REGISTER_ENUM (PanSurroundSize); REGISTER_ENUM (PanSurroundSnap); REGISTER_ENUM (BinauralRenderMode); + REGISTER_ENUM (PanSurroundElevationEnable); + REGISTER_ENUM (PanSurroundZones); + REGISTER_ENUM (PanSurroundRamp); REGISTER (_AutomationType); REGISTER_ENUM (Off); diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc index c2270d8acd..5cc7916380 100644 --- a/libs/ardour/event_type_map.cc +++ b/libs/ardour/event_type_map.cc @@ -132,6 +132,8 @@ EventTypeMap::from_symbol(const string& str) const p_type = GainAutomation; } else if (str == "send") { p_type = BusSendLevel; + } else if (str == "send-enable") { + p_type = BusSendEnable; } else if (str == "return") { p_type = InsertReturnLevel; } else if (str == "trim") { @@ -256,6 +258,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const return "gain"; } else if (t == BusSendLevel) { return "send"; + } else if (t == BusSendEnable) { + return "send-enable"; } else if (t == InsertReturnLevel) { return "return"; } else if (t == TrimAutomation) { @@ -284,6 +288,12 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const return std::string("pan-sur-snap-") + PBD::to_string(param.id()); } else if (t == BinauralRenderMode) { return std::string("binaural-render-mode-") + PBD::to_string(param.id()); + } else if (t == PanSurroundElevationEnable) { + return std::string("binaural-render-mode-") + PBD::to_string(param.id()); + } else if (t == PanSurroundZones) { + return std::string("surround-zones-") + PBD::to_string(param.id()); + } else if (t == PanSurroundRamp) { + return std::string("surround--ramp-") + PBD::to_string(param.id()); } else if (t == SoloAutomation) { return "solo"; } else if (t == MuteAutomation) { @@ -328,7 +338,7 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const } else if (t == MidiVelocityAutomation) { return "midi-velocity"; } else { - PBD::warning << "Uninitialized Parameter symbol() called." << endmsg; + PBD::warning << "Uninitialized Parameter symbol(" << t << ") called." << endmsg; return ""; } } diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index d6b5e5f25d..21d3e499ac 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -1905,6 +1905,9 @@ LuaBindings::common (lua_State* L) .addData ("pan_size", &SurroundPannable::pan_size) .addData ("pan_snap", &SurroundPannable::pan_snap) .addData ("binaural_render_mode", &SurroundPannable::binaural_render_mode) + .addData ("sur_elevation_enable", &SurroundPannable::sur_elevation_enable) + .addData ("sur_zones", &SurroundPannable::sur_zones) + .addData ("sur_ramp", &SurroundPannable::sur_ramp) .endClass () .deriveWSPtrClass ("SurroundSend") diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc index 8784660b36..52a181766d 100644 --- a/libs/ardour/parameter_descriptor.cc +++ b/libs/ardour/parameter_descriptor.cc @@ -126,7 +126,26 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter) scale_points->insert (std::make_pair (_("Near"), 2)); scale_points->insert (std::make_pair (_("Far"), 3)); break; + case PanSurroundZones: + enumeration = true; + integer_step = true; + upper = 5.0f; + normal = 0.0f; + scale_points = std::shared_ptr(new ScalePoints()); + scale_points->insert (std::make_pair (_("All"), 0)); + scale_points->insert (std::make_pair (_("No Back"), 1)); + scale_points->insert (std::make_pair (_("No Sides"), 2)); + scale_points->insert (std::make_pair (_("Center Back"), 3)); + scale_points->insert (std::make_pair (_("Screen Only"), 4)); + scale_points->insert (std::make_pair (_("Surround Only"), 5)); + break; + case PanSurroundElevationEnable: + upper = 1.0f; + normal = 1.0f; + toggled = true; + break; case PanSurroundSnap: + case PanSurroundRamp: case SoloAutomation: case MuteAutomation: upper = 1.0f; diff --git a/libs/ardour/surround_pannable.cc b/libs/ardour/surround_pannable.cc index e42df07851..3c0cc1a34e 100644 --- a/libs/ardour/surround_pannable.cc +++ b/libs/ardour/surround_pannable.cc @@ -70,6 +70,9 @@ SurroundPannable::SurroundPannable (Session& s, uint32_t chn, Temporal::TimeDoma , pan_size (new SurroundControllable (s, Evoral::Parameter (PanSurroundSize, 0, chn), tdp)) , pan_snap (new SurroundControllable (s, Evoral::Parameter (PanSurroundSnap, 0, chn), tdp)) , binaural_render_mode (new SurroundControllable (s, Evoral::Parameter (BinauralRenderMode, 0, chn), tdp)) + , sur_elevation_enable (new SurroundControllable (s, Evoral::Parameter (PanSurroundElevationEnable, 0, chn), tdp)) + , sur_zones (new SurroundControllable (s, Evoral::Parameter (PanSurroundZones, 0, chn), tdp)) + , sur_ramp (new SurroundControllable (s, Evoral::Parameter (PanSurroundRamp, 0, chn), tdp)) , _auto_state (Off) , _responding_to_control_auto_state_change (0) { @@ -81,6 +84,9 @@ SurroundPannable::SurroundPannable (Session& s, uint32_t chn, Temporal::TimeDoma add_control (pan_size); add_control (pan_snap); add_control (binaural_render_mode); // not automatable + add_control (sur_elevation_enable); // hidden, volatile + add_control (sur_zones); // hidden, volatile + add_control (sur_ramp); // hidden, volatile /* all controls change state together */ pan_pos_x->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&SurroundPannable::control_auto_state_changed, this, _1)); @@ -144,6 +150,9 @@ SurroundPannable::foreach_pan_control (boost::function