Audacity 3.2.0
|
A kind of ToolBar used to help with analysing voice recordings. More...
#include <TranscriptionToolBar.h>
Public Member Functions | |
TranscriptionToolBar (AudacityProject &project) | |
virtual | ~TranscriptionToolBar () |
bool | ShownByDefault () const override |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
DockID | DefaultDockID () const override |
Which dock the toolbar defaults into. Default implementation chooses the top dock. More... | |
void | Create (wxWindow *parent) override |
void | OnKeyEvent (wxKeyEvent &event) |
void | OnPlaySpeed (wxCommandEvent &event) |
void | OnSpeedSlider (wxCommandEvent &event) |
void | Populate () override |
void | Repaint (wxDC *WXUNUSED(dc)) override |
void | EnableDisableButtons () override |
void | UpdatePrefs () override |
int | GetInitialWidth () override |
Resizable toolbars should implement these. More... | |
int | GetMinToolbarWidth () override |
void | OnFocus (wxFocusEvent &event) |
void | OnCaptureKey (wxCommandEvent &event) |
void | PlayAtSpeed (bool looped, bool cutPreview) |
void | ShowPlaySpeedDialog () |
void | AdjustPlaySpeed (float adj) |
void | SetEnabled (bool enabled) |
void | SetPlaying (bool down, bool looped, bool cutPreview) |
double | GetPlaySpeed () const |
Public Member Functions inherited from ToolBar | |
ToolBar (AudacityProject &project, const TranslatableString &label, const Identifier §ion, bool resizable=false) | |
virtual | ~ToolBar () |
virtual bool | ShownByDefault () const |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
virtual bool | HideAfterReset () const |
Default implementation returns false. More... | |
virtual DockID | DefaultDockID () const |
Which dock the toolbar defaults into. Default implementation chooses the top dock. More... | |
bool | AcceptsFocus () const override |
bool | AcceptsFocusFromKeyboard () const override |
virtual void | SetToDefaultSize () |
virtual void | Create (wxWindow *parent) |
virtual void | EnableDisableButtons ()=0 |
virtual void | ReCreateButtons () |
void | UpdatePrefs () override |
virtual void | RegenerateTooltips ()=0 |
int | GetIndex () const |
Get a value used for computing cascading positions of undocked bars. More... | |
void | SetIndex (int index) |
Set a value used for computing cascading positions of undocked bars. More... | |
TranslatableString | GetTitle () |
TranslatableString | GetLabel () |
Identifier | GetSection () |
ToolDock * | GetDock () |
void | SetPreferredNeighbors (Identifier left, Identifier top={}) |
void | SetLabel (const TranslatableString &label) |
virtual void | SetDocked (ToolDock *dock, bool pushed) |
std::pair< Identifier, Identifier > | PreferredNeighbors () const noexcept |
Defaults to (NoBarID, NoBarId) More... | |
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 these. More... | |
virtual int | GetMinToolbarWidth () |
virtual wxSize | GetDockedSize () |
wxSize | GetSmartDockedSize () |
virtual void | ResizingDone () |
Public Member Functions inherited from wxPanelWrapper | |
wxPanelWrapper () | |
wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) | |
bool | Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) |
void | SetLabel (const TranslatableString &label) |
void | SetName (const TranslatableString &name) |
void | SetToolTip (const TranslatableString &toolTip) |
void | SetName () |
Public Member Functions inherited from wxTabTraversalWrapper< wxPanel > | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Static Public Member Functions | |
static Identifier | ID () |
static TranscriptionToolBar & | Get (AudacityProject &project) |
static const TranscriptionToolBar & | Get (const AudacityProject &project) |
Static Public Member Functions inherited from ToolBar | |
static AButton * | MakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size) |
static AButton * | MakeButton (ToolBar *parent, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const TranslatableString &label) |
static void | MakeAlternateImages (AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size) |
static void | SetButtonToolTip (AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands) |
static void | MakeButtonBackgroundsSmall () |
static void | MakeButtonBackgroundsLarge () |
Private Member Functions | |
void | SetPlaySpeed (double value) |
void | MakeAlternateImages (teBmps eFore, teBmps eDisabled, int id, unsigned altIdx) |
void | GetSamples (const WaveTrack *t, sampleCount *s0, sampleCount *slen) |
void | SetButton (bool newstate, AButton *button) |
void | RegenerateTooltips () override |
Static Private Member Functions | |
static AButton * | AddButton (TranscriptionToolBar *pBar, teBmps eFore, teBmps eDisabled, int id, const TranslatableString &label) |
Private Attributes | |
AButton * | mButtons [TTBNumButtons] |
wxImage * | upImage |
wxImage * | downImage |
wxImage * | hiliteImage |
ASlider * | mPlaySpeedSlider |
double | mPlaySpeed |
ASlider * | mSensitivitySlider |
int | mBackgroundWidth |
int | mBackgroundHeight |
std::shared_ptr< BoundedEnvelope > | mEnvelope |
Additional Inherited Members | |
Public Types inherited from ToolBar | |
enum | DockID { TopDockID = 1 , BotDockID = 2 } |
Identifies one of the docking areas for toolbars. More... | |
using | Holder = wxWindowPtr< ToolBar > |
Protected Member Functions inherited from ToolBar | |
void | SetButton (bool down, AButton *button) |
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... | |
virtual void | Populate ()=0 |
virtual void | Repaint (wxDC *dc)=0 |
void | OnErase (wxEraseEvent &event) |
void | OnPaint (wxPaintEvent &event) |
void | OnMouseEvents (wxMouseEvent &event) |
Protected Member Functions inherited from PrefsListener | |
virtual void | UpdateSelectedPrefs (int id) |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Static Protected Member Functions inherited from ToolBar | |
static void | MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn) |
static void | MakeMacRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size) |
static void | MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn) |
static void | MakeRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size) |
Static Protected Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Protected Attributes inherited from ToolBar | |
AudacityProject & | mProject |
TranslatableString | mLabel |
Identifier | mSection |
int | mIndex {0} |
A kind of ToolBar used to help with analysing voice recordings.
Definition at line 61 of file TranscriptionToolBar.h.
TranscriptionToolBar::TranscriptionToolBar | ( | AudacityProject & | project | ) |
Definition at line 100 of file TranscriptionToolBar.cpp.
References SetPlaySpeed().
|
virtual |
Definition at line 109 of file TranscriptionToolBar.cpp.
|
staticprivate |
This is a convenience function that allows for button creation in MakeButtons() with fewer arguments Very similar to code in ControlToolBar...
Definition at line 178 of file TranscriptionToolBar.cpp.
References ToolBar::Add(), id, ThemeBase::ImageSize(), label, ToolBar::MakeButton(), mButtons, AButton::SetLabel(), and theTheme.
Referenced by Populate().
void TranscriptionToolBar::AdjustPlaySpeed | ( | float | adj | ) |
Definition at line 1052 of file TranscriptionToolBar.cpp.
References ASlider::Decrease(), ASlider::Increase(), mPlaySpeedSlider, and OnSpeedSlider().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 134 of file TranscriptionToolBar.cpp.
References ToolBar::Create(), AButton::Disable(), AButton::Enable(), ASlider::Get(), mBackgroundHeight, mBackgroundWidth, mButtons, mPlaySpeedSlider, and SetPlaySpeed().
|
overridevirtual |
Which dock the toolbar defaults into. Default implementation chooses the top dock.
Reimplemented from ToolBar.
Definition at line 118 of file TranscriptionToolBar.cpp.
References ToolBar::BotDockID.
|
overridevirtual |
Implements ToolBar.
Definition at line 309 of file TranscriptionToolBar.cpp.
References TrackList::Any(), AudioIO::Get(), ViewInfo::Get(), TrackList::Get(), NotifyingSelectedRegion::isPoint(), mButtons, ToolBar::mProject, TrackList::Selected(), ViewInfo::selectedRegion, SetEnabled(), AButton::SetEnabled(), and tracks.
|
static |
Definition at line 123 of file TranscriptionToolBar.cpp.
References ToolManager::Get(), ID(), and project.
Referenced by Get(), anonymous_namespace{TranscriptionToolBar.cpp}::OnPlayAtSpeed(), anonymous_namespace{TranscriptionToolBar.cpp}::OnPlayAtSpeedCutPreview(), anonymous_namespace{TranscriptionToolBar.cpp}::OnPlayAtSpeedLooped(), anonymous_namespace{TranscriptionToolBar.cpp}::OnPlaySpeedDec(), anonymous_namespace{TranscriptionToolBar.cpp}::OnPlaySpeedInc(), and anonymous_namespace{TranscriptionToolBar.cpp}::OnSetPlaySpeed().
|
static |
Definition at line 129 of file TranscriptionToolBar.cpp.
References Get(), and project.
|
inlineoverridevirtual |
Resizable toolbars should implement these.
Reimplemented from ToolBar.
Definition at line 87 of file TranscriptionToolBar.h.
|
inlineoverridevirtual |
|
inline |
Definition at line 123 of file TranscriptionToolBar.h.
References mPlaySpeed.
Referenced by SetPlaySpeed().
|
private |
Definition at line 443 of file TranscriptionToolBar.cpp.
References details::end(), ViewInfo::Get(), WaveTrack::GetRate(), WaveTrack::GetStartTime(), ToolBar::mProject, ViewInfo::selectedRegion, and NotifyingSelectedRegion::t0().
|
static |
|
private |
Definition at line 203 of file TranscriptionToolBar.cpp.
References ThemeBase::ImageSize(), ToolBar::MakeAlternateImages(), mButtons, and theTheme.
Referenced by Populate().
void TranscriptionToolBar::OnCaptureKey | ( | wxCommandEvent & | event | ) |
Definition at line 394 of file TranscriptionToolBar.cpp.
References BasicUI::FindFocus(), and mPlaySpeedSlider.
void TranscriptionToolBar::OnFocus | ( | wxFocusEvent & | event | ) |
Definition at line 389 of file TranscriptionToolBar.cpp.
References KeyboardCapture::OnFocus().
Referenced by Populate().
void TranscriptionToolBar::OnKeyEvent | ( | wxKeyEvent & | event | ) |
Definition at line 412 of file TranscriptionToolBar.cpp.
References AudioIOBase::Get().
void TranscriptionToolBar::OnPlaySpeed | ( | wxCommandEvent & | event | ) |
Definition at line 560 of file TranscriptionToolBar.cpp.
References mButtons, OnSpeedSlider(), PlayAtSpeed(), TTB_PlaySpeed, and AButton::WasControlDown().
void TranscriptionToolBar::OnSpeedSlider | ( | wxCommandEvent & | event | ) |
Definition at line 572 of file TranscriptionToolBar.cpp.
References ASlider::Get(), mPlaySpeedSlider, RegenerateTooltips(), and SetPlaySpeed().
Referenced by AdjustPlaySpeed(), OnPlaySpeed(), and ShowPlaySpeedDialog().
void TranscriptionToolBar::PlayAtSpeed | ( | bool | looped, |
bool | cutPreview | ||
) |
Definition at line 489 of file TranscriptionToolBar.cpp.
References TrackList::Any(), cutPreviewPlay, AudioIOBase::Get(), ViewInfo::Get(), TrackList::Get(), ProjectAudioManager::Get(), ProjectAudioIO::GetDefaultOptions(), gPrefs, loopedPlay, mButtons, mEnvelope, mPlaySpeed, ToolBar::mProject, normalPlay, audacity::BasicSettings::ReadBool(), SetButton(), TIMETRACK_MAX, TIMETRACK_MIN, TTB_PlaySpeed, and wxT().
Referenced by OnPlaySpeed().
|
overridevirtual |
Implements ToolBar.
Definition at line 213 of file TranscriptionToolBar.cpp.
References _, ToolBar::Add(), AddButton(), ThemeBase::Colour(), AButton::FollowModifierKeys(), MakeAlternateImages(), ToolBar::MakeButtonBackgroundsSmall(), mButtons, mPlaySpeed, mPlaySpeedSlider, mSensitivitySlider, OnFocus(), safenew, ASlider::Set(), SPEED_SLIDER, ASlider::Options::Style(), theTheme, TranslatableString::Translation(), TTB_PlaySpeed, TTB_PlaySpeedSlider, UpdatePrefs(), and XO().
|
overrideprivatevirtual |
Implements ToolBar.
Definition at line 346 of file TranscriptionToolBar.cpp.
References entry, mButtons, ToolBar::mProject, mSensitivitySlider, ToolBar::SetButtonToolTip(), AButton::SetToolTip(), TTB_PlaySpeed, wxT(), and XO().
Referenced by OnSpeedSlider(), and UpdatePrefs().
|
inlineoverride |
Definition at line 84 of file TranscriptionToolBar.h.
|
private |
Definition at line 433 of file TranscriptionToolBar.cpp.
References AButton::PopUp(), and AButton::PushDown().
Referenced by PlayAtSpeed().
void TranscriptionToolBar::SetEnabled | ( | bool | enabled | ) |
Definition at line 1034 of file TranscriptionToolBar.cpp.
References mButtons, AButton::SetEnabled(), and TTB_PlaySpeed.
Referenced by EnableDisableButtons().
void TranscriptionToolBar::SetPlaying | ( | bool | down, |
bool | looped, | ||
bool | cutPreview | ||
) |
Definition at line 1039 of file TranscriptionToolBar.cpp.
References mButtons, AButton::PopUp(), AButton::PushDown(), AButton::SetAlternateIdx(), and TTB_PlaySpeed.
|
private |
Definition at line 169 of file TranscriptionToolBar.cpp.
References ProjectAudioIO::Get(), GetPlaySpeed(), mPlaySpeed, ToolBar::mProject, and ProjectAudioIO::SetPlaySpeed().
Referenced by Create(), OnSpeedSlider(), and TranscriptionToolBar().
|
overridevirtual |
Whether the toolbar should be shown by default. Default implementation returns true.
Reimplemented from ToolBar.
Definition at line 113 of file TranscriptionToolBar.cpp.
void TranscriptionToolBar::ShowPlaySpeedDialog | ( | ) |
Definition at line 1026 of file TranscriptionToolBar.cpp.
References mPlaySpeedSlider, OnSpeedSlider(), and ASlider::ShowDialog().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 335 of file TranscriptionToolBar.cpp.
References RegenerateTooltips(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), and XO().
Referenced by Populate().
|
private |
Definition at line 142 of file TranscriptionToolBar.h.
|
private |
Definition at line 143 of file TranscriptionToolBar.h.
|
private |
Definition at line 156 of file TranscriptionToolBar.h.
Referenced by Create().
|
private |
Definition at line 155 of file TranscriptionToolBar.h.
Referenced by Create().
|
private |
Definition at line 140 of file TranscriptionToolBar.h.
Referenced by AddButton(), Create(), EnableDisableButtons(), MakeAlternateImages(), OnPlaySpeed(), PlayAtSpeed(), Populate(), RegenerateTooltips(), SetEnabled(), and SetPlaying().
|
private |
Definition at line 158 of file TranscriptionToolBar.h.
Referenced by PlayAtSpeed().
|
private |
Definition at line 146 of file TranscriptionToolBar.h.
Referenced by GetPlaySpeed(), PlayAtSpeed(), Populate(), and SetPlaySpeed().
|
private |
Definition at line 145 of file TranscriptionToolBar.h.
Referenced by AdjustPlaySpeed(), Create(), OnCaptureKey(), OnSpeedSlider(), Populate(), and ShowPlaySpeedDialog().
|
private |
Definition at line 147 of file TranscriptionToolBar.h.
Referenced by Populate(), and RegenerateTooltips().
|
private |
Definition at line 141 of file TranscriptionToolBar.h.