mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-11 14:41:06 +02:00
... And in some places where a library uses signed types, assert that the reported number is not negative. What led me to this, is that there are many places where a size_t value for an allocation is the product of a number of channels and some other number.
61 lines
1.2 KiB
C++
61 lines
1.2 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
StereoToMono.h
|
|
|
|
Lynn Allan
|
|
|
|
**********************************************************************/
|
|
|
|
#ifndef __AUDACITY_EFFECT_STEREO_TO_MONO__
|
|
#define __AUDACITY_EFFECT_STEREO_TO_MONO__
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include "Effect.h"
|
|
|
|
#define STEREOTOMONO_PLUGIN_SYMBOL XO("Stereo To Mono")
|
|
|
|
class EffectStereoToMono final : public Effect
|
|
{
|
|
public:
|
|
EffectStereoToMono();
|
|
virtual ~EffectStereoToMono();
|
|
|
|
// IdentInterface implementation
|
|
|
|
wxString GetSymbol() override;
|
|
wxString GetDescription() override;
|
|
|
|
// EffectIdentInterface implementation
|
|
|
|
EffectType GetType() override;
|
|
bool IsInteractive() override;
|
|
|
|
// EffectClientInterface implementation
|
|
|
|
unsigned GetAudioInCount() override;
|
|
unsigned GetAudioOutCount() override;
|
|
|
|
// Effect implementation
|
|
|
|
bool Process() override;
|
|
bool IsHidden() override;
|
|
|
|
private:
|
|
// EffectStereoToMono implementation
|
|
|
|
bool ProcessOne(int count);
|
|
|
|
private:
|
|
sampleCount mStart;
|
|
sampleCount mEnd;
|
|
WaveTrack *mLeftTrack;
|
|
WaveTrack *mRightTrack;
|
|
std::unique_ptr<WaveTrack> mOutTrack;
|
|
};
|
|
|
|
#endif
|
|
|