2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
TruncSilence.h
|
|
|
|
|
|
|
|
Lynn Allan (from DM's Normalize)
|
|
|
|
//ToDo ... put BlendFrames in Effects, Project, or other class
|
|
|
|
//ToDo ... Use ZeroCrossing logic to improve blend
|
|
|
|
//ToDo ... BlendFrames on "fade-out"
|
|
|
|
//ToDo ... BlendFrameCount is a user-selectable parameter
|
|
|
|
//ToDo ... Detect transient signals that are too short to interrupt the TruncatableSilence
|
|
|
|
Philip Van Baren (more options and boundary fixes)
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_EFFECT_TRUNC_SILENCE__
|
|
|
|
#define __AUDACITY_EFFECT_TRUNC_SILENCE__
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
#include <wx/arrstr.h>
|
|
|
|
#include <wx/choice.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/list.h>
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "Effect.h"
|
2010-03-13 15:21:38 +00:00
|
|
|
|
2015-06-18 14:24:36 +00:00
|
|
|
class ShuttleGui;
|
|
|
|
|
2015-04-19 03:49:05 +00:00
|
|
|
#define TRUNCATESILENCE_PLUGIN_SYMBOL XO("Truncate Silence")
|
2010-03-13 15:21:38 +00:00
|
|
|
|
|
|
|
// Declaration of RegionList
|
|
|
|
struct REGION;
|
|
|
|
typedef struct REGION Region;
|
|
|
|
WX_DECLARE_LIST(Region, RegionList);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
class EffectTruncSilence : public Effect
|
|
|
|
{
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
|
|
|
EffectTruncSilence();
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual ~EffectTruncSilence();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// IdentInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual wxString GetSymbol();
|
|
|
|
virtual wxString GetDescription();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectIdentInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual EffectType GetType();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectClientInterface implementation
|
|
|
|
|
|
|
|
virtual bool GetAutomationParameters(EffectAutomationParameters & parms);
|
|
|
|
virtual bool SetAutomationParameters(EffectAutomationParameters & parms);
|
|
|
|
|
|
|
|
// Effect implementation
|
|
|
|
|
|
|
|
virtual bool Startup();
|
2010-01-23 19:44:49 +00:00
|
|
|
virtual bool Process();
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual void PopulateOrExchange(ShuttleGui & S);
|
|
|
|
virtual bool TransferDataToWindow();
|
|
|
|
virtual bool TransferDataFromWindow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// EffectTruncSilence implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
//ToDo ... put BlendFrames in Effects, Project, or other class
|
|
|
|
void BlendFrames(float* buffer, int leftIndex, int rightIndex, int blendFrameCount);
|
2010-03-13 15:21:38 +00:00
|
|
|
void Intersect(RegionList &dest, const RegionList &src);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void OnControlChange(wxCommandEvent & evt);
|
|
|
|
void UpdateUI();
|
|
|
|
|
|
|
|
private:
|
2010-01-23 19:44:49 +00:00
|
|
|
int mTruncDbChoiceIndex;
|
2015-04-17 03:53:42 +00:00
|
|
|
int mActionIndex;
|
2014-03-19 00:50:24 +00:00
|
|
|
double mInitialAllowedSilence;
|
|
|
|
double mTruncLongestAllowedSilence;
|
|
|
|
double mSilenceCompressPercent;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
wxArrayString mDbChoices;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
sampleCount mBlendFrameCount;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
wxChoice *mTruncDbChoice;
|
|
|
|
wxChoice *mActionChoice;
|
|
|
|
wxTextCtrl *mInitialAllowedSilenceT;
|
|
|
|
wxTextCtrl *mTruncLongestAllowedSilenceT;
|
|
|
|
wxTextCtrl *mSilenceCompressPercentT;
|
2014-03-19 00:50:24 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
DECLARE_EVENT_TABLE();
|
2010-01-23 19:44:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|