comparison audioio/AudioCallbackPlaySource.cpp @ 10:b6dc944128da

* Add basics of MIDI file import. Doesn't actually create the model yet. * Add rewind to start / ffwd to end. * Make zoom constraint default to sqrt(2) type if no constraint set
author Chris Cannam
date Thu, 09 Feb 2006 18:01:52 +0000
parents e71385792d9d
children 29b38a641d43
comparison
equal deleted inserted replaced
9:e71385792d9d 10:b6dc944128da
78 } 78 }
79 79
80 void 80 void
81 AudioCallbackPlaySource::addModel(Model *model) 81 AudioCallbackPlaySource::addModel(Model *model)
82 { 82 {
83 m_audioGenerator->addModel(model); 83 bool canPlay = m_audioGenerator->addModel(model);
84 84
85 m_mutex.lock(); 85 m_mutex.lock();
86 86
87 m_models.insert(model); 87 m_models.insert(model);
88 if (model->getEndFrame() > m_lastModelEndFrame) { 88 if (model->getEndFrame() > m_lastModelEndFrame) {
120 120
121 if (!m_writeBuffers || (m_writeBuffers->size() < modelChannels)) { 121 if (!m_writeBuffers || (m_writeBuffers->size() < modelChannels)) {
122 clearRingBuffers(true, modelChannels); 122 clearRingBuffers(true, modelChannels);
123 buffersChanged = true; 123 buffersChanged = true;
124 } else { 124 } else {
125 clearRingBuffers(true); 125 if (canPlay) clearRingBuffers(true);
126 } 126 }
127 127
128 if (buffersChanged || srChanged) { 128 if (buffersChanged || srChanged) {
129 if (m_converter) { 129 if (m_converter) {
130 src_delete(m_converter); 130 src_delete(m_converter);