Mercurial > hg > sonic-annotator
comparison runner/FeatureExtractionManager.cpp @ 107:7b60603966cf multiplex
Implementation of MultiplexedReader -- now builds, not yet tested
author | Chris Cannam |
---|---|
date | Thu, 02 Oct 2014 08:16:42 +0100 |
parents | de76b2df518f |
children | ca565b18ba3e |
comparison
equal
deleted
inserted
replaced
106:de76b2df518f | 107:7b60603966cf |
---|---|
585 } | 585 } |
586 | 586 |
587 AudioFileReader * | 587 AudioFileReader * |
588 FeatureExtractionManager::prepareReader(QString source) | 588 FeatureExtractionManager::prepareReader(QString source) |
589 { | 589 { |
590 AudioFileReader *reader = 0; | |
590 if (m_readyReaders.contains(source)) { | 591 if (m_readyReaders.contains(source)) { |
591 reader = m_readyReaders[source]; | 592 reader = m_readyReaders[source]; |
592 m_readyReaders.remove(source); | 593 m_readyReaders.remove(source); |
593 if (reader->getSampleRate() != m_sampleRate) { | 594 if (reader->getSampleRate() != m_sampleRate) { |
594 // can't use this; open it again | 595 // can't use this; open it again |
603 reader = AudioFileReaderFactory::createReader | 604 reader = AudioFileReaderFactory::createReader |
604 (fs, m_sampleRate, false, &retrievalProgress); | 605 (fs, m_sampleRate, false, &retrievalProgress); |
605 retrievalProgress.done(); | 606 retrievalProgress.done(); |
606 } | 607 } |
607 if (!reader) { | 608 if (!reader) { |
608 throw FailedToOpenFile(audioSource); | 609 throw FailedToOpenFile(source); |
609 } | 610 } |
610 return reader; | 611 return reader; |
611 } | 612 } |
612 | 613 |
613 void | 614 void |