27 #include <glibmm/fileutils.h>
28 #include <glibmm/miscutils.h>
44 int Stateful::current_state_version = 0;
45 int Stateful::loading_state_version = 0;
49 , _stateful_frozen (0)
85 if (!node && add_if_missing) {
113 if (!Glib::file_test (directory_path, Glib::FILE_TEST_IS_DIR)) {
114 if (g_mkdir_with_parents (directory_path.c_str(), 0755) != 0) {
127 std::string instant_xml_path = Glib::build_filename (directory_path,
"instant.xml");
155 std::string instant_xml_path = Glib::build_filename (directory_path,
"instant.xml");
157 if (Glib::file_test (instant_xml_path, Glib::FILE_TEST_EXISTS)) {
159 if (tree.
read(instant_xml_path)) {
173 for (i = nlist.begin(); i != nlist.end(); ++i) {
174 if ((*i)->name() == str) {
187 i->second->clear_changes ();
197 i->second->get_changes_as_properties (*pl, cmd);
214 if (i->second->set_value (node)) {
228 PropertyList::const_iterator p;
232 for (PropertyList::const_iterator pp = property_list.begin(); pp != property_list.end(); ++pp) {
236 for (PropertyList::const_iterator i = property_list.begin(); i != property_list.end(); ++i) {
241 string_compose (
"actually setting property %1 using %2\n", p->second->property_name(), i->second->property_name())
249 i->second->property_name()));
267 i->second->get_value (owner_state);
280 if (what_changed.empty()) {
328 if (i->second->changed()) {
344 i->second->apply_changes (&prop);
357 prop_list->
add (prop);
368 i->second->rdiff (cmds);
376 i->second->clear_owned_changes ();
385 if ((prop = node.
property (
"id")) != 0) {
virtual void resume_property_changes()
bool property_changes_suspended() const
virtual void send_change(const PropertyChange &)
const std::string & value() const
PBD::Signal1< void, const PropertyChange & > PropertyChanged
void save_extra_xml(const XMLNode &)
virtual void suspend_property_changes()
virtual PropertyList * property_factory(const XMLNode &) const
const std::string & name() const
void add_property(PropertyBase &s)
XMLNode * add_child_copy(const XMLNode &)
LIBPBD_API Transmitter error
LIBPBD_API Transmitter warning
PropertyList * get_changes_as_properties(Command *) const
const XMLNodeList & children(const std::string &str=std::string()) const
void add_properties(XMLNode &)
std::ostream & endmsg(std::ostream &ostr)
virtual void rdiff(std::vector< Command * > &) const
PropertyChange set_values(XMLNode const &)
OwnedPropertyList * _properties
std::list< XMLNode * > XMLNodeList
PropertyID property_id() const
virtual bool apply_changes(PropertyBase const &)
XMLProperty * property(const char *)
XMLNode * set_root(XMLNode *n)
bool set_id(const XMLNode &)
#define DEBUG_TRACE(bits, str)
virtual void post_set(const PropertyChange &)
const std::string & set_filename(const std::string &fn)
void remove_nodes(const std::string &)
void add_instant_xml(XMLNode &, const std::string &directory_path)
void add_child_nocopy(XMLNode &)
class LIBPBD_API PropertyList
virtual PropertyBase * clone_from_xml(const XMLNode &) const
virtual void clear_owned_changes()
Glib::Threads::Mutex _lock
XMLNode * extra_xml(const std::string &str, bool add_if_missing=false)
LIBPBD_API uint64_t Stateful
PBD::PropertyChange _pending_changed
XMLNode * child(const char *) const
virtual void mid_thaw(const PropertyChange &)
void add_extra_xml(XMLNode &)
void remove_nodes_and_delete(const std::string &)
XMLNode * instant_xml(const std::string &str, const std::string &directory_path)
XMLNodeList::const_iterator XMLNodeConstIterator
bool add(PropertyBase *prop)
std::string string_compose(const std::string &fmt, const T1 &o1)
bool add(PropertyBase &p)