#include <glibmm/thread.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
+#include <glibmm/thread.h>
#include "pbd/error.h"
-#include <glibmm/thread.h>
#include "pbd/boost_debug.h"
#include "pbd/pathscanner.h"
#include "pbd/stl_delete.h"
#include "pbd/basename.h"
#include "pbd/stacktrace.h"
#include "pbd/file_utils.h"
+#include "pbd/convert.h"
#include "ardour/amp.h"
#include "ardour/analyser.h"
#include "ardour/tempo.h"
#include "ardour/utils.h"
+#include "midi++/jack.h"
+
#include "i18n.h"
using namespace std;
_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 ();
routes.flush ();
boost::shared_ptr<RouteList> r = routes.reader ();
- cerr << "\n\n\n AFTER ROUTE CLEARING, there are " << r->size() << " routes in RCU\n";
DEBUG_TRACE (DEBUG::Destruction, "delete diskstreams\n");
{
/* Tell all IO objects to connect themselves together */
IO::enable_connecting ();
+ MIDI::JACK_MidiPort::MakeConnections ();
/* Now reset all panners */
Session::set_remote_control_ids ()
{
RemoteModel m = Config->get_remote_model();
+ bool emit_signal = false;
shared_ptr<RouteList> r = routes.reader ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- if ( MixerOrdered == m) {
+ if (MixerOrdered == m) {
long order = (*i)->order_key(N_("signal"));
- (*i)->set_remote_control_id( order+1 );
- } else if ( EditorOrdered == m) {
+ (*i)->set_remote_control_id (order+1, false);
+ emit_signal = true;
+ } else if (EditorOrdered == m) {
long order = (*i)->order_key(N_("editor"));
- (*i)->set_remote_control_id( order+1 );
- } else if ( UserOrdered == m) {
+ (*i)->set_remote_control_id (order+1, false);
+ emit_signal = true;
+ } else if (UserOrdered == m) {
//do nothing ... only changes to remote id's are initiated by user
}
}
+
+ if (emit_signal) {
+ Route::RemoteControlIDChange();
+ }
}
for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
boost::weak_ptr<Route> wpr (*x);
+ boost::shared_ptr<Route> r (*x);
- (*x)->listen_changed.connect_same_thread (*this, boost::bind (&Session::route_listen_changed, this, _1, wpr));
- (*x)->solo_changed.connect_same_thread (*this, boost::bind (&Session::route_solo_changed, this, _1, wpr));
- (*x)->mute_changed.connect_same_thread (*this, boost::bind (&Session::route_mute_changed, this, _1));
- (*x)->output()->changed.connect_same_thread (*this, boost::bind (&Session::set_worst_io_latencies_x, this, _1, _2));
- (*x)->processors_changed.connect_same_thread (*this, boost::bind (&Session::route_processors_changed, this, _1));
- (*x)->route_group_changed.connect_same_thread (*this, boost::bind (&Session::route_group_changed, this));
+ r->listen_changed.connect_same_thread (*this, boost::bind (&Session::route_listen_changed, this, _1, wpr));
+ r->solo_changed.connect_same_thread (*this, boost::bind (&Session::route_solo_changed, this, _1, wpr));
+ r->mute_changed.connect_same_thread (*this, boost::bind (&Session::route_mute_changed, this, _1));
+ r->output()->changed.connect_same_thread (*this, boost::bind (&Session::set_worst_io_latencies_x, this, _1, _2));
+ r->processors_changed.connect_same_thread (*this, boost::bind (&Session::route_processors_changed, this, _1));
+ r->route_group_changed.connect_same_thread (*this, boost::bind (&Session::route_group_changed, this));
- if ((*x)->is_master()) {
- _master_out = (*x);
+ if (r->is_master()) {
+ _master_out = r;
}
- if ((*x)->is_control()) {
- _control_out = (*x);
+ if (r->is_control()) {
+ _control_out = r;
}
}
}
RouteAdded (new_routes); /* EMIT SIGNAL */
+ Route::RemoteControlIDChange (); /* EMIT SIGNAL */
}
void
sync_order_keys (N_("session"));
+ Route::RemoteControlIDChange(); /* EMIT SIGNAL */
+
/* save the new state of the world */
if (save_state (_current_snapshot_name)) {
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_control() || (*i)->is_hidden()) {
continue;
} else if ((*i)->feeds (route, &via_sends_only)) {
if (!via_sends_only) {
}
}
- region->StateChanged.connect_same_thread (*this, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr<Region>(region)));
+ region->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr<Region>(region)));
update_region_name_map (region);
}
}
void
-Session::region_changed (Change what_changed, boost::weak_ptr<Region> weak_region)
+Session::region_changed (const PropertyChange& what_changed, boost::weak_ptr<Region> weak_region)
{
boost::shared_ptr<Region> region (weak_region.lock ());
return;
}
- if (what_changed & Region::HiddenChanged) {
+ if (what_changed.contains (Properties::hidden)) {
/* relay hidden changes */
RegionHiddenChange (region);
}
- if (what_changed & NameChanged) {
+ if (what_changed.contains (Properties::name)) {
update_region_name_map (region);
}
}
}
}
+ 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);
}
void
-Session::tempo_map_changed (Change)
+Session::tempo_map_changed (const PropertyChange&)
{
clear_clicks ();
/* construct a region to represent the bounced material */
- result = RegionFactory::create (srcs, 0,
- srcs.front()->length(srcs.front()->timeline_position()),
- region_name_from_path (srcs.front()->name(), true));
+ PropertyList plist;
+
+ plist.add (Properties::start, 0);
+ plist.add (Properties::length, srcs.front()->length(srcs.front()->timeline_position()));
+ plist.add (Properties::name, region_name_from_path (srcs.front()->name(), true));
+
+ result = RegionFactory::create (srcs, plist);
+
}
out:
}
Route::SyncOrderKeys (base); // EMIT SIGNAL
-}
+ /* this might not do anything */
+
+ set_remote_control_ids ();
+}
/** @return true if there is at least one record-enabled diskstream, otherwise false */
bool