Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::state::UndoAction Struct Reference

A single undoable action with undo and redo functions. More...

#include <undo_manager.hpp>

Static Public Member Functions

static std::unique_ptr< UndoAction > create (std::string action_name, std::function< void()> undo, std::function< void()> redo)

Public Attributes

std::string name
std::function< void()> undo_fn
std::function< void()> redo_fn

Detailed Description

A single undoable action with undo and redo functions.

auto action = UndoAction::create("Set gain to -6dB",
[=] { store.set_value(kGain, old_value); }, // undo
[=] { store.set_value(kGain, new_value); } // redo
);
undo_manager.perform(std::move(action));
static std::unique_ptr< UndoAction > create(std::string action_name, std::function< void()> undo, std::function< void()> redo)
Definition undo_manager.hpp:28

Member Function Documentation

◆ create()

std::unique_ptr< UndoAction > pulp::state::UndoAction::create ( std::string action_name,
std::function< void()> undo,
std::function< void()> redo )
inlinestatic

Member Data Documentation

◆ name

std::string pulp::state::UndoAction::name

◆ redo_fn

std::function<void()> pulp::state::UndoAction::redo_fn

◆ undo_fn

std::function<void()> pulp::state::UndoAction::undo_fn

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