diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-04-15 09:55:45 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-04-15 09:55:45 +0200 |
commit | 0fcacc1c3329e905228ceb80903f69561a7db732 (patch) | |
tree | 0d1d636d5e0b95b1d4554ad112aa63bfaa79e7e0 /dgedit/samplesorter.h | |
parent | a0bff571893f9afd5e4eb84ac52755f851398601 (diff) |
New selections model.
Diffstat (limited to 'dgedit/samplesorter.h')
-rw-r--r-- | dgedit/samplesorter.h | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/dgedit/samplesorter.h b/dgedit/samplesorter.h index 4ffaf2a..f35622a 100644 --- a/dgedit/samplesorter.h +++ b/dgedit/samplesorter.h @@ -31,29 +31,18 @@ #include <QVector> #include "selection.h" -class Level { -public: - float velocity; - QMap<float, Selection> selections; -}; - -typedef QVector<Level> Levels; - class SampleSorter : public QWidget { Q_OBJECT public: - SampleSorter(); - - Selections selections(); - Levels levels(); + SampleSorter(Selections &selections); public slots: - void setSelections(Selections selections); void setWavData(const float *data, size_t size); - void resort(); void setAttackLength(int len); int attackLength(); - void setActiveSelection(Selection s); + + void addSelection(sel_id_t id); + void relayout(); protected: void paintEvent(QPaintEvent *event); @@ -61,14 +50,11 @@ protected: void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); -signals: - void activeSelectionChanged(Selection selection); - private: - Selection *getSelectionByCoordinate(int x, int y); + sel_id_t getSelectionByCoordinate(int x, int y); + + Selections &selections; - Selections _selections; - QMap<float, Selection> sorted; float min; float max; int attlen; @@ -79,13 +65,7 @@ private: Selection sel; - QVector<double> threshold; - bool threshold_is_moving; - bool selection_is_moving_left; - bool selection_is_moving_right; - int cur_thr; - - Selection *sel_moving; + sel_id_t sel_moving; }; #endif/*__DRUMGIZMO_SAMPLESORTER_H__*/ |