annotate data/fileio/AudioFileReader.cpp @ 489:82ab61fa9223

* Reorganise our sparql queries on the basis that Redland must be available, not only optional. So for anything querying the pool of data about plugins, we use a single datastore and model which is initialised at the outset by PluginRDFIndexer and then queried directly; for anything that "reads from a file" (e.g. loading annotations) we query directly using Rasqal, going to the datastore when we need additional plugin-related information. This may improve performance, but mostly it simplifies the code and fixes a serious issue with RDF import in the previous versions (namely that multiple sequential RDF imports would end up sharing the same RDF data pool!)
author Chris Cannam
date Fri, 21 Nov 2008 16:12:29 +0000
parents 1d656dcda8ef
children 59e7fe1b1003
rev   line source
Chris@175 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@175 2
Chris@175 3 /*
Chris@175 4 Sonic Visualiser
Chris@175 5 An audio file viewer and annotation editor.
Chris@175 6 Centre for Digital Music, Queen Mary, University of London.
Chris@175 7 This file copyright 2006 Chris Cannam.
Chris@175 8
Chris@175 9 This program is free software; you can redistribute it and/or
Chris@175 10 modify it under the terms of the GNU General Public License as
Chris@175 11 published by the Free Software Foundation; either version 2 of the
Chris@175 12 License, or (at your option) any later version. See the file
Chris@175 13 COPYING included with this distribution for more information.
Chris@175 14 */
Chris@175 15
Chris@175 16 #include "AudioFileReader.h"
Chris@175 17
Chris@327 18 void
Chris@327 19 AudioFileReader::getDeInterleavedFrames(size_t start, size_t count,
Chris@327 20 std::vector<SampleBlock> &frames) const
Chris@327 21 {
Chris@327 22 SampleBlock interleaved;
Chris@327 23 getInterleavedFrames(start, count, interleaved);
Chris@327 24
Chris@327 25 size_t channels = getChannelCount();
Chris@327 26 size_t rc = interleaved.size() / channels;
Chris@327 27
Chris@327 28 frames.clear();
Chris@327 29
Chris@327 30 for (size_t c = 0; c < channels; ++c) {
Chris@327 31 frames.push_back(SampleBlock());
Chris@327 32 }
Chris@327 33
Chris@327 34 for (size_t i = 0; i < rc; ++i) {
Chris@327 35 for (size_t c = 0; c < channels; ++c) {
Chris@327 36 frames[c].push_back(interleaved[i * channels + c]);
Chris@327 37 }
Chris@327 38 }
Chris@327 39 }
Chris@327 40