mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 13:16:27 +01:00
git-svn-id: svn://localhost/ardour2/branches/3.0@6678 d708f5d6-7413-0410-9779-e7cbd77b26cf
55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
/*
|
|
Copyright (C) 2010 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.
|
|
|
|
*/
|
|
|
|
#ifndef __pbd_stateful_diff_command_h__
|
|
#define __pbd_stateful_diff_command_h__
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
#include <boost/weak_ptr.hpp>
|
|
#include "pbd/command.h"
|
|
|
|
namespace PBD
|
|
{
|
|
|
|
class Stateful;
|
|
|
|
/** A Command which stores its action as the differences between the before and after
|
|
* state of a Stateful object.
|
|
*/
|
|
class StatefulDiffCommand : public Command
|
|
{
|
|
public:
|
|
StatefulDiffCommand (boost::shared_ptr<Stateful>);
|
|
StatefulDiffCommand (boost::shared_ptr<Stateful>, XMLNode const &);
|
|
~StatefulDiffCommand ();
|
|
|
|
void operator() ();
|
|
void undo ();
|
|
|
|
XMLNode& get_state ();
|
|
|
|
private:
|
|
boost::weak_ptr<Stateful> _object; ///< the object in question
|
|
XMLNode* _before; ///< XML node containing the previous values of XML properties which changed
|
|
XMLNode* _after; ///< XML node containing the new values of XML properties which changed
|
|
};
|
|
|
|
};
|
|
|
|
#endif /* __pbd_stateful_diff_command_h__ */
|