changeset 412:c1b2b8b84165 tonioni

Merge from default branch
author Chris Cannam
date Tue, 09 Sep 2014 16:36:21 +0100
parents 08a45e4cf1b1 (current diff) 7709bb9a1130 (diff)
children d62a622a0e40
files
diffstat 6 files changed, 56 insertions(+), 62 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Tue Sep 02 16:23:48 2014 +0100
+++ b/audioio/AudioCallbackPlaySource.cpp	Tue Sep 09 16:36:21 2014 +0100
@@ -72,6 +72,7 @@
     m_timeStretcher(0),
     m_monoStretcher(0),
     m_stretchRatio(1.0),
+    m_stretchMono(false),
     m_stretcherInputCount(0),
     m_stretcherInputs(0),
     m_stretcherInputSizes(0),
--- a/audioio/AudioPulseAudioTarget.cpp	Tue Sep 02 16:23:48 2014 +0100
+++ b/audioio/AudioPulseAudioTarget.cpp	Tue Sep 09 16:36:21 2014 +0100
@@ -239,39 +239,19 @@
 	
 	float peak = 0.0;
 
-	if (ch < sourceChannels) {
-
-	    // PulseAudio samples are interleaved
-	    for (int i = 0; i < nframes; ++i) {
-                if (i < received) {
-                    output[i * 2 + ch] = tmpbuf[ch][i] * m_outputGain;
-                    float sample = fabsf(output[i * 2 + ch]);
-                    if (sample > peak) peak = sample;
-                } else {
-                    output[i * 2 + ch] = 0;
-                }
-	    }
-
-	} else if (ch == 1 && sourceChannels == 1) {
-
-	    for (int i = 0; i < nframes; ++i) {
-                if (i < received) {
-                    output[i * 2 + ch] = tmpbuf[0][i] * m_outputGain;
-                    float sample = fabsf(output[i * 2 + ch]);
-                    if (sample > peak) peak = sample;
-                } else {
-                    output[i * 2 + ch] = 0;
-                }
-	    }
-
-	} else {
-	    for (int i = 0; i < nframes; ++i) {
-		output[i * 2 + ch] = 0;
-	    }
-	}
+        // PulseAudio samples are interleaved
+        for (int i = 0; i < nframes; ++i) {
+            if (i < received) {
+                output[i * 2 + ch] = tmpbuf[ch][i] * m_outputGain;
+                float sample = fabsf(output[i * 2 + ch]);
+                if (sample > peak) peak = sample;
+            } else {
+                output[i * 2 + ch] = 0;
+            }
+        }
 
 	if (ch == 0) peakLeft = peak;
-	if (ch > 0 || sourceChannels == 1) peakRight = peak;
+	if (ch == 1) peakRight = peak;
     }
 
 #ifdef DEBUG_AUDIO_PULSE_AUDIO_TARGET_PLAY
--- a/audioio/ClipMixer.cpp	Tue Sep 02 16:23:48 2014 +0100
+++ b/audioio/ClipMixer.cpp	Tue Sep 09 16:36:21 2014 +0100
@@ -24,7 +24,10 @@
     m_channels(channels),
     m_sampleRate(sampleRate),
     m_blockSize(blockSize),
-    m_clipData(0)
+    m_clipData(0),
+    m_clipLength(0),
+    m_clipF0(0),
+    m_clipRate(0)
 {
 }
 
