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;
16 class StateManager : public virtual sigc::trackable
20 std::string operation;
21 State (std::string why) : operation (why) {}
25 typedef std::list<State*> StateMap;
28 virtual ~StateManager ();
30 virtual void drop_all_states ();
31 virtual void use_state (state_id_t);
32 virtual void save_state (std::string why);
34 sigc::signal<void,Change> StateChanged;
36 state_id_t _current_state_id;
38 virtual bool should_save_state () const { return true; }
40 static void prohibit_save ();
41 static void allow_save (const char* why, bool dosave);
44 static bool _allow_save;
45 static sigc::signal<void,const char*> SaveAllowed;
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__ */