, _flags (flg)
, _pending_declick (true)
, _meter_point (MeterPostFader)
+ , _meter_type (MeterPeak)
, _self_solo (false)
, _soloed_by_others_upstream (0)
, _soloed_by_others_downstream (0)
, _default_type (default_type)
, _remote_control_id (0)
, _in_configure_processors (false)
+ , _initial_io_setup (false)
, _custom_meter_position_noted (false)
, _last_custom_meter_was_at_end (false)
{
+ if (is_master()) {
+ _meter_type = MeterK20;
+ }
processor_max_streams.reset();
}
_input->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::input_port_count_changing, this, _1));
_output->changed.connect_same_thread (*this, boost::bind (&Route::output_change_handler, this, _1, _2));
+ _output->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::output_port_count_changing, this, _1));
/* add amp processor */
if (bufs.count() != (*i)->input_streams()) {
DEBUG_TRACE (
DEBUG::Processors, string_compose (
- "%1 bufs = %2 input for %3 = %4\n",
+ "input port mismatch %1 bufs = %2 input for %3 = %4\n",
_name, bufs.count(), (*i)->name(), (*i)->input_streams()
)
);
- continue;
}
}
#endif
Route::monitor_run (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
{
assert (is_monitor());
- BufferSet& bufs (_session.get_scratch_buffers (n_process_buffers()));
+ BufferSet& bufs (_session.get_route_buffers (n_process_buffers()));
passthru (bufs, start_frame, end_frame, nframes, declick);
}
void
Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
{
- BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
+ BufferSet& bufs (_session.get_route_buffers (n_process_buffers(), true));
bufs.set_count (_input->n_ports());
write_out_of_band_data (bufs, start_frame, end_frame, nframes);
DEBUG_TRACE (DEBUG::Processors, string_compose (
"%1 adding processor %2\n", name(), processor->name()));
- if (!_session.engine().connected() || !processor) {
+ if (!AudioEngine::instance()->connected() || !processor) {
return 1;
}
if (boost::dynamic_pointer_cast<UnknownProcessor> (*p)) {
DEBUG_TRACE (DEBUG::Processors, "--- CONFIGURE ABORTED due to unknown processor.\n");
- break;
+ DEBUG_TRACE (DEBUG::Processors, "}\n");
+ return list<pair<ChanCount, ChanCount> > ();
}
if ((*p)->can_support_io_configuration(in, out)) {
}
ChanCount out;
+ bool seen_mains_out = false;
+ processor_out_streams = _input->n_ports();
+ processor_max_streams.reset();
list< pair<ChanCount,ChanCount> >::iterator c = configuration.begin();
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) {
processor_max_streams = ChanCount::max(processor_max_streams, c->first);
processor_max_streams = ChanCount::max(processor_max_streams, c->second);
out = c->second;
+
+ if (boost::dynamic_pointer_cast<Delivery> (*p)
+ && boost::dynamic_pointer_cast<Delivery> (*p)->role() == Delivery::Main) {
+ /* main delivery will increase port count to match input.
+ * the Delivery::Main is usually the last processor - followed only by
+ * 'MeterOutput'.
+ */
+ seen_mains_out = true;
+ }
+ if (!seen_mains_out) {
+ processor_out_streams = out;
+ }
}
+
if (_meter) {
_meter->reset_max_channels (processor_max_streams);
}
node->add_property("denormal-protection", _denormal_protection?"yes":"no");
node->add_property("meter-point", enum_2_string (_meter_point));
+ node->add_property("meter-type", enum_2_string (_meter_type));
+
if (_route_group) {
node->add_property("route-group", _route_group->name());
}
}
set_id (node);
+ _initial_io_setup = true;
if ((prop = node.property (X_("flags"))) != 0) {
_flags = Flag (string_2_enum (prop->value(), _flags));
}
}
+ if ((prop = node.property (X_("meter-type"))) != 0) {
+ _meter_type = MeterType (string_2_enum (prop->value (), _meter_type));
+ }
+
+ _initial_io_setup = false;
+
set_processor_state (processor_state);
// this looks up the internal instrument in processors
Route::output_change_handler (IOChange change, void * /*src*/)
{
bool need_to_queue_solo_change = true;
+ if (_initial_io_setup) {
+ return;
+ }
if ((change.type & IOChange::ConfigurationChanged)) {
/* This is called with the process lock held if change
contains ConfigurationChanged
*/
need_to_queue_solo_change = false;
+ configure_processors (0);
+ io_changed (); /* EMIT SIGNAL */
}
if (!_output->connected() && _soloed_by_others_downstream) {
*/
}
- BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
+ BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
fill_buffers_with_input (bufs, _input, nframes);
_silent = false;
- BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
+ BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
fill_buffers_with_input (bufs, _input, nframes);
return false;
}
+/** Called when there is a proposed change to the output port count */
+bool
+Route::output_port_count_changing (ChanCount to)
+{
+ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+ if (processor_out_streams.get(*t) > to.get(*t)) {
+ return true;
+ }
+ }
+ /* The change is ok */
+ return false;
+}
+
list<string>
Route::unknown_processors () const
{
universally true, but the alternative is way too corner-case to worry about.
*/
- jack_latency_range_t all_connections;
+ LatencyRange all_connections;
if (from.empty()) {
all_connections.min = 0;
all_connections.max = 0;
} else {
- all_connections.min = ~((jack_nframes_t) 0);
+ all_connections.min = ~((pframes_t) 0);
all_connections.max = 0;
/* iterate over all "from" ports and determine the latency range for all of their
for (PortSet::iterator p = from.begin(); p != from.end(); ++p) {
- jack_latency_range_t range;
+ LatencyRange range;
p->get_connected_latency_range (range, playback);
latency compensation into account.
*/
- jack_latency_range_t range;
+ LatencyRange range;
range.min = value;
range.max = value;