1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-27 22:19:24 +02:00
audacity/src/toolbars/SpectralSelectionBar.h
Paul Licameli f0ae4c3858 ProjectWindow does not depend on selection toolbars...
... Freeing SelectionBar and SpectralSelectionBar from cycles.

Also fixing a minor problem:  if two projects are open, and one is playing or
recording, and you switch windows -- then the audio time in the selection bar
of the other project could be updated.
2019-06-12 21:02:11 -04:00

87 lines
2.0 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
SpectralSelectionBar.h
Paul Licameli
**********************************************************************/
#ifndef __AUDACITY_SPECTRAL_SELECTION_BAR__
#define __AUDACITY_SPECTRAL_SELECTION_BAR__
#include <wx/defs.h>
#include "ToolBar.h"
class wxChoice;
class wxComboBox;
class wxCommandEvent;
class wxDC;
class wxSizeEvent;
class AudacityProject;
class SpectralSelectionBarListener;
class NumericTextCtrl;
class SpectralSelectionBar final : public ToolBar {
public:
SpectralSelectionBar( AudacityProject &project );
virtual ~SpectralSelectionBar();
static SpectralSelectionBar &Get( AudacityProject &project );
static const SpectralSelectionBar &Get( const AudacityProject &project );
void Create(wxWindow *parent) override;
void Populate() override;
void Repaint(wxDC * WXUNUSED(dc)) override {};
void EnableDisableButtons() override {};
void UpdatePrefs() override;
void SetFrequencies(double bottom, double top);
void SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName);
void SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName);
void SetListener(SpectralSelectionBarListener *l);
void RegenerateTooltips() override {};
private:
void ValuesToControls();
void SetBounds();
void OnUpdate(wxCommandEvent &evt);
void OnCtrl(wxCommandEvent &evt);
void OnChoice(wxCommandEvent &evt);
void OnIdle( wxIdleEvent &evt );
void OnSize(wxSizeEvent &evt);
void ModifySpectralSelection(bool done = false);
SpectralSelectionBarListener * mListener;
bool mbCenterAndWidth;
double mCenter; // hertz
double mWidth; // logarithm of ratio of hertz
double mLow; // hertz
double mHigh; // hertz
NumericTextCtrl *mCenterCtrl, *mWidthCtrl, *mLowCtrl, *mHighCtrl;
wxChoice *mChoice;
int mHeight; // height of main sizer after creation - used by OnChoice()
public:
DECLARE_CLASS(SpectralSelectionBar)
DECLARE_EVENT_TABLE()
};
#endif