summaryrefslogtreecommitdiff
path: root/src/samplesorter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/samplesorter.h')
-rw-r--r--src/samplesorter.h63
1 files changed, 31 insertions, 32 deletions
diff --git a/src/samplesorter.h b/src/samplesorter.h
index ed86b9d..fa53a3f 100644
--- a/src/samplesorter.h
+++ b/src/samplesorter.h
@@ -24,59 +24,58 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_SAMPLESORTER_H__
-#define __DRUMGIZMO_SAMPLESORTER_H__
+#pragma once
#include <QWidget>
#include <QVector>
#include "selection.h"
-class SampleSorter : public QWidget {
-Q_OBJECT
+class SampleSorter
+ : public QWidget
+{
+ Q_OBJECT
public:
- SampleSorter(Selections &selections, Selections &selections_preview);
+ SampleSorter(Selections& selections, Selections& selections_preview);
public slots:
- void setWavData(const float *data, size_t size);
- void setAttackLength(int len);
- int attackLength();
+ void setWavData(const float* data, size_t size);
+ void setAttackLength(int len);
+ int attackLength();
- void addSelection(sel_id_t id);
- void addSelectionPreview(sel_id_t id);
+ void addSelection(sel_id_t id);
+ void addSelectionPreview(sel_id_t id);
- void relayout();
+ void relayout();
- void setShowPreview(bool show_preview);
+ void setShowPreview(bool show_preview);
- void setSpreadFactor(int spread);
+ void setSpreadFactor(int spread);
protected:
- void paintEvent(QPaintEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
+ void paintEvent(QPaintEvent* event);
+ void mouseMoveEvent(QMouseEvent* event);
+ void mousePressEvent(QMouseEvent* event);
+ void mouseReleaseEvent(QMouseEvent* event);
private:
- sel_id_t getSelectionByCoordinate(int x, int y);
+ sel_id_t getSelectionByCoordinate(int x, int y);
- Selections &selections;
- Selections &selections_preview;
+ Selections& selections;
+ Selections& selections_preview;
- bool show_preview;
+ bool show_preview;
- float min;
- float max;
- int attlen;
+ float min;
+ float max;
+ int attlen;
- // Wav data
- const float *data;
- size_t size;
+ // Wav data
+ const float* data;
+ size_t size;
- Selection sel;
+ Selection sel;
- sel_id_t sel_moving;
+ sel_id_t sel_moving;
- double spread;
+ double spread;
};
-
-#endif/*__DRUMGIZMO_SAMPLESORTER_H__*/