Audacity  2.2.0
ControlToolBar Class Referencefinal

A ToolBar that has the main Transport buttons. More...

#include <ControlToolBar.h>

Inheritance diagram for ControlToolBar:
ToolBar wxTabTraversalWrapper< Base >

Public Types

enum  PlayAppearance {
  PlayAppearance::Straight, PlayAppearance::Looped, PlayAppearance::CutPreview, PlayAppearance::Scrub,
  PlayAppearance::Seek
}
 
- Public Types inherited from ToolBar
using Holder = Destroy_ptr< ToolBar >
 

Public Member Functions

 ControlToolBar ()
 Methods for ControlToolBar. More...
 
virtual ~ControlToolBar ()
 
void Create (wxWindow *parent)
 
void UpdatePrefs ()
 
void OnKeyEvent (wxKeyEvent &event)
 
void OnRewind (wxCommandEvent &evt)
 
void OnPlay (wxCommandEvent &evt)
 
void OnStop (wxCommandEvent &evt)
 
void OnRecord (wxCommandEvent &evt)
 
void OnFF (wxCommandEvent &evt)
 
void OnPause (wxCommandEvent &evt)
 
void SetPlay (bool down, PlayAppearance appearance=PlayAppearance::Straight)
 
void SetStop (bool down)
 
void SetRecord (bool down, bool append=false)
 
bool IsPauseDown () const
 
bool IsRecordDown () const
 
bool CanStopAudioStream ()
 
void PlayCurrentRegion (bool looped=false, bool cutpreview=false)
 
int PlayPlayRegion (const SelectedRegion &selectedRegion, const AudioIOStartStreamOptions &options, PlayMode playMode, PlayAppearance appearance=PlayAppearance::Straight, bool backwards=false, bool playWhiteSpace=false)
 
void PlayDefault ()
 
void StopPlaying (bool stopStream=true)
 
void Pause ()
 
void Populate ()
 
void Repaint (wxDC *dc) override
 
void EnableDisableButtons () override
 
void ReCreateButtons () override
 
void RegenerateTooltips () override
 
int WidthForStatusBar (wxStatusBar *const)
 
void UpdateStatusBar (AudacityProject *pProject)
 
void StartScrollingIfPreferred ()
 
void StartScrolling ()
 
void StopScrolling ()
 
- Public Member Functions inherited from ToolBar
 ToolBar (int type, const wxString &label, const wxString &section, bool resizable=false)
 
virtual ~ToolBar ()
 
bool AcceptsFocus () const override
 
int GetType ()
 
wxString GetTitle ()
 
wxString GetLabel ()
 
wxString GetSection ()
 
ToolDockGetDock ()
 
void SetLabel (const wxString &label)
 
void SetDock (ToolDock *dock)
 
void SetDocked (ToolDock *dock, bool pushed)
 
virtual bool Expose (bool show=true)
 
bool IsResizable () const
 
bool IsVisible () const
 
bool IsDocked () const
 
bool IsPositioned ()
 
void SetVisible (bool bVisible)
 
void SetPositioned ()
 
virtual int GetInitialWidth ()
 Resizable toolbars should implement this. More...
 
virtual int GetMinToolbarWidth ()
 
virtual wxSize GetDockedSize ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< Base >
template<typename... Args>
 wxTabTraversalWrapper (Args &&...args)
 
 ~wxTabTraversalWrapper ()
 

Private Types

enum  {
  ID_PLAY_BUTTON = 11000, ID_RECORD_BUTTON, ID_PAUSE_BUTTON, ID_STOP_BUTTON,
  ID_FF_BUTTON, ID_REW_BUTTON, BUTTON_COUNT
}
 

Private Member Functions

AButtonMakeButton (teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const wxChar *label)
 
void ArrangeButtons ()
 
void SetupCutPreviewTracks (double playStart, double cutStart, double cutEnd, double playEnd)
 
void ClearCutPreviewTracks ()
 
wxString StateForStatusBar ()
 

Static Private Member Functions

static void MakeAlternateImages (AButton &button, int idx, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled)
 

Private Attributes

AButtonmRewind
 
AButtonmPlay
 
AButtonmRecord
 
AButtonmPause
 
AButtonmStop
 
AButtonmFF
 
bool mPaused
 
bool mErgonomicTransportButtons
 
wxString mStrLocale
 
wxBoxSizer * mSizer
 
std::shared_ptr< TrackListmCutPreviewTracks
 
wxString mStatePlay
 
wxString mStateStop
 
wxString mStateRecord
 
wxString mStatePause
 

Static Private Attributes

static AudacityProjectmBusyProject = NULL
 

Additional Inherited Members

- Static Public Member Functions inherited from ToolBar
static AButtonMakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size)
 
static void MakeAlternateImages (AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
 
static void SetButtonToolTip (AButton &button, const std::vector< wxString > &commands)
 
- Protected Member Functions inherited from ToolBar
void SetButton (bool down, AButton *button)
 
void MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
void MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
void MakeButtonBackgroundsLarge ()
 
void MakeButtonBackgroundsSmall ()
 
wxBoxSizer * GetSizer ()
 
void Add (wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
 
void Add (wxSizer *sizer, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 
void Add (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 
void AddSpacer (int size=14)
 
void AddStretchSpacer (int prop=1)
 
void Detach (wxWindow *window)
 
void Detach (wxSizer *sizer)
 
void Updated ()
 
int GetResizeGrabberWidth ()
 Returns the width in pixels of the resizer element. More...
 
void OnErase (wxEraseEvent &event)
 
void OnPaint (wxPaintEvent &event)
 
void OnMouseEvents (wxMouseEvent &event)
 
- Protected Attributes inherited from ToolBar
wxString mLabel
 
wxString mSection
 
int mType
 

Detailed Description

A ToolBar that has the main Transport buttons.

In the GUI, this is referred to as "Transport Toolbar", as it corresponds to commands in the Transport menu. "Control Toolbar" is historic. This class, which is a child of Toolbar, creates the window containing the Transport (rewind/play/stop/record/ff) buttons. The window can be embedded within a normal project window, or within a ToolbarFrame that is managed by a global ToolBarStub called gControlToolBarStub.

All of the controls in this window were custom-written for Audacity - they are not native controls on any platform - however, it is intended that the images could be easily replaced to allow "skinning" or just customization to match the look and feel of each platform.

Member Enumeration Documentation

anonymous enum
private
Enumerator
ID_PLAY_BUTTON 
ID_RECORD_BUTTON 
ID_PAUSE_BUTTON 
ID_STOP_BUTTON 
ID_FF_BUTTON 
ID_REW_BUTTON 
BUTTON_COUNT 
Enumerator
Straight 
Looped 
CutPreview 
Scrub 
Seek 

Constructor & Destructor Documentation

ControlToolBar::ControlToolBar ( )

Methods for ControlToolBar.

References gPrefs, and XO.

ControlToolBar::~ControlToolBar ( )
virtual

Member Function Documentation

void ControlToolBar::ArrangeButtons ( )
private
void ControlToolBar::ClearCutPreviewTracks ( )
private

References mCutPreviewTracks.

Referenced by SetupCutPreviewTracks(), and StopPlaying().

void ControlToolBar::Create ( wxWindow *  parent)
virtual

Reimplemented from ToolBar.

References ToolBar::Create().

bool ControlToolBar::IsPauseDown ( ) const
bool ControlToolBar::IsRecordDown ( ) const

References AButton::IsDown(), and mRecord.

void ControlToolBar::MakeAlternateImages ( AButton button,
int  idx,
teBmps  eEnabledUp,
teBmps  eEnabledDown,
teBmps  eDisabled 
)
staticprivate
AButton * ControlToolBar::MakeButton ( teBmps  eEnabledUp,
teBmps  eEnabledDown,
teBmps  eDisabled,
int  id,
bool  processdownevents,
const wxChar *  label 
)
private
void ControlToolBar::OnKeyEvent ( wxKeyEvent &  event)
void ControlToolBar::OnPlay ( wxCommandEvent &  evt)
void ControlToolBar::Pause ( )
void ControlToolBar::PlayDefault ( )
int ControlToolBar::PlayPlayRegion ( const SelectedRegion selectedRegion,
const AudioIOStartStreamOptions options,
PlayMode  playMode,
PlayAppearance  appearance = PlayAppearance::Straight,
bool  backwards = false,
bool  playWhiteSpace = false 
)
void ControlToolBar::RegenerateTooltips ( )
overridevirtual
void ControlToolBar::Repaint ( wxDC *  dc)
overridevirtual

Implements ToolBar.

References AColor::Bevel(), and mSizer.

void ControlToolBar::SetRecord ( bool  down,
bool  append = false 
)
void ControlToolBar::SetupCutPreviewTracks ( double  playStart,
double  cutStart,
double  cutEnd,
double  playEnd 
)
private
wxString ControlToolBar::StateForStatusBar ( )
private
void ControlToolBar::StopScrolling ( )
void ControlToolBar::UpdatePrefs ( )
virtual
int ControlToolBar::WidthForStatusBar ( wxStatusBar * const  sb)

Member Data Documentation

AudacityProject * ControlToolBar::mBusyProject = NULL
staticprivate
std::shared_ptr<TrackList> ControlToolBar::mCutPreviewTracks
private
bool ControlToolBar::mErgonomicTransportButtons
private

Referenced by ArrangeButtons(), and UpdatePrefs().

AButton* ControlToolBar::mFF
private
bool ControlToolBar::mPaused
private

Referenced by OnPause(), and StopPlaying().

AButton* ControlToolBar::mRewind
private
wxBoxSizer* ControlToolBar::mSizer
private
wxString ControlToolBar::mStatePause
private
wxString ControlToolBar::mStatePlay
private
wxString ControlToolBar::mStateRecord
private
wxString ControlToolBar::mStateStop
private
AButton* ControlToolBar::mStop
private
wxString ControlToolBar::mStrLocale
private

Referenced by UpdatePrefs().


The documentation for this class was generated from the following files: