summaryrefslogtreecommitdiff
path: root/src/canvastoolthreshold.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-05-24 20:44:33 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-05-24 20:44:33 +0200
commitcb896a4fa1acd9167d3e7ee9f6336a63309eebde (patch)
tree650337e053b670ba1f67d8b2f6da03d43fb0cda0 /src/canvastoolthreshold.cc
parent5f3f9fabf5ad2e1cda638612c3cf863045765a3b (diff)
Add save/load of selections/regions in instruments.
Diffstat (limited to 'src/canvastoolthreshold.cc')
-rw-r--r--src/canvastoolthreshold.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/canvastoolthreshold.cc b/src/canvastoolthreshold.cc
index bafee70..a905766 100644
--- a/src/canvastoolthreshold.cc
+++ b/src/canvastoolthreshold.cc
@@ -28,15 +28,19 @@
#include <math.h>
+#include "project.h"
+
#define mapX(x) canvas->mapX(x)
#define mapY(x) canvas->mapY(x)
#define unmapX(x) canvas->unmapX(x)
#define unmapY(x) canvas->unmapY(x)
-CanvasToolThreshold::CanvasToolThreshold(Canvas* c)
+CanvasToolThreshold::CanvasToolThreshold(Canvas* c, Instrument& instrument)
+ : instrument(instrument)
{
canvas = c;
- threshold = 0.5;
+ threshold = instrument.getThreshold();
+
threshold_is_moving = false;
colThreshold = QColor(255, 127, 127);
@@ -72,7 +76,7 @@ bool CanvasToolThreshold::mouseMoveEvent(QMouseEvent* event)
canvas->update();
emit thresholdChanging(threshold);
-
+ instrument.setThreshold(threshold);
return true;
}
@@ -117,7 +121,7 @@ bool CanvasToolThreshold::mouseReleaseEvent(QMouseEvent* event)
canvas->update();
emit thresholdChanged(threshold);
-
+ instrument.setThreshold(threshold);
return true;
}
}