changeset 137:006c90387f40

* Fix many compile warnings, remove some debug output
author Chris Cannam
date Mon, 30 Apr 2007 13:36:23 +0000
parents 37c26877ca5f
children 834ff910e3d2
files audioio/AudioCallbackPlaySource.cpp audioio/AudioPortAudioTarget.cpp audioio/PhaseVocoderTimeStretcher.cpp document/Document.cpp document/SVFileReader.cpp document/SVFileReader.h main/MainWindow.cpp main/main.cpp transform/FeatureExtractionPluginTransform.cpp transform/RealTimePluginTransform.cpp transform/TransformFactory.cpp
diffstat 11 files changed, 47 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/audioio/AudioCallbackPlaySource.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -400,7 +400,7 @@
 }
 
 void
-AudioCallbackPlaySource::playParametersChanged(PlayParameters *params)
+AudioCallbackPlaySource::playParametersChanged(PlayParameters *)
 {
     clearRingBuffers();
 }
@@ -509,8 +509,8 @@
     MultiSelection::SelectionList selections = m_viewManager->getSelections();
     MultiSelection::SelectionList::const_iterator i;
 
-    i = selections.begin();
-    size_t rangeStart = i->getStartFrame();
+//    i = selections.begin();
+//    size_t rangeStart = i->getStartFrame();
 
     i = selections.end();
     --i;
--- a/audioio/AudioPortAudioTarget.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/audioio/AudioPortAudioTarget.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -159,7 +159,7 @@
 			      PaTimestamp)
 #else
 int
