summaryrefslogtreecommitdiffstats
path: root/src/PatchageModule.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-02 05:16:57 +0000
committerDavid Robillard <d@drobilla.net>2008-01-02 05:16:57 +0000
commita023afc3a5889eab2d850a531bf91cee21bf4d97 (patch)
treed11fba2fd96590b14fa8db9b475aee76596c26dc /src/PatchageModule.hpp
parent515e08d4c0412a1cb803656237fe4087b8923d7c (diff)
downloadpatchage-a023afc3a5889eab2d850a531bf91cee21bf4d97.tar.gz
patchage-a023afc3a5889eab2d850a531bf91cee21bf4d97.tar.bz2
patchage-a023afc3a5889eab2d850a531bf91cee21bf4d97.zip
Store (in memory, not to disk) module locations on arrange, so locations are not destroyed by refresh.
git-svn-id: http://svn.drobilla.net/lad/patchage@1003 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageModule.hpp')
-rw-r--r--src/PatchageModule.hpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/PatchageModule.hpp b/src/PatchageModule.hpp
index f046267..9004143 100644
--- a/src/PatchageModule.hpp
+++ b/src/PatchageModule.hpp
@@ -54,7 +54,12 @@ public:
virtual ~PatchageModule() { delete _menu; }
- virtual void load_location() {
+ void move(double dx, double dy) {
+ FlowCanvas::Module::move(dx, dy);
+ store_location();
+ }
+
+ void load_location() {
boost::shared_ptr<Canvas> canvas = _canvas.lock();
if (!canvas)
return;
@@ -67,7 +72,12 @@ public:
move_to((canvas->width()/2) - 100 + rand() % 400,
(canvas->height()/2) - 100 + rand() % 400);
}
-
+
+ virtual void store_location() {
+ Coord loc = { property_x().get_value(), property_y().get_value() };
+ _app->state_manager()->set_module_location(_name, _type, loc);
+ }
+
void split() {
assert(_type == InputOutput);
_app->state_manager()->set_module_split(_name, true);
@@ -79,12 +89,7 @@ public:
_app->state_manager()->set_module_split(_name, false);
_app->refresh();
}
-
- virtual void store_location() {
- Coord loc = { property_x().get_value(), property_y().get_value() };
- _app->state_manager()->set_module_location(_name, _type, loc);
- }
-
+
virtual void show_dialog() {}
virtual void menu_disconnect_all() {