29{
XO(
"Stereo To Mono") };
50 return XO(
"Converts stereo tracks to mono");
88 bool bGoodResult =
true;
94 auto trackRange = outputs.Get().Selected<
WaveTrack>();
95 for (
const auto left : trackRange) {
96 if (left->Channels().size() > 1) {
98 auto end = left->TimeToLongSamples(left->GetEndTime());
99 totalTime += (
end - start);
108 for (
const auto track : trackRange) {
109 if (track->Channels().size() > 1) {
110 if (!
ProcessOne(outputs.Get(), curTime, totalTime, *track))
152 while (
auto blockLen = mixer.Process()) {
153 auto buffer = mixer.GetBuffer();
154 for (
auto i = 0; i < blockLen; i++)
155 ((
float *)buffer)[i] /= denominator;
172 track.
Paste(start, *outTrack);
std::vector< MixerOptions::StageSpecification > GetEffectStages(const WaveTrack &track)
virtual void SetMessage(const TranslatableString &message)=0
Change an existing dialog's message.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
const TrackList * inputTracks() const
BasicUI::ProgressDialog * mProgress
std::shared_ptr< TrackList > mTracks
bool TotalProgress(double frac, const TranslatableString &={}) const
Performs effect computation.
Use this object to copy the input tracks to tentative outputTracks.
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
ComponentInterfaceSymbol GetSymbol() const override
static const ComponentInterfaceSymbol Symbol
bool Process(EffectInstance &instance, EffectSettings &settings) override
TranslatableString GetDescription() const override
bool ProcessOne(TrackList &outputs, sampleCount &curTime, sampleCount totalTime, WaveTrack &track)
bool IsHiddenFromMenus() const override
Default is false.
EffectType GetType() const override
Type determines how it behaves.
virtual ~EffectStereoToMono()
Functions for doing the mixdown of the tracks.
std::vector< Input > Inputs
static RealtimeEffectList & Get(AudacityProject &project)
void Clear()
Use only in the main thread. Sends Remove messages.
std::shared_ptr< Subclass > SharedPointer()
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
AudacityProject * GetOwner()
static TrackListHolder Temporary(AudacityProject *pProject, const Track::Holder &pTrack={})
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
void MakeMono()
Simply discard any right channel.
double GetStartTime() const override
Implement WideSampleSequence.
void Clear(double t0, double t1) override
void Paste(double t0, const Track &src) override
double GetEndTime() const override
Implement WideSampleSequence.
double GetRate() const override
float GetChannelGain(int channel) const override
Takes gain and pan into account.
size_t GetMaxBlockSize() const
Holder EmptyCopy(size_t nChannels, const SampleBlockFactoryPtr &pFactory={}) const
sampleCount TimeToLongSamples(double t0) const
Positions or offsets within audio files need a wide type.
BuiltinEffectsModule::Registration< EffectStereoToMono > reg
const char * end(const char *str) noexcept
Externalized state of a plug-in.
Immutable structure is an argument to Mixer's constructor.