1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-05 00:00:21 +01:00
Files
audacity/src/effects/ChangeTempo.h
Leland Lucius 8fbfa460c4 Migrating the remaining effects
This brings the builtin, LV2, and VAMP effects inline with the
Audio Units, LADSPA, and VST effects.  All effects now share
a common UI.

This gives all effects (though not implemented for all):

User and factory preset capability
Preset import/export capability
Shared or private configuration options

Builtin effects can now be migrated to RTP, depending on algorithm.
LV2 effects now support graphical interfaces if the plugin supplies one.
Nyquist prompt enhanced to provide some features of the Nyquist Workbench.

It may not look like it, but this was a LOT of work, so trust me, there
WILL be problems and everything effect related should be suspect.  Keep
a sharp eye (or two) open.
2015-04-16 23:36:28 -05:00

101 lines
3.0 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
ChangeTempo.h
Vaughan Johnson, Dominic Mazzoni
Change Tempo effect provides speeding up or
slowing down tempo without changing pitch.
**********************************************************************/
#if USE_SOUNDTOUCH
#ifndef __AUDACITY_EFFECT_CHANGETEMPO__
#define __AUDACITY_EFFECT_CHANGETEMPO__
#include <wx/event.h>
#include <wx/slider.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include "../ShuttleGui.h"
#include "SoundTouchEffect.h"
#define CHANGETEMPO_PLUGIN_SYMBOL wxTRANSLATE("Change Tempo")
class EffectChangeTempo : public EffectSoundTouch
{
public:
EffectChangeTempo();
virtual ~EffectChangeTempo();
// IdentInterface implementation
virtual wxString GetSymbol();
virtual wxString GetDescription();
// EffectIdentInterface implementation
virtual EffectType GetType();
virtual bool SupportsAutomation();
// EffectClientInterface implementation
virtual bool GetAutomationParameters(EffectAutomationParameters & parms);
virtual bool SetAutomationParameters(EffectAutomationParameters & parms);
// Effect implementation
virtual bool Init();
virtual bool CheckWhetherSkipEffect();
virtual bool Process();
virtual double CalcPreviewInputLength(double previewLength);
virtual void PopulateOrExchange(ShuttleGui & S);
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();
private:
// EffectChangeTempo implementation
// handlers
void OnText_PercentChange(wxCommandEvent & evt);
void OnSlider_PercentChange(wxCommandEvent & evt);
void OnText_FromBPM(wxCommandEvent & evt);
void OnText_ToBPM(wxCommandEvent & evt);
void OnText_ToLength(wxCommandEvent & evt);
// helper fns
void Update_Text_PercentChange(); // Update control per current m_PercentChange.
void Update_Slider_PercentChange(); // Update control per current m_PercentChange.
void Update_Text_ToBPM(); // Use m_FromBPM & m_PercentChange to set new m_ToBPM & control.
void Update_Text_ToLength(); // Use m_FromLength & m_PercentChange to set new m_ToLength & control.
private:
double m_PercentChange; // percent change to apply to tempo
// -100% is meaningless, but sky's the upper limit
double m_FromBPM; // user-set beats-per-minute. Zero means not yet set.
double m_ToBPM; // Zero value means not yet set.
double m_FromLength; // starting length of selection
double m_ToLength; // target length of selection
bool m_bLoopDetect;
// controls
wxTextCtrl * m_pTextCtrl_PercentChange;
wxSlider * m_pSlider_PercentChange;
wxTextCtrl * m_pTextCtrl_FromBPM;
wxTextCtrl * m_pTextCtrl_ToBPM;
wxTextCtrl * m_pTextCtrl_FromLength;
wxTextCtrl * m_pTextCtrl_ToLength;
DECLARE_EVENT_TABLE();
};
#endif // __AUDACITY_EFFECT_CHANGETEMPO__
#endif // USE_SOUNDTOUCH