1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-17 16:11:11 +02:00

Importer functions return a vector of vector of pointers to tracks...

... grouping the channels; rather than one flat vector.

OGG, GStreamer and FFmpeg import were written to allow multiple multi-channel
tracks; others always imported one group of channels.

All of that is reflected in the results returned by the importers, though it
makes no difference yet in AudacityProject::AddImportedTracks (where the
results are used).
This commit is contained in:
Paul Licameli
2018-09-19 11:47:50 -04:00
parent b0c5f42b9a
commit 31d46ae624
15 changed files with 70 additions and 61 deletions

View File

@@ -109,17 +109,17 @@ private:
int mStreamIndex;
};
auto ODDecodeFFmpegTask::FromList(const std::list<TrackHolders> &channels) -> Streams
auto ODDecodeFFmpegTask::FromList( const TrackHolders &channels ) -> Streams
{
Streams streams;
streams.reserve(channels.size());
using namespace std;
transform(channels.begin(), channels.end(), back_inserter(streams),
[](const TrackHolders &holders) {
[](const NewChannelGroup &holders) {
Channels channels;
channels.reserve(holders.size());
transform(holders.begin(), holders.end(), back_inserter(channels),
mem_fn(&TrackHolders::value_type::get)
mem_fn(&NewChannelGroup::value_type::get)
);
return channels;
}

View File

@@ -31,7 +31,8 @@ public:
using Channels = std::vector < WaveTrack* >;
using Streams = std::vector < Channels >;
static Streams FromList(const std::list<TrackHolders> &channels);
static Streams FromList(
const std::vector< std::vector< std::unique_ptr<WaveTrack> > > &channels);
/// Constructs an ODTask
ODDecodeFFmpegTask(const ScsPtr &scs, Streams &&channels, const std::shared_ptr<FFmpegContext> &context, int streamIndex);