#include "ardour/processor.h"
#include "ardour/port.h"
#include "ardour/proxy_controllable.h"
+#include "ardour/recent_sessions.h"
#include "ardour/region_factory.h"
#include "ardour/route_group.h"
#include "ardour/send.h"
using namespace ARDOUR;
using namespace PBD;
-
+/** @param snapshot_name Snapshot name, without the .ardour prefix */
void
Session::first_stage_init (string fullpath, string snapshot_name)
{
}
}
+ if ((child = find_named_node (node, X_("Speakers"))) != 0) {
+ _speakers->set_state (*child, version);
+ }
+
+ if ((child = find_named_node (node, "Sources")) == 0) {
+ error << _("Session: XML state has no sources section") << endmsg;
+ goto out;
+ } else if (load_sources (*child)) {
+ goto out;
+ }
+
+ if ((child = find_named_node (node, "TempoMap")) == 0) {
+ error << _("Session: XML state has no Tempo Map section") << endmsg;
+ goto out;
+ } else if (_tempo_map->set_state (*child, version)) {
+ goto out;
+ }
+
if ((child = find_named_node (node, "Locations")) == 0) {
error << _("Session: XML state has no locations section") << endmsg;
goto out;
goto out;
}
- if ((child = find_named_node (node, X_("Speakers"))) != 0) {
- _speakers->set_state (*child, version);
- }
-
Location* location;
if ((location = _locations->auto_loop_location()) != 0) {
AudioFileSource::set_header_position_offset (_session_range_location->start());
}
- if ((child = find_named_node (node, "Sources")) == 0) {
- error << _("Session: XML state has no sources section") << endmsg;
- goto out;
- } else if (load_sources (*child)) {
- goto out;
- }
-
- if ((child = find_named_node (node, "TempoMap")) == 0) {
- error << _("Session: XML state has no Tempo Map section") << endmsg;
- goto out;
- } else if (_tempo_map->set_state (*child, version)) {
- goto out;
- }
-
if ((child = find_named_node (node, "Regions")) == 0) {
error << _("Session: XML state has no Regions section") << endmsg;
goto out;
_route_groups.push_back (g);
route_group_added (g); /* EMIT SIGNAL */
- g->MembershipChanged.connect_same_thread (*this, boost::bind (&Session::route_group_changed, this));
- g->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::route_group_changed, this));
+ g->RouteAdded.connect_same_thread (*this, boost::bind (&Session::route_added_to_route_group, this, _1, _2));
+ g->RouteRemoved.connect_same_thread (*this, boost::bind (&Session::route_removed_from_route_group, this, _1, _2));
+ g->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::route_group_property_changed, this, g));
set_dirty ();
}
//poke_midi_thread ();
- } else if (p == "mmc-device-id" || p == "mmc-receive-id") {
+ } else if (p == "mmc-device-id" || p == "mmc-receive-id" || p == "mmc-receive-device-id") {
MIDI::Manager::instance()->mmc()->set_receive_device_id (Config->get_mmc_receive_device_id());
- } else if (p == "mmc-send-id") {
+ } else if (p == "mmc-send-id" || p == "mmc-send-device-id") {
MIDI::Manager::instance()->mmc()->set_send_device_id (Config->get_mmc_send_device_id());
}
/* history file */
+
oldstr = Glib::build_filename (newpath, _current_snapshot_name) + history_suffix;
- newstr = Glib::build_filename (newpath, legal_name) + history_suffix;
-
- cerr << "Rename " << oldstr << " => " << newstr << endl;
- if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) {
- return 1;
+ if (Glib::file_test (oldstr, Glib::FILE_TEST_EXISTS)) {
+ newstr = Glib::build_filename (newpath, legal_name) + history_suffix;
+
+ cerr << "Rename " << oldstr << " => " << newstr << endl;
+
+ if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) {
+ return 1;
+ }
}
+ /* remove old name from recent sessions */
+
+ remove_recent_sessions (_path);
+
_path = newpath;
_current_snapshot_name = new_name;
_name = new_name;
save_state (_current_snapshot_name);
+
+ /* add to recent sessions */
+
+ store_recent_sessions (new_name, _path);
+
return 0;
#undef RENAME