summaryrefslogtreecommitdiffstats
path: root/src/Action.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-05-11 13:45:26 -0400
committerDavid Robillard <d@drobilla.net>2021-05-11 13:45:26 -0400
commitdf0fdf362347495531bc3a5d19233220721d846b (patch)
treee3631d08630d4d6651eb24aa53c9fc49157778ab /src/Action.hpp
parentc6ae340c6222240dc45e9bba714c722cebece186 (diff)
downloadpatchage-df0fdf362347495531bc3a5d19233220721d846b.tar.gz
patchage-df0fdf362347495531bc3a5d19233220721d846b.tar.bz2
patchage-df0fdf362347495531bc3a5d19233220721d846b.zip
Refactor most functionality around actions and settings
This moves more code into general places, and completely eliminates dependencies on the Patchage "god object".
Diffstat (limited to 'src/Action.hpp')
-rw-r--r--src/Action.hpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/Action.hpp b/src/Action.hpp
index f843a14..0a13216 100644
--- a/src/Action.hpp
+++ b/src/Action.hpp
@@ -19,6 +19,7 @@
#include "ClientID.hpp"
#include "PortID.hpp"
+#include "Setting.hpp"
#include "SignalDirection.hpp"
#include <boost/variant/variant.hpp>
@@ -26,11 +27,17 @@
namespace patchage {
namespace action {
+struct ChangeSetting {
+ Setting setting;
+};
+
struct ConnectPorts {
PortID tail;
PortID head;
};
+struct DecreaseFontSize {};
+
struct DisconnectClient {
ClientID client;
SignalDirection direction;
@@ -45,6 +52,8 @@ struct DisconnectPorts {
PortID head;
};
+struct IncreaseFontSize {};
+
struct MoveModule {
ClientID client;
SignalDirection direction;
@@ -52,6 +61,10 @@ struct MoveModule {
double y;
};
+struct Refresh {};
+
+struct ResetFontSize {};
+
struct SplitModule {
ClientID client;
};
@@ -60,16 +73,30 @@ struct UnsplitModule {
ClientID client;
};
+struct ZoomFull {};
+struct ZoomIn {};
+struct ZoomNormal {};
+struct ZoomOut {};
+
} // namespace action
/// A high-level action from the user
-using Action = boost::variant<action::ConnectPorts,
+using Action = boost::variant<action::ChangeSetting,
+ action::ConnectPorts,
+ action::DecreaseFontSize,
action::DisconnectClient,
action::DisconnectPort,
action::DisconnectPorts,
+ action::IncreaseFontSize,
action::MoveModule,
+ action::Refresh,
+ action::ResetFontSize,
action::SplitModule,
- action::UnsplitModule>;
+ action::UnsplitModule,
+ action::ZoomFull,
+ action::ZoomIn,
+ action::ZoomNormal,
+ action::ZoomOut>;
} // namespace patchage