Remove explicit well-known ctrl enum string functions

This is better provided by Plugin::print_parameter, which
is called by PluginControl::get_user_string(). This removes
special cases for the mode enums.
This commit is contained in:
Robin Gareus 2023-03-29 17:20:40 +02:00
parent c1d6456d58
commit 8c2454238e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
7 changed files with 5 additions and 55 deletions

View File

@ -549,7 +549,6 @@ public:
std::shared_ptr<AutomationControl> filter_slope_controllable (bool) const;
std::shared_ptr<AutomationControl> filter_enable_controllable (bool) const;
std::string tape_mode_name (uint32_t) const;
std::shared_ptr<AutomationControl> tape_drive_controllable () const;
std::shared_ptr<AutomationControl> tape_drive_mode_controllable () const;
std::shared_ptr<ReadOnlyControl> tape_drive_mtr_controllable () const;
@ -567,7 +566,6 @@ public:
std::shared_ptr<ReadOnlyControl> comp_meter_controllable () const;
std::shared_ptr<ReadOnlyControl> comp_redux_controllable () const;
std::string gate_mode_name (uint32_t) const;
std::shared_ptr<AutomationControl> gate_enable_controllable () const;
std::shared_ptr<AutomationControl> gate_mode_controllable () const;
std::shared_ptr<AutomationControl> gate_ratio_controllable () const;
@ -585,9 +583,6 @@ public:
std::shared_ptr<ReadOnlyControl> gate_meter_controllable () const;
std::shared_ptr<ReadOnlyControl> gate_redux_controllable () const;
std::string comp_mode_name (uint32_t mode) const;
std::string comp_speed_name (uint32_t mode) const;
std::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const;
std::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const;
std::shared_ptr<AutomationControl> send_pan_azimuth_controllable (uint32_t n) const;

View File

