#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);
+ }
}
}
}
lpnc += ':';
vector<string> ports;
- if (AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput, ports) > 0) {
+ if (type == DataType::NIL) {
+ vector<string> p1;
+ AudioEngine::instance()->get_ports ("", DataType::AUDIO, inputs ? IsInput : IsOutput, ports);
+ AudioEngine::instance()->get_ports ("", DataType::MIDI, inputs ? IsInput : IsOutput, p1);
+ for (vector<string>::const_iterator s = p1.begin(); s != p1.end(); ++s) {
+ ports.push_back (*s);
+ }
+ } else {
+ AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput, ports);
+ }
+
+ if (ports.size () > 0) {
for (vector<string>::const_iterator s = ports.begin(); s != ports.end(); ) {
}
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);