ardour
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
PBD::Stateful Class Referenceabstract

#include <stateful.h>

Inheritance diagram for PBD::Stateful:
ARDOUR::ControlProtocolManager ARDOUR::MuteMaster ARDOUR::Pannable ARDOUR::Panner ARDOUR::SceneChange ARDOUR::Speakers ARDOUR::UserBundle Gtkmm2ext::Keyboard PBD::Configuration PBD::StatefulDestructible UIConfiguration

Public Member Functions

 Stateful ()
 
virtual ~Stateful ()
 
virtual XMLNodeget_state (void)=0
 
virtual int set_state (const XMLNode &, int version)=0
 
virtual bool apply_changes (PropertyBase const &)
 
PropertyChange apply_changes (PropertyList const &)
 
const OwnedPropertyListproperties () const
 
void add_property (PropertyBase &s)
 
void add_extra_xml (XMLNode &)
 
XMLNodeextra_xml (const std::string &str, bool add_if_missing=false)
 
void save_extra_xml (const XMLNode &)
 
const PBD::IDid () const
 
bool set_id (const XMLNode &)
 
void set_id (const std::string &)
 
void reset_id ()
 
void clear_changes ()
 
virtual void clear_owned_changes ()
 
PropertyListget_changes_as_properties (Command *) const
 
virtual void rdiff (std::vector< Command * > &) const
 
bool changed () const
 
virtual PropertyListproperty_factory (const XMLNode &) const
 
virtual void suspend_property_changes ()
 
virtual void resume_property_changes ()
 
bool property_changes_suspended () const
 

Public Attributes

PBD::Signal1< void, const
PropertyChange & > 
PropertyChanged
 

Static Public Attributes

static int current_state_version = 0
 
static int loading_state_version = 0
 

Protected Member Functions

void add_instant_xml (XMLNode &, const std::string &directory_path)
 
XMLNodeinstant_xml (const std::string &str, const std::string &directory_path)
 
void add_properties (XMLNode &)
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 

Protected Attributes

XMLNode_extra_xml
 
XMLNode_instant_xml
 
PBD::PropertyChange _pending_changed
 
Glib::Threads::Mutex _lock
 
std::string _xml_node_name
 name of node to use for this object in XML More...
 
OwnedPropertyList_properties
 

Private Attributes

PBD::ID _id
 
gint _stateful_frozen
 

Detailed Description

Base class for objects with saveable and undoable state

Definition at line 45 of file stateful.h.

Constructor & Destructor Documentation

PBD::Stateful::Stateful ( )

Definition at line 47 of file stateful.cc.

PBD::Stateful::~Stateful ( )
virtual

Definition at line 55 of file stateful.cc.

Member Function Documentation

void PBD::Stateful::add_extra_xml ( XMLNode node)

Definition at line 66 of file stateful.cc.

void PBD::Stateful::add_instant_xml ( XMLNode node,
const std::string &  directory_path 
)
protected

Definition at line 111 of file stateful.cc.

void PBD::Stateful::add_properties ( XMLNode owner_state)
protected

Add property states to an XML node.

Parameters
owner_stateNode.

Definition at line 264 of file stateful.cc.

void PBD::Stateful::add_property ( PropertyBase s)

Definition at line 272 of file stateful.cc.

bool PBD::Stateful::apply_changes ( PropertyBase const &  prop)
virtual

Definition at line 337 of file stateful.cc.

PropertyChange PBD::Stateful::apply_changes ( PropertyList const &  property_list)

Definition at line 225 of file stateful.cc.

bool PBD::Stateful::changed ( ) const

Definition at line 325 of file stateful.cc.

void PBD::Stateful::clear_changes ( )

Forget about any changes to this object's properties

Definition at line 184 of file stateful.cc.

void PBD::Stateful::clear_owned_changes ( )
virtual

Reimplemented in ARDOUR::Playlist.

Definition at line 373 of file stateful.cc.

XMLNode * PBD::Stateful::extra_xml ( const std::string &  str,
bool  add_if_missing = false 
)

Definition at line 77 of file stateful.cc.

