1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-06 07:09:39 +02:00

Remove 8 warnings about re-#define-d names, related to SoundTouch

This commit is contained in:
Paul Licameli 2018-07-23 14:27:44 -04:00
parent e432883dec
commit 83e01fb43b
4 changed files with 62 additions and 14 deletions

View File

@ -37,6 +37,20 @@ the pitch without changing the tempo.
#include "../widgets/valnum.h"
#include "TimeWarper.h"
// Soundtouch defines these as well, which are also in generated configmac.h
// and configunix.h, so get rid of them before including,
// to avoid compiler warnings, and be sure to do this
// after all other #includes, to avoid any mischief that might result
// from doing the un-definitions before seeing any wx headers.
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#undef PACKAGE
#undef VERSION
#include "SoundTouch.h"
enum {
ID_PercentChange = 10000,
ID_FromPitch,
@ -201,7 +215,7 @@ bool EffectChangePitch::Process()
else
#endif
{
mSoundTouch = std::make_unique<SoundTouch>();
mSoundTouch = std::make_unique<soundtouch::SoundTouch>();
IdentityTimeWarper warper;
mSoundTouch->setPitchSemiTones((float)(m_dSemitonesChange));
#ifdef USE_MIDI

View File

@ -34,6 +34,20 @@
#include "ChangeTempo.h"
// Soundtouch defines these as well, which are also in generated configmac.h
// and configunix.h, so get rid of them before including,
// to avoid compiler warnings, and be sure to do this
// after all other #includes, to avoid any mischief that might result
// from doing the un-definitions before seeing any wx headers.
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#undef PACKAGE
#undef VERSION
#include "SoundTouch.h"
enum
{
ID_PercentChange = 10000,
@ -189,7 +203,7 @@ bool EffectChangeTempo::Process()
else
#endif
{
mSoundTouch = std::make_unique<SoundTouch>();
mSoundTouch = std::make_unique<soundtouch::SoundTouch>();
mSoundTouch->setTempoChange(m_PercentChange);
double mT1Dashed = mT0 + (mT1 - mT0)/(m_PercentChange/100.0 + 1.0);
RegionTimeWarper warper{ mT0, mT1,

View File

@ -25,6 +25,31 @@ effect that uses SoundTouch to do its processing (ChangeTempo
#include "TimeWarper.h"
#include "../NoteTrack.h"
// Soundtouch defines these as well, which are also in generated configmac.h
// and configunix.h, so get rid of them before including,
// to avoid compiler warnings, and be sure to do this
// after all other #includes, to avoid any mischief that might result
// from doing the un-definitions before seeing any wx headers.
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#undef PACKAGE
#undef VERSION
#include "SoundTouch.h"
#ifdef USE_MIDI
EffectSoundTouch::EffectSoundTouch()
{
mSemitones = 0;
}
#endif
EffectSoundTouch::~EffectSoundTouch()
{
}
bool EffectSoundTouch::ProcessLabelTrack(
LabelTrack *lt, const TimeWarper &warper)
{

View File

@ -21,15 +21,9 @@
#include "Effect.h"
// Soundtouch defines these as well, so get rid of them before including
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#include "SoundTouch.h"
using namespace soundtouch;
// forward declaration of a class defined in SoundTouch.h
// which is not included here
namespace soundtouch { class SoundTouch; }
class TimeWarper;
@ -38,7 +32,7 @@ class WaveTrack;
class EffectSoundTouch /* not final */ : public Effect
{
public:
// Effect implementation
void End() override;
@ -47,15 +41,16 @@ public:
#ifdef USE_MIDI
double mSemitones; // pitch change for NoteTracks
EffectSoundTouch() { mSemitones = 0; }
EffectSoundTouch();
#endif
~EffectSoundTouch() override;
protected:
// Effect implementation
bool ProcessWithTimeWarper(const TimeWarper &warper);
std::unique_ptr<SoundTouch> mSoundTouch;
std::unique_ptr<soundtouch::SoundTouch> mSoundTouch;
double mCurT0;
double mCurT1;