Audacity 3.2.0
|
Spectrogram settings, either for one track or as defaults. More...
#include <SpectrogramSettings.h>
Classes | |
class | ColorSchemeEnumSetting |
class | Globals |
Public Types | |
enum | { LogMinWindowSize = 3 , LogMaxWindowSize = 15 , NumWindowSizes = LogMaxWindowSize - LogMinWindowSize + 1 } |
enum | ScaleTypeValues : int { stLinear , stLogarithmic , stMel , stBark , stErb , stPeriod , stNumScaleTypes } |
enum | ColorScheme : int { csColorNew = 0 , csColorTheme , csGrayscale , csInvGrayscale , csNumColorScheme } |
enum | AlgorithmValues : int { algSTFT = 0 , algReassignment , algPitchEAC , algNumAlgorithms } |
typedef int | ScaleType |
typedef int | Algorithm |
Public Types inherited from ClientData::Cloneable< Covariant, Owner > | |
using | Base = std::conditional_t< std::is_void_v< Covariant >, Cloneable, Covariant > |
using | PointerType = Owner< Base > |
Public Member Functions | |
SpectrogramSettings () | |
SpectrogramSettings (const SpectrogramSettings &other) | |
SpectrogramSettings & | operator= (const SpectrogramSettings &other) |
~SpectrogramSettings () | |
PointerType | Clone () const override |
bool | IsDefault () const |
bool | Validate (bool quiet) |
void | LoadPrefs () |
void | SavePrefs () |
void | UpdatePrefs () override |
void | InvalidateCaches () |
void | DestroyWindows () |
void | CacheWindows () |
void | ConvertToEnumeratedWindowSizes () |
void | ConvertToActualWindowSizes () |
float | findBin (float frequency, float binUnit) const |
NumberScale | GetScale (float minFreq, float maxFreq) const |
bool | SpectralSelectionEnabled () const |
size_t | WindowSize () const |
size_t | ZeroPaddingFactor () const |
size_t | GetFFTLength () const |
size_t | NBins () const |
Public Member Functions inherited from PrefsListener | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Public Member Functions inherited from ClientData::Cloneable< Covariant, Owner > | |
Cloneable ()=default | |
Cloneable (const Cloneable &)=default | |
Cloneable & | operator= (const Cloneable &)=default |
virtual | ~Cloneable ()=default |
virtual PointerType | Clone () const =0 |
Static Public Member Functions | |
static const EnumValueSymbols & | GetScaleNames () |
static const EnumValueSymbols & | GetColorSchemeNames () |
static const TranslatableStrings & | GetAlgorithmNames () |
static SpectrogramSettings & | Get (const WaveTrack &track) |
static SpectrogramSettings & | Get (const WaveChannel &channel) |
static SpectrogramSettings & | Own (WaveChannel &wc) |
static void | Reset (WaveChannel &channel) |
Make channel lose indpendent settings and use defaults. More... | |
static SpectrogramSettings & | defaults () |
Static Public Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Public Attributes | |
int | minFreq |
int | maxFreq |
int | range |
int | gain |
int | frequencyGain |
int | windowType |
ColorScheme | colorScheme |
ScaleType | scaleType |
bool | spectralSelection |
Algorithm | algorithm |
HFFT | hFFT |
Floats | window |
Floats | tWindow |
Floats | dWindow |
Static Public Attributes | |
static ColorSchemeEnumSetting | colorSchemeSetting |
Private Attributes | |
int | windowSize |
int | zeroPaddingFactor |
Friends | |
class | SpectrumPrefs |
Additional Inherited Members | |
Protected Member Functions inherited from PrefsListener | |
virtual void | UpdateSelectedPrefs (int id) |
Spectrogram settings, either for one track or as defaults.
Definition at line 29 of file SpectrogramSettings.h.
typedef int SpectrogramSettings::Algorithm |
Definition at line 175 of file SpectrogramSettings.h.
typedef int SpectrogramSettings::ScaleType |
Definition at line 62 of file SpectrogramSettings.h.
anonymous enum |
Enumerator | |
---|---|
LogMinWindowSize | |
LogMaxWindowSize | |
NumWindowSizes |
Definition at line 52 of file SpectrogramSettings.h.
enum SpectrogramSettings::AlgorithmValues : int |
Enumerator | |
---|---|
algSTFT | |
algReassignment | |
algPitchEAC | |
algNumAlgorithms |
Definition at line 176 of file SpectrogramSettings.h.
enum SpectrogramSettings::ColorScheme : int |
Enumerator | |
---|---|
csColorNew | |
csColorTheme | |
csGrayscale | |
csInvGrayscale | |
csNumColorScheme |
Definition at line 152 of file SpectrogramSettings.h.
enum SpectrogramSettings::ScaleTypeValues : int |
Enumerator | |
---|---|
stLinear | |
stLogarithmic | |
stMel | |
stBark | |
stErb | |
stPeriod | |
stNumScaleTypes |
Definition at line 63 of file SpectrogramSettings.h.
SpectrogramSettings::SpectrogramSettings | ( | ) |
Definition at line 141 of file SpectrogramSettings.cpp.
References LoadPrefs().
SpectrogramSettings::SpectrogramSettings | ( | const SpectrogramSettings & | other | ) |
Definition at line 146 of file SpectrogramSettings.cpp.
SpectrogramSettings::~SpectrogramSettings | ( | ) |
Definition at line 516 of file SpectrogramSettings.cpp.
References DestroyWindows().
void SpectrogramSettings::CacheWindows | ( | ) |
Definition at line 591 of file SpectrogramSettings.cpp.
References algorithm, algReassignment, anonymous_namespace{SpectrogramSettings.cpp}::DWINDOW, dWindow, GetFFT(), hFFT, anonymous_namespace{SpectrogramSettings.cpp}::RecreateWindow(), anonymous_namespace{SpectrogramSettings.cpp}::TWINDOW, tWindow, anonymous_namespace{SpectrogramSettings.cpp}::WINDOW, window, windowSize, WindowSize(), windowType, and ZeroPaddingFactor().
|
overridevirtual |
Implements ClientData::Cloneable< Covariant, Owner >.
Definition at line 521 of file SpectrogramSettings.cpp.
void SpectrogramSettings::ConvertToActualWindowSizes | ( | ) |
Definition at line 631 of file SpectrogramSettings.cpp.
References LogMinWindowSize, windowSize, and zeroPaddingFactor.
Referenced by SpectrumPrefs::Preview(), SpectrumPrefs::Validate(), and Validate().
void SpectrogramSettings::ConvertToEnumeratedWindowSizes | ( | ) |
Definition at line 609 of file SpectrogramSettings.cpp.
References LogMaxWindowSize, LogMinWindowSize, min(), NumWindowSizes, size, windowSize, and zeroPaddingFactor.
Referenced by SpectrumPrefs::OnDefaults(), SpectrumPrefs::Preview(), SpectrumPrefs::SpectrumPrefs(), SpectrumPrefs::Validate(), and Validate().
|
static |
Definition at line 212 of file SpectrogramSettings.cpp.
Referenced by SpectrumPrefs::Commit(), Get(), SpectrumPrefs::OnDefaults(), SpectrumPrefs::Preview(), SpectrumPrefs::Rollback(), SpectrumPrefs::SpectrumPrefs(), and UpdatePrefs().
void SpectrogramSettings::DestroyWindows | ( | ) |
Definition at line 526 of file SpectrogramSettings.cpp.
References dWindow, hFFT, tWindow, and window.
Referenced by InvalidateCaches(), operator=(), and ~SpectrogramSettings().
float SpectrogramSettings::findBin | ( | float | frequency, |
float | binUnit | ||
) | const |
Definition at line 637 of file SpectrogramSettings.cpp.
|
static |
Return either the track's independent settings or global defaults Mutative access to attachment even if the track argument is const
Definition at line 119 of file SpectrogramSettings.cpp.
References Get(), and WaveChannel::GetTrack().
|
static |
Return either the track's independent settings or global defaults Mutative access to attachment even if the track argument is const
Definition at line 109 of file SpectrogramSettings.cpp.
References defaults(), and key1.
Referenced by SetTrackVisualsCommand::ApplyInner(), BrushHandle::BrushHandle(), SpectrumView::DoSetMinimized(), SpectrumVRulerControls::DoUpdateVRuler(), SpectrumVZoomHandle::DoZoom(), anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), for(), anonymous_namespace{BrushHandle.cpp}::FrequencyToPosition(), anonymous_namespace{SelectHandle.cpp}::FrequencyToPosition(), Get(), SpectrogramBounds::Get(), SpectrogramBounds::GetBounds(), NyquistBase::Init(), anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView(), anonymous_namespace{BrushHandle.cpp}::isSpectralSelectionView(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), anonymous_namespace{SelectHandle.cpp}::PositionToFrequency(), NyquistBase::ProcessOne(), SelectHandle::SnapCenterOnce(), SpectrumPrefs::SpectrumPrefs(), and SelectHandle::StartSnappingFreqSelection().
|
static |
Definition at line 278 of file SpectrogramSettings.cpp.
References XO().
Referenced by SpectrumPrefs::PopulateOrExchange().
|
static |
Definition at line 238 of file SpectrogramSettings.cpp.
References csNumColorScheme, wxT(), and XC.
Referenced by SpectrogramSettings::ColorSchemeEnumSetting::Migrate(), SetTrackVisualsCommand::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), and SetTrackVisualsCommand::VisitSettings().
size_t SpectrogramSettings::GetFFTLength | ( | ) | const |
Definition at line 646 of file SpectrogramSettings.cpp.
References algorithm, algPitchEAC, windowSize, and zeroPaddingFactor.
Referenced by NBins().
NumberScale SpectrogramSettings::GetScale | ( | float | minFreq, |
float | maxFreq | ||
) | const |
Definition at line 661 of file SpectrogramSettings.cpp.
References nstBark, nstErb, nstLinear, nstLogarithmic, nstMel, nstPeriod, scaleType, stBark, stErb, stLinear, stLogarithmic, stMel, and stPeriod.
|
static |
Definition at line 219 of file SpectrogramSettings.cpp.
References XO().
Referenced by SpectrumPrefs::PopulateOrExchange().
void SpectrogramSettings::InvalidateCaches | ( | ) |
Definition at line 511 of file SpectrogramSettings.cpp.
References DestroyWindows().
Referenced by LoadPrefs().
|
inline |
Definition at line 101 of file SpectrogramSettings.h.
void SpectrogramSettings::LoadPrefs | ( | ) |
Definition at line 362 of file SpectrogramSettings.cpp.
References algorithm, colorScheme, colorSchemeSetting, frequencyGain, gain, InvalidateCaches(), maxFreq, minFreq, range, Setting< T >::Read(), EnumSetting< Enum >::ReadEnum(), scaleType, spectralSelection, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumAlgorithm, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumEnableSelection, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumFFTSize, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumFrequencyGain, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumGain, SpectrumMaxFreq, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumMinFreq, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumRange, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumScale, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumWindowFunction, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumZeroPaddingFactor, Validate(), windowSize, windowType, and zeroPaddingFactor.
Referenced by SpectrumPrefs::Commit(), and SpectrogramSettings().
size_t SpectrogramSettings::NBins | ( | ) | const |
Definition at line 655 of file SpectrogramSettings.cpp.
References GetFFTLength().
SpectrogramSettings & SpectrogramSettings::operator= | ( | const SpectrogramSettings & | other | ) |
Definition at line 179 of file SpectrogramSettings.cpp.
References algorithm, colorScheme, DestroyWindows(), frequencyGain, gain, maxFreq, minFreq, range, scaleType, spectralSelection, windowSize, windowType, and zeroPaddingFactor.
|
static |
Definition at line 124 of file SpectrogramSettings.cpp.
References WaveChannel::GetTrack(), and key1.
Referenced by SetTrackVisualsCommand::ApplyInner(), SpectrumVRulerControls::DoHandleWheelRotation(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), SpectrumPrefs::Preview(), and SpectrumPrefs::Rollback().
|
static |
Make channel lose indpendent settings and use defaults.
Definition at line 136 of file SpectrogramSettings.cpp.
References WaveChannel::GetTrack(), and key1.
Referenced by SetTrackVisualsCommand::ApplyInner(), SpectrumPrefs::Preview(), and SpectrumPrefs::Rollback().
void SpectrogramSettings::SavePrefs | ( | ) |
Definition at line 405 of file SpectrogramSettings.cpp.
References algorithm, colorScheme, colorSchemeSetting, frequencyGain, gain, maxFreq, minFreq, range, scaleType, spectralSelection, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumAlgorithm, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumEnableSelection, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumFFTSize, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumFrequencyGain, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumGain, SpectrumMaxFreq, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumMinFreq, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumRange, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumScale, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumWindowFunction, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumZeroPaddingFactor, windowSize, windowType, Setting< T >::Write(), EnumSetting< Enum >::WriteEnum(), and zeroPaddingFactor.
Referenced by SpectrumPrefs::Commit().
bool SpectrogramSettings::SpectralSelectionEnabled | ( | ) | const |
Definition at line 687 of file SpectrogramSettings.cpp.
References SpectrogramSettings::Globals::Get(), and spectralSelection.
Referenced by NyquistBase::Init(), anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView(), anonymous_namespace{BrushHandle.cpp}::isSpectralSelectionView(), and NyquistBase::ProcessOne().
|
overridevirtual |
Implements PrefsListener.
Definition at line 447 of file SpectrogramSettings.cpp.
References algorithm, colorScheme, colorSchemeSetting, defaults(), frequencyGain, gain, maxFreq, minFreq, range, Setting< T >::Read(), EnumSetting< Enum >::ReadEnum(), scaleType, spectralSelection, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumAlgorithm, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumEnableSelection, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumFFTSize, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumFrequencyGain, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumGain, SpectrumMaxFreq, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumMinFreq, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumRange, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumScale, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumWindowFunction, anonymous_namespace{SpectrogramSettings.cpp}::SpectrumZeroPaddingFactor, Validate(), windowSize, windowType, and zeroPaddingFactor.
bool SpectrogramSettings::Validate | ( | bool | quiet | ) |
Definition at line 291 of file SpectrogramSettings.cpp.
References algNumAlgorithms, algorithm, colorScheme, ConvertToActualWindowSizes(), ConvertToEnumeratedWindowSizes(), csNumColorScheme, frequencyGain, maxFreq, min(), minFreq, NumWindowFuncs(), range, scaleType, BasicUI::ShowMessageBox(), stNumScaleTypes, windowType, and XO().
Referenced by LoadPrefs(), UpdatePrefs(), and SpectrumPrefs::Validate().
|
inline |
Definition at line 140 of file SpectrogramSettings.h.
Referenced by CacheWindows(), and SpectrumPrefs::SpectrumPrefs().
|
inline |
Definition at line 145 of file SpectrogramSettings.h.
Referenced by CacheWindows().
|
friend |
Definition at line 33 of file SpectrogramSettings.h.
Algorithm SpectrogramSettings::algorithm |
Definition at line 183 of file SpectrogramSettings.h.
Referenced by CacheWindows(), GetFFTLength(), LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), UpdatePrefs(), and Validate().
ColorScheme SpectrogramSettings::colorScheme |
Definition at line 161 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), UpdatePrefs(), and Validate().
|
static |
Definition at line 167 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), SavePrefs(), and UpdatePrefs().
Floats SpectrogramSettings::dWindow |
Definition at line 204 of file SpectrogramSettings.h.
Referenced by CacheWindows(), and DestroyWindows().
int SpectrogramSettings::frequencyGain |
Definition at line 133 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), UpdatePrefs(), and Validate().
int SpectrogramSettings::gain |
Definition at line 132 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), and UpdatePrefs().
HFFT SpectrogramSettings::hFFT |
Definition at line 199 of file SpectrogramSettings.h.
Referenced by CacheWindows(), and DestroyWindows().
int SpectrogramSettings::maxFreq |
Definition at line 126 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SpectrumPrefs::Preview(), SavePrefs(), SpectrumPrefs::SpectrumPrefs(), UpdatePrefs(), and Validate().
int SpectrogramSettings::minFreq |
Definition at line 125 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SpectrumPrefs::Preview(), SavePrefs(), SpectrumPrefs::SpectrumPrefs(), UpdatePrefs(), and Validate().
int SpectrogramSettings::range |
Definition at line 131 of file SpectrogramSettings.h.
Referenced by LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), UpdatePrefs(), and Validate().
ScaleType SpectrogramSettings::scaleType |
Definition at line 169 of file SpectrogramSettings.h.
Referenced by SpectrumView::DoSetMinimized(), GetScale(), LoadPrefs(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), UpdatePrefs(), and Validate().
bool SpectrogramSettings::spectralSelection |
Definition at line 172 of file SpectrogramSettings.h.
Referenced by SpectrogramSettings::Globals::LoadPrefs(), LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SpectrogramSettings::Globals::SavePrefs(), SavePrefs(), SpectralSelectionEnabled(), and UpdatePrefs().
Floats SpectrogramSettings::tWindow |
Definition at line 203 of file SpectrogramSettings.h.
Referenced by CacheWindows(), and DestroyWindows().
Floats SpectrogramSettings::window |
Definition at line 200 of file SpectrogramSettings.h.
Referenced by CacheWindows(), DestroyWindows(), and anonymous_namespace{SpectrogramSettings.cpp}::RecreateWindow().
|
private |
Definition at line 138 of file SpectrogramSettings.h.
Referenced by CacheWindows(), ConvertToActualWindowSizes(), ConvertToEnumeratedWindowSizes(), GetFFTLength(), LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), anonymous_namespace{SpectrogramSettings.cpp}::RecreateWindow(), SavePrefs(), and UpdatePrefs().
int SpectrogramSettings::windowType |
Definition at line 135 of file SpectrogramSettings.h.
Referenced by CacheWindows(), LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), anonymous_namespace{SpectrogramSettings.cpp}::RecreateWindow(), SavePrefs(), UpdatePrefs(), and Validate().
|
private |
Definition at line 143 of file SpectrogramSettings.h.
Referenced by ConvertToActualWindowSizes(), ConvertToEnumeratedWindowSizes(), GetFFTLength(), LoadPrefs(), operator=(), SpectrumPrefs::PopulateOrExchange(), SavePrefs(), and UpdatePrefs().