X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession_object.h;h=ac74f07b7700c3522e13f7597abc620487fa25d2;hb=a223b96725c68a4e41c9f2f5675756c274730889;hp=069badcb6afa0fbde699449488b990bf2bb23367;hpb=a1e0dc13df3cdc7033c940f0f3311a2bd47d3b2e;p=ardour.git diff --git a/libs/ardour/ardour/session_object.h b/libs/ardour/ardour/session_object.h index 069badcb6a..ac74f07b77 100644 --- a/libs/ardour/ardour/session_object.h +++ b/libs/ardour/ardour/session_object.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-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 @@ -23,44 +23,48 @@ #include #include "pbd/statefuldestructible.h" #include "pbd/signals.h" +#include "pbd/properties.h" +#include "ardour/ardour.h" #include "ardour/session_handle.h" -#include "i18n.h" - namespace ARDOUR { +namespace Properties { + LIBARDOUR_API extern PBD::PropertyDescriptor name; +} + class Session; /** A named object associated with a Session. Objects derived from this class are expected to be destroyed before the session calls drop_references(). */ -class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible +class LIBARDOUR_API SessionObject : public SessionHandleRef, public PBD::StatefulDestructible { public: + static void make_property_quarks (); + SessionObject (Session& session, const std::string& name) : SessionHandleRef (session) - , _name (X_("name"), PBD::Change (0), name) + , _name (Properties::name, name) { - add_state (_name); + add_property (_name); } - + Session& session() const { return _session; } std::string name() const { return _name; } virtual bool set_name (const std::string& str) { if (_name != str) { _name = str; - NameChanged(); + PropertyChanged (PBD::PropertyChange (Properties::name)); } return true; } - PBD::Signal0 NameChanged; - protected: - PBD::State _name; + PBD::Property _name; }; } // namespace ARDOUR