2 #include <score/command/Command.hpp>
4 #include <boost/call_traits.hpp>
18 virtual void undo()
const = 0;
19 virtual void redo()
const = 0;
32 using model_t =
typename T::model_type;
33 using parameter_t = T;
34 using parameter_pass_t =
35 typename boost::call_traits<typename T::param_type>::param_type;
41 m_old = (m_model.*T::get)();
46 void undo()
const final override { (m_model.*T::set)(m_old); }
48 void redo()
const final override { (m_model.*T::set)(m_new); }
50 void update(model_t&, parameter_pass_t newval) { m_new = newval; }
54 typename T::param_type m_old, m_new;
62 #define SCORE_SETTINGS_COMMAND_DECL(name) \
64 using score::SettingsCommand<parameter_t>::SettingsCommand; \
66 static const CommandKey& static_key() \
68 static const CommandKey var{#name}; \
Base class for commands to be used with the Settings system.
Definition: SettingsCommand.hpp:15
A Command class that modifies a parameter given its trait class.
Definition: SettingsCommand.hpp:30
Base toolkit upon which the software is built.
Definition: Application.cpp:90