-AudioPortAudioTarget::process(const void *inputBuffer, void *outputBuffer,
+AudioPortAudioTarget::process(const void *, void *outputBuffer,
                               unsigned long nframes,
                               const PaStreamCallbackTimeInfo *,
                               PaStreamCallbackFlags)
@@ -184,7 +184,7 @@
     // Because we offer pan, we always want at least 2 channels
     if (sourceChannels < 2) sourceChannels = 2;
 
-    if (!tmpbuf || tmpbufch != sourceChannels || tmpbufsz < m_bufferSize) {
+    if (!tmpbuf || tmpbufch != sourceChannels || int(tmpbufsz) < m_bufferSize) {
 
 	if (tmpbuf) {
 	    for (size_t i = 0; i < tmpbufch; ++i) {
--- a/audioio/PhaseVocoderTimeStretcher.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/audioio/PhaseVocoderTimeStretcher.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -163,7 +163,7 @@
         m_n1 = lrintf(m_n2 / m_ratio);
         if (m_n1 == 0) {
             m_n1 = 1;
-            m_n2 = m_ratio;
+            m_n2 = lrintf(m_ratio);
         }
     }
 
@@ -378,7 +378,6 @@
             if (m_totalCount > 50 && m_transientCount < m_totalCount) {
 
                 int fixed = lrintf(m_transientCount * m_n1);
-                int squashy = m_n2sum - fixed;
 
                 int idealTotal = lrintf(m_totalCount * m_n1 * m_ratio);
                 int idealSquashy = idealTotal - fixed;
@@ -542,7 +541,7 @@
 //        count > m_prevTransientScore * 1.2) {
     if (count > m_prevTransientScore &&
         count > m_transientThreshold &&
-        count - m_prevTransientScore > m_wlen / 20) {
+        count - m_prevTransientScore > int(m_wlen) / 20) {
         isTransient = true;
 
 
--- a/document/Document.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/document/Document.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -240,12 +240,12 @@
 	Layer *layer = *i;
 	Model *model = layer->getModel();
 
-        std::cerr << "Document::setMainModel: inspecting model "
-                  << (model ? model->objectName().toStdString() : "(null)") << " in layer "
-                  << layer->objectName().toStdString() << std::endl;
+//        std::cerr << "Document::setMainModel: inspecting model "
+//                  << (model ? model->objectName().toStdString() : "(null)") << " in layer "
+//                  << layer->objectName().toStdString() << std::endl;
 
 	if (model == oldMainModel) {
-            std::cerr << "... it uses the old main model, replacing" << std::endl;
+//            std::cerr << "... it uses the old main model, replacing" << std::endl;
 	    LayerFactory::getInstance()->setModel(layer, m_mainModel);
 	    continue;
 	}
@@ -260,7 +260,7 @@
 	    
 	if (m_models[model].source == oldMainModel) {
 
-            std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl;
+//            std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl;
 
 	    // This model was derived from the previous main
 	    // model: regenerate it.
@@ -533,10 +533,10 @@
 {
     Model *model = layer->getModel();
     if (!model) {
-	std::cerr << "Document::addLayerToView: Layer (\""
-                  << layer->objectName().toStdString()
-                  << "\") with no model being added to view: "
-                  << "normally you want to set the model first" << std::endl;
+//	std::cerr << "Document::addLayerToView: Layer (\""
+//                  << layer->objectName().toStdString()
+//                  << "\") with no model being added to view: "
+//                  << "normally you want to set the model first" << std::endl;
     } else {
 	if (model != m_mainModel &&
 	    m_models.find(model) == m_models.end()) {
--- a/document/SVFileReader.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/document/SVFileReader.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -797,8 +797,8 @@
     if (nm) {
 	float value = 0.0;
 	value = attributes.value("value").trimmed().toFloat(&ok);
-	float duration = 0.0;
-	duration = attributes.value("duration").trimmed().toFloat(&ok);
+	size_t duration = 0;
+	duration = attributes.value("duration").trimmed().toUInt(&ok);
 	QString label = attributes.value("label");
 	nm->addPoint(NoteModel::Point(frame, value, duration, label));
 	return ok;
@@ -1064,3 +1064,7 @@
     return true;
 }
 
+SVFileReaderPaneCallback::~SVFileReaderPaneCallback()
+{
+}
+
--- a/document/SVFileReader.h	Mon Apr 30 09:34:13 2007 +0000
+++ b/document/SVFileReader.h	Mon Apr 30 13:36:23 2007 +0000
@@ -32,6 +32,7 @@
 class SVFileReaderPaneCallback
 {
 public:
+    virtual ~SVFileReaderPaneCallback();
     virtual Pane *addPane() = 0;
     virtual void setWindowSize(int width, int height) = 0;
     virtual void addSelection(int start, int end) = 0;
--- a/main/MainWindow.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/main/MainWindow.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -292,7 +292,7 @@
 
 MainWindow::~MainWindow()
 {
-    std::cerr << "MainWindow::~MainWindow()" << std::endl;
+//    std::cerr << "MainWindow::~MainWindow()" << std::endl;
 
     if (!m_abandoning) {
         closeSession();
@@ -1418,7 +1418,7 @@
 	    Layer *layer = pane->getLayer(j);
 	    if (!layer) continue;
 	    if (observedLayers.find(layer) != observedLayers.end()) {
-		std::cerr << "found duplicate layer " << layer << std::endl;
+//		std::cerr << "found duplicate layer " << layer << std::endl;
 		continue;
 	    }
 
@@ -1436,7 +1436,7 @@
 
     map<QString, int> observedNames;
 
-    for (int i = 0; i < orderedLayers.size(); ++i) {
+    for (size_t i = 0; i < orderedLayers.size(); ++i) {
 	
         Layer *layer = orderedLayers[i];
 
@@ -2897,16 +2897,16 @@
 void
 MainWindow::closeEvent(QCloseEvent *e)
 {
-    std::cerr << "MainWindow::closeEvent" << std::endl;
+//    std::cerr << "MainWindow::closeEvent" << std::endl;
 
     if (m_openingAudioFile) {
-        std::cerr << "Busy - ignoring close event" << std::endl;
+//        std::cerr << "Busy - ignoring close event" << std::endl;
 	e->ignore();
 	return;
     }
 
     if (!m_abandoning && !checkSaveModified()) {
-        std::cerr << "Ignoring close event" << std::endl;
+//        std::cerr << "Ignoring close event" << std::endl;
 	e->ignore();
 	return;
     }
@@ -3797,7 +3797,7 @@
 }
 
 void
-MainWindow::globalCentreFrameChanged(unsigned long frame)
+MainWindow::globalCentreFrameChanged(unsigned long )
 {
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
     Pane *p = 0;
@@ -3807,7 +3807,7 @@
 }
 
 void
-MainWindow::viewCentreFrameChanged(View *v, unsigned long frame)
+MainWindow::viewCentreFrameChanged(View *v, unsigned long )
 {
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
     Pane *p = 0;
@@ -3816,7 +3816,7 @@
 }
 
 void
-MainWindow::viewZoomLevelChanged(View *v, unsigned long zoom, bool locked)
+MainWindow::viewZoomLevelChanged(View *v, unsigned long , bool )
 {
     if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
     Pane *p = 0;
@@ -3906,7 +3906,7 @@
 }
 
 void
-MainWindow::layerAdded(Layer *layer)
+MainWindow::layerAdded(Layer *)
 {
 //    std::cerr << "MainWindow::layerAdded(" << layer << ")" << std::endl;
 //    setupExistingLayersMenu();
@@ -3914,7 +3914,7 @@
 }
 
 void
-MainWindow::layerRemoved(Layer *layer)
+MainWindow::layerRemoved(Layer *)
 {
 //    std::cerr << "MainWindow::layerRemoved(" << layer << ")" << std::endl;
     setupExistingLayersMenus();
@@ -4103,7 +4103,7 @@
             n = message.getArg(0).toInt() - 1;
         }
         std::vector<QString> recent = m_recentFiles.getRecent();
-        if (n >= 0 && n < recent.size()) {
+        if (n >= 0 && n < int(recent.size())) {
             if (openSomeFile(recent[n], ReplaceMainModel) != FileOpenSucceeded) {
                 std::cerr << "MainWindow::handleOSCMessage: File open failed for path \""
                           << recent[n].toStdString() << "\"" << std::endl;
@@ -4280,7 +4280,7 @@
                     message.getArg(0).canConvert(QVariant::Int)) {
                     channel = message.getArg(0).toInt();
                     if (channel < -1 ||
-                        channel > getMainModel()->getChannelCount()) {
+                        channel > int(getMainModel()->getChannelCount())) {
                         std::cerr << "WARNING: MainWindow::handleOSCMessage: channel "
                                   << channel << " out of range" << std::endl;
                         channel = -1;
--- a/main/main.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/main/main.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -320,7 +320,7 @@
     }
 */
     int rv = application.exec();
-    std::cerr << "application.exec() returned " << rv << std::endl;
+//    std::cerr << "application.exec() returned " << rv << std::endl;
 
     cleanupMutex.lock();
     TempDirectory::getInstance()->cleanup();
--- a/transform/FeatureExtractionPluginTransform.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/transform/FeatureExtractionPluginTransform.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -432,7 +432,7 @@
 	if (feature.hasTimestamp) {
 	    //!!! warning: sampleRate may be non-integral
 	    frame = Vamp::RealTime::realTime2Frame(feature.timestamp,
-                                                   m_descriptor->sampleRate);
+                                                   lrintf(m_descriptor->sampleRate));
 	} else {
 	    frame = m_output->getEndFrame();
 	}
@@ -468,7 +468,9 @@
         NoteModel *model = getOutput<NoteModel>();
         if (!model) return;
 
-        model->addPoint(NoteModel::Point(frame, pitch, duration, feature.label.c_str()));
+        model->addPoint(NoteModel::Point(frame, pitch,
+                                         lrintf(duration),
+                                         feature.label.c_str()));
 	
     } else {
 	
--- a/transform/RealTimePluginTransform.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/transform/RealTimePluginTransform.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -71,7 +71,8 @@
         PluginXml(m_plugin).setParametersFromXml(configurationXml);
     }
 
-    if (m_outputNo >= 0 && m_outputNo >= m_plugin->getControlOutputCount()) {
+    if (m_outputNo >= 0 &&
+        m_outputNo >= int(m_plugin->getControlOutputCount())) {
         std::cerr << "RealTimePluginTransform: Plugin has fewer than desired " << m_outputNo << " control outputs" << std::endl;
         return;
     }
@@ -131,10 +132,10 @@
     WritableWaveFileModel *wwfm = dynamic_cast<WritableWaveFileModel *>(m_output);
     if (!stvm && !wwfm) return;
 
-    if (stvm && (m_outputNo >= m_plugin->getControlOutputCount())) return;
+    if (stvm && (m_outputNo >= int(m_plugin->getControlOutputCount()))) return;
 
     size_t sampleRate = input->getSampleRate();
-    int channelCount = input->getChannelCount();
+    size_t channelCount = input->getChannelCount();
     if (!wwfm && m_context.channel != -1) channelCount = 1;
 
     size_t blockSize = m_plugin->getBufferSize();
@@ -149,8 +150,6 @@
 
     size_t latency = m_plugin->getLatency();
 
-    int i = 0;
-
     while (blockFrame < endFrame && !m_abandoned) {
 
 	size_t completion =
--- a/transform/TransformFactory.cpp	Mon Apr 30 09:34:13 2007 +0000
+++ b/transform/TransformFactory.cpp	Mon Apr 30 13:36:23 2007 +0000
@@ -279,7 +279,7 @@
             bool configurable = (!plugin->getPrograms().empty() ||
                                  !plugin->getParameterDescriptors().empty());
 
-            std::cerr << "Adding feature extraction plugin transform: id = " << transformId.toStdString() << std::endl;
+//            std::cerr << "Feature extraction plugin transform: " << transformId.toStdString() << std::endl;
 
 	    transforms[transformId] = 
                 TransformDesc(tr("Analysis"),
@@ -592,7 +592,7 @@
 
         if (output != "A") {
             int outputNo = output.toInt();
-            if (outputNo >= 0 && outputNo < desc->controlOutputPortCount) {
+            if (outputNo >= 0 && outputNo < int(desc->controlOutputPortCount)) {
                 outputLabel = desc->controlOutputPortNames[outputNo].c_str();
             }
         }