@ -142,8 +142,8 @@ class LIBARDOUR_API Stripable : public SessionObject,
* return of a null ptr (or an empty string for eq_band_name()).
*/
virtual uint32_t eq_band_cnt () const = 0;
virtual std::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
virtual std::string eq_band_name (uint32_t) const = 0;
virtual std::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
virtual std::shared_ptr<AutomationControl> eq_gain_controllable (uint32_t band) const = 0;
virtual std::shared_ptr<AutomationControl> eq_freq_controllable (uint32_t band) const = 0;
virtual std::shared_ptr<AutomationControl> eq_q_controllable (uint32_t band) const = 0;
@ -153,8 +153,6 @@ class LIBARDOUR_API Stripable : public SessionObject,
virtual std::shared_ptr<AutomationControl> filter_slope_controllable (bool hp) const = 0;
virtual std::shared_ptr<AutomationControl> filter_enable_controllable (bool hp) const = 0;
virtual std::string tape_mode_name (uint32_t) const = 0;
virtual std::shared_ptr<AutomationControl> tape_drive_controllable () const = 0;
virtual std::shared_ptr<AutomationControl> tape_drive_mode_controllable () const = 0;
virtual std::shared_ptr<ReadOnlyControl> tape_drive_mtr_controllable () const = 0;
@ -176,7 +174,6 @@ class LIBARDOUR_API Stripable : public SessionObject,
virtual std::shared_ptr<ReadOnlyControl> comp_meter_controllable () const = 0;
virtual std::shared_ptr<ReadOnlyControl> comp_redux_controllable () const = 0;
virtual std::string gate_mode_name (uint32_t) const = 0;
virtual std::shared_ptr<AutomationControl> gate_enable_controllable () const = 0;
virtual std::shared_ptr<AutomationControl> gate_mode_controllable () const = 0;
virtual std::shared_ptr<AutomationControl> gate_ratio_controllable () const = 0;
@ -194,17 +191,6 @@ class LIBARDOUR_API Stripable : public SessionObject,
virtual std::shared_ptr<ReadOnlyControl> gate_meter_controllable () const = 0;
virtual std::shared_ptr<ReadOnlyControl> gate_redux_controllable () const = 0;
/* @param mode must be supplied by the comp_mode_controllable(). All other values
* result in undefined behaviour
*/
virtual std::string comp_mode_name (uint32_t mode) const = 0;
/* @param mode - as for comp mode name. This returns the name for the
* parameter/control accessed via comp_speed_controllable(), which can
* be mode dependent.
*/
virtual std::string comp_speed_name (uint32_t mode) const = 0;
/* "well-known" controls for sends to well-known busses in this route. Any or all may
* be null.
*

View File

@ -164,11 +164,6 @@ class LIBARDOUR_API VCA : public Stripable,
std::shared_ptr<ReadOnlyControl> gate_meter_controllable () const { return std::shared_ptr<ReadOnlyControl>(); }
std::shared_ptr<ReadOnlyControl> gate_redux_controllable () const { return std::shared_ptr<ReadOnlyControl>(); }
std::string tape_mode_name (uint32_t) const {return std::string("");}
std::string gate_mode_name (uint32_t) const {return std::string("");}
std::string comp_mode_name (uint32_t mode) const { return std::string(); }
std::string comp_speed_name (uint32_t mode) const { return std::string(); }
std::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const { return std::shared_ptr<AutomationControl>(); }
std::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const { return std::shared_ptr<AutomationControl>(); }
std::shared_ptr<AutomationControl> send_pan_azimuth_controllable (uint32_t n) const { return std::shared_ptr<AutomationControl>(); }

View File

@ -1371,8 +1371,6 @@ LuaBindings::common (lua_State* L)
.addFunction ("comp_mode_controllable", &Stripable::comp_mode_controllable)
.addFunction ("comp_makeup_controllable", &Stripable::comp_makeup_controllable)
.addFunction ("comp_redux_controllable", &Stripable::comp_redux_controllable)
.addFunction ("comp_mode_name", &Stripable::comp_mode_name)
.addFunction ("comp_speed_name", &Stripable::comp_speed_name)
.addFunction ("eq_band_cnt", &Stripable::eq_band_cnt)
.addFunction ("eq_enable_controllable", &Stripable::eq_enable_controllable)
.addFunction ("eq_band_name", &Stripable::eq_band_name)

View File

@ -5807,12 +5807,6 @@ Route::filter_enable_controllable (bool) const
return std::shared_ptr<AutomationControl>();
}
std::string
Route::tape_mode_name (uint32_t mode) const
{
return _("???");
}
std::shared_ptr<AutomationControl>
Route::tape_drive_controllable () const
{
@ -5923,24 +5917,6 @@ Route::comp_redux_controllable () const
{
return std::shared_ptr<ReadOnlyControl>();
}
string
Route::comp_mode_name (uint32_t mode) const
{
return _("???");
}
string
Route::comp_speed_name (uint32_t mode) const
{
return _("???");
}
string
Route::gate_mode_name (uint32_t mode) const
{
return _("???");
}
std::shared_ptr<AutomationControl>
Route::gate_enable_controllable () const
{

View File

@ -508,7 +508,7 @@ void DynamicsSubview::setup_vpot(
std::vector<AutomationType> params;
if (tc) { available.push_back (std::make_pair (tc, "Thresh")); }
if (sc) { available.push_back (std::make_pair (sc, mc ? _subview_stripable->comp_speed_name (mc->get_value()) : "Speed")); }
if (sc) { available.push_back (std::make_pair (sc, mc ? mc->get_user_string () : "Speed")); }
if (mc) { available.push_back (std::make_pair (mc, "Mode")); }
if (kc) { available.push_back (std::make_pair (kc, "Makeup")); }
if (ec) { available.push_back (std::make_pair (ec, "on/off")); }
@ -571,7 +571,7 @@ DynamicsSubview::notify_change (std::weak_ptr<ARDOUR::AutomationControl> pc, uin
if (control) {
float val = control->get_value();
if (control == _subview_stripable->comp_mode_controllable ()) {
pending_display[1] = _subview_stripable->comp_mode_name (val);
pending_display[1] = control->get_user_string ();
} else {
do_parameter_display(pending_display[1], control->desc(), val, strip, true);
}

View File

@ -1061,8 +1061,8 @@ void
OSCSelectObserver::comp_mode ()
{
change_message (X_("/select/comp_mode"), _strip->comp_mode_controllable());
_osc.text_message (X_("/select/comp_mode_name"), _strip->comp_mode_name(_strip->comp_mode_controllable()->get_value()), addr);
_osc.text_message (X_("/select/comp_speed_name"), _strip->comp_speed_name(_strip->comp_mode_controllable()->get_value()), addr);
_osc.text_message (X_("/select/comp_mode_name"), _strip->comp_mode_controllable()->get_user_string(), addr);
_osc.text_message (X_("/select/comp_speed_name"), _strip->comp_speed_controllable()->get_user_string(), addr);
}
void