mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 17:16:38 +01:00
r321@gandalf: fugalh | 2006-08-12 15:48:28 -0600
Behold serialized undo. git-svn-id: svn://localhost/ardour2/branches/undo@799 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
46af8c0211
commit
81b9700c14
11 changed files with 26 additions and 26 deletions
|
|
@ -1298,7 +1298,6 @@ ARDOUR_UI::start_engine ()
|
||||||
settings for a new session
|
settings for a new session
|
||||||
*/
|
*/
|
||||||
session->save_state ("");
|
session->save_state ("");
|
||||||
session->save_history ("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* there is too much going on, in too many threads, for us to
|
/* there is too much going on, in too many threads, for us to
|
||||||
|
|
@ -1472,7 +1471,6 @@ ARDOUR_UI::save_state_canfail (string name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = session->save_state (name)) != 0) {
|
if ((ret = session->save_state (name)) != 0) {
|
||||||
session->save_history (name);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,6 @@ ARDOUR_UI::unload_session ()
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
session->save_state ("");
|
session->save_state ("");
|
||||||
session->save_history ("");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ using namespace ARDOUR;
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
|
sigc::signal<void,AutomationList *> AutomationList::AutomationListCreated;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void dumpit (const AutomationList& al, string prefix = "")
|
static void dumpit (const AutomationList& al, string prefix = "")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ using namespace ARDOUR;
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
|
sigc::signal<void, Curve*> Curve::CurveCreated;
|
||||||
|
|
||||||
Curve::Curve (double minv, double maxv, double canv, bool nostate)
|
Curve::Curve (double minv, double maxv, double canv, bool nostate)
|
||||||
: AutomationList (canv, nostate)
|
: AutomationList (canv, nostate)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ Session::Session (AudioEngine &eng,
|
||||||
{
|
{
|
||||||
bool new_session;
|
bool new_session;
|
||||||
|
|
||||||
cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << endl;
|
cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << " (1)" << endl;
|
||||||
|
|
||||||
n_physical_outputs = _engine.n_physical_outputs();
|
n_physical_outputs = _engine.n_physical_outputs();
|
||||||
n_physical_inputs = _engine.n_physical_inputs();
|
n_physical_inputs = _engine.n_physical_inputs();
|
||||||
|
|
@ -312,7 +312,7 @@ Session::Session (AudioEngine &eng,
|
||||||
{
|
{
|
||||||
bool new_session;
|
bool new_session;
|
||||||
|
|
||||||
cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << endl;
|
cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << " (2)" << endl;
|
||||||
|
|
||||||
n_physical_outputs = max (requested_physical_out, _engine.n_physical_outputs());
|
n_physical_outputs = max (requested_physical_out, _engine.n_physical_outputs());
|
||||||
n_physical_inputs = max (requested_physical_in, _engine.n_physical_inputs());
|
n_physical_inputs = max (requested_physical_in, _engine.n_physical_inputs());
|
||||||
|
|
@ -1007,7 +1007,6 @@ Session::auto_punch_start_changed (Location* location)
|
||||||
if (get_record_enabled() && get_punch_in()) {
|
if (get_record_enabled() && get_punch_in()) {
|
||||||
/* capture start has been changed, so save new pending state */
|
/* capture start has been changed, so save new pending state */
|
||||||
save_state ("", true);
|
save_state ("", true);
|
||||||
save_history("");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1325,7 +1324,6 @@ Session::maybe_enable_record ()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
save_state ("", true);
|
save_state ("", true);
|
||||||
save_history ("");
|
|
||||||
|
|
||||||
if (_transport_speed) {
|
if (_transport_speed) {
|
||||||
if (!punch_in) {
|
if (!punch_in) {
|
||||||
|
|
@ -1889,7 +1887,6 @@ Session::add_route (shared_ptr<Route> route)
|
||||||
|
|
||||||
set_dirty();
|
set_dirty();
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
|
|
||||||
RouteAdded (route); /* EMIT SIGNAL */
|
RouteAdded (route); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
@ -1921,7 +1918,6 @@ Session::add_diskstream (Diskstream* dstream)
|
||||||
|
|
||||||
set_dirty();
|
set_dirty();
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
|
|
||||||
DiskstreamAdded (dstream); /* EMIT SIGNAL */
|
DiskstreamAdded (dstream); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
@ -1986,7 +1982,6 @@ Session::remove_route (shared_ptr<Route> route)
|
||||||
/* XXX should we disconnect from the Route's signals ? */
|
/* XXX should we disconnect from the Route's signals ? */
|
||||||
|
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
|
|
||||||
/* all shared ptrs to route should go out of scope here */
|
/* all shared ptrs to route should go out of scope here */
|
||||||
}
|
}
|
||||||
|
|
@ -2689,7 +2684,6 @@ Session::remove_source (Source* source)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceRemoved(source); /* EMIT SIGNAL */
|
SourceRemoved(source); /* EMIT SIGNAL */
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,12 @@ Command *Session::memento_command_factory(XMLNode *n)
|
||||||
/* get before/after */
|
/* get before/after */
|
||||||
if (n->name() == "MementoCommand")
|
if (n->name() == "MementoCommand")
|
||||||
{
|
{
|
||||||
before = n->children().front();
|
before = new XMLNode(*n->children().front());
|
||||||
after = n->children().back();
|
after = new XMLNode(*n->children().back());
|
||||||
} else if (n->name() == "MementoUndoCommand")
|
} else if (n->name() == "MementoUndoCommand")
|
||||||
before = n->children().front();
|
before = new XMLNode(*n->children().front());
|
||||||
else if (n->name() == "MementoRedoCommand")
|
else if (n->name() == "MementoRedoCommand")
|
||||||
after = n->children().front();
|
after = new XMLNode(*n->children().front());
|
||||||
|
|
||||||
|
|
||||||
/* create command */
|
/* create command */
|
||||||
|
|
@ -64,9 +64,6 @@ Command *Session::memento_command_factory(XMLNode *n)
|
||||||
}
|
}
|
||||||
else if (obj_T == "Route") // inlcudes AudioTrack
|
else if (obj_T == "Route") // inlcudes AudioTrack
|
||||||
return new MementoCommand<Route>(*route_by_id(id), before, after);
|
return new MementoCommand<Route>(*route_by_id(id), before, after);
|
||||||
// For Editor and AutomationLine which are off-limits here
|
|
||||||
else if (registry.count(id))
|
|
||||||
return new MementoCommand<Stateful>(*registry[id], before, after);
|
|
||||||
else if (obj_T == "Curve")
|
else if (obj_T == "Curve")
|
||||||
{
|
{
|
||||||
if (curves.count(id))
|
if (curves.count(id))
|
||||||
|
|
@ -77,6 +74,9 @@ Command *Session::memento_command_factory(XMLNode *n)
|
||||||
if (automation_lists.count(id))
|
if (automation_lists.count(id))
|
||||||
return new MementoCommand<AutomationList>(*automation_lists[id], before, after);
|
return new MementoCommand<AutomationList>(*automation_lists[id], before, after);
|
||||||
}
|
}
|
||||||
|
// For Editor and AutomationLine which are off-limits here
|
||||||
|
else if (registry.count(id))
|
||||||
|
return new MementoCommand<Stateful>(*registry[id], before, after);
|
||||||
|
|
||||||
/* we failed */
|
/* we failed */
|
||||||
error << _("could not reconstitute MementoCommand from XMLNode. id=") << id.to_s() << endmsg;
|
error << _("could not reconstitute MementoCommand from XMLNode. id=") << id.to_s() << endmsg;
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,6 @@ Session::mmc_record_strobe (MIDI::MachineControl &mmc)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
save_state ("", true);
|
save_state ("", true);
|
||||||
save_history ("");
|
|
||||||
g_atomic_int_set (&_record_status, Enabled);
|
g_atomic_int_set (&_record_status, Enabled);
|
||||||
RecordStateChanged (); /* EMIT SIGNAL */
|
RecordStateChanged (); /* EMIT SIGNAL */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,7 @@ Session::second_stage_init (bool new_session)
|
||||||
_end_location_is_free = false;
|
_end_location_is_free = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
restore_history(_current_snapshot_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -715,6 +716,7 @@ Session::save_state (string snapshot_name, bool pending)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pending) {
|
if (!pending) {
|
||||||
|
save_history(snapshot_name);
|
||||||
|
|
||||||
bool was_dirty = dirty();
|
bool was_dirty = dirty();
|
||||||
|
|
||||||
|
|
@ -1690,7 +1692,6 @@ Session::set_state (const XMLNode& node)
|
||||||
|
|
||||||
if (state_was_pending) {
|
if (state_was_pending) {
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
remove_pending_capture_state ();
|
remove_pending_capture_state ();
|
||||||
state_was_pending = false;
|
state_was_pending = false;
|
||||||
}
|
}
|
||||||
|
|
@ -2478,7 +2479,6 @@ void
|
||||||
Session::auto_save()
|
Session::auto_save()
|
||||||
{
|
{
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteGroup *
|
RouteGroup *
|
||||||
|
|
@ -3150,7 +3150,6 @@ Session::cleanup_sources (Session::cleanup_report& rep)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
save_state ("");
|
save_state ("");
|
||||||
save_history ("");
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
_state_of_the_state = (StateOfTheState) (_state_of_the_state & ~InCleanup);
|
_state_of_the_state = (StateOfTheState) (_state_of_the_state & ~InCleanup);
|
||||||
|
|
@ -3290,6 +3289,7 @@ Session::save_history (string snapshot_name)
|
||||||
string xml_path;
|
string xml_path;
|
||||||
string bak_path;
|
string bak_path;
|
||||||
|
|
||||||
|
|
||||||
tree.set_root (&history.get_state());
|
tree.set_root (&history.get_state());
|
||||||
|
|
||||||
if (snapshot_name.empty()) {
|
if (snapshot_name.empty()) {
|
||||||
|
|
@ -3297,6 +3297,7 @@ Session::save_history (string snapshot_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
xml_path = _path + snapshot_name + ".history";
|
xml_path = _path + snapshot_name + ".history";
|
||||||
|
info << "Saving history to " << xml_path << endmsg;
|
||||||
|
|
||||||
bak_path = xml_path + ".bak";
|
bak_path = xml_path + ".bak";
|
||||||
|
|
||||||
|
|
@ -3340,6 +3341,8 @@ Session::restore_history (string snapshot_name)
|
||||||
/* read xml */
|
/* read xml */
|
||||||
xmlpath = _path + snapshot_name + ".history";
|
xmlpath = _path + snapshot_name + ".history";
|
||||||
|
|
||||||
|
info << string_compose(_("Loading history from '%1'."), xmlpath) << endmsg;
|
||||||
|
|
||||||
if (access (xmlpath.c_str(), F_OK)) {
|
if (access (xmlpath.c_str(), F_OK)) {
|
||||||
error << string_compose(_("%1: session history file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
|
error << string_compose(_("%1: session history file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -3350,6 +3353,8 @@ Session::restore_history (string snapshot_name)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info << "root children " << tree.root()->children().size() << endmsg;
|
||||||
|
|
||||||
/* replace history */
|
/* replace history */
|
||||||
history.clear();
|
history.clear();
|
||||||
for (XMLNodeConstIterator it = tree.root()->children().begin();
|
for (XMLNodeConstIterator it = tree.root()->children().begin();
|
||||||
|
|
@ -3388,5 +3393,10 @@ Session::restore_history (string snapshot_name)
|
||||||
}
|
}
|
||||||
history.add(ut);
|
history.add(ut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XMLTree tree2;
|
||||||
|
tree2.set_root(&history.get_state());
|
||||||
|
info << tree2.write_buffer() << endmsg;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,6 @@ Session::non_realtime_stop (bool abort)
|
||||||
if ((post_transport_work & PostTransportLocate) && get_record_enabled()) {
|
if ((post_transport_work & PostTransportLocate) && get_record_enabled()) {
|
||||||
/* capture start has been changed, so save pending state */
|
/* capture start has been changed, so save pending state */
|
||||||
save_state ("", true);
|
save_state ("", true);
|
||||||
save_history ("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* always try to get rid of this */
|
/* always try to get rid of this */
|
||||||
|
|
@ -422,7 +421,6 @@ Session::non_realtime_stop (bool abort)
|
||||||
|
|
||||||
if (did_record) {
|
if (did_record) {
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
save_history (_current_snapshot_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (post_transport_work & PostTransportDuration) {
|
if (post_transport_work & PostTransportDuration) {
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,6 @@ Track::set_name (string str, void *src)
|
||||||
|
|
||||||
if ((ret = IO::set_name (str, src)) == 0) {
|
if ((ret = IO::set_name (str, src)) == 0) {
|
||||||
_session.save_state ("");
|
_session.save_state ("");
|
||||||
_session.save_history ("");
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,6 @@ void
|
||||||
BasicUI::save_state ()
|
BasicUI::save_state ()
|
||||||
{
|
{
|
||||||
session->save_state ("");
|
session->save_state ("");
|
||||||
session->save_history("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue