diff options
Diffstat (limited to 'dgedit')
-rw-r--r-- | dgedit/canvas.cc | 2 | ||||
-rw-r--r-- | dgedit/canvas.h | 6 | ||||
-rw-r--r-- | dgedit/canvastool.h | 12 |
3 files changed, 13 insertions, 7 deletions
diff --git a/dgedit/canvas.cc b/dgedit/canvas.cc index 5fc1f1f..44536b3 100644 --- a/dgedit/canvas.cc +++ b/dgedit/canvas.cc @@ -444,7 +444,7 @@ void Canvas::autoCreateSelections() } int minsize = 100; // attack. - float minval = 0.0001; // noise floor + float minval = 0.00003; // noise floor int to = i; float runavg = fabs(data[from]); while((runavg > minval || diff --git a/dgedit/canvas.h b/dgedit/canvas.h index b881d01..0fb7f4c 100644 --- a/dgedit/canvas.h +++ b/dgedit/canvas.h @@ -33,6 +33,7 @@ #include "selection.h" #include "mipmap.h" +#include "canvastool.h" class Canvas : public QWidget { Q_OBJECT @@ -43,6 +44,8 @@ public: void load(QString file); Selections selections(); + + void addTool(CanvasTool *tool); signals: void selectionsChanged(Selections selections); @@ -106,6 +109,9 @@ private: QColor colActiveSel; Selections _selections; + + + QVector<CanvasTool*> tools; }; #endif/*__DRUMGIZMO_CANVAS_H__*/ diff --git a/dgedit/canvastool.h b/dgedit/canvastool.h index a378c53..bd224d0 100644 --- a/dgedit/canvastool.h +++ b/dgedit/canvastool.h @@ -30,12 +30,12 @@ class CanvasTool : public QObject { Q_OBJECT public: - virtual void mouseMoveEvent(QMouseEvent *event); - virtual void mousePressEvent(QMouseEvent *event); - virtual void mouseReleaseEvent(QMouseEvent *event); - virtual void resizeEvent(QResizeEvent *event); - virtual void paintEvent(QPaintEvent *event); - virtual void keyReleaseEvent(QKeyEvent *event); + virtual void mouseMoveEvent(QMouseEvent *event) = 0; + virtual void mousePressEvent(QMouseEvent *event) = 0; + virtual void mouseReleaseEvent(QMouseEvent *event) = 0; + virtual void resizeEvent(QResizeEvent *event) = 0; + virtual void paintEvent(QPaintEvent *event) = 0; + virtual void keyReleaseEvent(QKeyEvent *event) = 0; signals: void activateChanged(bool activestate); |