return;
}
+ if (_route_group && src != _route_group && _route_group->is_active() && _route_group->is_solo()) {
+ _route_group->foreach_route (boost::bind (&Route::set_listen, _1, yn, _route_group));
+ return;
+ }
+
if (_monitor_send) {
if (yn != _monitor_send->active()) {
if (yn) {
cerr << name << " {" << endl;
for (list<boost::shared_ptr<Processor> >::const_iterator p = procs.begin();
p != procs.end(); ++p) {
- cerr << "\t" << (*p)->name() << " ID = " << (*p)->id() << endl;
+ cerr << "\t" << (*p)->name() << " ID = " << (*p)->id() << " @ " << (*p) << endl;
}
cerr << "}" << endl;
}
}
+/** Add a processor to a route such that it ends up with a given index into the visible processors.
+ * @param index Index to add the processor at, or -1 to add at the end of the list.
+ */
+
+int
+Route::add_processor_by_index (boost::shared_ptr<Processor> processor, int index, ProcessorStreams* err, bool activation_allowed)
+{
+ /* XXX this is not thread safe - we don't hold the lock across determining the iter
+ to add before and actually doing the insertion. dammit.
+ */
+
+ if (index == -1) {
+ return add_processor (processor, _processors.end(), err, activation_allowed);
+ }
+
+ ProcessorList::iterator i = _processors.begin ();
+ int j = 0;
+ while (i != _processors.end() && j < index) {
+ if ((*i)->display_to_user()) {
+ ++j;
+ }
+
+ ++i;
+ }
+
+ return add_processor (processor, i, err, activation_allowed);
+}
+
/** Add a processor to the route.
* @param iter an iterator in _processors; the new processor will be inserted immediately before this location.
*/
DEBUG_TRACE (DEBUG::Processors, string_compose (
"%1 adding processor %2\n", name(), processor->name()));
- ChanCount old_pms = processor_max_streams;
-
if (!_session.engine().connected() || !processor) {
return 1;
}
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(processor)) != 0) {
- if (pi->natural_input_streams() == ChanCount::ZERO) {
+ if (pi->has_no_inputs ()) {
/* generator plugin */
_have_internal_generator = true;
}
if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
prop->value() == "lv2" ||
prop->value() == "vst" ||
+ prop->value() == "lxvst" ||
prop->value() == "audiounit") {
processor.reset (new PluginInsert (_session));
loc = _processors.end ();
}
- ChanCount old_pms = processor_max_streams;
-
if (!_session.engine().connected()) {
return 1;
}
pi->set_count (1);
}
- ProcessorList::iterator inserted = _processors.insert (loc, *i);
+ _processors.insert (loc, *i);
if ((*i)->active()) {
(*i)->activate ();
boost::shared_ptr<PluginInsert> pi;
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
- if (pi->is_generator()) {
+ if (pi->has_no_inputs ()) {
_have_internal_generator = true;
break;
}
void
Route::clear_processors (Placement p)
{
- const ChanCount old_pms = processor_max_streams;
-
if (!_session.engine().connected()) {
return;
}
return 0;
}
- ChanCount old_pms = processor_max_streams;
-
if (!_session.engine().connected()) {
return 1;
}
boost::shared_ptr<PluginInsert> pi;
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
- if (pi->is_generator()) {
+ if (pi->has_no_inputs ()) {
_have_internal_generator = true;
break;
}
boost::shared_ptr<PluginInsert> pi;
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
- if (pi->is_generator()) {
+ if (pi->has_no_inputs ()) {
_have_internal_generator = true;
break;
}
}
/* make sure we have sufficient scratch buffers to cope with the new processor
- configuration */
+ configuration
+ */
_session.ensure_buffers (n_process_buffers ());
DEBUG_TRACE (DEBUG::Processors, string_compose ("%1: configuration complete\n", _name));
if (_processors.empty()) {
return;
}
+
ProcessorList::iterator start, end;
placement_range(p, start, end);
- bool before_amp = true;
- for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
- if ((*i) == _amp) {
- before_amp = false;
- continue;
- }
- if (p == PreFader && before_amp) {
- if (state) {
- (*i)->activate ();
- } else {
- (*i)->deactivate ();
- }
+ for (ProcessorList::iterator i = start; i != end; ++i) {
+ if (state) {
+ (*i)->activate ();
+ } else {
+ (*i)->deactivate ();
}
}
Route::set_name (prop->value());
}
- if ((prop = node.property ("id")) != 0) {
- _id = prop->value ();
- }
+ set_id (node);
if ((prop = node.property (X_("flags"))) != 0) {
_flags = Flag (string_2_enum (prop->value(), _flags));
Route::set_name (prop->value ());
}
- if ((prop = child->property (X_("id"))) != 0) {
- _id = prop->value ();
- }
+ set_id (*child);
if ((prop = child->property (X_("active"))) != 0) {
bool yn = string_is_affirmative (prop->value());
} else if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
prop->value() == "lv2" ||
prop->value() == "vst" ||
+ prop->value() == "lxvst" ||
prop->value() == "audiounit") {
processor.reset (new PluginInsert(_session));
boost::shared_ptr<PluginInsert> pi;
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
- if (pi->is_generator()) {
+ if (pi->has_no_inputs ()) {
_have_internal_generator = true;
break;
}
int
Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
- bool session_state_changing, bool /*can_record*/, bool /*rec_monitors_input*/)
+ bool session_state_changing, bool /*can_record*/)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
-framecnt_t
-Route::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame)
-{
- if (_roll_delay > nframes) {
-
- _roll_delay -= nframes;
- silence_unlocked (nframes);
- /* transport frame is not legal for caller to use */
- return 0;
-
- } else if (_roll_delay > 0) {
-
- nframes -= _roll_delay;
- silence_unlocked (_roll_delay);
- transport_frame += _roll_delay;
-
- /* shuffle all the port buffers for things that lead "out" of this Route
- to reflect that we just wrote _roll_delay frames of silence.
- */
-
- Glib::RWLock::ReaderLock lm (_processor_lock);
- for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
- boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i);
- if (iop) {
- iop->increment_port_buffer_offset (_roll_delay);
- }
- }
- _output->increment_port_buffer_offset (_roll_delay);
-
- _roll_delay = 0;
-
- }
-
- return nframes;
-}
-
int
Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
- bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
+ bool /*can_record*/, bool& /* need_butler */)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (!lm.locked()) {
int
Route::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
- bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
+ bool /*can_record*/, bool& /* need_butler */)
{
silence (nframes);
return 0;
jack_latency_range_t all_connections;
- all_connections.min = ~((jack_nframes_t) 0);
- all_connections.max = 0;
-
- /* iterate over all "from" ports and determine the latency range for all of their
- connections to the "outside" (outside of this Route).
- */
-
- for (PortSet::iterator p = from.begin(); p != from.end(); ++p) {
-
- jack_latency_range_t range;
-
- p->get_connected_latency_range (range, playback);
-
- all_connections.min = min (all_connections.min, range.min);
- all_connections.max = max (all_connections.max, range.max);
+ if (from.empty()) {
+ all_connections.min = 0;
+ all_connections.max = 0;
+ } else {
+ all_connections.min = ~((jack_nframes_t) 0);
+ all_connections.max = 0;
+
+ /* iterate over all "from" ports and determine the latency range for all of their
+ connections to the "outside" (outside of this Route).
+ */
+
+ for (PortSet::iterator p = from.begin(); p != from.end(); ++p) {
+
+ jack_latency_range_t range;
+
+ p->get_connected_latency_range (range, playback);
+
+ all_connections.min = min (all_connections.min, range.min);
+ all_connections.max = max (all_connections.max, range.max);
+ }
}
/* set the "from" port latencies to the max/min range of all their connections */
new_processors.insert (amp, _monitor_send);
break;
}
+ _monitor_send->set_can_pan (false);
break;
case AfterFaderListen:
switch (Config->get_afl_position ()) {
new_processors.insert (new_processors.end(), _monitor_send);
break;
}
+ _monitor_send->set_can_pan (true);
break;
}
} else {
new_processors.insert (new_processors.end(), _monitor_send);
+ _monitor_send->set_can_pan (false);
}
}