summaryrefslogtreecommitdiffstats
path: root/src/StateManager.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-02 04:14:26 +0000
committerDavid Robillard <d@drobilla.net>2008-01-02 04:14:26 +0000
commit119af67b5139e40eb3f21dde42882765e917efcb (patch)
treec538c7a53d6a32f89dec27663e202666139f1197 /src/StateManager.hpp
parent1c2a70154bc1f9070c1a2b9b3cf98f8d398ca215 (diff)
downloadpatchage-119af67b5139e40eb3f21dde42882765e917efcb.tar.gz
patchage-119af67b5139e40eb3f21dde42882765e917efcb.tar.bz2
patchage-119af67b5139e40eb3f21dde42882765e917efcb.zip
Minor Patchage code cleanups.
git-svn-id: http://svn.drobilla.net/lad/patchage@1001 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/StateManager.hpp')
-rw-r--r--src/StateManager.hpp36
1 files changed, 15 insertions, 21 deletions
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 <iostream>
#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<ModuleLocation> _module_locations;
- map<string,bool> _module_splits;
- float _zoom;
+ struct ModuleLocation {
+ std::string name;
+ ModuleType type; // for distinguishing terminal modules (input or output)
+ Coord loc;
+ };
+
+ std::list<ModuleLocation> _module_locations;
+ std::map<std::string,bool> _module_splits;
+ float _zoom;
};