From 3a27410dcbaaca10480ffc14770b41c11e9ca1da Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 11 Feb 2010 17:08:34 +0000 Subject: More tinkering with State<>. Use some StateDiffCommands instead of MementoCommand. More use of State<> for Region members. git-svn-id: svn://localhost/ardour2/branches/3.0@6675 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/ardour.h | 1 + libs/ardour/ardour/region.h | 14 +++++++------- libs/ardour/ardour/session_object.h | 14 +++++++++----- 3 files changed, 17 insertions(+), 12 deletions(-) (limited to 'libs/ardour/ardour') diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index a7b3bcafd0..403cf21007 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -70,6 +70,7 @@ namespace ARDOUR { extern PBD::Change PositionChanged; extern PBD::Change NameChanged; extern PBD::Change BoundsChanged; + extern PBD::Change FlagsChanged; static const double SHUTTLE_FRACT_SPEED1=0.48412291827; /* derived from A1,A2 */ diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 414a1723f9..9c78285a09 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -314,21 +314,21 @@ class Region virtual void recompute_at_end () = 0; DataType _type; - Flag _flags; + PBD::EnumState _flags; PBD::State _start; - nframes_t _length; + PBD::State _length; nframes_t _last_length; PBD::State _position; nframes_t _last_position; PositionLockStyle _positional_lock_style; - nframes_t _sync_position; + PBD::State _sync_position; PBD::State _layer; mutable RegionEditState _first_edit; int _frozen; - nframes64_t _ancestral_start; - nframes64_t _ancestral_length; - float _stretch; - float _shift; + PBD::State _ancestral_start; + PBD::State _ancestral_length; + PBD::State _stretch; + PBD::State _shift; BBT_Time _bbt_time; AnalysisFeatureList _transients; bool _valid_transients; diff --git a/libs/ardour/ardour/session_object.h b/libs/ardour/ardour/session_object.h index 47caab5475..cf9ccbb3a7 100644 --- a/libs/ardour/ardour/session_object.h +++ b/libs/ardour/ardour/session_object.h @@ -26,6 +26,8 @@ #include "ardour/session_handle.h" +#include "i18n.h" + namespace ARDOUR { class Session; @@ -39,11 +41,13 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible public: SessionObject (Session& session, const std::string& name) : SessionHandleRef (session) - , _name(name) - {} + , _name (X_("name"), PBD::Change (0), "") + { + add_state (_name); + } - Session& session() const { return _session; } - const std::string& name() const { return _name; } + Session& session() const { return _session; } + std::string name() const { return _name; } virtual bool set_name (const std::string& str) { if (_name != str) { @@ -56,7 +60,7 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible PBD::Signal0 NameChanged; protected: - std::string _name; + PBD::State _name; }; } // namespace ARDOUR -- cgit v1.2.3