Ardour  9.0-pre0-350-gf17a656217
MementoCommandBinder< obj_T > Class Template Referenceabstract

#include <memento_command.h>

Inheritance diagram for MementoCommandBinder< obj_T >:
[legend]

Public Member Functions

virtual void set_state (XMLNode const &, int version) const =0
 
virtual XMLNodeget_state () const =0
 
virtual std::string type_name () const =0
 
virtual void add_state (XMLNode *)=0
 
- Public Member Functions inherited from PBD::Destructible
virtual ~Destructible ()
 
virtual void drop_references ()
 

Additional Inherited Members

- Public Attributes inherited from PBD::Destructible
PBD::Signal< void()> Destroyed
 
PBD::Signal< void()> DropReferences
 

Detailed Description

template<class obj_T>
class MementoCommandBinder< obj_T >

A class that can return a Stateful object which is the subject of a MementoCommand.

The existence of this class means that the undo record can refer to objects which don't exist in the session file. Currently this is used for

  1. MIDI automation; when MIDI automation is edited, undo records are written for the AutomationList being changed. However this AutomationList is a temporary structure, built by a MidiModel, which doesn't get written to the session file. Hence we need to be able to go from a MidiSource and Parameter to an AutomationList. This Binder mechanism allows this through MidiAutomationListBinder; the undo record stores the source and parameter, and these are bound to an AutomationList by the Binder.
  2. Crossfades; unlike regions, these are completely removed from a session when they are deleted. This means that the undo record can contain references to non-existant crossfades. To get around this, CrossfadeBinder can do ‘just-in-time’ binding from the crossfade ID.

Definition at line 54 of file memento_command.h.

Member Function Documentation

◆ add_state()

template<class obj_T >
virtual void MementoCommandBinder< obj_T >::add_state ( XMLNode )
pure virtual

◆ get_state()

template<class obj_T >
virtual XMLNode& MementoCommandBinder< obj_T >::get_state ( ) const
pure virtual

◆ set_state()

template<class obj_T >
virtual void MementoCommandBinder< obj_T >::set_state ( XMLNode const &  ,
int  version 
) const
pure virtual

◆ type_name()

template<class obj_T >
virtual std::string MementoCommandBinder< obj_T >::type_name ( ) const
pure virtual
Returns
Name of our type

Implemented in SimpleMementoCommandBinder< obj_T >, and ARDOUR::MidiAutomationListBinder.


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