summaryrefslogtreecommitdiffstats
path: root/src/StateManager.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-02 20:12:58 +0000
committerDavid Robillard <d@drobilla.net>2008-08-02 20:12:58 +0000
commit925022321b8f7dba8b10993a9cd32c0cc0b45e0d (patch)
treead2dde7d67af4d9626291298cffe0ba3f4941d59 /src/StateManager.hpp
parentf7eab5b56d8b77b3e0cd0b42ff5a94aae69942ca (diff)
downloadpatchage-925022321b8f7dba8b10993a9cd32c0cc0b45e0d.tar.gz
patchage-925022321b8f7dba8b10993a9cd32c0cc0b45e0d.tar.bz2
patchage-925022321b8f7dba8b10993a9cd32c0cc0b45e0d.zip
Apply module split restoration patch from Nedko.
git-svn-id: http://svn.drobilla.net/lad/patchage@1317 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/StateManager.hpp')
-rw-r--r--src/StateManager.hpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/StateManager.hpp b/src/StateManager.hpp
index 757c2e9..12cdbb9 100644
--- a/src/StateManager.hpp
+++ b/src/StateManager.hpp
@@ -25,7 +25,15 @@
#include "PatchagePort.hpp"
enum ModuleType { Input, Output, InputOutput };
-struct Coord { double x; double y; };
+
+#define UNINITIALIZED_COORD -1
+struct Coord
+{
+ Coord() { x = UNINITIALIZED_COORD; y = UNINITIALIZED_COORD; }
+ Coord(double x_, double y_) : x(x_), y(y_) {}
+ double x;
+ double y;
+};
class StateManager
{
@@ -35,7 +43,7 @@ public:
void load(const std::string& filename);
void save(const std::string& filename);
- Coord get_module_location(const std::string& name, ModuleType type);
+ bool get_module_location(const std::string& name, ModuleType type, Coord& loc);
void set_module_location(const std::string& name, ModuleType type, Coord loc);
void set_module_split(const std::string& name, bool split);
@@ -52,14 +60,15 @@ public:
void set_window_size(Coord size) { _window_size = size; }
private:
- struct ModuleLocation {
- std::string name;
- ModuleType type; // for distinguishing terminal modules (input or output)
- Coord loc;
+ struct ModuleSettings {
+ ModuleSettings() { split = false; };
+ bool split;
+ Coord input_location;
+ Coord output_location;
+ Coord inout_location;
};
- std::list<ModuleLocation> _module_locations;
- std::map<std::string,bool> _module_splits;
+ std::map<std::string,ModuleSettings> _module_settings;
Coord _window_location;
Coord _window_size;
float _zoom;