(layer->getModel());
+ if (tvm) {
+ m_panLayer->setModel(tvm);
+ return;
+ }
+ }
+ }
+}
+
+void
MainWindow::updateVisibleRangeDisplay(Pane *p) const
{
if (!getMainModel() || !p) {
@@ -3237,28 +3292,76 @@
MainWindow::resetInstantsCounters()
{
LabelCounterInputDialog dialog(m_labeller, this);
+ dialog.setWindowTitle(tr("Reset Counters"));
dialog.exec();
}
void
-MainWindow::modelGenerationFailed(QString transformName)
+MainWindow::modelGenerationFailed(QString transformName, QString message)
+{
+ if (message != "") {
+
+ QMessageBox::warning
+ (this,
+ tr("Failed to generate layer"),
+ tr("Layer generation failedFailed to generate derived layer.
The layer transform \"%1\" failed:
%2")
+ .arg(transformName).arg(message),
+ QMessageBox::Ok);
+ } else {
+ QMessageBox::warning
+ (this,
+ tr("Failed to generate layer"),
+ tr("Layer generation failed
Failed to generate a derived layer.
The layer transform \"%1\" failed.
No error information is available.")
+ .arg(transformName),
+ QMessageBox::Ok);
+ }
+}
+
+void
+MainWindow::modelGenerationWarning(QString transformName, QString message)
+{
+ QMessageBox::warning
+ (this, tr("Warning"), message, QMessageBox::Ok);
+}
+
+void
+MainWindow::modelRegenerationFailed(QString layerName,
+ QString transformName, QString message)
+{
+ if (message != "") {
+
+ QMessageBox::warning
+ (this,
+ tr("Failed to regenerate layer"),
+ tr("Layer generation failed
Failed to regenerate derived layer \"%1\" using new data model as input.
The layer transform \"%2\" failed:
%3")
+ .arg(layerName).arg(transformName).arg(message),
+ QMessageBox::Ok);
+ } else {
+ QMessageBox::warning
+ (this,
+ tr("Failed to regenerate layer"),
+ tr("Layer generation failed
Failed to regenerate derived layer \"%1\" using new data model as input.
The layer transform \"%2\" failed.
No error information is available.")
+ .arg(layerName).arg(transformName),
+ QMessageBox::Ok);
+ }
+}
+
+void
+MainWindow::modelRegenerationWarning(QString layerName,
+ QString transformName, QString message)
+{
+ QMessageBox::warning
+ (this, tr("Warning"), tr("Warning when regenerating layer
When regenerating the derived layer \"%1\" using new data model as input:
%2").arg(layerName).arg(message), QMessageBox::Ok);
+}
+
+void
+MainWindow::alignmentFailed(QString transformName, QString message)
{
QMessageBox::warning
(this,
- tr("Failed to generate layer"),
- tr("Layer generation failed
Failed to generate a derived layer.
The layer transform \"%1\" failed.
This may mean that a plugin failed to initialise, perhaps because it rejected the processing block size that was requested.")
- .arg(transformName),
- QMessageBox::Ok);
-}
-
-void
-MainWindow::modelRegenerationFailed(QString layerName, QString transformName)
-{
- QMessageBox::warning
- (this,
- tr("Failed to regenerate layer"),
- tr("Layer generation failed
Failed to regenerate derived layer \"%1\".
The layer transform \"%2\" failed to run.
This may mean that the layer used a plugin that is not currently available.")
- .arg(layerName).arg(transformName),
+ tr("Failed to calculate alignment"),
+ tr("Alignment calculation failed
Failed to calculate an audio alignment using transform \"%1\":
%2")
+ .arg(transformName).arg(message),
QMessageBox::Ok);
}
@@ -3280,6 +3383,7 @@
}
m_layerTreeDialog = new LayerTreeDialog(m_paneStack);
+ m_layerTreeDialog->setAttribute(Qt::WA_DeleteOnClose); // see below
m_layerTreeDialog->show();
}
@@ -3315,12 +3419,6 @@
contextHelpChanged(tr("Adjust the master playback level"));
} else if (w == m_playSpeed) {
contextHelpChanged(tr("Adjust the master playback speed"));
-#ifndef HAVE_RUBBERBAND
- } else if (w == m_playSharpen && w->isEnabled()) {
- contextHelpChanged(tr("Toggle transient sharpening for playback time scaling"));
- } else if (w == m_playMono && w->isEnabled()) {
- contextHelpChanged(tr("Toggle mono mode for playback time scaling"));
-#endif
}
}
@@ -3339,7 +3437,7 @@
void
MainWindow::help()
{
- openHelpUrl(tr("http://www.sonicvisualiser.org/doc/reference/1.0/en/"));
+ openHelpUrl(tr("http://www.sonicvisualiser.org/doc/reference/1.2/en/"));
}
void
@@ -3366,7 +3464,7 @@
QString aboutText;
aboutText += tr("
About Sonic Visualiser
");
- aboutText += tr("Sonic Visualiser is a program for viewing and exploring audio data for
semantic music analysis and annotation.
");
+ aboutText += tr("Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.
");
aboutText += tr("%1 : %2 configuration
")
.arg(version)
.arg(debug ? tr("Debug") : tr("Release"));
@@ -3448,11 +3546,11 @@
#endif
aboutText +=
- "Sonic Visualiser Copyright © 2005 - 2007 Chris Cannam and
"
+ "
Sonic Visualiser Copyright © 2005 - 2008 Chris Cannam and "
"Queen Mary, University of London.
"
- "This program is free software; you can redistribute it and/or
"
- "modify it under the terms of the GNU General Public License as
"
- "published by the Free Software Foundation; either version 2 of the
"
+ "
This program is free software; you can redistribute it and/or "
+ "modify it under the terms of the GNU General Public License as "
+ "published by the Free Software Foundation; either version 2 of the "
"License, or (at your option) any later version.
See the file "
"COPYING included with this distribution for more information.
";
diff -r 35e438b612ff -r fc542303eda2 main/MainWindow.h
--- a/main/MainWindow.h Fri Nov 30 17:36:14 2007 +0000
+++ b/main/MainWindow.h Wed Feb 27 10:32:45 2008 +0000
@@ -113,11 +113,16 @@
virtual void setInstantsCounterCycle();
virtual void resetInstantsCounters();
- virtual void modelGenerationFailed(QString);
- virtual void modelRegenerationFailed(QString, QString);
+ virtual void modelGenerationFailed(QString, QString);
+ virtual void modelGenerationWarning(QString, QString);
+ virtual void modelRegenerationFailed(QString, QString, QString);
+ virtual void modelRegenerationWarning(QString, QString, QString);
+ virtual void alignmentFailed(QString, QString);
virtual void rightButtonMenuRequested(Pane *, QPoint point);
+ virtual void propertyStacksResized(int);
+
virtual void addPane();
virtual void addLayer();
virtual void renameCurrentLayer();
@@ -132,13 +137,11 @@
virtual void setupRecentTransformsMenu();
virtual void playSpeedChanged(int);
-#ifndef HAVE_RUBBERBAND
- virtual void playSharpenToggled();
- virtual void playMonoToggled();
-#endif
virtual void playSoloToggled();
virtual void alignToggled();
+ virtual void currentPaneChanged(Pane *);
+
virtual void speedUpPlayback();
virtual void slowDownPlayback();
virtual void restoreNormalPlayback();
@@ -167,10 +170,6 @@
Overview *m_overview;
Fader *m_fader;
AudioDial *m_playSpeed;
-#ifndef HAVE_RUBBERBAND
- QPushButton *m_playSharpen;
- QPushButton *m_playMono;
-#endif
WaveformLayer *m_panLayer;
bool m_mainMenusCreated;
@@ -195,34 +194,37 @@
bool m_soloModified;
bool m_prevSolo;
+ QFrame *m_playControlsSpacer;
+ int m_playControlsWidth;
+
QPointer m_preferencesDialog;
QPointer m_layerTreeDialog;
KeyReference *m_keyReference;
- struct PaneConfiguration {
- PaneConfiguration(LayerFactory::LayerType _layer
+ struct LayerConfiguration {
+ LayerConfiguration(LayerFactory::LayerType _layer
= LayerFactory::TimeRuler,
- Model *_source = 0,
- int _channel = -1) :
+ Model *_source = 0,
+ int _channel = -1) :
layer(_layer), sourceModel(_source), channel(_channel) { }
LayerFactory::LayerType layer;
Model *sourceModel;
int channel;
};
- typedef std::map PaneActionMap;
+ typedef std::map PaneActionMap;
PaneActionMap m_paneActions;
+ typedef std::map LayerActionMap;
+ LayerActionMap m_layerActions;
+
typedef std::map TransformActionMap;
TransformActionMap m_transformActions;
typedef std::map TransformActionReverseMap;
TransformActionReverseMap m_transformActionsReverse;
- typedef std::map LayerActionMap;
- LayerActionMap m_layerActions;
-
typedef std::map ExistingLayerActionMap;
ExistingLayerActionMap m_existingLayerActions;
ExistingLayerActionMap m_sliceActions;
@@ -243,7 +245,7 @@
virtual void setupExistingLayersMenus();
virtual void setupToolbars();
- virtual void addPane(const PaneConfiguration &configuration, QString text);
+ virtual void addPane(const LayerConfiguration &configuration, QString text);
virtual void closeEvent(QCloseEvent *e);
virtual bool checkSaveModified();
diff -r 35e438b612ff -r fc542303eda2 main/OSCHandler.cpp
--- a/main/OSCHandler.cpp Fri Nov 30 17:36:14 2007 +0000
+++ b/main/OSCHandler.cpp Wed Feb 27 10:32:45 2008 +0000
@@ -1,3 +1,17 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
+
+/*
+ Sonic Visualiser
+ An audio file viewer and annotation editor.
+ Centre for Digital Music, Queen Mary, University of London.
+ This file copyright 2006-2007 Chris Cannam and QMUL.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. See the file
+ COPYING included with this distribution for more information.
+*/
#include "MainWindow.h"
#include "data/osc/OSCQueue.h"
@@ -12,7 +26,7 @@
#include "audioio/AudioCallbackPlayTarget.h"
#include "framework/Document.h"
#include "data/fileio/WavFileWriter.h"
-#include "plugin/transform/ModelTransformerFactory.h"
+#include "plugin/transform/TransformFactory.h"
#include "widgets/Fader.h"
#include "widgets/AudioDial.h"
@@ -267,9 +281,9 @@
<< "type " << str.toStdString() << std::endl;
} else {
- PaneConfiguration configuration(type,
- getMainModel(),
- channel);
+ LayerConfiguration configuration(type,
+ getMainModel(),
+ channel);
addPane(configuration,
tr("Add %1 Pane")
@@ -482,18 +496,17 @@
message.getArgCount() == 1 &&
message.getArg(0).canConvert(QVariant::String)) {
- TransformId transform = message.getArg(0).toString();
+ TransformId transformId = message.getArg(0).toString();
+ Transform transform = TransformFactory::getInstance()->
+ getDefaultTransformFor(transformId);
+
Layer *newLayer = m_document->createDerivedLayer
- (transform,
- getMainModel(),
- ModelTransformerFactory::getInstance()->getDefaultContextForTransformer
- (transform, getMainModel()),
- "");
+ (transform, getMainModel());
if (newLayer) {
m_document->addLayerToView(pane, newLayer);
- m_recentTransforms.add(transform);
+ m_recentTransforms.add(transformId);
m_paneStack->setCurrentLayer(pane, newLayer);
}
}
diff -r 35e438b612ff -r fc542303eda2 main/PreferencesDialog.cpp
--- a/main/PreferencesDialog.cpp Fri Nov 30 17:36:14 2007 +0000
+++ b/main/PreferencesDialog.cpp Wed Feb 27 10:32:45 2008 +0000
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include "widgets/WindowTypeSelector.h"
#include "widgets/IconLoader.h"
@@ -144,6 +145,13 @@
this, SLOT(tempDirButtonClicked()));
tempDirButton->setFixedSize(QSize(24, 24));
+ QCheckBox *showSplash = new QCheckBox;
+ m_showSplash = prefs->getShowSplash();
+ showSplash->setCheckState(m_showSplash ? Qt::Checked : Qt::Unchecked);
+ connect(showSplash, SIGNAL(stateChanged(int)),
+ this, SLOT(showSplashChanged(int)));
+
+#ifndef Q_WS_MAC
QComboBox *bgMode = new QComboBox;
int bg = prefs->getPropertyRangeAndValue("Background Mode", &min, &max,
&deflt);
@@ -155,6 +163,20 @@
connect(bgMode, SIGNAL(currentIndexChanged(int)),
this, SLOT(backgroundModeChanged(int)));
+#endif
+
+ QSpinBox *fontSize = new QSpinBox;
+ int fs = prefs->getPropertyRangeAndValue("View Font Size", &min, &max,
+ &deflt);
+ m_viewFontSize = fs;
+ fontSize->setMinimum(min);
+ fontSize->setMaximum(max);
+ fontSize->setSuffix(" pt");
+ fontSize->setSingleStep(1);
+ fontSize->setValue(fs);
+
+ connect(fontSize, SIGNAL(valueChanged(int)),
+ this, SLOT(viewFontSizeChanged(int)));
// General tab
@@ -170,10 +192,29 @@
row, 0);
subgrid->addWidget(propertyLayout, row++, 1, 1, 2);
+#ifndef Q_WS_MAC
subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
("Background Mode"))),
row, 0);
subgrid->addWidget(bgMode, row++, 1, 1, 2);
+#endif
+
+ subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
+ ("View Font Size"))),
+ row, 0);
+ subgrid->addWidget(fontSize, row++, 1, 1, 2);
+
+ subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
+ ("Show Splash Screen"))),
+ row, 0);
+ subgrid->addWidget(showSplash, row++, 1, 1, 1);
+
+ subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
+ ("Temporary Directory Root"))),
+ row, 0);
+ subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1);
+ subgrid->addWidget(tempDirButton, row, 2, 1, 1);
+ row++;
subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
("Resample On Load"))),
@@ -185,13 +226,6 @@
row, 0);
subgrid->addWidget(resampleQuality, row++, 1, 1, 2);
- subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
- ("Temporary Directory Root"))),
- row, 0);
- subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1);
- subgrid->addWidget(tempDirButton, row, 2, 1, 1);
- row++;
-
subgrid->setRowStretch(row, 10);
tab->addTab(frame, tr("&General"));
@@ -288,6 +322,14 @@
}
void
+PreferencesDialog::showSplashChanged(int state)
+{
+ m_showSplash = (state == Qt::Checked);
+ m_applyButton->setEnabled(true);
+ m_changesOnRestart = true;
+}
+
+void
PreferencesDialog::tempDirRootChanged(QString r)
{
m_tempDirRoot = r;
@@ -315,6 +357,13 @@
}
void
+PreferencesDialog::viewFontSizeChanged(int sz)
+{
+ m_viewFontSize = sz;
+ m_applyButton->setEnabled(true);
+}
+
+void
PreferencesDialog::okClicked()
{
applyClicked();
@@ -333,8 +382,10 @@
prefs->setTuningFrequency(m_tuningFrequency);
prefs->setResampleQuality(m_resampleQuality);
prefs->setResampleOnLoad(m_resampleOnLoad);
+ prefs->setShowSplash(m_showSplash);
prefs->setTemporaryDirectoryRoot(m_tempDirRoot);
prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode));
+ prefs->setViewFontSize(m_viewFontSize);
m_applyButton->setEnabled(false);
diff -r 35e438b612ff -r fc542303eda2 main/PreferencesDialog.h
--- a/main/PreferencesDialog.h Fri Nov 30 17:36:14 2007 +0000
+++ b/main/PreferencesDialog.h Wed Feb 27 10:32:45 2008 +0000
@@ -44,6 +44,8 @@
void resampleOnLoadChanged(int state);
void tempDirRootChanged(QString root);
void backgroundModeChanged(int mode);
+ void viewFontSizeChanged(int sz);
+ void showSplashChanged(int state);
void tempDirButtonClicked();
@@ -65,6 +67,8 @@
bool m_resampleOnLoad;
QString m_tempDirRoot;
int m_backgroundMode;
+ int m_viewFontSize;
+ bool m_showSplash;
bool m_changesOnRestart;
};
diff -r 35e438b612ff -r fc542303eda2 main/main.cpp
--- a/main/main.cpp Fri Nov 30 17:36:14 2007 +0000
+++ b/main/main.cpp Wed Feb 27 10:32:45 2008 +0000
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#include
#include
@@ -53,7 +54,11 @@
Document, SVFileReader
- Turning one model (e.g. audio) into another (e.g. more audio, or a
- curve extracted from it): Transform and subclasses
+ curve extracted from it): Transform, encapsulating the data that need
+ to be stored to be able to reproduce a given transformation;
+ TransformFactory, for discovering the available types of transform;
+ ModelTransformerFactory, ModelTransformer and subclasses, providing
+ the mechanisms for applying transforms to data models
- Creating the plugins used by transforms: RealTimePluginFactory,
FeatureExtractionPluginFactory. See also the API documentation for
@@ -229,6 +234,18 @@
QApplication::setOrganizationDomain("sonicvisualiser.org");
QApplication::setApplicationName(QApplication::tr("Sonic Visualiser"));
+ QPixmap pixmap(":/icons/sv-splash.png");
+ QSplashScreen splash(pixmap);
+
+ QSettings settings;
+
+ settings.beginGroup("Preferences");
+ if (settings.value("show-splash", true).toBool()) {
+ splash.show();
+ application.processEvents();
+ }
+ settings.endGroup();
+
QIcon icon;
int sizes[] = { 16, 22, 24, 32, 48, 64, 128 };
for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) {
@@ -277,7 +294,6 @@
if (height < 450) height = available.height() * 2 / 3;
if (width > height * 2) width = height * 2;
- QSettings settings;
settings.beginGroup("MainWindow");
QSize size = settings.value("size", QSize(width, height)).toSize();
gui->resize(size);
@@ -351,6 +367,7 @@
settings.endGroup();
#endif
+ splash.finish(gui);
/*
TipDialog tipDialog;
diff -r 35e438b612ff -r fc542303eda2 sonic-visualiser.qrc
--- a/sonic-visualiser.qrc Fri Nov 30 17:36:14 2007 +0000
+++ b/sonic-visualiser.qrc Wed Feb 27 10:32:45 2008 +0000
@@ -69,6 +69,7 @@
icons/cross.png
icons/normalise.png
icons/normalise-columns.png
+ icons/invert-vertical.png
icons/show-peaks.png
icons/sv-16x16.png
icons/sv-22x22.png
@@ -77,6 +78,7 @@
icons/sv-48x48.png
icons/sv-64x64.png
icons/sv-128x128.png
+ icons/sv-splash.png
samples/bass.wav
samples/beep.wav
samples/bounce.wav
diff -r 35e438b612ff -r fc542303eda2 sv.pro
--- a/sv.pro Fri Nov 30 17:36:14 2007 +0000
+++ b/sv.pro Wed Feb 27 10:32:45 2008 +0000
@@ -1,7 +1,7 @@
TEMPLATE = app
-SV_UNIT_PACKAGES = vamp vamp-hostsdk fftw3f samplerate jack portaudio mad id3tag oggz fishsound lrdf raptor sndfile liblo
+SV_UNIT_PACKAGES = vamp vamp-hostsdk rubberband fftw3 fftw3f samplerate jack portaudio mad id3tag oggz fishsound lrdf raptor sndfile liblo
load(../sv.prf)
CONFIG += sv qt thread warn_on stl rtti exceptions