summaryrefslogtreecommitdiffstats
path: root/src/StateManager.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-02 20:42:23 +0000
committerDavid Robillard <d@drobilla.net>2008-08-02 20:42:23 +0000
commit503944e72ce146e5bed2556e7b2caa5a41edd7ea (patch)
tree2259f758036ecb680b208106fd866d58bf4560c5 /src/StateManager.hpp
parent925022321b8f7dba8b10993a9cd32c0cc0b45e0d (diff)
downloadpatchage-503944e72ce146e5bed2556e7b2caa5a41edd7ea.tar.gz
patchage-503944e72ce146e5bed2556e7b2caa5a41edd7ea.tar.bz2
patchage-503944e72ce146e5bed2556e7b2caa5a41edd7ea.zip
Format split/location code from Nedko for consistency.
Make coordinates valid over all possible values (including -1). git-svn-id: http://svn.drobilla.net/lad/patchage@1318 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/StateManager.hpp')
-rw-r--r--src/StateManager.hpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/StateManager.hpp b/src/StateManager.hpp
index 12cdbb9..3899eef 100644
--- a/src/StateManager.hpp
+++ b/src/StateManager.hpp
@@ -22,15 +22,13 @@
#include <list>
#include <map>
#include <iostream>
+#include <boost/optional.hpp>
#include "PatchagePort.hpp"
enum ModuleType { Input, Output, InputOutput };
-#define UNINITIALIZED_COORD -1
-struct Coord
-{
- Coord() { x = UNINITIALIZED_COORD; y = UNINITIALIZED_COORD; }
- Coord(double x_, double y_) : x(x_), y(y_) {}
+struct Coord {
+ Coord(double x_=0, double y_=0) : x(x_), y(y_) {}
double x;
double y;
};
@@ -61,17 +59,17 @@ public:
private:
struct ModuleSettings {
- ModuleSettings() { split = false; };
+ ModuleSettings() : split(false) {}
bool split;
- Coord input_location;
- Coord output_location;
- Coord inout_location;
+ boost::optional<Coord> input_location;
+ boost::optional<Coord> output_location;
+ boost::optional<Coord> inout_location;
};
std::map<std::string,ModuleSettings> _module_settings;
- Coord _window_location;
- Coord _window_size;
- float _zoom;
+ Coord _window_location;
+ Coord _window_size;
+ float _zoom;
};