1 #ifndef __ardour_state_manager_h__
2 #define __ardour_state_manager_h__
8 #include <sigc++/signal.h>
10 #include <ardour/ardour.h>
14 typedef uint32_t state_id_t;
17 class StateManager : public sigc::trackable
21 std::string operation;
22 State (std::string why) : operation (why) {}
26 typedef std::list<State*> StateMap;
29 virtual ~StateManager ();
31 virtual void drop_all_states ();
32 virtual void use_state (state_id_t);
33 virtual void save_state (std::string why);
35 sigc::signal<void,Change> StateChanged;
37 state_id_t _current_state_id;
39 static void set_allow_save (bool);
40 static bool allow_save ();
43 static bool _allow_save;
44 typedef std::pair<StateManager*,std::string> DeferredSave;
45 static std::vector<DeferredSave> deferred;
49 virtual Change restore_state (State&) = 0;
50 virtual State* state_factory (std::string why) const = 0;
51 virtual void send_state_changed (Change);
56 #endif /* __ardour_state_manager_h__ */