changeset 231:e8a7a935128e

* add splash screen
author Chris Cannam
date Wed, 23 Jan 2008 11:38:34 +0000
parents 1000222cd8f1
children 99e0dfd3ea75
files icons/sv-splash.png icons/sv-splash.svg main/MainWindow.cpp main/main.cpp sonic-visualiser.qrc
diffstat 5 files changed, 147 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
Binary file icons/sv-splash.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/sv-splash.svg	Wed Jan 23 11:38:34 2008 +0000
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="640px"
+   height="480px"
+   id="svg1952"
+   sodipodi:version="0.32"
+   inkscape:version="0.44.1"
+   sodipodi:docbase="/home/studio/code/sonic-visualiser/sv/icons"
+   sodipodi:docname="sv-splash.svg"
+   inkscape:export-filename="/home/studio/code/sonic-visualiser/sv/icons/sv-splash.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs1954" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="320"
+     inkscape:cy="240"
+     inkscape:current-layer="layer1"
+     inkscape:document-units="px"
+     showgrid="true"
+     inkscape:window-width="1101"
+     inkscape:window-height="969"
+     inkscape:window-x="169"
+     inkscape:window-y="26" />
+  <metadata
+     id="metadata1957">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <rect
+       style="fill:white;fill-opacity:1;stroke:black;stroke-width:5.70384979;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3849"
+       width="578.29614"
+       height="316.29614"
+       x="28.851925"
+       y="57.851925" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#d45500;stroke-width:7.58643961px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 226.71778,185.52035 C 407.22042,185.52035 407.22042,185.52035 407.22042,185.52035"
+       id="path4036" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:10.28721237;stroke-linecap:butt;stroke-linejoin:miter;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:1.39999998;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 228.89103,185.52402 C 255.18599,185.52402 258.59857,185.60302 258.59857,185.60302 C 270.76871,133.56701 271.36497,127.54591 274.66485,178.25451 C 279.70514,266.89367 284.18048,220.02667 290.61951,183.64501 C 302.75722,68.043355 303.99332,111.5005 306.56423,135.80647 C 316.45027,256.01216 316.0237,282.95104 321.30811,243.02856 C 325.23523,213.36022 336.92287,88.29917 339.01862,122.7736 C 353.59512,259.79486 354.02613,251.94928 358.50413,216.49781 C 373.27326,77.656444 368.76189,188.69998 377.97144,186.27485 C 404.04172,186.27485 403.59893,185.60302 403.59893,185.60302 L 407.00661,185.60302"
+       id="path3783"
+       sodipodi:nodetypes="cccccsccccc" />
+    <rect
+       style="fill:none;stroke:#d45500;stroke-width:15.17287922;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3775"
+       width="191.29092"
+       height="187.44695"
+       x="223.48573"
+       y="91.460907" />
+    <text
+       xml:space="preserve"
+       style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Korataki"
+       x="59"
+       y="330"
+       id="text2049"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan2051"
+         x="59"
+         y="330">SONIC VISUALISER</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Korataki"
+       x="84.300003"
+       y="352"
+       id="text2053"
+       sodipodi:linespacing="100%"><tspan
+         sodipodi:role="line"
+         id="tspan2055"
+         x="84.300003"
+         y="352">QUEEN MARY, UNIVERSITY OF LONDON</tspan></text>
+  </g>
+</svg>
--- a/main/MainWindow.cpp	Wed Jan 09 17:09:44 2008 +0000
+++ b/main/MainWindow.cpp	Wed Jan 23 11:38:34 2008 +0000
@@ -921,9 +921,11 @@
     for (unsigned int i = 0;
 	 i < sizeof(backgroundTypes)/sizeof(backgroundTypes[0]); ++i) {
 
-	for (int menuType = 0; menuType <= 1; ++menuType) { // pane, layer
-
-	    if (menuType == 0) menu = m_paneMenu;
+        const int paneMenuType = 0, layerMenuType = 1;
+
+	for (int menuType = paneMenuType; menuType <= layerMenuType; ++menuType) {
+
+	    if (menuType == paneMenuType) menu = m_paneMenu;
 	    else menu = m_layerMenu;
 
 	    QMenu *submenu = 0;
@@ -938,7 +940,7 @@
             case LayerFactory::Waveform:
                 icon = il.load("waveform");
                 mainText = tr("Add &Waveform");
-                if (menuType == 0) {
+                if (menuType == paneMenuType) {
                     shortcutText = tr("W");
                     tipText = tr("Add a new pane showing a waveform view");
                 } else {
@@ -950,7 +952,7 @@
             case LayerFactory::Spectrogram:
                 icon = il.load("spectrogram");
                 mainText = tr("Add Spectro&gram");
-                if (menuType == 0) {
+                if (menuType == paneMenuType) {
                     shortcutText = tr("G");
                     tipText = tr("Add a new pane showing a spectrogram");
                 } else {
@@ -961,7 +963,7 @@
             case LayerFactory::MelodicRangeSpectrogram:
                 icon = il.load("spectrogram");
                 mainText = tr("Add &Melodic Range Spectrogram");
-                if (menuType == 0) {
+                if (menuType == paneMenuType) {
                     shortcutText = tr("M");
                     tipText = tr("Add a new pane showing a spectrogram set up for an overview of note pitches");
                 } else {
@@ -972,7 +974,7 @@
             case LayerFactory::PeakFrequencySpectrogram:
                 icon = il.load("spectrogram");
                 mainText = tr("Add Pea&k Frequency Spectrogram");
-                if (menuType == 0) {
+                if (menuType == paneMenuType) {
                     shortcutText = tr("K");
                     tipText = tr("Add a new pane showing a spectrogram set up for tracking frequencies");
                 } else {
@@ -983,7 +985,7 @@
             case LayerFactory::Spectrum:
                 icon = il.load("spectrum");
                 mainText = tr("Add Spectr&um");
-                if (menuType == 0) {
+                if (menuType == paneMenuType) {
                     shortcutText = tr("U");
                     tipText = tr("Add a new pane showing a frequency spectrum");
                 } else {
@@ -995,11 +997,11 @@
             }
 
             std::vector<Model *> candidateModels;
-            if (menuType == 0) {
+//            if (menuType == paneMenuType) {
                 candidateModels = models;
-            } else {
-                candidateModels.push_back(0);
-            }
+//            } else {
+//                candidateModels.push_back(0);
+//            }
             
             for (std::vector<Model *>::iterator mi =
                      candidateModels.begin();
@@ -1024,22 +1026,22 @@
                     bool isDefault = (c == 0);
                     bool isOnly = (isDefault && (channels == 1));
 
-                    if (menuType == 1) {
-                        if (isDefault) isOnly = true;
-                        else continue;
-                    }
-
-                    if (isOnly && (!plural || menuType == 1)) {
-
-                        if (menuType == 1 && type != LayerFactory::Waveform) {
-                            action = new QAction(mainText, this);
-                        } else {
+//                    if (menuType == layerMenuType) {
+//                        if (isDefault) isOnly = true;
+//                        else continue;
+//                    }
+
+                    if (isOnly && (!plural /*|| menuType == layerMenuType*/)) {
+
+//                        if (menuType == layerMenuType && type != LayerFactory::Waveform) {
+//                            action = new QAction(mainText, this);
+//                        } else {
                             action = new QAction(icon, mainText, this);
-                        }                            
+//                        }                            
 
                         action->setShortcut(shortcutText);
                         action->setStatusTip(tipText);
-                        if (menuType == 0) {
+                        if (menuType == paneMenuType) {
                             connect(action, SIGNAL(triggered()),
                                     this, SLOT(addPane()));
                             connect(this, SIGNAL(canAddPane(bool)),
@@ -1094,7 +1096,7 @@
 
                         action->setStatusTip(tipText);
 
-                        if (menuType == 0) {
+                        if (menuType == paneMenuType) {
                             connect(action, SIGNAL(triggered()),
                                     this, SLOT(addPane()));
                             connect(this, SIGNAL(canAddPane(bool)),
@@ -3445,7 +3447,7 @@
     QString aboutText;
 
     aboutText += tr("<h3>About Sonic Visualiser</h3>");
-    aboutText += tr("<p>Sonic Visualiser is a program for viewing and exploring audio data for<br>semantic music analysis and annotation.</p>");
+    aboutText += tr("<p>Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.</p>");
     aboutText += tr("<p>%1 : %2 configuration</p>")
         .arg(version)
         .arg(debug ? tr("Debug") : tr("Release"));
@@ -3527,11 +3529,11 @@
 #endif
 
     aboutText += 
-        "<p>Sonic Visualiser Copyright &copy; 2005 - 2007 Chris Cannam and<br>"
+        "<p>Sonic Visualiser Copyright &copy; 2005 - 2008 Chris Cannam and "
         "Queen Mary, University of London.</p>"
-        "<p>This program is free software; you can redistribute it and/or<br>"
-        "modify it under the terms of the GNU General Public License as<br>"
-        "published by the Free Software Foundation; either version 2 of the<br>"
+        "<p>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.<br>See the file "
         "COPYING included with this distribution for more information.</p>";
     
--- a/main/main.cpp	Wed Jan 09 17:09:44 2008 +0000
+++ b/main/main.cpp	Wed Jan 23 11:38:34 2008 +0000
@@ -32,6 +32,7 @@
 #include <QIcon>
 #include <QSessionManager>
 #include <QDir>
+#include <QSplashScreen>
 
 #include <iostream>
 #include <signal.h>
@@ -229,6 +230,17 @@
     QApplication::setOrganizationDomain("sonicvisualiser.org");
     QApplication::setApplicationName(QApplication::tr("Sonic Visualiser"));
 
+    QPixmap pixmap(":/icons/sv-splash.png");
+    QSplashScreen splash(pixmap);
+
+    QSettings settings;
+    settings.beginGroup("MainWindow");
+    
+    if (settings.value("showsplash", true).toBool()) {
+        splash.show();
+        application.processEvents();
+    }
+
     QIcon icon;
     int sizes[] = { 16, 22, 24, 32, 48, 64, 128 };
     for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) {
@@ -277,8 +289,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);
     if (settings.contains("position")) {
@@ -351,6 +361,7 @@
     settings.endGroup();
 #endif
 
+    splash.finish(gui);
 
 /*
     TipDialog tipDialog;
--- a/sonic-visualiser.qrc	Wed Jan 09 17:09:44 2008 +0000
+++ b/sonic-visualiser.qrc	Wed Jan 23 11:38:34 2008 +0000
@@ -77,6 +77,7 @@
     <file>icons/sv-48x48.png</file>
     <file>icons/sv-64x64.png</file>
     <file>icons/sv-128x128.png</file>
+    <file>icons/sv-splash.png</file>
     <file>samples/bass.wav</file>
     <file>samples/beep.wav</file>
     <file>samples/bounce.wav</file>