changeset 25:4593a7ebad93

* Ensure plugin parameters for a transform are saved in the .sv file and restored in case the plugin has to be run again * Make plugin dialog offer options for mixdown/single-channel use if the file has more than one channels but the plugin only accepts one * Fix incorrect samplerate playback for second file loaded if its samplerate differed from first * Add Zoom to Fit and Select Visible Range menu options, split out Import Audio into main model and secondary model options * Add stubs for cut, copy and paste operations (not implemented yet)
author Chris Cannam
date Thu, 30 Mar 2006 13:18:11 +0000
parents a0900900a6f6
children cc48a7189152
files audioio/AudioCallbackPlaySource.cpp audioio/AudioCallbackPlaySource.h audioio/AudioPortAudioTarget.cpp
diffstat 3 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Mon Mar 27 15:03:02 2006 +0000
+++ b/audioio/AudioCallbackPlaySource.cpp	Thu Mar 30 13:18:11 2006 +0000
@@ -117,6 +117,8 @@
 		  << " vs " << m_sourceSampleRate
 		  << "), playback will be wrong"
 		  << std::endl;
+        emit sampleRateMismatch(model->getSampleRate(), m_sourceSampleRate,
+                                false);
     }
 
     size_t modelChannels = 1;
@@ -519,9 +521,16 @@
 	    std::cerr
 		<< "AudioCallbackPlaySource::setModel: ERROR in creating samplerate converter: "
 		<< src_strerror(err) << std::endl;
-	}
 
-	emit sampleRateMismatch(getSourceSampleRate(), getTargetSampleRate());
+            emit sampleRateMismatch(getSourceSampleRate(),
+                                    getTargetSampleRate(),
+                                    false);
+	} else {
+
+            emit sampleRateMismatch(getSourceSampleRate(),
+                                    getTargetSampleRate(),
+                                    true);
+        }
     }
 }
 
--- a/audioio/AudioCallbackPlaySource.h	Mon Mar 27 15:03:02 2006 +0000
+++ b/audioio/AudioCallbackPlaySource.h	Thu Mar 30 13:18:11 2006 +0000
@@ -183,8 +183,7 @@
 
     void playStatusChanged(bool isPlaying);
 
-    /// Just a warning
-    void sampleRateMismatch(size_t requested, size_t available);
+    void sampleRateMismatch(size_t requested, size_t available, bool willResample);
 
 protected slots:
     void selectionChanged();
--- a/audioio/AudioPortAudioTarget.cpp	Mon Mar 27 15:03:02 2006 +0000
+++ b/audioio/AudioPortAudioTarget.cpp	Thu Mar 30 13:18:11 2006 +0000
@@ -47,6 +47,8 @@
 
     m_latency = Pa_GetMinNumBuffers(m_bufferSize, m_sampleRate) * m_bufferSize;
 
+    std::cerr << "\n\n\nLATENCY= " << m_latency << std::endl;
+
     err = Pa_OpenDefaultStream(&m_stream, 0, 2, paFloat32,
 			       m_sampleRate, m_bufferSize, 0,
 			       processStatic, this);