diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index fc63dfbde0..1a00fd305f 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -44,6 +44,7 @@ #include "ardour/value_as_string.h" #include "plugin_pin_dialog.h" +#include "plugin_setup_dialog.h" #include "gui_thread.h" #include "timers.h" #include "ui_config.h" @@ -523,18 +524,7 @@ PluginPinWidget::refill_output_presets () for (PluginOutputConfiguration::const_iterator i = ppc.begin () ; i != ppc.end (); ++i) { assert (*i > 0); - std::string tmp; - switch (*i) { - case 1: - tmp = _("Mono"); - break; - case 2: - tmp = _("Stereo"); - break; - default: - tmp = string_compose (P_("%1 Channel", "%1 Channels", *i), *i); - break; - } + std::string tmp = PluginSetupDialog::preset_label (*i); _out_presets.AddMenuElem (MenuElem (tmp, sigc::bind (sigc::mem_fun (*this, &PluginPinWidget::select_output_preset), *i))); if (n_audio == *i) { _out_presets.set_text (tmp); diff --git a/gtk2_ardour/plugin_setup_dialog.cc b/gtk2_ardour/plugin_setup_dialog.cc index 215c2f68fd..f296ab83be 100644 --- a/gtk2_ardour/plugin_setup_dialog.cc +++ b/gtk2_ardour/plugin_setup_dialog.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2017 Robin Gareus + * Copyright (C) 2016-2023 Robin Gareus * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -207,7 +207,7 @@ PluginSetupDialog::toggle_fan_out () } std::string -PluginSetupDialog::preset_label (uint32_t n_audio) const +PluginSetupDialog::preset_label (uint32_t n_audio) { std::string rv; switch (n_audio) { diff --git a/gtk2_ardour/plugin_setup_dialog.h b/gtk2_ardour/plugin_setup_dialog.h index c47523f58e..6fd85b78f4 100644 --- a/gtk2_ardour/plugin_setup_dialog.h +++ b/gtk2_ardour/plugin_setup_dialog.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2017 Robin Gareus + * Copyright (C) 2016-2023 Robin Gareus * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,8 @@ public: bool fan_out () const { return _fan_out.get_active () && _fan_out.get_sensitive (); } + static std::string preset_label (uint32_t); + private: void setup_output_presets (); void update_sensitivity (uint32_t); @@ -43,8 +45,6 @@ private: void apply_mapping (); void toggle_fan_out (); - std::string preset_label (uint32_t) const; - boost::shared_ptr _route; boost::shared_ptr _pi;