+ switch (spec.channel_config->region_processing_type ()) {
+ case RegionExportChannelFactory::None:
+ case RegionExportChannelFactory::Processed:
+ region_export = false;
+ break;
+ default:
+ break;
+ }
+#if 1 // hack alert -- align master bus, compensate master latency
+
+ /* there's no easier way to get this information here.
+ * Ports are configured in the PortExportChannelSelector GUI,
+ * This ExportHandler has no context of routes.
+ */
+ boost::shared_ptr<Route> master_bus = session.master_out ();
+ if (master_bus) {
+ const PortSet& ps = master_bus->output ()->ports();
+
+ const ExportChannelConfiguration::ChannelList& channels = spec.channel_config->get_channels ();
+ for (ExportChannelConfiguration::ChannelList::const_iterator it = channels.begin(); it != channels.end(); ++it) {
+
+ boost::shared_ptr <PortExportChannel> pep = boost::dynamic_pointer_cast<PortExportChannel> (*it);
+ if (!pep) {
+ continue;
+ }
+ PortExportChannel::PortSet const& ports = pep->get_ports ();
+ for (PortExportChannel::PortSet::const_iterator it = ports.begin(); it != ports.end(); ++it) {
+ boost::shared_ptr<AudioPort> ap = (*it).lock();
+ if (ps.contains (ap)) {
+ incl_master_bus = true;
+ }
+ }
+ }
+ }
+#endif
+ graph_builder->add_config (spec, realtime);