From 119af67b5139e40eb3f21dde42882765e917efcb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 2 Jan 2008 04:14:26 +0000 Subject: Minor Patchage code cleanups. git-svn-id: http://svn.drobilla.net/lad/patchage@1001 a436a847-0d15-0410-975c-d299462d15a1 --- src/StateManager.hpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'src/StateManager.hpp') diff --git a/src/StateManager.hpp b/src/StateManager.hpp index 71d6bdd..63b47ec 100644 --- a/src/StateManager.hpp +++ b/src/StateManager.hpp @@ -24,34 +24,22 @@ #include #include "PatchagePort.hpp" -using std::string; using std::list; using std::map; - - enum ModuleType { Input, Output, InputOutput }; struct Coord { double x; double y; }; -// This should probably be moved out in to a seperate class/file.... -typedef struct ModuleLocation -{ - string name; - ModuleType type; // for distinguishing terminal modules (input or output) - Coord loc; -}; - - class StateManager { public: StateManager(); - void load(const string& filename); - void save(const string& filename); + void load(const std::string& filename); + void save(const std::string& filename); - Coord get_module_location(const string& name, ModuleType type); - void set_module_location(const string& name, ModuleType type, Coord loc); + Coord get_module_location(const std::string& name, ModuleType type); + void set_module_location(const std::string& name, ModuleType type, Coord loc); - void set_module_split(const string& name, bool split); - bool get_module_split(const string& name, bool default_val) const; + void set_module_split(const std::string& name, bool split); + bool get_module_split(const std::string& name, bool default_val) const; float get_zoom(); void set_zoom(float zoom); @@ -59,9 +47,15 @@ public: int get_port_color(PortType type); private: - list _module_locations; - map _module_splits; - float _zoom; + struct ModuleLocation { + std::string name; + ModuleType type; // for distinguishing terminal modules (input or output) + Coord loc; + }; + + std::list _module_locations; + std::map _module_splits; + float _zoom; }; -- cgit v1.2.1