From 503944e72ce146e5bed2556e7b2caa5a41edd7ea Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Aug 2008 20:42:23 +0000 Subject: 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 --- src/StateManager.hpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/StateManager.hpp') 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 #include #include +#include #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 input_location; + boost::optional output_location; + boost::optional inout_location; }; std::map _module_settings; - Coord _window_location; - Coord _window_size; - float _zoom; + Coord _window_location; + Coord _window_size; + float _zoom; }; -- cgit v1.2.1