Mercurial > hg > sonic-visualiser
comparison main/main.cpp @ 245:fc542303eda2 1.2-stable
* merge from trunk (1.2 ended up being tracked from trunk, but we may want
this branch for fixes later)
| author | Chris Cannam |
|---|---|
| date | Wed, 27 Feb 2008 10:32:45 +0000 |
| parents | 35e438b612ff |
| children |
comparison
equal
deleted
inserted
replaced
| 223:35e438b612ff | 245:fc542303eda2 |
|---|---|
| 30 #include <QLocale> | 30 #include <QLocale> |
| 31 #include <QSettings> | 31 #include <QSettings> |
| 32 #include <QIcon> | 32 #include <QIcon> |
| 33 #include <QSessionManager> | 33 #include <QSessionManager> |
| 34 #include <QDir> | 34 #include <QDir> |
| 35 #include <QSplashScreen> | |
| 35 | 36 |
| 36 #include <iostream> | 37 #include <iostream> |
| 37 #include <signal.h> | 38 #include <signal.h> |
| 38 | 39 |
| 39 #ifdef HAVE_FFTW3F | 40 #ifdef HAVE_FFTW3F |
| 51 | 52 |
| 52 - Main window class, document class, and file parser: MainWindow, | 53 - Main window class, document class, and file parser: MainWindow, |
| 53 Document, SVFileReader | 54 Document, SVFileReader |
| 54 | 55 |
| 55 - Turning one model (e.g. audio) into another (e.g. more audio, or a | 56 - Turning one model (e.g. audio) into another (e.g. more audio, or a |
| 56 curve extracted from it): Transform and subclasses | 57 curve extracted from it): Transform, encapsulating the data that need |
| 58 to be stored to be able to reproduce a given transformation; | |
| 59 TransformFactory, for discovering the available types of transform; | |
| 60 ModelTransformerFactory, ModelTransformer and subclasses, providing | |
| 61 the mechanisms for applying transforms to data models | |
| 57 | 62 |
| 58 - Creating the plugins used by transforms: RealTimePluginFactory, | 63 - Creating the plugins used by transforms: RealTimePluginFactory, |
| 59 FeatureExtractionPluginFactory. See also the API documentation for | 64 FeatureExtractionPluginFactory. See also the API documentation for |
| 60 Vamp feature extraction plugins at | 65 Vamp feature extraction plugins at |
| 61 http://www.vamp-plugins.org/code-doc/. | 66 http://www.vamp-plugins.org/code-doc/. |
| 227 | 232 |
| 228 QApplication::setOrganizationName("sonic-visualiser"); | 233 QApplication::setOrganizationName("sonic-visualiser"); |
| 229 QApplication::setOrganizationDomain("sonicvisualiser.org"); | 234 QApplication::setOrganizationDomain("sonicvisualiser.org"); |
| 230 QApplication::setApplicationName(QApplication::tr("Sonic Visualiser")); | 235 QApplication::setApplicationName(QApplication::tr("Sonic Visualiser")); |
| 231 | 236 |
| 237 QPixmap pixmap(":/icons/sv-splash.png"); | |
| 238 QSplashScreen splash(pixmap); | |
| 239 | |
| 240 QSettings settings; | |
| 241 | |
| 242 settings.beginGroup("Preferences"); | |
| 243 if (settings.value("show-splash", true).toBool()) { | |
| 244 splash.show(); | |
| 245 application.processEvents(); | |
| 246 } | |
| 247 settings.endGroup(); | |
| 248 | |
| 232 QIcon icon; | 249 QIcon icon; |
| 233 int sizes[] = { 16, 22, 24, 32, 48, 64, 128 }; | 250 int sizes[] = { 16, 22, 24, 32, 48, 64, 128 }; |
| 234 for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) { | 251 for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) { |
| 235 icon.addFile(QString(":icons/sv-%1x%2.png").arg(sizes[i]).arg(sizes[i])); | 252 icon.addFile(QString(":icons/sv-%1x%2.png").arg(sizes[i]).arg(sizes[i])); |
| 236 } | 253 } |
| 275 int width = available.width() * 2 / 3; | 292 int width = available.width() * 2 / 3; |
| 276 int height = available.height() / 2; | 293 int height = available.height() / 2; |
| 277 if (height < 450) height = available.height() * 2 / 3; | 294 if (height < 450) height = available.height() * 2 / 3; |
| 278 if (width > height * 2) width = height * 2; | 295 if (width > height * 2) width = height * 2; |
| 279 | 296 |
| 280 QSettings settings; | |
| 281 settings.beginGroup("MainWindow"); | 297 settings.beginGroup("MainWindow"); |
| 282 QSize size = settings.value("size", QSize(width, height)).toSize(); | 298 QSize size = settings.value("size", QSize(width, height)).toSize(); |
| 283 gui->resize(size); | 299 gui->resize(size); |
| 284 if (settings.contains("position")) { | 300 if (settings.contains("position")) { |
| 285 gui->move(settings.value("position").toPoint()); | 301 gui->move(settings.value("position").toPoint()); |
| 349 fftwf_import_wisdom_from_string(wisdom.toLocal8Bit().data()); | 365 fftwf_import_wisdom_from_string(wisdom.toLocal8Bit().data()); |
| 350 } | 366 } |
| 351 settings.endGroup(); | 367 settings.endGroup(); |
| 352 #endif | 368 #endif |
| 353 | 369 |
| 370 splash.finish(gui); | |
| 354 | 371 |
| 355 /* | 372 /* |
| 356 TipDialog tipDialog; | 373 TipDialog tipDialog; |
| 357 if (tipDialog.isOK()) { | 374 if (tipDialog.isOK()) { |
| 358 tipDialog.exec(); | 375 tipDialog.exec(); |
