From 0fcacc1c3329e905228ceb80903f69561a7db732 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 15 Apr 2014 09:55:45 +0200 Subject: New selections model. --- dgedit/samplesorter.h | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) (limited to 'dgedit/samplesorter.h') 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 #include "selection.h" -class Level { -public: - float velocity; - QMap selections; -}; - -typedef QVector 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 sorted; float min; float max; int attlen; @@ -79,13 +65,7 @@ private: Selection sel; - QVector 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__*/ -- cgit v1.2.3