summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-16 11:38:49 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-16 11:38:49 +0200
commit50b1911fb718823b596aaa0ac600ebc2fd85f18d (patch)
tree814ea2d2e66658b2ef5c209cb9e646b1dc120ac9
parenteb013918c17ac19b21845ded977aeee26bdf8275 (diff)
Reinstate volume fader.
-rw-r--r--dgedit/mainwindow.cc42
1 files changed, 14 insertions, 28 deletions
diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc
index b64d710..6585c67 100644
--- a/dgedit/mainwindow.cc
+++ b/dgedit/mainwindow.cc
@@ -47,6 +47,7 @@
#include "canvastool.h"
#include "canvastoolthreshold.h"
#include "canvastoollisten.h"
+#include "volumefader.h"
#define MAXVAL 10000000L
#define SINGLESTEP MAXVAL/100000
@@ -137,7 +138,7 @@ MainWindow::MainWindow()
sb_playsamples = new QScrollBar(Qt::Horizontal);
sb_playsamples->setRange(100, 4000); // ms
-
+
lh->addWidget(canvas);
lh->addWidget(yscale);
@@ -150,34 +151,12 @@ MainWindow::MainWindow()
lv->addWidget(sb_playsamples);
-
-
- // under tab widget
-
- /*
- 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, lineed_slider4));
- 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);
- lineed_slider4->setText("100000");
- attribs_layout->addWidget(slider4, 8, 2);
-
- configs->addLayout(attribs_layout);
- */
-
-
-
QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this);
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+ dockWidget->setWidget(new QWidget());
+ dockWidget->widget()->setLayout(new QVBoxLayout());
+
QTabWidget *tabs = new QTabWidget(this);
tabs->addTab(createFilesTab(), "Files");
generateTabId = tabs->addTab(createGenerateTab(), "Generate");
@@ -185,9 +164,16 @@ MainWindow::MainWindow()
tabs->addTab(createExportTab(), "Export");
connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
- dockWidget->setWidget(tabs);
+ dockWidget->widget()->layout()->addWidget(tabs);
+
+ VolumeFader *vol = new VolumeFader();
+ connect(vol, SIGNAL(volumeChangedDb(double)),
+ &player, SLOT(setGainDB(double)));
+ connect(&player, SIGNAL(peakUpdate(double)),
+ vol, SLOT(updatePeakPower(double)));
+ dockWidget->widget()->layout()->addWidget(vol);
+
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
- // dock->setLayout(configs);
yscale->setValue(MAXVAL);
yoffset->setValue(MAXVAL/2);