diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-10-21 16:31:16 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-10-21 16:31:16 -0400 |
commit | 7df9917a11129485b7d85db3f45840263c109a25 (patch) | |
tree | de056cba09b16d7d51a3f46b8f8d54fd310418da /gtk2_ardour/port_group.cc | |
parent | 4ab80e16e9e851e0e685d194625b3f5dbbce7e56 (diff) |
minor code-tidying tweak - continue if port handle is null, rather than nest inside conditional
Diffstat (limited to 'gtk2_ardour/port_group.cc')
-rw-r--r-- | gtk2_ardour/port_group.cc | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index 808ddc4ee0..7439fe1b77 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -543,8 +543,10 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp we excluded them earlier. */ - string lp = p, monitor = _("Monitor"); - boost::to_lower (lp); + string lp = p; + string monitor = _("Monitor"); + + boost::to_lower (lp); boost::to_lower (monitor); if ((lp.find (monitor) != string::npos) && @@ -560,29 +562,35 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp */ PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (p); - if (ph) { - DataType t (AudioEngine::instance()->port_engine().port_data_type (ph)); - if (t != DataType::NIL) { - if (port_has_prefix (p, X_("system:")) || - port_has_prefix (p, X_("alsa_pcm:")) || - port_has_prefix (p, X_("alsa_midi:"))) { - extra_system[t].push_back (p); - } else if (port_has_prefix (p, lpnc)) { - - /* we own this port (named after the program) */ - - /* Hide scene ports from non-Tracks Live builds */ - if (!ARDOUR::Profile->get_trx()) { - if (p.find (_("Scene ")) != string::npos) { - ++s; - continue; - } - } - extra_program[t].push_back (p); - } else { - extra_other[t].push_back (p); + if (!ph) { + continue; + } + + DataType t (AudioEngine::instance()->port_engine().port_data_type (ph)); + + if (t != DataType::NIL) { + + if (port_has_prefix (p, X_("system:")) || + port_has_prefix (p, X_("alsa_pcm:")) || + port_has_prefix (p, X_("alsa_midi:"))) { + extra_system[t].push_back (p); + + } else if (port_has_prefix (p, lpnc)) { + + /* we own this port (named after the program) */ + + /* Hide scene ports from non-Tracks Live builds */ + if (!ARDOUR::Profile->get_trx()) { + if (p.find (_("Scene ")) != string::npos) { + ++s; + continue; + } } + + extra_program[t].push_back (p); + } else { + extra_other[t].push_back (p); } } } |