diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-07 14:05:15 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-07 14:05:15 +0200 |
commit | e714b7719e995e41a897a77fa0ff054f24e8687a (patch) | |
tree | 1b25c05fc5c8b2b667c70f80f1bb32cacfce99b1 /gtk2_ardour/plugin_pin_dialog.cc | |
parent | 2486ee0137bba587d598ea54b4c6350423a30a9e (diff) |
refine sidechain labels
Diffstat (limited to 'gtk2_ardour/plugin_pin_dialog.cc')
-rw-r--r-- | gtk2_ardour/plugin_pin_dialog.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index df479f4d1b..18c6852b0c 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include <boost/algorithm/string.hpp> + #include <gtkmm/table.h> #include <gtkmm/frame.h> #include <gtkmm/box.h> @@ -165,7 +167,7 @@ PluginPinDialog::PluginPinDialog (boost::shared_ptr<ARDOUR::PluginInsert> pi) box->pack_start (_add_sc_audio, false, false); box->pack_start (_add_sc_midi , false, false); f = manage (new Frame()); - f->set_label (_("Add Port")); + f->set_label (_("Add Sidechain Input")); f->add (*box); tr->pack_start (*f, false, false); @@ -367,23 +369,36 @@ PluginPinDialog::add_port_to_table (boost::shared_ptr<Port> p, uint32_t r, bool lbl = "..."; tip += " <- "; } else { + string lpn (PROGRAM_NAME); + boost::to_lower (lpn); + std::string program_port_prefix = lpn + ":"; // e.g. "ardour:" + lbl = cns[0]; tip += " <- "; - if (lbl.find ("system:") == 0) { + if (lbl.find ("system:capture_") == 0) { + lbl = AudioEngine::instance ()->get_pretty_name_by_name (lbl); + if (lbl.empty ()) { + lbl = cns[0].substr (15); + } + } else if (lbl.find("system:midi_capture_") == 0) { lbl = AudioEngine::instance ()->get_pretty_name_by_name (lbl); if (lbl.empty ()) { - lbl = cns[0].substr (7); + // "system:midi_capture_123" -> "123" + lbl = "M " + cns[0].substr (20); } + } else if (lbl.find (program_port_prefix) == 0) { + lbl = lbl.substr (program_port_prefix.size()); } } for (std::vector<std::string>::const_iterator i = cns.begin(); i != cns.end(); ++i) { tip += *i; tip += " "; } + replace_all (lbl, "_", " "); ArdourButton *pb = manage (new ArdourButton (lbl)); pb->set_text_ellipsize (Pango::ELLIPSIZE_MIDDLE); - pb->set_layout_ellipsize_width (56 * PANGO_SCALE); + pb->set_layout_ellipsize_width (108 * PANGO_SCALE); ARDOUR_UI_UTILS::set_tooltip (*pb, tip); _sidechain_tbl->attach (*pb, 0, 1, r, r +1 , EXPAND|FILL, SHRINK); |