1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 00:50:05 +02:00
audacity/src/prefs/SpectrumPrefs.h
Paul Licameli bf005c0dec PrefsPanel::Factory is a specialization of std::function...
... We don't need to define a class for it
2019-05-16 12:14:51 -04:00

113 lines
2.5 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
SpectrumPrefs.h
Dominic Mazzoni
James Crook
**********************************************************************/
/*
Salvo Ventura
November 2006
Added selection box for windowType
All params are saved in config file.
*/
#ifndef __AUDACITY_SPECTRUM_PREFS__
#define __AUDACITY_SPECTRUM_PREFS__
#include "../Experimental.h"
#include <wx/defs.h>
#include "../WaveTrack.h"
#include "PrefsPanel.h"
#include "SpectrogramSettings.h"
class wxArrayStringEx;
class wxChoice;
class wxCheckBox;
class wxTextCtrl;
struct FFTParam;
class ShuttleGui;
class SpectrogramSettings;
class WaveTrack;
#define SPECTRUM_PREFS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Spectrum") }
class SpectrumPrefs final : public PrefsPanel
{
public:
SpectrumPrefs(wxWindow * parent, wxWindowID winid, WaveTrack *wt);
virtual ~SpectrumPrefs();
ComponentInterfaceSymbol GetSymbol() override;
wxString GetDescription() override;
void Preview() override;
bool Commit() override;
void PopulateOrExchange(ShuttleGui & S) override;
void Rollback();
bool ShowsPreviewButton() override;
bool Validate() override;
wxString HelpPageName() override;
private:
void Populate(size_t windowSize);
void PopulatePaddingChoices(size_t windowSize);
void OnControl(wxCommandEvent &event);
void OnWindowSize(wxCommandEvent &event);
void OnDefaults(wxCommandEvent&);
void OnAlgorithm(wxCommandEvent &);
DECLARE_EVENT_TABLE()
void EnableDisableSTFTOnlyControls();
WaveTrack *const mWt;
bool mDefaulted, mOrigDefaulted;
wxTextCtrl *mMinFreq;
wxTextCtrl *mMaxFreq;
wxTextCtrl *mGain;
wxTextCtrl *mRange;
wxTextCtrl *mFrequencyGain;
#ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
int mZeroPaddingChoice;
wxChoice *mZeroPaddingChoiceCtrl;
wxArrayStringEx mZeroPaddingChoices;
#endif
wxArrayStringEx mTypeChoices;
wxChoice *mAlgorithmChoice;
#ifdef EXPERIMENTAL_FIND_NOTES
wxTextCtrl *mFindNotesMinA;
wxTextCtrl *mFindNotesN;
#endif
wxCheckBox *mDefaultsCheckbox;
SpectrogramSettings mTempSettings, mOrigSettings;
WaveTrack::WaveTrackDisplay mOrigDisplay;
float mOrigMin, mOrigMax;
bool mPopulating;
bool mCommitted{};
};
/// A PrefsPanel::Factory that creates one SpectrumPrefs panel.
/// This factory can be parametrized by a single track, to change settings
/// non-globally
extern PrefsPanel::Factory SpectrumPrefsFactory( WaveTrack *wt = 0 );
#endif