#include "time_axis_view.h"
#include "public_editor.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
class RouteIOsComparator {
public:
bool operator() (RouteIOs const & a, RouteIOs const & b) {
- return a.route->order_key () < b.route->order_key ();
+ return a.route->presentation_info ().order() < b.route->presentation_info().order();
}
};
/* Sort RouteIOs by the routes' editor order keys */
route_ios.sort (RouteIOsComparator ());
- /* Now put the bundles that belong to these sorted RouteIOs into the PortGroup.
- Note that if the RouteIO's bundles are multi-type, we may make new Bundles
- with only the ports of one type.
- */
+ /* Now put the bundles that belong to these sorted RouteIOs into the PortGroup. */
for (list<RouteIOs>::iterator i = route_ios.begin(); i != route_ios.end(); ++i) {
- TimeAxisView* tv = PublicEditor::instance().axis_view_from_route (i->route);
+ TimeAxisView* tv = PublicEditor::instance().axis_view_from_stripable (i->route);
/* Work out which group to put these IOs' bundles in */
boost::shared_ptr<PortGroup> g;
}
for (list<boost::shared_ptr<IO> >::iterator j = i->ios.begin(); j != i->ios.end(); ++j) {
- if (tv) {
- g->add_bundle ((*j)->bundle(), *j, tv->color ());
- } else {
- g->add_bundle ((*j)->bundle(), *j);
+ /* Only add the bundle if there is at least one port
+ * with a type that's been asked for */
+ if (type == DataType::NIL || (*j)->bundle()->nchannels().n(type) > 0) {
+ if (tv) {
+ g->add_bundle ((*j)->bundle(), *j, tv->color ());
+ } else {
+ g->add_bundle ((*j)->bundle(), *j);
+ }
}
}
}
sync->add_channel (
_("MTC in"), DataType::MIDI, ae->make_port_name_non_relative (session->mtc_input_port()->name())
);
- sync->add_channel (
- _("MIDI control in"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_input_port()->name())
- );
sync->add_channel (
_("MIDI clock in"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_clock_input_port()->name())
);
sync->add_channel (
_("MTC out"), DataType::MIDI, ae->make_port_name_non_relative (session->mtc_output_port()->name())
);
- sync->add_channel (
- _("MIDI control out"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_output_port()->name())
- );
sync->add_channel (
_("MIDI clock out"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_clock_output_port()->name())
);
connections.
*/
- if (p.find ("Midi-Through") != string::npos) {
+ if (p.find ("Midi-Through") != string::npos || p.find ("Midi Through") != string::npos) {
++s;
continue;
}
we excluded them earlier.
*/
- string lp = p;
- boost::to_lower (lp);
+ string lp = p;
+ string monitor = _("Monitor");
+
+ boost::to_lower (lp);
+ boost::to_lower (monitor);
- if ((lp.find (N_(":monitor")) != string::npos) &&
+ if ((lp.find (monitor) != string::npos) &&
(lp.find (lpn) != string::npos)) {
++s;
continue;
*/
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, N_("system:")) ||
- port_has_prefix (p, N_("alsa_pcm:")) ||
- port_has_prefix (p, N_("alsa_midi:"))) {
- extra_system[t].push_back (p);
- } else if (port_has_prefix (p, lpnc)) {
- /* Hide scene ports from non-Tracks Live builds */
- if (!ARDOUR::Profile->get_trx()) {
- if (p.find (_("Scene ")) != string::npos) {
- ++s;
- continue;
- }
+
+ 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);
}
+
+ extra_program[t].push_back (p);
+ } else {
+ extra_other[t].push_back (p);
}
}
}
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
if (!extra_program[*i].empty()) {
- /* remove program name prefix from port name and use rest as bundle name */
- std::string bundle_name = extra_program[*i].front().substr (lpnc.length());
- boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_program[*i], *i, inputs, bundle_name);
+ /* used program name as bundle name */
+ boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_program[*i], *i, inputs, lpn);
program->add_bundle (b);
}
}
}
add_group_if_not_empty (other);
- if (type != DataType::MIDI) {
- add_group_if_not_empty (bus);
- }
+ add_group_if_not_empty (bus);
add_group_if_not_empty (track);
add_group_if_not_empty (program);
add_group_if_not_empty (system);