25 auto format = std::max(effectiveFormat, defaultFormat);
51 for(
auto& stream : importedStreams)
57 if(trackList->empty())
60 for(
const auto track : trackList->Any<
WaveTrack>())
63 outTracks.push_back(std::move(trackList));
70 for(
auto channel : track->Channels())
Toolkit-neutral facade for basic user interface services.
std::vector< std::shared_ptr< TrackList > > TrackHolders
std::shared_ptr< TrackList > TrackListHolder
static void ShowMessageBox(const TranslatableString &message, const TranslatableString &caption=XO("Import Project"))
static TrackListHolder NewWaveTrack(WaveTrackFactory &trackFactory, unsigned nChannels, sampleFormat effectiveFormat, double rate)
static sampleFormat ChooseFormat(sampleFormat effectiveFormat)
Choose appropriate format, which will not be narrower than the specified one.
static void ForEachChannel(TrackList &trackList, const std::function< void(WaveChannel &)> &op)
Iterates over channels in each wave track from the list.
static void FinalizeImport(TrackHolders &outTracks, const std::vector< TrackListHolder > &importedStreams)
Flushes the given channels and moves them to outTracks.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
auto Any() -> TrackIterRange< TrackType >
Holds a msgid for the translation catalog; may also bind format arguments.
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
std::shared_ptr< WaveTrack > Create()
Creates an unnamed empty WaveTrack with default sample format and default rate.
A Track that contains audio waveform data.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
PROJECT_RATE_API sampleFormat SampleFormatChoice()