changeset 397:f747be6743ab

Debug bits
author Chris Cannam
date Wed, 13 Aug 2014 16:44:50 +0100
parents 2f54917f1599
children 7373a8c262ca 81e41a430b58
files audioio/AudioCallbackPlaySource.cpp audioio/AudioGenerator.cpp audioio/ClipMixer.cpp
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Wed Aug 13 16:44:44 2014 +0100
+++ b/audioio/AudioCallbackPlaySource.cpp	Wed Aug 13 16:44:50 2014 +0100
@@ -361,14 +361,22 @@
 {
     if (!haveLock) m_mutex.lock();
 
+    cerr << "clearRingBuffers" << endl;
+
     rebuildRangeLists();
 
     if (count == 0) {
 	if (m_writeBuffers) count = m_writeBuffers->size();
     }
 
+    cerr << "current playing frame = " << getCurrentPlayingFrame() << endl;
+
+    cerr << "write buffer fill (before) = " << m_writeBufferFill << endl;
+
     m_writeBufferFill = getCurrentBufferedFrame();
 
+    cerr << "current buffered frame = " << m_writeBufferFill << endl;
+
     if (m_readBuffers != m_writeBuffers) {
 	delete m_writeBuffers;
     }
--- a/audioio/AudioGenerator.cpp	Wed Aug 13 16:44:44 2014 +0100
+++ b/audioio/AudioGenerator.cpp	Wed Aug 13 16:44:50 2014 +0100
@@ -284,6 +284,8 @@
 {
     QMutexLocker locker(&m_mutex);
 
+    cerr << "AudioGenerator::reset()" << endl;
+
     for (ClipMixerMap::iterator i = m_clipMixerMap.begin(); i != m_clipMixerMap.end(); ++i) {
 	if (i->second) {
 	    i->second->reset();
--- a/audioio/ClipMixer.cpp	Wed Aug 13 16:44:44 2014 +0100
+++ b/audioio/ClipMixer.cpp	Wed Aug 13 16:44:50 2014 +0100
@@ -131,6 +131,12 @@
 
     float *levels = new float[m_channels];
 
+#ifdef DEBUG_CLIP_MIXER
+    cerr << "ClipMixer::mix: have " << m_playing.size() << " playing note(s)"
+         << " and " << endingNotes.size() << " note(s) ending here"
+         << endl;
+#endif
+
     foreach (NoteStart note, m_playing) {
 
         for (int c = 0; c < m_channels; ++c) {