mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 23:17:46 +01:00
r227@gwythaint (orig r767): fugalh | 2006-08-09 08:14:17 -0600
r274@gandalf: fugalh | 2006-08-07 19:53:48 -0600 Nuke Serializable in favor of Stateful. Got rid of some warnings with stub code. git-svn-id: svn://localhost/ardour2/trunk@770 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
commit
514daa01ec
9 changed files with 45 additions and 61 deletions
|
|
@ -1278,4 +1278,5 @@ int AutomationLine::set_state(const XMLNode &node)
|
|||
{
|
||||
// TODO
|
||||
alist.set_state(node);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -841,52 +841,52 @@ class Session : public sigc::trackable, public Stateful
|
|||
class GlobalSoloStateCommand : public Command
|
||||
{
|
||||
GlobalRouteBooleanState before, after;
|
||||
void *src;
|
||||
Session &sess;
|
||||
void *src;
|
||||
public:
|
||||
GlobalSoloStateCommand(Session &, void *src);
|
||||
void operator()();
|
||||
void undo();
|
||||
XMLNode &serialize();
|
||||
XMLNode &get_state();
|
||||
void mark();
|
||||
};
|
||||
|
||||
class GlobalMuteStateCommand : public Command
|
||||
{
|
||||
GlobalRouteBooleanState before, after;
|
||||
void *src;
|
||||
Session &sess;
|
||||
void *src;
|
||||
public:
|
||||
GlobalMuteStateCommand(Session &, void *src);
|
||||
void operator()();
|
||||
void undo();
|
||||
XMLNode &serialize();
|
||||
XMLNode &get_state();
|
||||
void mark();
|
||||
};
|
||||
|
||||
class GlobalRecordEnableStateCommand : public Command
|
||||
{
|
||||
GlobalRouteBooleanState before, after;
|
||||
void *src;
|
||||
Session &sess;
|
||||
void *src;
|
||||
public:
|
||||
GlobalRecordEnableStateCommand(Session &, void *src);
|
||||
void operator()();
|
||||
void undo();
|
||||
XMLNode &serialize();
|
||||
XMLNode &get_state();
|
||||
void mark();
|
||||
};
|
||||
|
||||
class GlobalMeteringStateCommand : public Command
|
||||
{
|
||||
GlobalRouteMeterState before, after;
|
||||
void *src;
|
||||
Session &sess;
|
||||
void *src;
|
||||
public:
|
||||
GlobalMeteringStateCommand(Session &, void *src);
|
||||
void operator()();
|
||||
void undo();
|
||||
XMLNode &serialize();
|
||||
XMLNode &get_state();
|
||||
void mark();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ void Session::GlobalSoloStateCommand::undo()
|
|||
{
|
||||
sess.set_global_solo(before, src);
|
||||
}
|
||||
XMLNode &Session::GlobalSoloStateCommand::serialize()
|
||||
XMLNode &Session::GlobalSoloStateCommand::get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("GlobalSoloStateCommand");
|
||||
return *node;
|
||||
}
|
||||
|
||||
// mute
|
||||
|
|
@ -42,8 +44,10 @@ void Session::GlobalMuteStateCommand::undo()
|
|||
{
|
||||
sess.set_global_mute(before, src);
|
||||
}
|
||||
XMLNode &Session::GlobalMuteStateCommand::serialize()
|
||||
XMLNode &Session::GlobalMuteStateCommand::get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("GlobalMuteStateCommand");
|
||||
return *node;
|
||||
}
|
||||
|
||||
// record enable
|
||||
|
|
@ -64,8 +68,10 @@ void Session::GlobalRecordEnableStateCommand::undo()
|
|||
{
|
||||
sess.set_global_record_enable(before, src);
|
||||
}
|
||||
XMLNode &Session::GlobalRecordEnableStateCommand::serialize()
|
||||
XMLNode &Session::GlobalRecordEnableStateCommand::get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("GlobalRecordEnableStateCommand");
|
||||
return *node;
|
||||
}
|
||||
|
||||
// metering
|
||||
|
|
@ -86,8 +92,10 @@ void Session::GlobalMeteringStateCommand::undo()
|
|||
{
|
||||
sess.set_global_route_metering(before, src);
|
||||
}
|
||||
XMLNode &Session::GlobalMeteringStateCommand::serialize()
|
||||
XMLNode &Session::GlobalMeteringStateCommand::get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("GlobalMeteringStateCommand");
|
||||
return *node;
|
||||
}
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include <pbd/command.h>
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
class XMLNode;
|
||||
|
||||
XMLNode &Command::serialize()
|
||||
XMLNode &Command::get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode ("Command");
|
||||
// TODO
|
||||
|
|
|
|||
|
|
@ -21,16 +21,17 @@
|
|||
#ifndef __lib_pbd_command_h__
|
||||
#define __lib_pbd_command_h__
|
||||
|
||||
#include <pbd/serializable.h>
|
||||
#include <pbd/stateful.h>
|
||||
|
||||
class Command : public Serializable
|
||||
class Command : public Stateful
|
||||
{
|
||||
public:
|
||||
virtual ~Command() {}
|
||||
virtual void operator() () = 0;
|
||||
virtual void undo() = 0;
|
||||
virtual void redo() { (*this)(); }
|
||||
virtual XMLNode &serialize();
|
||||
virtual XMLNode &get_state();
|
||||
virtual int set_state(const XMLNode&) { /* noop */ return 0; }
|
||||
};
|
||||
|
||||
#endif // __lib_pbd_command_h_
|
||||
|
|
|
|||
|
|
@ -39,12 +39,14 @@ class MementoCommand : public Command
|
|||
: obj(obj), before(before), after(after) {}
|
||||
void operator() () { obj.set_state(after); }
|
||||
void undo() { obj.set_state(before); }
|
||||
virtual XMLNode &serialize() {}
|
||||
//{
|
||||
virtual XMLNode &get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("MementoCommand");
|
||||
// obj.id
|
||||
// key is "MementoCommand" or something
|
||||
// before and after mementos
|
||||
//}
|
||||
return *node;
|
||||
}
|
||||
// TODO does this need a copy constructor?
|
||||
protected:
|
||||
obj_T &obj;
|
||||
|
|
@ -60,12 +62,14 @@ public:
|
|||
: obj(obj), before(before) {}
|
||||
void operator() () { /* noop */ }
|
||||
void undo() { obj.set_state(before); }
|
||||
virtual XMLNode &serialize() {}
|
||||
//{
|
||||
virtual XMLNode &get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("MementoUndoCommand"); // XXX
|
||||
// obj.id
|
||||
// key is "MementoCommand" or something
|
||||
// before and after mementos
|
||||
//}
|
||||
return *node;
|
||||
}
|
||||
protected:
|
||||
obj_T &obj;
|
||||
XMLNode &before;
|
||||
|
|
@ -80,12 +84,14 @@ public:
|
|||
: obj(obj), after(after) {}
|
||||
void operator() () { obj.set_state(after); }
|
||||
void undo() { /* noop */ }
|
||||
virtual XMLNode &serialize() {}
|
||||
//{
|
||||
virtual XMLNode &get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode("MementoUndoCommand");
|
||||
// obj.id
|
||||
// key is "MementoCommand" or something
|
||||
// before and after mementos
|
||||
//}
|
||||
return *node;
|
||||
}
|
||||
protected:
|
||||
obj_T &obj;
|
||||
XMLNode &after;
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2006 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: /local/undo/libs/pbd3/pbd/undo.h 59 2006-06-15T18:16:20.960977Z fugalh $
|
||||
*/
|
||||
|
||||
#ifndef __lib_pbd_serializable_h__
|
||||
#define __lib_pbd_serializable_h__
|
||||
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
class Serializable
|
||||
{
|
||||
public:
|
||||
virtual XMLNode &serialize() = 0;
|
||||
virtual ~Serializable() {}
|
||||
};
|
||||
|
||||
#endif // __lib_pbd_serializable_h__
|
||||
|
|
@ -49,7 +49,7 @@ class UndoTransaction : public Command
|
|||
void undo();
|
||||
void redo();
|
||||
|
||||
XMLNode &serialize();
|
||||
XMLNode &get_state();
|
||||
|
||||
void set_name (const string& str) {
|
||||
_name = str;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include <pbd/undo.h>
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace sigc;
|
||||
|
|
@ -82,7 +83,7 @@ UndoTransaction::redo ()
|
|||
(*this)();
|
||||
}
|
||||
|
||||
XMLNode &UndoTransaction::serialize()
|
||||
XMLNode &UndoTransaction::get_state()
|
||||
{
|
||||
XMLNode *node = new XMLNode ("UndoTransaction");
|
||||
// TODO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue