pretty send and sidechain names
This commit is contained in:
parent
fa73112f08
commit
ccbf56827d
|
@ -504,14 +504,20 @@ PluginPinDialog::port_label (const std::string& portname, bool strip)
|
||||||
boost::to_lower (lpn);
|
boost::to_lower (lpn);
|
||||||
std::string program_port_prefix = lpn + ":"; // e.g. "ardour:"
|
std::string program_port_prefix = lpn + ":"; // e.g. "ardour:"
|
||||||
|
|
||||||
|
std::string pn = AudioEngine::instance ()->get_pretty_name_by_name (portname);
|
||||||
|
if (!pn.empty ()) {
|
||||||
|
string::size_type slash = pn.find ("/");
|
||||||
|
if (slash != string::npos) {
|
||||||
|
pn = pn.substr (0, slash);
|
||||||
|
}
|
||||||
|
return pn;
|
||||||
|
}
|
||||||
std::string label (portname);
|
std::string label (portname);
|
||||||
if (label.find ("system:capture_") == 0) {
|
if (label.find ("system:capture_") == 0) {
|
||||||
label = AudioEngine::instance ()->get_pretty_name_by_name (label);
|
|
||||||
if (label.empty ()) {
|
if (label.empty ()) {
|
||||||
label = portname.substr (15);
|
label = portname.substr (15);
|
||||||
}
|
}
|
||||||
} else if (label.find ("system:midi_capture_") == 0) {
|
} else if (label.find ("system:midi_capture_") == 0) {
|
||||||
label = AudioEngine::instance ()->get_pretty_name_by_name (label);
|
|
||||||
if (label.empty ()) {
|
if (label.empty ()) {
|
||||||
// "system:midi_capture_123" -> "123"
|
// "system:midi_capture_123" -> "123"
|
||||||
label = "M " + portname.substr (20);
|
label = "M " + portname.substr (20);
|
||||||
|
@ -1650,8 +1656,15 @@ PluginPinDialog::add_send_from (boost::weak_ptr<ARDOUR::Port> wp, boost::weak_pt
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ignore_updates = true;
|
std::string sendname = send->name ();
|
||||||
|
string::size_type last_letter = sendname.find_last_not_of ("0123456789");
|
||||||
|
if (last_letter != string::npos) {
|
||||||
|
send->output ()->set_pretty_name (string_compose (_("SC %1 (%2)"),
|
||||||
|
r->name (),
|
||||||
|
sendname.substr (last_letter + 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
_ignore_updates = true;
|
||||||
p->disconnect_all ();
|
p->disconnect_all ();
|
||||||
|
|
||||||
DataType dt = p->type ();
|
DataType dt = p->type ();
|
||||||
|
|
|
@ -513,6 +513,10 @@ ProcessorEntry::setup_tooltip ()
|
||||||
string_compose (_("<b>%1</b>\nThe Plugin is not available on this system\nand has been replaced by a stub."), name (Wide)));
|
string_compose (_("<b>%1</b>\nThe Plugin is not available on this system\nand has been replaced by a stub."), name (Wide)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (boost::dynamic_pointer_cast<Send> (_processor) && !boost::dynamic_pointer_cast<InternalSend>(_processor)) {
|
||||||
|
ARDOUR_UI_UTILS::set_tooltip (_button, string_compose ("<b>> %1</b>", _processor->name()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ARDOUR_UI_UTILS::set_tooltip (_button, string_compose ("<b>%1</b>", name (Wide)));
|
ARDOUR_UI_UTILS::set_tooltip (_button, string_compose ("<b>%1</b>", name (Wide)));
|
||||||
}
|
}
|
||||||
|
@ -531,19 +535,52 @@ ProcessorEntry::name (Width w) const
|
||||||
!boost::dynamic_pointer_cast<InternalSend>(_processor)) {
|
!boost::dynamic_pointer_cast<InternalSend>(_processor)) {
|
||||||
|
|
||||||
name_display += '>';
|
name_display += '>';
|
||||||
|
std::string send_name;
|
||||||
|
bool pretty_ok = true;
|
||||||
|
|
||||||
|
if (send->remove_on_disconnect ()) {
|
||||||
|
// assume it's a sidechain, find pretty name of connected port(s)
|
||||||
|
PortSet& ps (send->output ()->ports ());
|
||||||
|
for (PortSet::iterator i = ps.begin (); i != ps.end () && pretty_ok; ++i) {
|
||||||
|
vector<string> connections;
|
||||||
|
if (i->get_connections (connections)) {
|
||||||
|
vector<string>::const_iterator ci;
|
||||||
|
for (ci = connections.begin(); ci != connections.end(); ++ci) {
|
||||||
|
std::string pn = AudioEngine::instance()->get_pretty_name_by_name (*ci);
|
||||||
|
if (pn.empty ()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (send_name.empty ()) {
|
||||||
|
send_name = pn;
|
||||||
|
} else if (send_name != pn) {
|
||||||
|
// pretty names don't match
|
||||||
|
pretty_ok = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pretty_ok) {
|
||||||
|
send_name = "";
|
||||||
|
}
|
||||||
|
|
||||||
/* grab the send name out of its overall name */
|
/* grab the send name out of its overall name */
|
||||||
|
if (send_name.empty()) {
|
||||||
string::size_type lbracket, rbracket;
|
send_name = send->name();
|
||||||
lbracket = send->name().find ('[');
|
string::size_type lbracket, rbracket;
|
||||||
rbracket = send->name().find (']');
|
lbracket = send_name.find ('[');
|
||||||
|
rbracket = send_name.find (']');
|
||||||
|
send_name = send_name.substr (lbracket+1, lbracket-rbracket-1);
|
||||||
|
}
|
||||||
|
|
||||||
switch (w) {
|
switch (w) {
|
||||||
case Wide:
|
case Wide:
|
||||||
name_display += send->name().substr (lbracket+1, lbracket-rbracket-1);
|
name_display += send_name;
|
||||||
break;
|
break;
|
||||||
case Narrow:
|
case Narrow:
|
||||||
name_display += PBD::short_version (send->name().substr (lbracket+1, lbracket-rbracket-1), 4);
|
name_display += PBD::short_version (send_name, 5);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user