Session::Session (AudioEngine &eng,
const string& fullpath,
const string& snapshot_name,
+ BusProfile* bus_profile,
string mix_template)
: _engine (eng),
{
playlists.reset (new SessionPlaylists);
- bool new_session;
-
interpolation.add_channel_to (0, 0);
if (!eng.connected()) {
throw failed_constructor();
}
- info << "Loading session " << fullpath << " using snapshot " << snapshot_name << " (1)" << endl;
-
n_physical_outputs = _engine.n_physical_outputs(DataType::AUDIO);
n_physical_inputs = _engine.n_physical_inputs(DataType::AUDIO);
first_stage_init (fullpath, snapshot_name);
- new_session = !Glib::file_test (_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
+ _is_new = !Glib::file_test (_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
- if (new_session) {
- if (create (new_session, mix_template, compute_initial_length())) {
+ if (_is_new) {
+ if (create (mix_template, compute_initial_length(), bus_profile)) {
destroy ();
throw failed_constructor ();
}
- }
+ }
- if (second_stage_init (new_session)) {
+ if (second_stage_init ()) {
destroy ();
throw failed_constructor ();
}
if (was_dirty) {
DirtyChanged (); /* EMIT SIGNAL */
}
-}
-
-Session::Session (AudioEngine &eng,
- string fullpath,
- string snapshot_name,
- AutoConnectOption input_ac,
- AutoConnectOption output_ac,
- uint32_t control_out_channels,
- uint32_t master_out_channels,
- uint32_t requested_physical_in,
- uint32_t requested_physical_out,
- nframes_t initial_length)
- : _engine (eng),
- _target_transport_speed (0.0),
- _requested_return_frame (-1),
- _scratch_buffers(new BufferSet()),
- _silent_buffers(new BufferSet()),
- _mix_buffers(new BufferSet()),
- mmc (0),
- _mmc_port (default_mmc_port),
- _mtc_port (default_mtc_port),
- _midi_port (default_midi_port),
- _midi_clock_port (default_midi_clock_port),
- _session_dir ( new SessionDirectory(fullpath)),
- state_tree (0),
- _butler (new Butler (*this)),
- _post_transport_work (0),
- _send_timecode_update (false),
- diskstreams (new DiskstreamList),
- routes (new RouteList),
- _total_free_4k_blocks (0),
- _bundles (new BundleList),
- _bundle_xml_node (0),
- _click_io ((IO *) 0),
- click_data (0),
- click_emphasis_data (0),
- main_outs (0),
- _metadata (new SessionMetadata()),
- _have_rec_enabled_diskstream (false)
-{
- playlists.reset (new SessionPlaylists);
-
- bool new_session;
-
- interpolation.add_channel_to (0, 0);
-
- if (!eng.connected()) {
- throw failed_constructor();
- }
-
- info << "Loading session " << fullpath << " using snapshot " << snapshot_name << " (2)" << endl;
-
- n_physical_outputs = _engine.n_physical_outputs (DataType::AUDIO);
- n_physical_inputs = _engine.n_physical_inputs (DataType::AUDIO);
-
- if (n_physical_inputs) {
- n_physical_inputs = max (requested_physical_in, n_physical_inputs);
- }
-
- if (n_physical_outputs) {
- n_physical_outputs = max (requested_physical_out, n_physical_outputs);
- }
-
- first_stage_init (fullpath, snapshot_name);
-
- new_session = !g_file_test (_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
-
- if (new_session) {
- if (create (new_session, string(), initial_length)) {
- destroy ();
- throw failed_constructor ();
- }
- }
-
- {
- /* set up Master Out and Control Out if necessary */
-
- RouteList rl;
- int control_id = 1;
-
- if (master_out_channels) {
- ChanCount count(DataType::AUDIO, master_out_channels);
- Route* rt = new Route (*this, _("master"), Route::MasterOut, DataType::AUDIO);
- boost_debug_shared_ptr_mark_interesting (rt, "Route");
- boost::shared_ptr<Route> r (rt);
- r->input()->ensure_io (count, false, this);
- r->output()->ensure_io (count, false, this);
- r->set_remote_control_id (control_id);
-
- rl.push_back (r);
- } else {
- /* prohibit auto-connect to master, because there isn't one */
- output_ac = AutoConnectOption (output_ac & ~AutoConnectMaster);
- }
-
- if (control_out_channels) {
- ChanCount count(DataType::AUDIO, control_out_channels);
- Route* rt = new Route (*this, _("monitor"), Route::ControlOut, DataType::AUDIO);
- boost_debug_shared_ptr_mark_interesting (rt, "Route");
- shared_ptr<Route> r (rt);
- r->input()->ensure_io (count, false, this);
- r->output()->ensure_io (count, false, this);
- r->set_remote_control_id (control_id++);
-
- rl.push_back (r);
- }
-
- if (!rl.empty()) {
- add_routes (rl, false);
- }
-
- }
-
- if (no_auto_connect()) {
- input_ac = AutoConnectOption (0);
- output_ac = AutoConnectOption (0);
- }
-
- Config->set_input_auto_connect (input_ac);
- Config->set_output_auto_connect (output_ac);
-
- if (second_stage_init (new_session)) {
- destroy ();
- throw failed_constructor ();
- }
-
- store_recent_sessions (_name, _path);
-
- _state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
-
- Config->ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, false));
+ _is_new = false;
}
Session::~Session ()
_engine.remove_session ();
- /* clear region map. it doesn't hold references, but lets just be sensible here */
-
- RegionFactory::clear_map ();
-
/* clear history so that no references to objects are held any more */
_history.clear ();
named_selections.clear ();
DEBUG_TRACE (DEBUG::Destruction, "delete regions\n");
- for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
- DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for region %1 ; pre-ref = %2\n", i->second->name(), i->second.use_count()));
- i->second->drop_references ();
- }
- regions.clear ();
+ RegionFactory::delete_all_regions ();
DEBUG_TRACE (DEBUG::Destruction, "delete routes\n");
auditioner.reset ();
_master_out.reset ();
- _control_out.reset ();
+ _monitor_out.reset ();
{
RCUWriter<RouteList> writer (routes);
hookup_io ();
- if (!no_auto_connect()) {
+ if (_is_new && !no_auto_connect()) {
+
+ /* don't connect the master bus outputs if there is a monitor bus */
- if (_master_out && Config->get_auto_connect_standard_busses()) {
+ if (_master_out && Config->get_auto_connect_standard_busses() && !_monitor_out) {
/* if requested auto-connect the outputs to the first N physical ports.
*/
}
}
- if (_control_out) {
+ if (_monitor_out) {
/* AUDIO ONLY as of june 29th 2009, because listen semantics for anything else
are undefined, at best.
under some conditions)
*/
- uint32_t limit = _control_out->n_inputs().n_audio();
+ uint32_t limit = _monitor_out->n_inputs().n_audio();
if (_master_out) {
for (uint32_t n = 0; n < limit; ++n) {
- AudioPort* p = _control_out->input()->ports().nth_audio_port (n);
+ AudioPort* p = _monitor_out->input()->ports().nth_audio_port (n);
AudioPort* o = _master_out->output()->ports().nth_audio_port (n);
if (o) {
string connect_to = o->name();
- if (_control_out->input()->connect (p, connect_to, this)) {
+ if (_monitor_out->input()->connect (p, connect_to, this)) {
error << string_compose (_("cannot connect control input %1 to %2"), n, connect_to)
<< endmsg;
break;
}
}
- /* if control out is not connected,
- connect control out to physical outs, but use ones after the master if possible
+ /* if control out is not connected, connect control out to physical outs
*/
- if (!_control_out->output()->connected_to (boost::shared_ptr<IO>())) {
+ if (!_monitor_out->output()->connected ()) {
if (!Config->get_monitor_bus_preferred_bundle().empty()) {
boost::shared_ptr<Bundle> b = bundle_by_name (Config->get_monitor_bus_preferred_bundle());
if (b) {
- _control_out->output()->connect_ports_to_bundle (b, this);
+ _monitor_out->output()->connect_ports_to_bundle (b, this);
} else {
warning << string_compose (_("The preferred I/O for the monitor bus (%1) cannot be found"),
Config->get_monitor_bus_preferred_bundle())
}
} else {
-
+
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
- uint32_t shift = _master_out->n_outputs().get(*t);
uint32_t mod = _engine.n_physical_outputs (*t);
- limit = _control_out->n_outputs().get(*t);
-
- cerr << "Connecting " << limit << " control out ports, shift is " << shift
- << " mod is " << mod << endl;
+ uint32_t limit = _monitor_out->n_outputs().get(*t);
for (uint32_t n = 0; n < limit; ++n) {
- Port* p = _control_out->output()->ports().port(*t, n);
- string connect_to = _engine.get_nth_physical_output (*t, (n+shift) % mod);
+ Port* p = _monitor_out->output()->ports().port(*t, n);
+ string connect_to = _engine.get_nth_physical_output (*t, (n % mod));
if (!connect_to.empty()) {
- if (_control_out->output()->connect (p, connect_to, this)) {
+ if (_monitor_out->output()->connect (p, connect_to, this)) {
error << string_compose (
_("cannot connect control output %1 to %2"),
n, connect_to)
/* we delay creating the auditioner till now because
it makes its own connections to ports.
- the engine has to be running for this to work.
*/
try {
- auditioner.reset (new Auditioner (*this));
+ Auditioner* a = new Auditioner (*this);
+ if (a->init()) {
+ delete a;
+ throw failed_constructor();
+ }
+ a->use_new_diskstream ();
+ auditioner.reset (a);
}
catch (failed_constructor& err) {
Delivery::reset_panners ();
- /* Connect tracks to listen/solo etc. busses XXX generalize this beyond control_out */
-
- if (_control_out) {
+ /* Connect tracks to monitor/listen bus if there is one.
+ Note that in an existing session, the internal sends will
+ already exist, but we want the routes to notice that
+ they connect to the control out specifically.
+ */
+ if (_monitor_out) {
boost::shared_ptr<RouteList> r = routes.reader ();
-
- for (RouteList::iterator x = r->begin(); x != r->end(); ++x) {
-
- if ((*x)->is_control() || (*x)->is_master()) {
- continue;
- }
-
- (*x)->listen_via (_control_out,
- (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
- false, false);
- }
- }
+ for (RouteList::iterator x = r->begin(); x != r->end(); ++x) {
+
+ if ((*x)->is_monitor()) {
+
+ /* relax */
+
+ } else if ((*x)->is_master()) {
+
+ /* relax */
+
+ } else {
+
+ (*x)->listen_via (_monitor_out,
+ (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
+ false, false);
+ }
+ }
+ }
/* Anyone who cares about input state, wake up and do something */
try {
MidiTrack* mt = new MidiTrack (*this, track_name, Route::Flag (0), mode);
+
+ if (mt->init ()) {
+ delete mt;
+ goto failed;
+ }
+
+ mt->use_new_diskstream();
+
boost_debug_shared_ptr_mark_interesting (mt, "Track");
track = boost::shared_ptr<MidiTrack>(mt);
catch (AudioEngine::PortRegistrationFailure& pfe) {
- error << _("No more JACK ports are available. You will need to stop Ardour and restart JACK with ports if you need this many tracks.") << endmsg;
+ error << string_compose (_("No more JACK ports are available. You will need to stop %1 and restart JACK with ports if you need this many tracks."), PROGRAM_NAME) << endmsg;
if (track) {
/* we need to get rid of this, since the track failed to be created */
try {
AudioTrack* at = new AudioTrack (*this, track_name, Route::Flag (0), mode);
+
+ if (at->init ()) {
+ delete at;
+ goto failed;
+ }
+
+ at->use_new_diskstream();
+
boost_debug_shared_ptr_mark_interesting (at, "Track");
track = boost::shared_ptr<AudioTrack>(at);
try {
Route* rt = new Route (*this, bus_name, Route::Flag(0), DataType::AUDIO);
+
+ if (rt->init ()) {
+ delete rt;
+ goto failure;
+ }
+
boost_debug_shared_ptr_mark_interesting (rt, "Route");
shared_ptr<Route> bus (rt);
we will resort when done.
*/
- if (!_control_out && IO::connecting_legal) {
+ if (!_monitor_out && IO::connecting_legal) {
resort_routes_using (r);
}
}
_master_out = r;
}
- if (r->is_control()) {
- _control_out = r;
+ if (r->is_monitor()) {
+ _monitor_out = r;
}
}
- if (_control_out && IO::connecting_legal) {
+ if (_monitor_out && IO::connecting_legal) {
for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
- if ((*x)->is_control() || (*x)->is_master()) {
- continue;
- }
- (*x)->listen_via (_control_out,
- (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
- false, false);
+ if ((*x)->is_monitor()) {
+ /* relax */
+ } else if ((*x)->is_master()) {
+ /* relax */
+ } else {
+ (*x)->listen_via (_monitor_out,
+ (Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
+ false, false);
+ }
}
resort_routes ();
void
Session::add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::shared_ptr<RouteList> senders)
{
- if (dest->is_control() || dest->is_master()) {
+ if (dest->is_monitor() || dest->is_master()) {
return;
}
for (RouteList::iterator i = senders->begin(); i != senders->end(); ++i) {
- if ((*i)->is_control() || (*i)->is_master() || (*i) == dest) {
+ if ((*i)->is_monitor() || (*i)->is_master() || (*i) == dest) {
continue;
}
diskstream_playlist_changed (boost::weak_ptr<Diskstream> (dstream));
dstream->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Session::update_have_rec_enabled_diskstream, this));
-
- dstream->prepare ();
-
}
void
_master_out = shared_ptr<Route> ();
}
- if (route == _control_out) {
+ if (route == _monitor_out) {
/* cancel control outs for all routes */
for (RouteList::iterator r = rs->begin(); r != rs->end(); ++r) {
- (*r)->drop_listen (_control_out);
+ (*r)->drop_listen (_monitor_out);
}
- _control_out.reset ();
+ _monitor_out.reset ();
}
update_route_solo_state ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
bool via_sends_only;
- if ((*i) == route || (*i)->solo_isolated() || (*i)->is_master() || (*i)->is_control() || (*i)->is_hidden()) {
+ if ((*i) == route || (*i)->solo_isolated() || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_hidden()) {
continue;
} else if ((*i)->feeds (route, &via_sends_only)) {
if (!via_sends_only) {
/* ditto for control outs make sure master is never muted by solo */
- if (_control_out && route != _control_out && _control_out && _control_out->soloed_by_others() == 0) {
- _control_out->mod_solo_by_others (1);
+ if (_monitor_out && route != _monitor_out && _monitor_out && _monitor_out->soloed_by_others() == 0) {
+ _monitor_out->mod_solo_by_others (1);
}
solo_update_disabled = false;
void
Session::update_route_solo_state (boost::shared_ptr<RouteList> r)
{
- /* now figure out if anything that matters is soloed */
+ /* now figure out if anything that matters is soloed (or is "listening")*/
bool something_soloed = false;
+ uint32_t listeners = 0;
if (!r) {
r = routes.reader();
}
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- if (!(*i)->is_master() && !(*i)->is_control() && !(*i)->is_hidden() && (*i)->self_soloed()) {
+ if (!(*i)->is_master() && !(*i)->is_monitor() && !(*i)->is_hidden() && (*i)->self_soloed()) {
something_soloed = true;
break;
}
- }
- if (something_soloed != _non_soloed_outs_muted) {
- _non_soloed_outs_muted = something_soloed;
- SoloActive (_non_soloed_outs_muted); /* EMIT SIGNAL */
+ if (!(*i)->is_hidden() && (*i)->listening()) {
+ listeners++;
+ }
}
+
+ if (something_soloed != _non_soloed_outs_muted) {
+ _non_soloed_outs_muted = something_soloed;
+ SoloActive (_non_soloed_outs_muted); /* EMIT SIGNAL */
+ }
+
+ if (listeners) {
+ _listen_cnt = listeners;
+ }
}
boost::shared_ptr<RouteList>
/* Region management */
-string
-Session::new_region_name (string old)
-{
- string::size_type last_period;
- uint32_t number;
- string::size_type len = old.length() + 64;
- char buf[len];
-
- if ((last_period = old.find_last_of ('.')) == string::npos) {
-
- /* no period present - add one explicitly */
-
- old += '.';
- last_period = old.length() - 1;
- number = 0;
-
- } else {
-
- number = atoi (old.substr (last_period+1).c_str());
-
- }
-
- while (number < (UINT_MAX-1)) {
-
- RegionList::const_iterator i;
- string sbuf;
-
- number++;
-
- snprintf (buf, len, "%s%" PRIu32, old.substr (0, last_period + 1).c_str(), number);
- sbuf = buf;
-
- for (i = regions.begin(); i != regions.end(); ++i) {
- if (i->second->name() == sbuf) {
- break;
- }
- }
-
- if (i == regions.end()) {
- break;
- }
- }
-
- if (number != (UINT_MAX-1)) {
- return buf;
- }
-
- error << string_compose (_("cannot create new name for region \"%1\""), old) << endmsg;
- return old;
-}
-
-int
-Session::region_name (string& result, string base, bool newlevel)
-{
- char buf[16];
- string subbase;
-
- if (base.find("/") != string::npos) {
- base = base.substr(base.find_last_of("/") + 1);
- }
-
- if (base == "") {
-
- Glib::Mutex::Lock lm (region_lock);
-
- snprintf (buf, sizeof (buf), "%d", (int)regions.size() + 1);
- result = "region.";
- result += buf;
-
- } else {
-
- if (newlevel) {
- subbase = base;
- } else {
- string::size_type pos;
-
- pos = base.find_last_of ('.');
-
- /* pos may be npos, but then we just use entire base */
-
- subbase = base.substr (0, pos);
-
- }
-
- {
- Glib::Mutex::Lock lm (region_lock);
-
- map<string,uint32_t>::iterator x;
-
- result = subbase;
-
- if ((x = region_name_map.find (subbase)) == region_name_map.end()) {
- result += ".1";
- region_name_map[subbase] = 1;
- } else {
- x->second++;
- snprintf (buf, sizeof (buf), ".%d", x->second);
-
- result += buf;
- }
- }
- }
-
- return 0;
-}
-
-void
-Session::add_region (boost::shared_ptr<Region> region)
-{
- vector<boost::shared_ptr<Region> > v;
- v.push_back (region);
- add_regions (v);
-}
-
-void
-Session::add_regions (vector<boost::shared_ptr<Region> >& new_regions)
-{
- bool added = false;
-
- {
- Glib::Mutex::Lock lm (region_lock);
-
- for (vector<boost::shared_ptr<Region> >::iterator ii = new_regions.begin(); ii != new_regions.end(); ++ii) {
-
- boost::shared_ptr<Region> region = *ii;
-
- if (region == 0) {
-
- error << _("Session::add_region() ignored a null region. Warning: you might have lost a region.") << endmsg;
-
- } else {
-
- RegionList::iterator x;
-
- for (x = regions.begin(); x != regions.end(); ++x) {
-
- if (region->region_list_equivalent (x->second)) {
- break;
- }
- }
-
- if (x == regions.end()) {
-
- pair<RegionList::key_type,RegionList::mapped_type> entry;
-
- entry.first = region->id();
- entry.second = region;
-
- pair<RegionList::iterator,bool> x = regions.insert (entry);
-
- if (!x.second) {
- return;
- }
-
- added = true;
- }
- }
- }
- }
-
- /* mark dirty because something has changed even if we didn't
- add the region to the region list.
- */
-
- set_dirty ();
-
- if (added) {
-
- vector<boost::weak_ptr<Region> > v;
- boost::shared_ptr<Region> first_r;
-
- for (vector<boost::shared_ptr<Region> >::iterator ii = new_regions.begin(); ii != new_regions.end(); ++ii) {
-
- boost::shared_ptr<Region> region = *ii;
-
- if (region == 0) {
-
- error << _("Session::add_region() ignored a null region. Warning: you might have lost a region.") << endmsg;
-
- } else {
- v.push_back (region);
-
- if (!first_r) {
- first_r = region;
- }
- }
-
- region->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr<Region>(region)));
- update_region_name_map (region);
- }
-
- if (!v.empty()) {
- RegionsAdded (v); /* EMIT SIGNAL */
- }
- }
-}
-
-void
-Session::update_region_name_map (boost::shared_ptr<Region> region)
-{
- string::size_type last_period = region->name().find_last_of ('.');
-
- if (last_period != string::npos && last_period < region->name().length() - 1) {
-
- string base = region->name().substr (0, last_period);
- string number = region->name().substr (last_period+1);
- map<string,uint32_t>::iterator x;
-
- /* note that if there is no number, we get zero from atoi,
- which is just fine
- */
-
- region_name_map[base] = atoi (number);
- }
-}
-
-void
-Session::region_changed (const PropertyChange& what_changed, boost::weak_ptr<Region> weak_region)
-{
- boost::shared_ptr<Region> region (weak_region.lock ());
-
- if (!region) {
- return;
- }
-
- if (what_changed.contains (Properties::hidden)) {
- /* relay hidden changes */
- RegionHiddenChange (region);
- }
-
- if (what_changed.contains (Properties::name)) {
- update_region_name_map (region);
- }
-}
-
-void
-Session::remove_region (boost::weak_ptr<Region> weak_region)
-{
- RegionList::iterator i;
- boost::shared_ptr<Region> region (weak_region.lock ());
-
- if (!region) {
- return;
- }
-
- bool removed = false;
-
- {
- Glib::Mutex::Lock lm (region_lock);
-
- if ((i = regions.find (region->id())) != regions.end()) {
- regions.erase (i);
- removed = true;
- }
- }
-
- /* mark dirty because something has changed even if we didn't
- remove the region from the region list.
- */
-
- set_dirty();
-
- if (removed) {
- RegionRemoved(region); /* EMIT SIGNAL */
- }
-}
-
boost::shared_ptr<Region>
-Session::find_whole_file_parent (boost::shared_ptr<Region const> child)
+Session::find_whole_file_parent (boost::shared_ptr<Region const> child) const
{
- RegionList::iterator i;
+ const RegionFactory::RegionMap& regions (RegionFactory::regions());
+ RegionFactory::RegionMap::const_iterator i;
boost::shared_ptr<Region> region;
Glib::Mutex::Lock lm (region_lock);
for (vector<boost::shared_ptr<Source> >::iterator i = srcs.begin(); i != srcs.end(); ++i) {
- (*i)->mark_for_remove ();
- (*i)->drop_references ();
-
- cerr << "source was not used by any playlist\n";
+ (*i)->mark_for_remove ();
+ (*i)->drop_references ();
+
+ cerr << "source was not used by any playlist\n";
}
return 0;
}
}
- for (list<boost::shared_ptr<Region> >::iterator i = r.begin(); i != r.end(); ++i) {
- remove_region (*i);
- }
-
destroy_regions (r);
save_state (_current_snapshot_name);
return 0;
}
-int
-Session::remove_region_from_region_list (boost::shared_ptr<Region> r)
-{
- remove_region (r);
- return 0;
-}
-
/* Source Management */
void
void
Session::cancel_audition ()
{
- if (auditioner->active()) {
+ if (auditioner->auditioning()) {
auditioner->cancel_audition ();
AuditionActive (false); /* EMIT SIGNAL */
}
bool
Session::RoutePublicOrderSorter::operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b)
{
+ if (a->is_monitor()) {
+ return true;
+ }
+ if (b->is_monitor()) {
+ return false;
+ }
return a->order_key(N_("signal")) < b->order_key(N_("signal"));
}
{
/* can be called before we have an auditioner object */
if (auditioner) {
- return auditioner->active();
+ return auditioner->auditioning();
} else {
return false;
}
}
}
-void
-Session::add_processor (Processor* processor)
-{
- /* Session does not own Processors (they belong to a Route) but we do want to track
- the arrival and departure of port inserts, sends and returns for naming
- purposes.
- */
- processor->DropReferences.connect_same_thread (*this, boost::bind (&Session::remove_processor, this, processor));
- set_dirty();
-}
-
-void
-Session::remove_processor (Processor* processor)
-{
- Send* send;
- Return* retrn;
- PortInsert* port_insert;
-
- if ((port_insert = dynamic_cast<PortInsert *> (processor)) != 0) {
- insert_bitset[port_insert->bit_slot()] = false;
- } else if ((send = dynamic_cast<Send *> (processor)) != 0) {
- send_bitset[send->bit_slot()] = false;
- } else if ((retrn = dynamic_cast<Return *> (processor)) != 0) {
- return_bitset[retrn->bit_slot()] = false;
- }
-
- set_dirty();
-}
-
nframes_t
Session::available_capture_duration ()
{
void
Session::mark_send_id (uint32_t id)
{
+ cerr << "Marking send ID " << id << " in use\n";
+
if (id >= send_bitset.size()) {
send_bitset.resize (id+16, false);
}
insert_bitset[id] = true;
}
+void
+Session::unmark_send_id (uint32_t id)
+{
+ if (id < send_bitset.size()) {
+ send_bitset[id] = false;
+ }
+}
+
+void
+Session::unmark_return_id (uint32_t id)
+{
+ if (id < return_bitset.size()) {
+ return_bitset[id] = false;
+ }
+}
+
+void
+Session::unmark_insert_id (uint32_t id)
+{
+ if (id < insert_bitset.size()) {
+ insert_bitset[id] = false;
+ }
+}
+
+
/* Named Selection management */
boost::shared_ptr<NamedSelection>
}
int
-Session::freeze (InterThreadInfo& itt)
+Session::freeze_all (InterThreadInfo& itt)
{
shared_ptr<RouteList> r = routes.reader ();
/* XXX this is wrong because itt.progress will keep returning to zero at the start
of every track.
*/
- t->freeze (itt);
+ t->freeze_me (itt);
}
}
boost::shared_ptr<RouteList> r = routes.reader ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- (*i)->put_control_outs_at (p);
+ (*i)->put_monitor_send_at (p);
}
}
{
/* cancel all solo or all listen when solo control mode changes */
- if (Config->get_solo_control_is_listen_control()) {
- set_solo (routes.reader(), false);
- } else {
- set_listen (routes.reader(), false);
- }
+ if (soloing()) {
+ set_solo (get_routes(), false);
+ } else if (listening()) {
+ set_listen (get_routes(), false);
+ }
}
void