diff options
Diffstat (limited to 'extern/audaspace/src')
-rw-r--r-- | extern/audaspace/src/file/File.cpp | 20 | ||||
-rw-r--r-- | extern/audaspace/src/file/FileManager.cpp | 36 | ||||
-rw-r--r-- | extern/audaspace/src/fx/VolumeReader.cpp | 2 |
3 files changed, 47 insertions, 11 deletions
diff --git a/extern/audaspace/src/file/File.cpp b/extern/audaspace/src/file/File.cpp index 0cdecb03657..5d4bae482d6 100644 --- a/extern/audaspace/src/file/File.cpp +++ b/extern/audaspace/src/file/File.cpp @@ -23,23 +23,31 @@ AUD_NAMESPACE_BEGIN -File::File(std::string filename) : - m_filename(filename) +File::File(std::string filename, int stream) : + m_filename(filename), m_stream(stream) { } -File::File(const data_t* buffer, int size) : - m_buffer(new Buffer(size)) +File::File(const data_t* buffer, int size, int stream) : + m_buffer(new Buffer(size)), m_stream(stream) { std::memcpy(m_buffer->getBuffer(), buffer, size); } +std::vector<StreamInfo> File::queryStreams() +{ + if(m_buffer.get()) + return FileManager::queryStreams(m_buffer); + else + return FileManager::queryStreams(m_filename); +} + std::shared_ptr<IReader> File::createReader() { if(m_buffer.get()) - return FileManager::createReader(m_buffer); + return FileManager::createReader(m_buffer, m_stream); else - return FileManager::createReader(m_filename); + return FileManager::createReader(m_filename, m_stream); } AUD_NAMESPACE_END diff --git a/extern/audaspace/src/file/FileManager.cpp b/extern/audaspace/src/file/FileManager.cpp index f8ef8deb409..7cbc0318f8c 100644 --- a/extern/audaspace/src/file/FileManager.cpp +++ b/extern/audaspace/src/file/FileManager.cpp @@ -43,13 +43,13 @@ void FileManager::registerOutput(std::shared_ptr<aud::IFileOutput> output) outputs().push_back(output); } -std::shared_ptr<IReader> FileManager::createReader(std::string filename) +std::shared_ptr<IReader> FileManager::createReader(std::string filename, int stream) { for(std::shared_ptr<IFileInput> input : inputs()) { try { - return input->createReader(filename); + return input->createReader(filename, stream); } catch(Exception&) {} } @@ -57,13 +57,41 @@ std::shared_ptr<IReader> FileManager::createReader(std::string filename) AUD_THROW(FileException, "The file couldn't be read with any installed file reader."); } -std::shared_ptr<IReader> FileManager::createReader(std::shared_ptr<Buffer> buffer) +std::shared_ptr<IReader> FileManager::createReader(std::shared_ptr<Buffer> buffer, int stream) { for(std::shared_ptr<IFileInput> input : inputs()) { try { - return input->createReader(buffer); + return input->createReader(buffer, stream); + } + catch(Exception&) {} + } + + AUD_THROW(FileException, "The file couldn't be read with any installed file reader."); +} + +std::vector<StreamInfo> FileManager::queryStreams(std::string filename) +{ + for(std::shared_ptr<IFileInput> input : inputs()) + { + try + { + return input->queryStreams(filename); + } + catch(Exception&) {} + } + + AUD_THROW(FileException, "The file couldn't be read with any installed file reader."); +} + +std::vector<StreamInfo> FileManager::queryStreams(std::shared_ptr<Buffer> buffer) +{ + for(std::shared_ptr<IFileInput> input : inputs()) + { + try + { + return input->queryStreams(buffer); } catch(Exception&) {} } diff --git a/extern/audaspace/src/fx/VolumeReader.cpp b/extern/audaspace/src/fx/VolumeReader.cpp index 627acbac9ef..ac1d4882a87 100644 --- a/extern/audaspace/src/fx/VolumeReader.cpp +++ b/extern/audaspace/src/fx/VolumeReader.cpp @@ -57,4 +57,4 @@ void VolumeReader::read(int& length, bool& eos, sample_t* buffer) buffer[i] = buffer[i] * m_volumeStorage->getVolume(); } -AUD_NAMESPACE_END +AUD_NAMESPACE_END
\ No newline at end of file |