PropertyList * PBD::Stateful::get_changes_as_properties ( Command cmd) const

Definition at line 192 of file stateful.cc.

virtual XMLNode& PBD::Stateful::get_state ( void  )
pure virtual
const PBD::ID& PBD::Stateful::id ( ) const
inline

Definition at line 68 of file stateful.h.

XMLNode * PBD::Stateful::instant_xml ( const std::string &  str,
const std::string &  directory_path 
)
protected

Definition at line 151 of file stateful.cc.

virtual void PBD::Stateful::mid_thaw ( const PropertyChange )
inlineprotectedvirtual

derived classes can implement this in order to process a property change within thaw() just before send_change() is called.

Reimplemented in ARDOUR::Region.

Definition at line 123 of file stateful.h.

virtual void PBD::Stateful::post_set ( const PropertyChange )
inlineprotectedvirtual

Reimplemented in ARDOUR::Region, ARDOUR::AudioRegion, and ARDOUR::MidiRegion.

Definition at line 109 of file stateful.h.

const OwnedPropertyList& PBD::Stateful::properties ( ) const
inline

Definition at line 56 of file stateful.h.

bool PBD::Stateful::property_changes_suspended ( ) const
inline

Definition at line 95 of file stateful.h.

PropertyList * PBD::Stateful::property_factory ( const XMLNode history_node) const
virtual

Definition at line 349 of file stateful.cc.

void PBD::Stateful::rdiff ( std::vector< Command * > &  cmds) const
virtual

Reimplemented in ARDOUR::Playlist.

Definition at line 365 of file stateful.cc.

void PBD::Stateful::reset_id ( )

Definition at line 394 of file stateful.cc.

void PBD::Stateful::resume_property_changes ( )
virtual

Definition at line 302 of file stateful.cc.

void PBD::Stateful::save_extra_xml ( const XMLNode node)

Definition at line 94 of file stateful.cc.

void PBD::Stateful::send_change ( const PropertyChange what_changed)
protectedvirtual

Reimplemented in ARDOUR::Region.

Definition at line 278 of file stateful.cc.

bool PBD::Stateful::set_id ( const XMLNode node)

Definition at line 381 of file stateful.cc.

void PBD::Stateful::set_id ( const std::string &  )
virtual int PBD::Stateful::set_state ( const XMLNode ,
int  version 
)
pure virtual
PropertyChange PBD::Stateful::set_values ( XMLNode const &  node)
protected

Set our property values from an XML node. Derived types can call this from set_state() (or elsewhere) to get basic property setting done.

Returns
IDs of properties that were changed.

Definition at line 209 of file stateful.cc.

void PBD::Stateful::suspend_property_changes ( )
virtual

Reimplemented in ARDOUR::Region.

Definition at line 296 of file stateful.cc.

Member Data Documentation

XMLNode* PBD::Stateful::_extra_xml
protected

Definition at line 109 of file stateful.h.

PBD::ID PBD::Stateful::_id
private

Definition at line 126 of file stateful.h.

XMLNode* PBD::Stateful::_instant_xml
protected

Definition at line 112 of file stateful.h.

Glib::Threads::Mutex PBD::Stateful::_lock
protected

Definition at line 114 of file stateful.h.

PBD::PropertyChange PBD::Stateful::_pending_changed
protected

Definition at line 113 of file stateful.h.

OwnedPropertyList* PBD::Stateful::_properties
protected

Definition at line 117 of file stateful.h.

gint PBD::Stateful::_stateful_frozen
private

Definition at line 127 of file stateful.h.

std::string PBD::Stateful::_xml_node_name
protected

name of node to use for this object in XML

Definition at line 116 of file stateful.h.

int PBD::Stateful::current_state_version = 0
static

Definition at line 89 of file stateful.h.

int PBD::Stateful::loading_state_version = 0
static

Definition at line 90 of file stateful.h.

PBD::Signal1<void,const PropertyChange&> PBD::Stateful::PropertyChanged

Definition at line 87 of file stateful.h.


The documentation for this class was generated from the following files: