Chris@175: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@175: Chris@175: /* Chris@175: Sonic Visualiser Chris@175: An audio file viewer and annotation editor. Chris@175: Centre for Digital Music, Queen Mary, University of London. Chris@175: This file copyright 2006 Chris Cannam. Chris@175: Chris@175: This program is free software; you can redistribute it and/or Chris@175: modify it under the terms of the GNU General Public License as Chris@175: published by the Free Software Foundation; either version 2 of the Chris@175: License, or (at your option) any later version. See the file Chris@175: COPYING included with this distribution for more information. Chris@175: */ Chris@175: Chris@175: #include "AudioFileReader.h" Chris@175: Chris@327: void Chris@929: AudioFileReader::getDeInterleavedFrames(int start, int count, Chris@327: std::vector &frames) const Chris@327: { Chris@327: SampleBlock interleaved; Chris@327: getInterleavedFrames(start, count, interleaved); Chris@327: Chris@929: int channels = getChannelCount(); Chris@929: int rc = interleaved.size() / channels; Chris@327: Chris@327: frames.clear(); Chris@327: Chris@929: for (int c = 0; c < channels; ++c) { Chris@327: frames.push_back(SampleBlock()); Chris@327: } Chris@327: Chris@929: for (int i = 0; i < rc; ++i) { Chris@929: for (int c = 0; c < channels; ++c) { Chris@327: frames[c].push_back(interleaved[i * channels + c]); Chris@327: } Chris@327: } Chris@327: } Chris@327: