comparison audioio/AudioGenerator.cpp @ 38:54287e5e7451 sv1-v0.9rc1 sv1-v0.9rc2

* Make vertical scale alignment modes work in note layer as well as time-value layer, and several significant fixes to it * Make it possible to draw notes properly on the note layer * Show units (and frequencies etc in note layer's case) in the time-value and note layer description boxes * Minor fix to item edit dialog layout * Some minor menu rearrangement * Comment out a lot of debug output * Add SV website and reference URLs to Help menu, and add code to (attempt to) open them in the user's preferred browser
author Chris Cannam
date Fri, 12 May 2006 14:40:43 +0000
parents 58cf1620d6e3
children a996c0ef6177
comparison
equal deleted inserted replaced
37:58cf1620d6e3 38:54287e5e7451
118 118
119 void 119 void
120 AudioGenerator::playPluginConfigurationChanged(const Model *model, 120 AudioGenerator::playPluginConfigurationChanged(const Model *model,
121 QString configurationXml) 121 QString configurationXml)
122 { 122 {
123 std::cerr << "AudioGenerator::playPluginConfigurationChanged" << std::endl; 123 // std::cerr << "AudioGenerator::playPluginConfigurationChanged" << std::endl;
124 124
125 if (m_synthMap.find(model) == m_synthMap.end()) { 125 if (m_synthMap.find(model) == m_synthMap.end()) {
126 std::cerr << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << std::endl; 126 std::cerr << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << std::endl;
127 return; 127 return;
128 } 128 }
265 factory->instantiatePlugin 265 factory->instantiatePlugin
266 (pluginId, 0, 0, m_sourceSampleRate, m_pluginBlockSize, m_targetChannelCount); 266 (pluginId, 0, 0, m_sourceSampleRate, m_pluginBlockSize, m_targetChannelCount);
267 267
268 if (!instance) { 268 if (!instance) {
269 std::cerr << "Failed to instantiate plugin " << pluginId.toStdString() << std::endl; 269 std::cerr << "Failed to instantiate plugin " << pluginId.toStdString() << std::endl;
270 return 0;
270 } 271 }
271 272
272 setSampleDir(instance); 273 setSampleDir(instance);
273 274
274 for (unsigned int i = 0; i < instance->getParameterCount(); ++i) { 275 for (unsigned int i = 0; i < instance->getParameterCount(); ++i) {
275 instance->setParameterValue(i, instance->getParameterDefault(i)); 276 instance->setParameterValue(i, instance->getParameterDefault(i));
276 } 277 }
277 std::string defaultProgram = instance->getProgram(0, 0); 278 std::string defaultProgram = instance->getProgram(0, 0);
278 if (defaultProgram != "") { 279 if (defaultProgram != "") {
279 std::cerr << "first selecting default program " << defaultProgram << std::endl; 280 // std::cerr << "first selecting default program " << defaultProgram << std::endl;
280 instance->selectProgram(defaultProgram); 281 instance->selectProgram(defaultProgram);
281 } 282 }
282 if (program != "") { 283 if (program != "") {
283 std::cerr << "now selecting desired program " << program.toStdString() << std::endl; 284 // std::cerr << "now selecting desired program " << program.toStdString() << std::endl;
284 instance->selectProgram(program.toStdString()); 285 instance->selectProgram(program.toStdString());
285 } 286 }
286 instance->setIdealChannelCount(m_targetChannelCount); // reset! 287 instance->setIdealChannelCount(m_targetChannelCount); // reset!
287 288
288 return instance; 289 return instance;
332 void 333 void
333 AudioGenerator::setTargetChannelCount(size_t targetChannelCount) 334 AudioGenerator::setTargetChannelCount(size_t targetChannelCount)
334 { 335 {
335 if (m_targetChannelCount == targetChannelCount) return; 336 if (m_targetChannelCount == targetChannelCount) return;
336 337
337 std::cerr << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << std::endl; 338 // std::cerr << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << std::endl;
338 339
339 QMutexLocker locker(&m_mutex); 340 QMutexLocker locker(&m_mutex);
340 m_targetChannelCount = targetChannelCount; 341 m_targetChannelCount = targetChannelCount;
341 342
342 for (PluginMap::iterator i = m_synthMap.begin(); i != m_synthMap.end(); ++i) { 343 for (PluginMap::iterator i = m_synthMap.begin(); i != m_synthMap.end(); ++i) {