, _post_transport_work (0)
, _send_timecode_update (false)
, _all_route_group (new RouteGroup (*this, "all"))
- , _process_graph (new Graph (*this))
, routes (new RouteList)
, _total_free_4k_blocks (0)
, _bundles (new BundleList)
{
_locations = new Locations (*this);
+ if (how_many_dsp_threads () > 1) {
+ /* For now, only create the graph if we are using >1 DSP threads, as
+ it is a bit slower than the old code with 1 thread.
+ */
+ _process_graph.reset (new Graph (*this));
+ }
+
playlists.reset (new SessionPlaylists);
_all_route_group->set_active (true, this);
} else if ((*x)->is_master()) {
/* relax */
} else {
- (*x)->drop_listen (_monitor_out);
+ (*x)->remove_aux_or_listen (_monitor_out);
}
}
}
/* writer goes out of scope and forces update */
}
- //_process_graph->dump(1);
-
#ifndef NDEBUG
boost::shared_ptr<RouteList> rl = routes.reader ();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
Note: the process graph rechain does not require a
topologically-sorted list, but hey ho.
*/
- _process_graph->rechain (sorted_routes, edges);
+ if (_process_graph) {
+ _process_graph->rechain (sorted_routes, edges);
+ }
+
_current_route_graph = edges;
/* Complete the building of the routes' lists of what directly
if (_monitor_out && IO::connecting_legal) {
- for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
- if ((*x)->is_monitor()) {
- /* relax */
- } else if ((*x)->is_master()) {
- /* relax */
- } else {
- (*x)->enable_monitor_send ();
+ {
+ Glib::Mutex::Lock lm (_engine.process_lock());
+
+ for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
+ if ((*x)->is_monitor()) {
+ /* relax */
+ } else if ((*x)->is_master()) {
+ /* relax */
+ } else {
+ (*x)->enable_monitor_send ();
+ }
}
}
dest->add_internal_return();
}
+
for (RouteList::iterator i = senders->begin(); i != senders->end(); ++i) {
-
+
if ((*i)->is_monitor() || (*i)->is_master() || (*i) == dest) {
continue;
}
-
- (*i)->listen_via (dest, p);
+
+ (*i)->add_aux_send (dest, p);
}
graph_reordered ();
*/
resort_routes ();
- _process_graph->clear_other_chain ();
+ if (_process_graph) {
+ _process_graph->clear_other_chain ();
+ }
/* get rid of it from the dead wood collection in the route list manager */
}
}
+uint32_t
+Session::next_aux_send_id ()
+{
+ /* this doesn't really loop forever. just think about it */
+
+ while (true) {
+ for (boost::dynamic_bitset<uint32_t>::size_type n = 0; n < aux_send_bitset.size(); ++n) {
+ if (!aux_send_bitset[n]) {
+ aux_send_bitset[n] = true;
+ return n;
+
+ }
+ }
+
+ /* none available, so resize and try again */
+
+ aux_send_bitset.resize (aux_send_bitset.size() + 16, false);
+ }
+}
+
uint32_t
Session::next_return_id ()
{
send_bitset[id] = true;
}
+void
+Session::mark_aux_send_id (uint32_t id)
+{
+ if (id >= aux_send_bitset.size()) {
+ aux_send_bitset.resize (id+16, false);
+ }
+ if (aux_send_bitset[id]) {
+ warning << string_compose (_("aux send ID %1 appears to be in use already"), id) << endmsg;
+ }
+ aux_send_bitset[id] = true;
+}
+
void
Session::mark_return_id (uint32_t id)
{
}
}
+void
+Session::unmark_aux_send_id (uint32_t id)
+{
+ if (id < aux_send_bitset.size()) {
+ aux_send_bitset[id] = false;
+ }
+}
+
void
Session::unmark_return_id (uint32_t id)
{