mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-29 23:29:41 +02:00
Start work on new Compressor2 effect.
Add skeleton files and add them to build systems. Signed-off-by: Max Maisel <max.maisel@posteo.de>
This commit is contained in:
parent
eb774a449c
commit
e5a6585a12
@ -432,6 +432,8 @@ list( APPEND SOURCES PRIVATE
|
||||
effects/ClickRemoval.h
|
||||
effects/Compressor.cpp
|
||||
effects/Compressor.h
|
||||
effects/Compressor2.cpp
|
||||
effects/Compressor2.h
|
||||
effects/Contrast.cpp
|
||||
effects/Contrast.h
|
||||
effects/Distortion.cpp
|
||||
|
151
src/effects/Compressor2.cpp
Normal file
151
src/effects/Compressor2.cpp
Normal file
@ -0,0 +1,151 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
Compressor2.cpp
|
||||
|
||||
Max Maisel
|
||||
|
||||
*******************************************************************//**
|
||||
|
||||
\class EffectCompressor2
|
||||
\brief An Effect which reduces the dynamic level.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
|
||||
#include "../Audacity.h" // for rint from configwin.h
|
||||
#include "Compressor2.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <wx/intl.h>
|
||||
#include <wx/valgen.h>
|
||||
|
||||
#include "../Internat.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../ProjectFileManager.h"
|
||||
#include "../Shuttle.h"
|
||||
#include "../ShuttleGui.h"
|
||||
#include "../WaveTrack.h"
|
||||
#include "../widgets/valnum.h"
|
||||
#include "../widgets/ProgressDialog.h"
|
||||
|
||||
#include "LoadEffects.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(EffectCompressor2, wxEvtHandler)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
const ComponentInterfaceSymbol EffectCompressor2::Symbol
|
||||
{ XO("Compressor v2") };
|
||||
|
||||
namespace{ BuiltinEffectsModule::Registration< EffectCompressor2 > reg; }
|
||||
|
||||
EffectCompressor2::EffectCompressor2()
|
||||
{
|
||||
SetLinearEffectFlag(false);
|
||||
}
|
||||
|
||||
EffectCompressor2::~EffectCompressor2()
|
||||
{
|
||||
}
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
||||
ComponentInterfaceSymbol EffectCompressor2::GetSymbol()
|
||||
{
|
||||
return Symbol;
|
||||
}
|
||||
|
||||
TranslatableString EffectCompressor2::GetDescription()
|
||||
{
|
||||
return XO("Reduces the dynamic of one or more tracks");
|
||||
}
|
||||
|
||||
ManualPageID EffectCompressor2::ManualPage()
|
||||
{
|
||||
return L"Compressor2";
|
||||
}
|
||||
|
||||
// EffectDefinitionInterface implementation
|
||||
|
||||
EffectType EffectCompressor2::GetType()
|
||||
{
|
||||
return EffectTypeProcess;
|
||||
}
|
||||
|
||||
// EffectClientInterface implementation
|
||||
bool EffectCompressor2::DefineParams( ShuttleParams & S )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectCompressor2::GetAutomationParameters(CommandParameters & parms)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectCompressor2::SetAutomationParameters(CommandParameters & parms)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Effect implementation
|
||||
|
||||
bool EffectCompressor2::CheckWhetherSkipEffect()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EffectCompressor2::Startup()
|
||||
{
|
||||
wxString base = wxT("/Effects/Compressor2/");
|
||||
// Load the old "current" settings
|
||||
if (gPrefs->Exists(base))
|
||||
{
|
||||
SaveUserPreset(GetCurrentSettingsGroup());
|
||||
|
||||
gPrefs->Flush();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectCompressor2::Process()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void EffectCompressor2::PopulateOrExchange(ShuttleGui & S)
|
||||
{
|
||||
}
|
||||
|
||||
bool EffectCompressor2::TransferDataToWindow()
|
||||
{
|
||||
if (!mUIParent->TransferDataToWindow())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateUI();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectCompressor2::TransferDataFromWindow()
|
||||
{
|
||||
if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// EffectCompressor2 implementation
|
||||
|
||||
void EffectCompressor2::OnUpdateUI(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
void EffectCompressor2::UpdateUI()
|
||||
{
|
||||
}
|
70
src/effects/Compressor2.h
Normal file
70
src/effects/Compressor2.h
Normal file
@ -0,0 +1,70 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
Compressor2.h
|
||||
|
||||
Max Maisel (based on Compressor effect)
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_EFFECT_COMPRESSOR2__
|
||||
#define __AUDACITY_EFFECT_COMPRESSOR2__
|
||||
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
|
||||
#include "Effect.h"
|
||||
|
||||
class ShuttleGui;
|
||||
|
||||
class EffectCompressor2 final : public Effect
|
||||
{
|
||||
public:
|
||||
static const ComponentInterfaceSymbol Symbol;
|
||||
|
||||
EffectCompressor2();
|
||||
virtual ~EffectCompressor2();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
||||
ComponentInterfaceSymbol GetSymbol() override;
|
||||
TranslatableString GetDescription() override;
|
||||
ManualPageID ManualPage() override;
|
||||
|
||||
// EffectDefinitionInterface implementation
|
||||
|
||||
EffectType GetType() override;
|
||||
|
||||
// EffectClientInterface implementation
|
||||
|
||||
bool DefineParams( ShuttleParams & S ) override;
|
||||
bool GetAutomationParameters(CommandParameters & parms) override;
|
||||
bool SetAutomationParameters(CommandParameters & parms) override;
|
||||
|
||||
// Effect implementation
|
||||
|
||||
bool CheckWhetherSkipEffect() override;
|
||||
bool Startup() override;
|
||||
bool Process() override;
|
||||
void PopulateOrExchange(ShuttleGui & S) override;
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
private:
|
||||
// EffectCompressor2 implementation
|
||||
|
||||
bool UpdateProgress();
|
||||
void OnUpdateUI(wxCommandEvent & evt);
|
||||
void UpdateUI();
|
||||
|
||||
private:
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user