Mercurial > hg > svapp
comparison audioio/AudioGenerator.cpp @ 418:8d2112977aa0 tonioni
Don't clear ring buffers & regenerate when adding a model that is muted anyway
author | Chris Cannam |
---|---|
date | Tue, 11 Nov 2014 16:34:22 +0000 |
parents | f747be6743ab |
children | aa6fb3516e28 |
comparison
equal
deleted
inserted
replaced
417:d62a622a0e40 | 418:8d2112977aa0 |
---|---|
122 m_sourceSampleRate = model->getSampleRate(); | 122 m_sourceSampleRate = model->getSampleRate(); |
123 return true; | 123 return true; |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 const Playable *playable = model; | |
128 if (!playable || !playable->canPlay()) return 0; | |
129 | |
130 PlayParameters *parameters = | |
131 PlayParameterRepository::getInstance()->getPlayParameters(playable); | |
132 | |
133 bool willPlay = !parameters->isPlayMuted(); | |
134 | |
127 if (usesClipMixer(model)) { | 135 if (usesClipMixer(model)) { |
128 ClipMixer *mixer = makeClipMixerFor(model); | 136 ClipMixer *mixer = makeClipMixerFor(model); |
129 if (mixer) { | 137 if (mixer) { |
130 QMutexLocker locker(&m_mutex); | 138 QMutexLocker locker(&m_mutex); |
131 m_clipMixerMap[model] = mixer; | 139 m_clipMixerMap[model] = mixer; |
132 return true; | 140 return willPlay; |
133 } | 141 } |
134 } | 142 } |
135 | 143 |
136 if (usesContinuousSynth(model)) { | 144 if (usesContinuousSynth(model)) { |
137 ContinuousSynth *synth = makeSynthFor(model); | 145 ContinuousSynth *synth = makeSynthFor(model); |
138 if (synth) { | 146 if (synth) { |
139 QMutexLocker locker(&m_mutex); | 147 QMutexLocker locker(&m_mutex); |
140 m_continuousSynthMap[model] = synth; | 148 m_continuousSynthMap[model] = synth; |
141 return true; | 149 return willPlay; |
142 } | 150 } |
143 } | 151 } |
144 | 152 |
145 return false; | 153 return false; |
146 } | 154 } |