-/* grrr, strict C++ says that static member functions are not C functions, but we also want
- to be able to pack this into a sigc::ptr_fun and not sigc::mem_fun, so we have to make
- it a genuine function rather than a member.
-*/
+/** 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.
+ */
+template <class obj_T>
+class /*LIBPBD_API*/ MementoCommandBinder : public PBD::Destructible
+{
+public:
+ /** @return Stateful object to operate on */
+ virtual obj_T* get () const = 0;