From f2f14d1aa60a9b724a45b0854cee3143f1da80cf Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 21 Apr 2013 19:50:08 +0200 Subject: Added attach length slider. Fixed sample sorter to use sqrt of energy instead of just energy. This spreads out the samples more evenly. --- dgedit/mainwindow.cc | 8 ++++++++ dgedit/samplesorter.cc | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'dgedit') diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc index c750a22..afa8a16 100644 --- a/dgedit/mainwindow.cc +++ b/dgedit/mainwindow.cc @@ -39,6 +39,7 @@ #include #include #include +#include #include "canvastool.h" #include "canvastoolselections.h" @@ -148,6 +149,13 @@ MainWindow::MainWindow() configs->addLayout(btns); + configs->addWidget(new QLabel("Attack length:")); + QSlider *slider = new QSlider(Qt::Horizontal); + slider->setRange(10, 10000); + slider->setValue(666); + connect(slider, SIGNAL(sliderMoved(int)), sorter, SLOT(setAttackLength(int))); + configs->addWidget(slider); + configs->addWidget(new QLabel("Prefix:")); QLineEdit *prefix = new QLineEdit(); connect(prefix, SIGNAL(textChanged(const QString &)), diff --git a/dgedit/samplesorter.cc b/dgedit/samplesorter.cc index 5958354..a2ec3dc 100644 --- a/dgedit/samplesorter.cc +++ b/dgedit/samplesorter.cc @@ -215,7 +215,9 @@ void SampleSorter::paintEvent(QPaintEvent *event) if(sel.to == i.value().to && sel.from == i.value().from) painter.setPen(colPtSel); else painter.setPen(colPt); - float x = (i.key()/max)*(float)width(); + float x = (i.key()/max); + x = sqrt(x); + x *= (float)width(); drawCircle(painter, x, MAP(x)); i++; } -- cgit v1.2.3