comparison audioio/AudioGenerator.cpp @ 41:a4a05344c7d6

* Change preferences dialog to ok/apply/cancel model * Make preferences persist in a config file * Change instance() to getInstance() for all singleton types * Make pasting to time-value layer with no values in clipboard ask you how to generate the values * Fix bad behaviour caused by importing "data"-type (i.e. 3d dense) model from annotation file without a fixed window size available
author Chris Cannam
date Thu, 27 Jul 2006 16:06:32 +0000
parents a996c0ef6177
children
comparison
equal deleted inserted replaced
40:a996c0ef6177 41:a4a05344c7d6
47 47
48 AudioGenerator::AudioGenerator() : 48 AudioGenerator::AudioGenerator() :
49 m_sourceSampleRate(0), 49 m_sourceSampleRate(0),
50 m_targetChannelCount(1) 50 m_targetChannelCount(1)
51 { 51 {
52 connect(PlayParameterRepository::instance(), 52 connect(PlayParameterRepository::getInstance(),
53 SIGNAL(playPluginIdChanged(const Model *, QString)), 53 SIGNAL(playPluginIdChanged(const Model *, QString)),
54 this, 54 this,
55 SLOT(playPluginIdChanged(const Model *, QString))); 55 SLOT(playPluginIdChanged(const Model *, QString)));
56 56
57 connect(PlayParameterRepository::instance(), 57 connect(PlayParameterRepository::getInstance(),
58 SIGNAL(playPluginConfigurationChanged(const Model *, QString)), 58 SIGNAL(playPluginConfigurationChanged(const Model *, QString)),
59 this, 59 this,
60 SLOT(playPluginConfigurationChanged(const Model *, QString))); 60 SLOT(playPluginConfigurationChanged(const Model *, QString)));
61 } 61 }
62 62
183 AudioGenerator::getSampleDir() 183 AudioGenerator::getSampleDir()
184 { 184 {
185 if (m_sampleDir != "") return m_sampleDir; 185 if (m_sampleDir != "") return m_sampleDir;
186 186
187 try { 187 try {
188 m_sampleDir = TempDirectory::instance()->getSubDirectoryPath("samples"); 188 m_sampleDir = TempDirectory::getInstance()->getSubDirectoryPath("samples");
189 } catch (DirectoryCreationFailed f) { 189 } catch (DirectoryCreationFailed f) {
190 std::cerr << "WARNING: AudioGenerator::getSampleDir: Failed to create " 190 std::cerr << "WARNING: AudioGenerator::getSampleDir: Failed to create "
191 << "temporary sample directory" << std::endl; 191 << "temporary sample directory" << std::endl;
192 m_sampleDir = ""; 192 m_sampleDir = "";
193 return ""; 193 return "";
221 AudioGenerator::loadPluginFor(const Model *model) 221 AudioGenerator::loadPluginFor(const Model *model)
222 { 222 {
223 QString pluginId, configurationXml; 223 QString pluginId, configurationXml;
224 224
225 PlayParameters *parameters = 225 PlayParameters *parameters =
226 PlayParameterRepository::instance()->getPlayParameters(model); 226 PlayParameterRepository::getInstance()->getPlayParameters(model);
227 if (parameters) { 227 if (parameters) {
228 pluginId = parameters->getPlayPluginId(); 228 pluginId = parameters->getPlayPluginId();
229 configurationXml = parameters->getPlayPluginConfiguration(); 229 configurationXml = parameters->getPlayPluginConfiguration();
230 } 230 }
231 231
362 } 362 }
363 363
364 QMutexLocker locker(&m_mutex); 364 QMutexLocker locker(&m_mutex);
365 365
366 PlayParameters *parameters = 366 PlayParameters *parameters =
367 PlayParameterRepository::instance()->getPlayParameters(model); 367 PlayParameterRepository::getInstance()->getPlayParameters(model);
368 if (!parameters) return frameCount; 368 if (!parameters) return frameCount;
369 369
370 bool playing = !parameters->isPlayMuted(); 370 bool playing = !parameters->isPlayMuted();
371 if (!playing) return frameCount; 371 if (!playing) return frameCount;
372 372