From b36b592bba86aa0dbdea8d4653a6affcce95a72c Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Sun, 6 Apr 2014 15:38:09 +0200 Subject: Added presets for most common types of drums. Values not adjusted yet just copied from snare --- dgedit/presets.ini | 59 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/dgedit/presets.ini b/dgedit/presets.ini index 6434f05..2ce9433 100644 --- a/dgedit/presets.ini +++ b/dgedit/presets.ini @@ -1,15 +1,50 @@ -[Bright snare] +[Kickdrum] + prefix = "Kickdrum" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Snare] prefix = "Snare" - attacklength = 1 - falloff = 2 - fadelength = 3 -[Tommy gun] + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Rack tom] prefix = "Tom" - attacklength = 10 - falloff = 20 - fadelength = 30 -[Kickdrum] - prefix = "Kickass" - attacklength = 100 + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Floor tom] + prefix = "FTom" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Hihat open] + prefix = "HihatOpen" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Hihat closed] + prefix = "HihatClosed" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[China cymbal] + prefix = "China" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Crash cymbal] + prefix = "Crash" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Ride] + prefix = "Ride" + attacklength = 30 + falloff = 200 + fadelength = 1200 +[Ride bell] + prefix = "RideBell" + attacklength = 30 falloff = 200 - fadelength = 300 + fadelength = 1200 -- cgit v1.2.3 From 75a874acefd730170abe84386e900f83fe1fec09 Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Sun, 6 Apr 2014 20:16:49 +0200 Subject: Added lineedits that show the value of sliders. Non editable at the moment and initial values need to be set. --- dgedit/mainwindow.cc | 89 ++++++++++++++++++++++++++++++++++++++++------------ dgedit/mainwindow.h | 13 +++++++- 2 files changed, 81 insertions(+), 21 deletions(-) diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc index 5956d1c..cb01059 100644 --- a/dgedit/mainwindow.cc +++ b/dgedit/mainwindow.cc @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -167,61 +168,89 @@ MainWindow::MainWindow() connect(presets, SIGNAL(currentIndexChanged(int)), this, SLOT(setPreset(int))); configs->addWidget(presets); - configs->addWidget(new QLabel("Attack length:")); + QGridLayout *attribs_layout = new QGridLayout(); + + attribs_layout->addWidget(new QLabel("Attack length:"), 1, 1, 1, 2); + lineed_attacklength = new QLineEdit(); + lineed_attacklength->setReadOnly(true); + lineed_attacklength->setValidator(new QIntValidator(0, 1000)); + attribs_layout->addWidget(lineed_attacklength, 2, 1); slider_attacklength = new QSlider(Qt::Horizontal); slider_attacklength->setRange(10, 1000); - connect(slider_attacklength, SIGNAL(sliderMoved(int)), sorter, SLOT(setAttackLength(int))); + connect(slider_attacklength, SIGNAL(sliderMoved(int)), + this, SLOT(setAttackLengthLineEd(int))); + connect(slider_attacklength, SIGNAL(sliderMoved(int)), + sorter, SLOT(setAttackLength(int))); slider_attacklength->setValue(666); - configs->addWidget(slider_attacklength); + attribs_layout->addWidget(slider_attacklength, 2, 2); - configs->addWidget(new QLabel("Falloff:")); + attribs_layout->addWidget(new QLabel("Falloff:"), 3, 1, 1, 2); + lineed_falloff = new QLineEdit(); + lineed_falloff->setReadOnly(true); + lineed_falloff->setValidator(new QIntValidator(0, 10000)); + attribs_layout->addWidget(lineed_falloff, 4, 1); slider_falloff = new QSlider(Qt::Horizontal); slider_falloff->setRange(1, 10000); + connect(slider_falloff, SIGNAL(sliderMoved(int)), + this, SLOT(setFalloffLineEd(int))); connect(slider_falloff, SIGNAL(sliderMoved(int)), selections, SLOT(noiseFloorChanged(int))); slider_falloff->setValue(666); - configs->addWidget(slider_falloff); + attribs_layout->addWidget(slider_falloff, 4, 2); - configs->addWidget(new QLabel("Fadelength:")); + attribs_layout->addWidget(new QLabel("Fadelength:"), 5, 1, 1, 2); + lineed_fadelength = new QLineEdit(); + lineed_fadelength->setReadOnly(true); + lineed_fadelength->setValidator(new QIntValidator(0, 2000)); + attribs_layout->addWidget(lineed_fadelength, 6, 1); slider_fadelength = new QSlider(Qt::Horizontal); slider_fadelength->setRange(1, 2000); + connect(slider_fadelength, SIGNAL(sliderMoved(int)), + this, SLOT(setFadeLengthLineEd(int))); connect(slider_fadelength, SIGNAL(sliderMoved(int)), selections, SLOT(fadeoutChanged(int))); slider_fadelength->setValue(666); - configs->addWidget(slider_fadelength); + attribs_layout->addWidget(slider_fadelength, 6, 2); - configs->addWidget(new QLabel("Player volume:")); + attribs_layout->addWidget(new QLabel("Player volume:"), 7, 1, 1, 2); + lineed_slider4 = new QLineEdit(); + lineed_slider4->setReadOnly(true); + lineed_slider4->setValidator(new QIntValidator(0, 1000000)); + attribs_layout->addWidget(lineed_slider4, 8, 1); QSlider *slider4 = new QSlider(Qt::Horizontal); slider4->setRange(0, 1000000); + connect(slider4, SIGNAL(sliderMoved(int)), + this, SLOT(setVolumeLineEd(int))); connect(slider4, SIGNAL(sliderMoved(int)), listen, SLOT(setVolume(int))); slider4->setValue(100000); - configs->addWidget(slider4); + attribs_layout->addWidget(slider4, 8, 2); + + configs->addLayout(attribs_layout); configs->addWidget(new QLabel("Prefix:")); prefix = new QLineEdit(); connect(prefix, SIGNAL(textChanged(const QString &)), extractor, SLOT(setOutputPrefix(const QString &))); - prefix->setText("kick-r"); configs->addWidget(prefix); configs->addWidget(new QLabel("Export path:")); QHBoxLayout *lo_exportp = new QHBoxLayout(); - exportp = new QLineEdit(); - connect(exportp, SIGNAL(textChanged(const QString &)), + lineed_exportp = new QLineEdit(); + connect(lineed_exportp, SIGNAL(textChanged(const QString &)), extractor, SLOT(setExportPath(const QString &))); - exportp->setText("/home/deva/tmp/drumgizmoexport"); - lo_exportp->addWidget(exportp); + lo_exportp->addWidget(lineed_exportp); QPushButton *btn_browse = new QPushButton("..."); connect(btn_browse, SIGNAL(clicked()), this, SLOT(browse())); lo_exportp->addWidget(btn_browse); + configs->addLayout(lo_exportp); + configs->addWidget(new QLabel("Files: (double-click to set as master)")); QPushButton *loadbtn = new QPushButton(); loadbtn->setText("Add files..."); configs->addWidget(loadbtn); - configs->addWidget(new QLabel("Files: (double-click to set as master)")); filelist = new FileList(); connect(filelist, SIGNAL(masterFileChanged(QString)), this, SLOT(loadFile(QString))); @@ -266,6 +295,27 @@ MainWindow::MainWindow() statusBar()->showMessage("Ready"); } +void MainWindow::setAttackLengthLineEd(int value) +{ + lineed_attacklength->setText(QString::number(value)); +} + +void MainWindow::setFalloffLineEd(int value) +{ + lineed_falloff->setText(QString::number(value)); +} + +void MainWindow::setFadeLengthLineEd(int value) +{ + lineed_fadelength->setText(QString::number(value)); +} + +void MainWindow::setVolumeLineEd(int value) +{ + lineed_slider4->setText(QString::number(value)); +} + + void MainWindow::playSamples() { // unsigned int length = 44100 / 4; // 0.25 seconds in 44k1Hz @@ -299,7 +349,7 @@ void MainWindow::loadSettings() QSettings settings("config.ini", QSettings::IniFormat); settings.beginGroup("MainWindow"); - exportp->setText(settings.value("exportp", "").toString()); + lineed_exportp->setText(settings.value("exportpath", "").toString()); resize(settings.value("size", QSize(700, 800)).toSize()); move(settings.value("pos", QPoint(0, 0)).toPoint()); settings.endGroup(); @@ -310,10 +360,9 @@ void MainWindow::saveSettings() QSettings settings("config.ini", QSettings::IniFormat); settings.beginGroup("MainWindow"); - settings.setValue("exportp", exportp->text()); + settings.setValue("exportpath", lineed_exportp->text()); settings.setValue("size", size()); settings.setValue("pos", pos()); - settings.setValue("exportp", exportp->text()); settings.endGroup(); } @@ -376,6 +425,6 @@ void MainWindow::setPreset(int index) } void MainWindow::browse() { - QString path = QFileDialog::getExistingDirectory(this, "Select export path", exportp->text()); - exportp->setText(path); + QString path = QFileDialog::getExistingDirectory(this, "Select export path", lineed_exportp->text()); + lineed_exportp->setText(path); } diff --git a/dgedit/mainwindow.h b/dgedit/mainwindow.h index 280b60c..5fbf0ec 100644 --- a/dgedit/mainwindow.h +++ b/dgedit/mainwindow.h @@ -83,11 +83,22 @@ private: QScrollBar *xoffset; QScrollBar *sb_playsamples; QComboBox *presets; + QLineEdit *lineed_attacklength; QSlider *slider_attacklength; + QLineEdit *lineed_falloff; QSlider *slider_falloff; + QLineEdit *lineed_fadelength; QSlider *slider_fadelength; + QLineEdit *lineed_slider4; QLineEdit *prefix; - QLineEdit *exportp; + QLineEdit *lineed_exportp; + +private slots: + void setAttackLengthLineEd(int); + void setFalloffLineEd(int); + void setFadeLengthLineEd(int); + void setVolumeLineEd(int); + }; #endif/*__DRUMGIZMO_MAINWINDOW_H__*/ -- cgit v1.2.3 From 651fefdeb00194e9df7b03b9adffad140f35c89a Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Wed, 9 Apr 2014 08:12:21 +0200 Subject: Added initial values to lineedit showing values of sliders. --- dgedit/mainwindow.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc index cb01059..79af877 100644 --- a/dgedit/mainwindow.cc +++ b/dgedit/mainwindow.cc @@ -224,6 +224,7 @@ MainWindow::MainWindow() connect(slider4, SIGNAL(sliderMoved(int)), listen, SLOT(setVolume(int))); slider4->setValue(100000); + lineed_slider4->setText("100000"); attribs_layout->addWidget(slider4, 8, 2); configs->addLayout(attribs_layout); @@ -419,8 +420,11 @@ void MainWindow::setPreset(int index) QVariant v = presets->itemData(index); Preset p = v.value(); slider_attacklength->setValue(p.attacklength); + lineed_attacklength->setText(QString::number(p.attacklength)); slider_falloff->setValue(p.falloff); + lineed_falloff->setText(QString::number(p.falloff)); slider_fadelength->setValue(p.fadelength); + lineed_fadelength->setText(QString::number(p.fadelength)); prefix->setText(p.prefix); } -- cgit v1.2.3