changeset 715:62811ec41cbf library_integration

Merge from the default branch
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Mon, 17 Oct 2011 14:10:28 +0100
parents eb741b4e8d21 (diff) 7f76499ef4f2 (current diff)
children c10853ea9b71
files
diffstat 5 files changed, 53 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/base/AudioPlaySource.h	Mon Oct 17 11:57:25 2011 +0100
+++ b/base/AudioPlaySource.h	Mon Oct 17 14:10:28 2011 +0100
@@ -96,6 +96,11 @@
      */
     virtual void setAuditioningEffect(Auditionable *) = 0;
 
+    /**
+     * Request spontaneous playback of a single short note of the
+     * given pitch.
+     */
+    virtual void queueExampleNote(int midiPitch) = 0;
 };
 
 #endif
--- a/base/Preferences.cpp	Mon Oct 17 11:57:25 2011 +0100
+++ b/base/Preferences.cpp	Mon Oct 17 14:10:28 2011 +0100
@@ -47,7 +47,8 @@
     m_viewFontSize(10),
     m_backgroundMode(BackgroundFromTheme),
     m_timeToTextMode(TimeToTextMs),
-    m_showSplash(true)
+    m_showSplash(true),
+    m_startInMiniMode(false)
 {
     QSettings settings;
     settings.beginGroup("Preferences");
@@ -68,6 +69,7 @@
         (settings.value("time-to-text-mode", int(TimeToTextMs)).toInt());
     m_viewFontSize = settings.value("view-font-size", 10).toInt();
     m_showSplash = settings.value("show-splash", true).toBool();
+    m_startInMiniMode = settings.value("start-in-mini-mode", false).toBool();
     settings.endGroup();
 
     settings.beginGroup("TempDirectory");
@@ -96,6 +98,7 @@
     props.push_back("Time To Text Mode");
     props.push_back("View Font Size");
     props.push_back("Show Splash Screen");
+    props.push_back("Start In Minimal Mode");
     return props;
 }
 
@@ -141,6 +144,9 @@
     if (name == "Show Splash Screen") {
         return tr("Show splash screen on startup");
     }
+    if (name == "Start In Minimal Mode") {
+        return tr("Start Sonic Visualiser in minimal mode");
+    }
     return name;
 }
 
@@ -187,6 +193,9 @@
     if (name == "Show Splash Screen") {
         return ToggleProperty;
     }
+    if (name == "Start In Minimal Mode") {
+        return ToggleProperty;
+    }
     return InvalidProperty;
 }
 
@@ -259,6 +268,10 @@
         if (deflt) *deflt = 1;
     }
 
+    if (name == "Start In Minimal Mode") {
+        if (deflt) *deflt = 0;
+    }
+
     return 0;
 }
 
@@ -363,6 +376,8 @@
         setViewFontSize(value);
     } else if (name == "Show Splash Screen") {
         setShowSplash(value ? true : false);
+    } else if (name == "Start In Minimal Mode") {
+        setStartInMiniMode(value ? true : false);
     }
 }
 
@@ -553,4 +568,19 @@
         emit propertyChanged("Show Splash Screen");
     }
 }
+
+void
+Preferences::setStartInMiniMode(bool show)
+{
+    if (m_startInMiniMode != show) {
+
+        m_startInMiniMode = show;
+
+        QSettings settings;
+        settings.beginGroup("Preferences");
+        settings.setValue("start-in-mini-mode", show);
+        settings.endGroup();
+        emit propertyChanged("Start Sonic Visualiser in minimal mode");
+    }
+}
         
--- a/base/Preferences.h	Mon Oct 17 11:57:25 2011 +0100
+++ b/base/Preferences.h	Mon Oct 17 14:10:28 2011 +0100
@@ -88,6 +88,8 @@
 
     bool getShowSplash() const { return m_showSplash; }
 
+    bool getStartInMiniMode() const { return m_startInMiniMode; }
+
 public slots:
     virtual void setProperty(const PropertyName &, int);
 
@@ -105,6 +107,8 @@
     void setViewFontSize(int size);
     void setShowSplash(bool);
 
+    void setStartInMiniMode(bool);
+
 private:
     Preferences(); // may throw DirectoryCreationFailed
     virtual ~Preferences();
@@ -124,6 +128,8 @@
     BackgroundMode m_backgroundMode;
     TimeToTextMode m_timeToTextMode;
     bool m_showSplash;
+
+    bool m_startInMiniMode;
 };
 
 #endif
--- a/rdf/RDFFeatureWriter.cpp	Mon Oct 17 11:57:25 2011 +0100
+++ b/rdf/RDFFeatureWriter.cpp	Mon Oct 17 14:10:28 2011 +0100
@@ -75,10 +75,11 @@
     p.hasArg = true;
     pl.push_back(p);
 
-    p.name = "network";
-    p.description = "Attempt to retrieve RDF descriptions of plugins from network, if not available locally";
-    p.hasArg = false;
-    pl.push_back(p);
+    //mathieub: remove this functionality for the library edition
+    //p.name = "network";
+    //p.description = "Attempt to retrieve RDF descriptions of plugins from network, if not available locally";
+    //p.hasArg = false;
+    //pl.push_back(p);
     
     return pl;
 }
@@ -102,9 +103,10 @@
         if (i->first == "maker-uri") {
             m_userMakerUri = i->second.c_str();
         }
-        if (i->first == "network") {
-            m_network = true;
-        }
+        //mathieub: remove this functionality for the library edition
+        //if (i->first == "network") {
+        //    m_network = true;
+        //}
     }
 }
 
--- a/system/System.h	Mon Oct 17 11:57:25 2011 +0100
+++ b/system/System.h	Mon Oct 17 14:10:28 2011 +0100
@@ -57,12 +57,12 @@
 #define getpid _getpid
 
 extern "C" {
-void usleep(unsigned long usec);
+//void usleep(unsigned long usec); //uncomment for osx compilation
 int gettimeofday(struct timeval *p, void *tz);
 }
 
 #define ISNAN _isnan
-#define ISINF _isinf
+#define ISINF std::isinf //replace with _isinf for osx compilation
 
 #else