# HG changeset patch # User Chris Cannam # Date 1374073288 -3600 # Node ID f63051833723ad9a4fd56ce902359fbbe42faefc # Parent 97c53dfaf798e1e791bb54031228c04e4aa6ad63# Parent f700ea718d5281d68357b5fc287b07180a9233f6 Merge diff -r 97c53dfaf798 -r f63051833723 data/fileio/AudioFileReader.h --- a/data/fileio/AudioFileReader.h Wed Jul 17 15:59:17 2013 +0100 +++ b/data/fileio/AudioFileReader.h Wed Jul 17 16:01:28 2013 +0100 @@ -65,6 +65,13 @@ typedef std::map TagMap; virtual TagMap getTags() const { return TagMap(); } + /** + * Return true if this file supports fast seek and random + * access. Typically this will be true for uncompressed formats + * and false for compressed ones. + */ + virtual bool isQuicklySeekable() const = 0; + /** * Return interleaved samples for count frames from index start. * The resulting sample block will contain count * diff -r 97c53dfaf798 -r f63051833723 data/fileio/AudioFileReaderFactory.cpp --- a/data/fileio/AudioFileReaderFactory.cpp Wed Jul 17 15:59:17 2013 +0100 +++ b/data/fileio/AudioFileReaderFactory.cpp Wed Jul 17 16:01:28 2013 +0100 @@ -16,7 +16,7 @@ #include "AudioFileReaderFactory.h" #include "WavFileReader.h" -#include "ResamplingWavFileReader.h" +#include "DecodingWavFileReader.h" #include "OggVorbisFileReader.h" #include "MP3FileReader.h" #include "QuickTimeFileReader.h" @@ -98,20 +98,22 @@ reader = new WavFileReader(source); - if (targetRate != 0 && - reader->isOK() && - reader->getSampleRate() != targetRate) { + int fileRate = reader->getSampleRate(); - SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", creating resampling reader" << endl; + if (reader->isOK() && + (!reader->isQuicklySeekable() || + (targetRate != 0 && fileRate != targetRate))) { + + SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", seekable " << reader->isQuicklySeekable() << ", creating decoding reader" << endl; delete reader; - reader = new ResamplingWavFileReader + reader = new DecodingWavFileReader (source, threading ? - ResamplingWavFileReader::ResampleThreaded : - ResamplingWavFileReader::ResampleAtOnce, - ResamplingWavFileReader::CacheInTemporaryFile, - targetRate, + DecodingWavFileReader::ResampleThreaded : + DecodingWavFileReader::ResampleAtOnce, + DecodingWavFileReader::CacheInTemporaryFile, + targetRate ? targetRate : fileRate, reporter); if (!reader->isOK()) { delete reader; @@ -209,20 +211,22 @@ reader = new WavFileReader(source); - if (targetRate != 0 && - reader->isOK() && - reader->getSampleRate() != targetRate) { + int fileRate = reader->getSampleRate(); - SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", creating resampling reader" << endl; + if (reader->isOK() && + (!reader->isQuicklySeekable() || + (targetRate != 0 && fileRate != targetRate))) { + + SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", seekable " << reader->isQuicklySeekable() << ", creating decoding reader" << endl; delete reader; - reader = new ResamplingWavFileReader + reader = new DecodingWavFileReader (source, threading ? - ResamplingWavFileReader::ResampleThreaded : - ResamplingWavFileReader::ResampleAtOnce, - ResamplingWavFileReader::CacheInTemporaryFile, - targetRate, + DecodingWavFileReader::ResampleThreaded : + DecodingWavFileReader::ResampleAtOnce, + DecodingWavFileReader::CacheInTemporaryFile, + targetRate ? targetRate : fileRate, reporter); } diff -r 97c53dfaf798 -r f63051833723 data/fileio/CodedAudioFileReader.h --- a/data/fileio/CodedAudioFileReader.h Wed Jul 17 15:59:17 2013 +0100 +++ b/data/fileio/CodedAudioFileReader.h Wed Jul 17 16:01:28 2013 +0100 @@ -43,6 +43,9 @@ virtual size_t getNativeRate() const { return m_fileRate; } + /// Intermediate cache means all CodedAudioFileReaders are quickly seekable + virtual bool isQuicklySeekable() const { return true; } + signals: void progress(int); diff -r 97c53dfaf798 -r f63051833723 data/fileio/DecodingWavFileReader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/fileio/DecodingWavFileReader.cpp Wed Jul 17 16:01:28 2013 +0100 @@ -0,0 +1,192 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + This file copyright 2007 QMUL. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "DecodingWavFileReader.h" + +#include "WavFileReader.h" +#include "base/Profiler.h" +#include "base/ProgressReporter.h" + +#include + +DecodingWavFileReader::DecodingWavFileReader(FileSource source, + ResampleMode resampleMode, + CacheMode mode, + size_t targetRate, + ProgressReporter *reporter) : + CodedAudioFileReader(mode, targetRate), + m_source(source), + m_path(source.getLocalFilename()), + m_cancelled(false), + m_processed(0), + m_completion(0), + m_original(0), + m_reporter(reporter), + m_decodeThread(0) +{ + m_channelCount = 0; + m_fileRate = 0; + + SVDEBUG << "DecodingWavFileReader::DecodingWavFileReader(\"" + << m_path << "\"): rate " << targetRate << endl; + + Profiler profiler("DecodingWavFileReader::DecodingWavFileReader", true); + + m_original = new WavFileReader(m_path); + if (!m_original->isOK()) { + m_error = m_original->getError(); + return; + } + + m_channelCount = m_original->getChannelCount(); + m_fileRate = m_original->getSampleRate(); + + initialiseDecodeCache(); + + if (resampleMode == ResampleAtOnce) { + + if (m_reporter) { + connect(m_reporter, SIGNAL(cancelled()), this, SLOT(cancelled())); + m_reporter->setMessage + (tr("Decoding %1...").arg(QFileInfo(m_path).fileName())); + } + + size_t blockSize = 16384; + size_t total = m_original->getFrameCount(); + + SampleBlock block; + + for (size_t i = 0; i < total; i += blockSize) { + + size_t count = blockSize; + if (i + count > total) count = total - i; + + m_original->getInterleavedFrames(i, count, block); + addBlock(block); + + if (m_cancelled) break; + } + + if (isDecodeCacheInitialised()) finishDecodeCache(); + endSerialised(); + + if (m_reporter) m_reporter->setProgress(100); + + delete m_original; + m_original = 0; + + } else { + + if (m_reporter) m_reporter->setProgress(100); + + m_decodeThread = new DecodeThread(this); + m_decodeThread->start(); + } +} + +DecodingWavFileReader::~DecodingWavFileReader() +{ + if (m_decodeThread) { + m_cancelled = true; + m_decodeThread->wait(); + delete m_decodeThread; + } + + delete m_original; +} + +void +DecodingWavFileReader::cancelled() +{ + m_cancelled = true; +} + +void +DecodingWavFileReader::DecodeThread::run() +{ + if (m_reader->m_cacheMode == CacheInTemporaryFile) { + m_reader->startSerialised("DecodingWavFileReader::Decode"); + } + + size_t blockSize = 16384; + size_t total = m_reader->m_original->getFrameCount(); + + SampleBlock block; + + for (size_t i = 0; i < total; i += blockSize) { + + size_t count = blockSize; + if (i + count > total) count = total - i; + + m_reader->m_original->getInterleavedFrames(i, count, block); + m_reader->addBlock(block); + + if (m_reader->m_cancelled) break; + } + + if (m_reader->isDecodeCacheInitialised()) m_reader->finishDecodeCache(); + m_reader->m_completion = 100; + + m_reader->endSerialised(); + + delete m_reader->m_original; + m_reader->m_original = 0; +} + +void +DecodingWavFileReader::addBlock(const SampleBlock &frames) +{ + addSamplesToDecodeCache(frames); + + m_processed += frames.size(); + + float ratio = float(m_sampleRate) / float(m_fileRate); + + int progress = lrint((float(m_processed) * ratio * 100) / + float(m_original->getFrameCount())); + + if (progress > 99) progress = 99; + m_completion = progress; + + if (m_reporter) { + m_reporter->setProgress(progress); + } +} + +void +DecodingWavFileReader::getSupportedExtensions(std::set &extensions) +{ + WavFileReader::getSupportedExtensions(extensions); +} + +bool +DecodingWavFileReader::supportsExtension(QString extension) +{ + return WavFileReader::supportsExtension(extension); +} + +bool +DecodingWavFileReader::supportsContentType(QString type) +{ + return WavFileReader::supportsContentType(type); +} + +bool +DecodingWavFileReader::supports(FileSource &source) +{ + return WavFileReader::supports(source); +} + + diff -r 97c53dfaf798 -r f63051833723 data/fileio/DecodingWavFileReader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/fileio/DecodingWavFileReader.h Wed Jul 17 16:01:28 2013 +0100 @@ -0,0 +1,87 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + This file copyright 2007 QMUL. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _DECODING_WAV_FILE_READER_H_ +#define _DECODING_WAV_FILE_READER_H_ + +#include "CodedAudioFileReader.h" + +#include "base/Thread.h" + +#include + +class WavFileReader; +class ProgressReporter; + +class DecodingWavFileReader : public CodedAudioFileReader +{ + Q_OBJECT +public: + enum ResampleMode { + ResampleAtOnce, // resample the file on construction, with progress dialog + ResampleThreaded // resample in a background thread after construction + }; + + DecodingWavFileReader(FileSource source, + ResampleMode resampleMode, + CacheMode cacheMode, + size_t targetRate = 0, + ProgressReporter *reporter = 0); + virtual ~DecodingWavFileReader(); + + virtual QString getError() const { return m_error; } + virtual QString getLocation() const { return m_source.getLocation(); } + static void getSupportedExtensions(std::set &extensions); + static bool supportsExtension(QString ext); + static bool supportsContentType(QString type); + static bool supports(FileSource &source); + + virtual int getDecodeCompletion() const { return m_completion; } + + virtual bool isUpdating() const { + return m_decodeThread && m_decodeThread->isRunning(); + } + +public slots: + void cancelled(); + +protected: + FileSource m_source; + QString m_path; + QString m_error; + bool m_cancelled; + size_t m_processed; + int m_completion; + + WavFileReader *m_original; + ProgressReporter *m_reporter; + + void addBlock(const SampleBlock &frames); + + class DecodeThread : public Thread + { + public: + DecodeThread(DecodingWavFileReader *reader) : m_reader(reader) { } + virtual void run(); + + protected: + DecodingWavFileReader *m_reader; + }; + + DecodeThread *m_decodeThread; +}; + +#endif + diff -r 97c53dfaf798 -r f63051833723 data/fileio/ResamplingWavFileReader.cpp --- a/data/fileio/ResamplingWavFileReader.cpp Wed Jul 17 15:59:17 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - Sonic Visualiser - An audio file viewer and annotation editor. - Centre for Digital Music, Queen Mary, University of London. - This file copyright 2007 QMUL. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#include "ResamplingWavFileReader.h" - -#include "WavFileReader.h" -#include "base/Profiler.h" -#include "base/ProgressReporter.h" - -#include - -ResamplingWavFileReader::ResamplingWavFileReader(FileSource source, - ResampleMode resampleMode, - CacheMode mode, - size_t targetRate, - ProgressReporter *reporter) : - CodedAudioFileReader(mode, targetRate), - m_source(source), - m_path(source.getLocalFilename()), - m_cancelled(false), - m_processed(0), - m_completion(0), - m_original(0), - m_reporter(reporter), - m_decodeThread(0) -{ - m_channelCount = 0; - m_fileRate = 0; - - SVDEBUG << "ResamplingWavFileReader::ResamplingWavFileReader(\"" - << m_path << "\"): rate " << targetRate << endl; - - Profiler profiler("ResamplingWavFileReader::ResamplingWavFileReader", true); - - m_original = new WavFileReader(m_path); - if (!m_original->isOK()) { - m_error = m_original->getError(); - return; - } - - m_channelCount = m_original->getChannelCount(); - m_fileRate = m_original->getSampleRate(); - - initialiseDecodeCache(); - - if (resampleMode == ResampleAtOnce) { - - if (m_reporter) { - connect(m_reporter, SIGNAL(cancelled()), this, SLOT(cancelled())); - m_reporter->setMessage - (tr("Resampling %1...").arg(QFileInfo(m_path).fileName())); - } - - size_t blockSize = 16384; - size_t total = m_original->getFrameCount(); - - SampleBlock block; - - for (size_t i = 0; i < total; i += blockSize) { - - size_t count = blockSize; - if (i + count > total) count = total - i; - - m_original->getInterleavedFrames(i, count, block); - addBlock(block); - - if (m_cancelled) break; - } - - if (isDecodeCacheInitialised()) finishDecodeCache(); - endSerialised(); - - if (m_reporter) m_reporter->setProgress(100); - - delete m_original; - m_original = 0; - - } else { - - if (m_reporter) m_reporter->setProgress(100); - - m_decodeThread = new DecodeThread(this); - m_decodeThread->start(); - } -} - -ResamplingWavFileReader::~ResamplingWavFileReader() -{ - if (m_decodeThread) { - m_cancelled = true; - m_decodeThread->wait(); - delete m_decodeThread; - } - - delete m_original; -} - -void -ResamplingWavFileReader::cancelled() -{ - m_cancelled = true; -} - -void -ResamplingWavFileReader::DecodeThread::run() -{ - if (m_reader->m_cacheMode == CacheInTemporaryFile) { - m_reader->startSerialised("ResamplingWavFileReader::Decode"); - } - - size_t blockSize = 16384; - size_t total = m_reader->m_original->getFrameCount(); - - SampleBlock block; - - for (size_t i = 0; i < total; i += blockSize) { - - size_t count = blockSize; - if (i + count > total) count = total - i; - - m_reader->m_original->getInterleavedFrames(i, count, block); - m_reader->addBlock(block); - - if (m_reader->m_cancelled) break; - } - - if (m_reader->isDecodeCacheInitialised()) m_reader->finishDecodeCache(); - m_reader->m_completion = 100; - - m_reader->endSerialised(); - - delete m_reader->m_original; - m_reader->m_original = 0; -} - -void -ResamplingWavFileReader::addBlock(const SampleBlock &frames) -{ - addSamplesToDecodeCache(frames); - - m_processed += frames.size(); - - float ratio = float(m_sampleRate) / float(m_fileRate); - - int progress = lrint((float(m_processed) * ratio * 100) / - float(m_original->getFrameCount())); - - if (progress > 99) progress = 99; - m_completion = progress; - - if (m_reporter) { - m_reporter->setProgress(progress); - } -} - -void -ResamplingWavFileReader::getSupportedExtensions(std::set &extensions) -{ - WavFileReader::getSupportedExtensions(extensions); -} - -bool -ResamplingWavFileReader::supportsExtension(QString extension) -{ - return WavFileReader::supportsExtension(extension); -} - -bool -ResamplingWavFileReader::supportsContentType(QString type) -{ - return WavFileReader::supportsContentType(type); -} - -bool -ResamplingWavFileReader::supports(FileSource &source) -{ - return WavFileReader::supports(source); -} - - diff -r 97c53dfaf798 -r f63051833723 data/fileio/ResamplingWavFileReader.h --- a/data/fileio/ResamplingWavFileReader.h Wed Jul 17 15:59:17 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - Sonic Visualiser - An audio file viewer and annotation editor. - Centre for Digital Music, Queen Mary, University of London. - This file copyright 2007 QMUL. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#ifndef _RESAMPLING_WAV_FILE_READER_H_ -#define _RESAMPLING_WAV_FILE_READER_H_ - -#include "CodedAudioFileReader.h" - -#include "base/Thread.h" - -#include - -class WavFileReader; -class ProgressReporter; - -class ResamplingWavFileReader : public CodedAudioFileReader -{ - Q_OBJECT -public: - enum ResampleMode { - ResampleAtOnce, // resample the file on construction, with progress dialog - ResampleThreaded // resample in a background thread after construction - }; - - ResamplingWavFileReader(FileSource source, - ResampleMode resampleMode, - CacheMode cacheMode, - size_t targetRate = 0, - ProgressReporter *reporter = 0); - virtual ~ResamplingWavFileReader(); - - virtual QString getError() const { return m_error; } - virtual QString getLocation() const { return m_source.getLocation(); } - static void getSupportedExtensions(std::set &extensions); - static bool supportsExtension(QString ext); - static bool supportsContentType(QString type); - static bool supports(FileSource &source); - - virtual int getDecodeCompletion() const { return m_completion; } - - virtual bool isUpdating() const { - return m_decodeThread && m_decodeThread->isRunning(); - } - -public slots: - void cancelled(); - -protected: - FileSource m_source; - QString m_path; - QString m_error; - bool m_cancelled; - size_t m_processed; - int m_completion; - - WavFileReader *m_original; - ProgressReporter *m_reporter; - - void addBlock(const SampleBlock &frames); - - class DecodeThread : public Thread - { - public: - DecodeThread(ResamplingWavFileReader *reader) : m_reader(reader) { } - virtual void run(); - - protected: - ResamplingWavFileReader *m_reader; - }; - - DecodeThread *m_decodeThread; -}; - -#endif - diff -r 97c53dfaf798 -r f63051833723 data/fileio/WavFileReader.cpp --- a/data/fileio/WavFileReader.cpp Wed Jul 17 15:59:17 2013 +0100 +++ b/data/fileio/WavFileReader.cpp Wed Jul 17 16:01:28 2013 +0100 @@ -24,6 +24,7 @@ m_file(0), m_source(source), m_path(source.getLocalFilename()), + m_seekable(false), m_buffer(0), m_bufsiz(0), m_lastStart(0), @@ -54,12 +55,26 @@ } if (m_fileInfo.channels > 0) { + m_frameCount = m_fileInfo.frames; m_channelCount = m_fileInfo.channels; m_sampleRate = m_fileInfo.samplerate; + + m_seekable = (m_fileInfo.seekable != 0); + + // Our m_seekable reports whether a file is rapidly seekable, + // so things like Ogg don't qualify. We cautiously report + // every file type of "at least" the historical period of Ogg + // or FLAC as non-seekable. + int type = m_fileInfo.format & SF_FORMAT_TYPEMASK; +// std::cerr << "WavFileReader: format type is " << type << " (flac, ogg are " << SF_FORMAT_FLAC << ", " << SF_FORMAT_OGG << ")" << std::endl; + if (type >= SF_FORMAT_FLAC || type >= SF_FORMAT_OGG) { +// std::cerr << "WavFileReader: Recording as non-seekable" << std::endl; + m_seekable = false; + } } -// std::cerr << "WavFileReader: Frame count " << m_frameCount << ", channel count " << m_channelCount << ", sample rate " << m_sampleRate << std::endl; +// std::cerr << "WavFileReader: Frame count " << m_frameCount << ", channel count " << m_channelCount << ", sample rate " << m_sampleRate << ", seekable " << m_seekable << std::endl; } diff -r 97c53dfaf798 -r f63051833723 data/fileio/WavFileReader.h --- a/data/fileio/WavFileReader.h Wed Jul 17 15:59:17 2013 +0100 +++ b/data/fileio/WavFileReader.h Wed Jul 17 16:01:28 2013 +0100 @@ -23,6 +23,16 @@ #include +/** + * Reader for audio files using libsndfile. + * + * This is typically intended for seekable file types that can be read + * directly (e.g. WAV, AIFF etc). + * + * Compressed files supported by libsndfile (e.g. Ogg, FLAC) should + * normally be read using DecodingWavFileReader instead (which decodes + * to an intermediate cached file). + */ class WavFileReader : public AudioFileReader { public: @@ -32,6 +42,8 @@ virtual QString getLocation() const { return m_source.getLocation(); } virtual QString getError() const { return m_error; } + virtual bool isQuicklySeekable() const { return m_seekable; } + /** * Must be safe to call from multiple threads with different * arguments on the same object at the same time. @@ -59,6 +71,8 @@ QString m_path; QString m_error; + bool m_seekable; + mutable QMutex m_mutex; mutable float *m_buffer; mutable size_t m_bufsiz; diff -r 97c53dfaf798 -r f63051833723 svcore.pro --- a/svcore.pro Wed Jul 17 15:59:17 2013 +0100 +++ b/svcore.pro Wed Jul 17 16:01:28 2013 +0100 @@ -1,290 +1,290 @@ - -TEMPLATE = lib - -exists(config.pri) { - include(config.pri) -} -win* { - !exists(config.pri) { - DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_RUBBERBAND HAVE_DATAQUAY HAVE_LIBLO HAVE_MAD HAVE_ID3TAG - } -} - -CONFIG += staticlib qt thread warn_on stl rtti exceptions -QT += network xml -QT -= gui - -TARGET = svcore - -DEPENDPATH += . data plugin plugin/api/alsa -INCLUDEPATH += . data plugin plugin/api/alsa ../dataquay -OBJECTS_DIR = o -MOC_DIR = o - -win32-g++ { - INCLUDEPATH += ../sv-dependency-builds/win32-mingw/include -} -win32-msvc* { - INCLUDEPATH += ../sv-dependency-builds/win32-msvc/include -} - -# Doesn't work with this library, which contains C99 as well as C++ -PRECOMPILED_HEADER = - -# Set up suitable platform defines for RtMidi -linux*: DEFINES += __LINUX_ALSASEQ__ -macx*: DEFINES += __MACOSX_CORE__ -win*: DEFINES += __WINDOWS_MM__ -solaris*: DEFINES += __RTMIDI_DUMMY_ONLY__ - -HEADERS += base/AudioLevel.h \ - base/AudioPlaySource.h \ - base/Clipboard.h \ - base/Command.h \ - base/Debug.h \ - base/Exceptions.h \ - base/LogRange.h \ - base/Pitch.h \ - base/Playable.h \ - base/PlayParameterRepository.h \ - base/PlayParameters.h \ - base/Preferences.h \ - base/Profiler.h \ - base/ProgressPrinter.h \ - base/ProgressReporter.h \ - base/PropertyContainer.h \ - base/RangeMapper.h \ - base/RealTime.h \ - base/RecentFiles.h \ - base/Resampler.h \ - base/ResizeableBitset.h \ - base/ResourceFinder.h \ - base/RingBuffer.h \ - base/Scavenger.h \ - base/Selection.h \ - base/Serialiser.h \ - base/StorageAdviser.h \ - base/StringBits.h \ - base/TempDirectory.h \ - base/TempWriteFile.h \ - base/TextMatcher.h \ - base/Thread.h \ - base/UnitDatabase.h \ - base/ViewManagerBase.h \ - base/Window.h \ - base/XmlExportable.h \ - base/ZoomConstraint.h -SOURCES += base/AudioLevel.cpp \ - base/Clipboard.cpp \ - base/Command.cpp \ - base/Debug.cpp \ - base/Exceptions.cpp \ - base/LogRange.cpp \ - base/Pitch.cpp \ - base/PlayParameterRepository.cpp \ - base/PlayParameters.cpp \ - base/Preferences.cpp \ - base/Profiler.cpp \ - base/ProgressPrinter.cpp \ - base/ProgressReporter.cpp \ - base/PropertyContainer.cpp \ - base/RangeMapper.cpp \ - base/RealTime.cpp \ - base/RecentFiles.cpp \ - base/Resampler.cpp \ - base/ResourceFinder.cpp \ - base/Selection.cpp \ - base/Serialiser.cpp \ - base/StorageAdviser.cpp \ - base/StringBits.cpp \ - base/TempDirectory.cpp \ - base/TempWriteFile.cpp \ - base/TextMatcher.cpp \ - base/Thread.cpp \ - base/UnitDatabase.cpp \ - base/ViewManagerBase.cpp \ - base/XmlExportable.cpp - -HEADERS += data/fft/FFTapi.h \ - data/fft/FFTCacheReader.h \ - data/fft/FFTCacheStorageType.h \ - data/fft/FFTCacheWriter.h \ - data/fft/FFTDataServer.h \ - data/fft/FFTFileCacheReader.h \ - data/fft/FFTFileCacheWriter.h \ - data/fft/FFTMemoryCache.h \ - data/fileio/AudioFileReader.h \ - data/fileio/AudioFileReaderFactory.h \ - data/fileio/BZipFileDevice.h \ - data/fileio/CachedFile.h \ - data/fileio/CodedAudioFileReader.h \ - data/fileio/CSVFileReader.h \ - data/fileio/CSVFileWriter.h \ - data/fileio/CSVFormat.h \ - data/fileio/DataFileReader.h \ - data/fileio/DataFileReaderFactory.h \ - data/fileio/FileFinder.h \ - data/fileio/FileReadThread.h \ - data/fileio/FileSource.h \ - data/fileio/MatchFileReader.h \ - data/fileio/MatrixFile.h \ - data/fileio/MIDIFileReader.h \ - data/fileio/MIDIFileWriter.h \ - data/fileio/MP3FileReader.h \ - data/fileio/OggVorbisFileReader.h \ - data/fileio/PlaylistFileReader.h \ - data/fileio/QuickTimeFileReader.h \ - data/fileio/CoreAudioFileReader.h \ - data/fileio/ResamplingWavFileReader.h \ - data/fileio/WavFileReader.h \ - data/fileio/WavFileWriter.h \ - data/midi/MIDIEvent.h \ - data/midi/MIDIInput.h \ - data/midi/rtmidi/RtError.h \ - data/midi/rtmidi/RtMidi.h \ - data/model/AggregateWaveModel.h \ - data/model/AlignmentModel.h \ - data/model/Dense3DModelPeakCache.h \ - data/model/DenseThreeDimensionalModel.h \ - data/model/DenseTimeValueModel.h \ - data/model/EditableDenseThreeDimensionalModel.h \ - data/model/FFTModel.h \ - data/model/ImageModel.h \ - data/model/IntervalModel.h \ - data/model/Labeller.h \ - data/model/Model.h \ - data/model/ModelDataTableModel.h \ - data/model/NoteModel.h \ - data/model/FlexiNoteModel.h \ - data/model/PathModel.h \ - data/model/PowerOfSqrtTwoZoomConstraint.h \ - data/model/PowerOfTwoZoomConstraint.h \ - data/model/RangeSummarisableTimeValueModel.h \ - data/model/RegionModel.h \ - data/model/SparseModel.h \ - data/model/SparseOneDimensionalModel.h \ - data/model/SparseTimeValueModel.h \ - data/model/SparseValueModel.h \ - data/model/TabularModel.h \ - data/model/TextModel.h \ - data/model/WaveFileModel.h \ - data/model/WritableWaveFileModel.h \ - data/osc/OSCMessage.h \ - data/osc/OSCQueue.h -SOURCES += data/fft/FFTapi.cpp \ - data/fft/FFTDataServer.cpp \ - data/fft/FFTFileCacheReader.cpp \ - data/fft/FFTFileCacheWriter.cpp \ - data/fft/FFTMemoryCache.cpp \ - data/fileio/AudioFileReader.cpp \ - data/fileio/AudioFileReaderFactory.cpp \ - data/fileio/BZipFileDevice.cpp \ - data/fileio/CachedFile.cpp \ - data/fileio/CodedAudioFileReader.cpp \ - data/fileio/CSVFileReader.cpp \ - data/fileio/CSVFileWriter.cpp \ - data/fileio/CSVFormat.cpp \ - data/fileio/DataFileReaderFactory.cpp \ - data/fileio/FileReadThread.cpp \ - data/fileio/FileSource.cpp \ - data/fileio/MatchFileReader.cpp \ - data/fileio/MatrixFile.cpp \ - data/fileio/MIDIFileReader.cpp \ - data/fileio/MIDIFileWriter.cpp \ - data/fileio/MP3FileReader.cpp \ - data/fileio/OggVorbisFileReader.cpp \ - data/fileio/PlaylistFileReader.cpp \ - data/fileio/QuickTimeFileReader.cpp \ - data/fileio/CoreAudioFileReader.cpp \ - data/fileio/ResamplingWavFileReader.cpp \ - data/fileio/WavFileReader.cpp \ - data/fileio/WavFileWriter.cpp \ - data/midi/MIDIInput.cpp \ - data/midi/rtmidi/RtMidi.cpp \ - data/model/AggregateWaveModel.cpp \ - data/model/AlignmentModel.cpp \ - data/model/Dense3DModelPeakCache.cpp \ - data/model/DenseTimeValueModel.cpp \ - data/model/EditableDenseThreeDimensionalModel.cpp \ - data/model/FFTModel.cpp \ - data/model/Model.cpp \ - data/model/ModelDataTableModel.cpp \ - data/model/PowerOfSqrtTwoZoomConstraint.cpp \ - data/model/PowerOfTwoZoomConstraint.cpp \ - data/model/RangeSummarisableTimeValueModel.cpp \ - data/model/WaveFileModel.cpp \ - data/model/WritableWaveFileModel.cpp \ - data/osc/OSCMessage.cpp \ - data/osc/OSCQueue.cpp - -HEADERS += plugin/DSSIPluginFactory.h \ - plugin/DSSIPluginInstance.h \ - plugin/FeatureExtractionPluginFactory.h \ - plugin/LADSPAPluginFactory.h \ - plugin/LADSPAPluginInstance.h \ - plugin/PluginIdentifier.h \ - plugin/PluginXml.h \ - plugin/RealTimePluginFactory.h \ - plugin/RealTimePluginInstance.h \ - plugin/api/dssi.h \ - plugin/api/ladspa.h \ - plugin/plugins/SamplePlayer.h \ - plugin/api/alsa/asoundef.h \ - plugin/api/alsa/asoundlib.h \ - plugin/api/alsa/seq.h \ - plugin/api/alsa/seq_event.h \ - plugin/api/alsa/seq_midi_event.h \ - plugin/api/alsa/sound/asequencer.h - - -SOURCES += plugin/DSSIPluginFactory.cpp \ - plugin/DSSIPluginInstance.cpp \ - plugin/FeatureExtractionPluginFactory.cpp \ - plugin/LADSPAPluginFactory.cpp \ - plugin/LADSPAPluginInstance.cpp \ - plugin/PluginIdentifier.cpp \ - plugin/PluginXml.cpp \ - plugin/RealTimePluginFactory.cpp \ - plugin/RealTimePluginInstance.cpp \ - plugin/plugins/SamplePlayer.cpp - -!linux* { -SOURCES += plugin/api/dssi_alsa_compat.c -} - -HEADERS += rdf/PluginRDFIndexer.h \ - rdf/PluginRDFDescription.h \ - rdf/RDFExporter.h \ - rdf/RDFFeatureWriter.h \ - rdf/RDFImporter.h \ - rdf/RDFTransformFactory.h -SOURCES += rdf/PluginRDFIndexer.cpp \ - rdf/PluginRDFDescription.cpp \ - rdf/RDFExporter.cpp \ - rdf/RDFFeatureWriter.cpp \ - rdf/RDFImporter.cpp \ - rdf/RDFTransformFactory.cpp - -HEADERS += system/Init.h \ - system/System.h -SOURCES += system/Init.cpp \ - system/System.cpp - -HEADERS += transform/CSVFeatureWriter.h \ - transform/FeatureExtractionModelTransformer.h \ - transform/FeatureWriter.h \ - transform/FileFeatureWriter.h \ - transform/RealTimeEffectModelTransformer.h \ - transform/Transform.h \ - transform/TransformDescription.h \ - transform/TransformFactory.h \ - transform/ModelTransformer.h \ - transform/ModelTransformerFactory.h -SOURCES += transform/CSVFeatureWriter.cpp \ - transform/FeatureExtractionModelTransformer.cpp \ - transform/FileFeatureWriter.cpp \ - transform/RealTimeEffectModelTransformer.cpp \ - transform/Transform.cpp \ - transform/TransformFactory.cpp \ - transform/ModelTransformer.cpp \ - transform/ModelTransformerFactory.cpp + +TEMPLATE = lib + +exists(config.pri) { + include(config.pri) +} +win* { + !exists(config.pri) { + DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_RUBBERBAND HAVE_DATAQUAY HAVE_LIBLO HAVE_MAD HAVE_ID3TAG + } +} + +CONFIG += staticlib qt thread warn_on stl rtti exceptions +QT += network xml +QT -= gui + +TARGET = svcore + +DEPENDPATH += . data plugin plugin/api/alsa +INCLUDEPATH += . data plugin plugin/api/alsa ../dataquay +OBJECTS_DIR = o +MOC_DIR = o + +win32-g++ { + INCLUDEPATH += ../sv-dependency-builds/win32-mingw/include +} +win32-msvc* { + INCLUDEPATH += ../sv-dependency-builds/win32-msvc/include +} + +# Doesn't work with this library, which contains C99 as well as C++ +PRECOMPILED_HEADER = + +# Set up suitable platform defines for RtMidi +linux*: DEFINES += __LINUX_ALSASEQ__ +macx*: DEFINES += __MACOSX_CORE__ +win*: DEFINES += __WINDOWS_MM__ +solaris*: DEFINES += __RTMIDI_DUMMY_ONLY__ + +HEADERS += base/AudioLevel.h \ + base/AudioPlaySource.h \ + base/Clipboard.h \ + base/Command.h \ + base/Debug.h \ + base/Exceptions.h \ + base/LogRange.h \ + base/Pitch.h \ + base/Playable.h \ + base/PlayParameterRepository.h \ + base/PlayParameters.h \ + base/Preferences.h \ + base/Profiler.h \ + base/ProgressPrinter.h \ + base/ProgressReporter.h \ + base/PropertyContainer.h \ + base/RangeMapper.h \ + base/RealTime.h \ + base/RecentFiles.h \ + base/Resampler.h \ + base/ResizeableBitset.h \ + base/ResourceFinder.h \ + base/RingBuffer.h \ + base/Scavenger.h \ + base/Selection.h \ + base/Serialiser.h \ + base/StorageAdviser.h \ + base/StringBits.h \ + base/TempDirectory.h \ + base/TempWriteFile.h \ + base/TextMatcher.h \ + base/Thread.h \ + base/UnitDatabase.h \ + base/ViewManagerBase.h \ + base/Window.h \ + base/XmlExportable.h \ + base/ZoomConstraint.h +SOURCES += base/AudioLevel.cpp \ + base/Clipboard.cpp \ + base/Command.cpp \ + base/Debug.cpp \ + base/Exceptions.cpp \ + base/LogRange.cpp \ + base/Pitch.cpp \ + base/PlayParameterRepository.cpp \ + base/PlayParameters.cpp \ + base/Preferences.cpp \ + base/Profiler.cpp \ + base/ProgressPrinter.cpp \ + base/ProgressReporter.cpp \ + base/PropertyContainer.cpp \ + base/RangeMapper.cpp \ + base/RealTime.cpp \ + base/RecentFiles.cpp \ + base/Resampler.cpp \ + base/ResourceFinder.cpp \ + base/Selection.cpp \ + base/Serialiser.cpp \ + base/StorageAdviser.cpp \ + base/StringBits.cpp \ + base/TempDirectory.cpp \ + base/TempWriteFile.cpp \ + base/TextMatcher.cpp \ + base/Thread.cpp \ + base/UnitDatabase.cpp \ + base/ViewManagerBase.cpp \ + base/XmlExportable.cpp + +HEADERS += data/fft/FFTapi.h \ + data/fft/FFTCacheReader.h \ + data/fft/FFTCacheStorageType.h \ + data/fft/FFTCacheWriter.h \ + data/fft/FFTDataServer.h \ + data/fft/FFTFileCacheReader.h \ + data/fft/FFTFileCacheWriter.h \ + data/fft/FFTMemoryCache.h \ + data/fileio/AudioFileReader.h \ + data/fileio/AudioFileReaderFactory.h \ + data/fileio/BZipFileDevice.h \ + data/fileio/CachedFile.h \ + data/fileio/CodedAudioFileReader.h \ + data/fileio/CSVFileReader.h \ + data/fileio/CSVFileWriter.h \ + data/fileio/CSVFormat.h \ + data/fileio/DataFileReader.h \ + data/fileio/DataFileReaderFactory.h \ + data/fileio/FileFinder.h \ + data/fileio/FileReadThread.h \ + data/fileio/FileSource.h \ + data/fileio/MatchFileReader.h \ + data/fileio/MatrixFile.h \ + data/fileio/MIDIFileReader.h \ + data/fileio/MIDIFileWriter.h \ + data/fileio/MP3FileReader.h \ + data/fileio/OggVorbisFileReader.h \ + data/fileio/PlaylistFileReader.h \ + data/fileio/QuickTimeFileReader.h \ + data/fileio/CoreAudioFileReader.h \ + data/fileio/DecodingWavFileReader.h \ + data/fileio/WavFileReader.h \ + data/fileio/WavFileWriter.h \ + data/midi/MIDIEvent.h \ + data/midi/MIDIInput.h \ + data/midi/rtmidi/RtError.h \ + data/midi/rtmidi/RtMidi.h \ + data/model/AggregateWaveModel.h \ + data/model/AlignmentModel.h \ + data/model/Dense3DModelPeakCache.h \ + data/model/DenseThreeDimensionalModel.h \ + data/model/DenseTimeValueModel.h \ + data/model/EditableDenseThreeDimensionalModel.h \ + data/model/FFTModel.h \ + data/model/ImageModel.h \ + data/model/IntervalModel.h \ + data/model/Labeller.h \ + data/model/Model.h \ + data/model/ModelDataTableModel.h \ + data/model/NoteModel.h \ + data/model/FlexiNoteModel.h \ + data/model/PathModel.h \ + data/model/PowerOfSqrtTwoZoomConstraint.h \ + data/model/PowerOfTwoZoomConstraint.h \ + data/model/RangeSummarisableTimeValueModel.h \ + data/model/RegionModel.h \ + data/model/SparseModel.h \ + data/model/SparseOneDimensionalModel.h \ + data/model/SparseTimeValueModel.h \ + data/model/SparseValueModel.h \ + data/model/TabularModel.h \ + data/model/TextModel.h \ + data/model/WaveFileModel.h \ + data/model/WritableWaveFileModel.h \ + data/osc/OSCMessage.h \ + data/osc/OSCQueue.h +SOURCES += data/fft/FFTapi.cpp \ + data/fft/FFTDataServer.cpp \ + data/fft/FFTFileCacheReader.cpp \ + data/fft/FFTFileCacheWriter.cpp \ + data/fft/FFTMemoryCache.cpp \ + data/fileio/AudioFileReader.cpp \ + data/fileio/AudioFileReaderFactory.cpp \ + data/fileio/BZipFileDevice.cpp \ + data/fileio/CachedFile.cpp \ + data/fileio/CodedAudioFileReader.cpp \ + data/fileio/CSVFileReader.cpp \ + data/fileio/CSVFileWriter.cpp \ + data/fileio/CSVFormat.cpp \ + data/fileio/DataFileReaderFactory.cpp \ + data/fileio/FileReadThread.cpp \ + data/fileio/FileSource.cpp \ + data/fileio/MatchFileReader.cpp \ + data/fileio/MatrixFile.cpp \ + data/fileio/MIDIFileReader.cpp \ + data/fileio/MIDIFileWriter.cpp \ + data/fileio/MP3FileReader.cpp \ + data/fileio/OggVorbisFileReader.cpp \ + data/fileio/PlaylistFileReader.cpp \ + data/fileio/QuickTimeFileReader.cpp \ + data/fileio/CoreAudioFileReader.cpp \ + data/fileio/DecodingWavFileReader.cpp \ + data/fileio/WavFileReader.cpp \ + data/fileio/WavFileWriter.cpp \ + data/midi/MIDIInput.cpp \ + data/midi/rtmidi/RtMidi.cpp \ + data/model/AggregateWaveModel.cpp \ + data/model/AlignmentModel.cpp \ + data/model/Dense3DModelPeakCache.cpp \ + data/model/DenseTimeValueModel.cpp \ + data/model/EditableDenseThreeDimensionalModel.cpp \ + data/model/FFTModel.cpp \ + data/model/Model.cpp \ + data/model/ModelDataTableModel.cpp \ + data/model/PowerOfSqrtTwoZoomConstraint.cpp \ + data/model/PowerOfTwoZoomConstraint.cpp \ + data/model/RangeSummarisableTimeValueModel.cpp \ + data/model/WaveFileModel.cpp \ + data/model/WritableWaveFileModel.cpp \ + data/osc/OSCMessage.cpp \ + data/osc/OSCQueue.cpp + +HEADERS += plugin/DSSIPluginFactory.h \ + plugin/DSSIPluginInstance.h \ + plugin/FeatureExtractionPluginFactory.h \ + plugin/LADSPAPluginFactory.h \ + plugin/LADSPAPluginInstance.h \ + plugin/PluginIdentifier.h \ + plugin/PluginXml.h \ + plugin/RealTimePluginFactory.h \ + plugin/RealTimePluginInstance.h \ + plugin/api/dssi.h \ + plugin/api/ladspa.h \ + plugin/plugins/SamplePlayer.h \ + plugin/api/alsa/asoundef.h \ + plugin/api/alsa/asoundlib.h \ + plugin/api/alsa/seq.h \ + plugin/api/alsa/seq_event.h \ + plugin/api/alsa/seq_midi_event.h \ + plugin/api/alsa/sound/asequencer.h + + +SOURCES += plugin/DSSIPluginFactory.cpp \ + plugin/DSSIPluginInstance.cpp \ + plugin/FeatureExtractionPluginFactory.cpp \ + plugin/LADSPAPluginFactory.cpp \ + plugin/LADSPAPluginInstance.cpp \ + plugin/PluginIdentifier.cpp \ + plugin/PluginXml.cpp \ + plugin/RealTimePluginFactory.cpp \ + plugin/RealTimePluginInstance.cpp \ + plugin/plugins/SamplePlayer.cpp + +!linux* { +SOURCES += plugin/api/dssi_alsa_compat.c +} + +HEADERS += rdf/PluginRDFIndexer.h \ + rdf/PluginRDFDescription.h \ + rdf/RDFExporter.h \ + rdf/RDFFeatureWriter.h \ + rdf/RDFImporter.h \ + rdf/RDFTransformFactory.h +SOURCES += rdf/PluginRDFIndexer.cpp \ + rdf/PluginRDFDescription.cpp \ + rdf/RDFExporter.cpp \ + rdf/RDFFeatureWriter.cpp \ + rdf/RDFImporter.cpp \ + rdf/RDFTransformFactory.cpp + +HEADERS += system/Init.h \ + system/System.h +SOURCES += system/Init.cpp \ + system/System.cpp + +HEADERS += transform/CSVFeatureWriter.h \ + transform/FeatureExtractionModelTransformer.h \ + transform/FeatureWriter.h \ + transform/FileFeatureWriter.h \ + transform/RealTimeEffectModelTransformer.h \ + transform/Transform.h \ + transform/TransformDescription.h \ + transform/TransformFactory.h \ + transform/ModelTransformer.h \ + transform/ModelTransformerFactory.h +SOURCES += transform/CSVFeatureWriter.cpp \ + transform/FeatureExtractionModelTransformer.cpp \ + transform/FileFeatureWriter.cpp \ + transform/RealTimeEffectModelTransformer.cpp \ + transform/Transform.cpp \ + transform/TransformFactory.cpp \ + transform/ModelTransformer.cpp \ + transform/ModelTransformerFactory.cpp