@@ -102,7 +105,7 @@
 float
 ClipMixer::getResampleRatioFor(float frequency)
 {
-    if (!m_clipData) return 1.0;
+    if (!m_clipData || !m_clipRate) return 1.0;
     float pitchRatio = m_clipF0 / frequency;
     float resampleRatio = m_sampleRate / m_clipRate;
     return pitchRatio * resampleRatio;
--- a/framework/Document.cpp	Tue Sep 02 16:23:48 2014 +0100
+++ b/framework/Document.cpp	Tue Sep 09 16:36:21 2014 +0100
@@ -628,6 +628,7 @@
 
     ModelRecord rec;
     rec.source = 0;
+    rec.channel = 0;
     rec.refcount = 0;
     rec.additional = false;
 
@@ -663,6 +664,7 @@
 
     ModelRecord rec;
     rec.source = 0;
+    rec.channel = 0;
     rec.refcount = 0;
     rec.additional = true;
 
--- a/framework/MainWindowBase.cpp	Tue Sep 02 16:23:48 2014 +0100
+++ b/framework/MainWindowBase.cpp	Tue Sep 09 16:36:21 2014 +0100
@@ -913,19 +913,21 @@
         
         Layer *layer = m_paneStack->getCurrentPane()->getSelectedLayer();
 
-        if (m_viewManager && 
-            (m_viewManager->getToolMode() == ViewManager::MeasureMode)) {
-
-            layer->deleteCurrentMeasureRect();
-
-        } else {
-
-            MultiSelection::SelectionList selections =
-                m_viewManager->getSelections();
+        if (m_viewManager) {
+
+            if (m_viewManager->getToolMode() == ViewManager::MeasureMode) {
+
+                layer->deleteCurrentMeasureRect();
             
-            for (MultiSelection::SelectionList::iterator i = selections.begin();
-                 i != selections.end(); ++i) {
-                layer->deleteSelection(*i);
+            } else {
+
+                MultiSelection::SelectionList selections =
+                    m_viewManager->getSelections();
+            
+                for (MultiSelection::SelectionList::iterator i = selections.begin();
+                     i != selections.end(); ++i) {
+                    layer->deleteSelection(*i);
+                }
             }
 	}
     }
@@ -1010,18 +1012,18 @@
             SparseOneDimensionalModel::EditCommand *command =
                 new SparseOneDimensionalModel::EditCommand(sodm, tr("Add Point"));
 
-            if (m_labeller->requiresPrevPoint()) {
-
-                SparseOneDimensionalModel::PointList prevPoints =
-                    sodm->getPreviousPoints(frame);
-
-                if (!prevPoints.empty()) {
-                    prevPoint = *prevPoints.begin();
-                    havePrevPoint = true;
+            if (m_labeller) {
+
+                if (m_labeller->requiresPrevPoint()) {
+
+                    SparseOneDimensionalModel::PointList prevPoints =
+                        sodm->getPreviousPoints(frame);
+
+                    if (!prevPoints.empty()) {
+                        prevPoint = *prevPoints.begin();
+                        havePrevPoint = true;
+                    }
                 }
-            }
-
-            if (m_labeller) {
 
                 m_labeller->setSampleRate(sodm->getSampleRate());
 
@@ -1112,7 +1114,7 @@
     NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel());
     if (nm) {
         NoteModel::Point point(alignedStart,
-                               rm->getValueMinimum(),
+                               nm->getValueMinimum(),
                                alignedDuration,
                                1.f,
                                "");
@@ -1131,17 +1133,17 @@
     FlexiNoteModel *fnm = dynamic_cast<FlexiNoteModel *>(layer->getModel());
     if (fnm) {
         FlexiNoteModel::Point point(alignedStart,
-                               rm->getValueMinimum(),
-                               alignedDuration,
-                               1.f,
-                               "");
+                                    fnm->getValueMinimum(),
+                                    alignedDuration,
+                                    1.f,
+                                    "");
         FlexiNoteModel::EditCommand *command =
             new FlexiNoteModel::EditCommand(fnm, tr("Add Point"));
         command->addPoint(point);
         command->setName(name);
         c = command->finish();
     }
-
+    
     if (c) {
         CommandHistory::getInstance()->addCommand(c, false);
         return;
@@ -2875,6 +2877,7 @@
 MainWindowBase::RemovePaneCommand::RemovePaneCommand(MainWindowBase *mw, Pane *pane) :
     m_mw(mw),
     m_pane(pane),
+    m_prevCurrentPane(0),
     m_added(true)
 {
 }
--- a/framework/SVFileReader.cpp	Tue Sep 02 16:23:48 2014 +0100
+++ b/framework/SVFileReader.cpp	Tue Sep 09 16:36:21 2014 +0100
@@ -58,15 +58,20 @@
     m_paneCallback(callback),
     m_location(location),
     m_currentPane(0),
+    m_currentLayer(0),
     m_currentDataset(0),
     m_currentDerivedModel(0),
     m_currentDerivedModelId(-1),
     m_currentPlayParameters(0),
     m_currentTransformSource(0),
+    m_currentTransformChannel(0),
+    m_currentTransformIsNewStyle(true),
     m_datasetSeparator(" "),
     m_inRow(false),
     m_inLayer(false),
     m_inView(false),
+    m_inData(false),
+    m_inSelections(false),
     m_rowNumber(0),
     m_ok(false)
 {