Audacity 3.2.0
|
#include <WaveTrackAffordanceControls.h>
Public Member Functions | |
WaveTrackAffordanceControls (const std::shared_ptr< Track > &pTrack) | |
std::vector< UIHandlePtr > | HitTest (const TrackPanelMouseState &state, const AudacityProject *pProject) override |
void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override |
IntervalIterator | GetSelectedInterval () const |
unsigned | CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) override |
unsigned | KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) override |
unsigned | Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) override |
unsigned | LoseFocus (AudacityProject *project) override |
void | OnTextEditFinished (AudacityProject *project, const wxString &text) override |
void | OnTextEditCancelled (AudacityProject *project) override |
void | OnTextModified (AudacityProject *project, const wxString &text) override |
void | OnTextContextMenu (AudacityProject *project, const wxPoint &position) override |
unsigned | OnAffordanceClick (const TrackPanelMouseEvent &event, AudacityProject *project) |
bool | OnTextCopy (AudacityProject &project) |
bool | OnTextCut (AudacityProject &project) |
bool | OnTextPaste (AudacityProject &project) |
bool | OnTextSelect (AudacityProject &project) |
void | StartEditSelectedClipName (AudacityProject &project) |
void | StartEditSelectedClipSpeed (AudacityProject &project) |
void | OnRenderClipStretching (AudacityProject &project) const |
std::vector< MenuItem > | GetMenuItems (const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject) override |
Return a list of items for DoContextMenu() (empties for separators) More... | |
Public Member Functions inherited from CommonTrackCell | |
CommonTrackCell (const std::shared_ptr< Track > &pTrack) | |
Construct from a track. More... | |
~CommonTrackCell () | |
std::shared_ptr< Track > | DoFindTrack () override |
void | Reparent (const std::shared_ptr< Track > &parent) override |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
Public Member Functions inherited from CommonTrackPanelCell | |
CommonTrackPanelCell () | |
virtual | ~CommonTrackPanelCell ()=0 |
HitTestPreview | DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override |
std::shared_ptr< Track > | FindTrack () |
std::shared_ptr< const Track > | FindTrack () const |
virtual std::vector< MenuItem > | GetMenuItems (const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject) |
Return a list of items for DoContextMenu() (empties for separators) More... | |
Public Member Functions inherited from TrackPanelCell | |
TrackPanelCell ()=default | |
TrackPanelCell (const TrackPanelCell &)=delete | |
TrackPanelCell & | operator= (const TrackPanelCell &)=delete |
virtual | ~TrackPanelCell ()=0 |
virtual HitTestPreview | DefaultPreview (const TrackPanelMouseState &state, const AudacityProject *pProject) |
virtual std::vector< UIHandlePtr > | HitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0 |
virtual unsigned | HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) |
virtual std::shared_ptr< TrackPanelCell > | ContextMenuDelegate () |
virtual unsigned | DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) |
virtual unsigned | CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | LoseFocus (AudacityProject *project) |
Public Member Functions inherited from TrackPanelNode | |
TrackPanelNode () | |
virtual | ~TrackPanelNode ()=0 |
Public Member Functions inherited from TrackPanelDrawable | |
virtual | ~TrackPanelDrawable ()=0 |
virtual void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) |
virtual wxRect | DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass) |
Public Member Functions inherited from TrackAttachment | |
virtual | ~TrackAttachment () |
virtual void | CopyTo (Track &track) const |
Copy state, for undo/redo purposes. More... | |
virtual void | Reparent (const std::shared_ptr< Track > &parent) |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
virtual void | WriteXMLAttributes (XMLWriter &) const |
Serialize persistent attributes. More... | |
virtual bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
Deserialize an attribute, returning true if recognized. More... | |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from TextEditDelegate | |
virtual | ~TextEditDelegate () |
virtual void | OnTextEditFinished (AudacityProject *project, const wxString &text)=0 |
virtual void | OnTextEditCancelled (AudacityProject *project)=0 |
virtual void | OnTextModified (AudacityProject *project, const wxString &text)=0 |
virtual void | OnTextContextMenu (AudacityProject *project, const wxPoint &position)=0 |
Private Types | |
using | IntervalIterator = ChannelGroup::IntervalIterator< WaveTrack::Interval > |
Private Member Functions | |
bool | IsIntervalVisible (const IntervalIterator &it) const noexcept |
bool | StartEditClipName (AudacityProject &project, IntervalIterator it) |
Starts in-place clip name editing or shows a Clip Name Edit dialog, depending on prefs. More... | |
void | ResetClipNameEdit () |
void | OnTrackListEvent (const TrackListEvent &evt) |
void | OnSelectionChange (NotifyingSelectedRegionMessage) |
unsigned | ExitTextEditing () |
std::shared_ptr< TextEditHelper > | MakeTextEditHelper (const wxString &text) |
Private Attributes | |
IntervalIterator | mFocusInterval |
std::weak_ptr< ClipOverflowButtonHandle > | mOverflowButtonHandle |
std::weak_ptr< ClipPitchAndSpeedButtonHandle > | mPitchButtonHandle |
std::weak_ptr< ClipPitchAndSpeedButtonHandle > | mSpeedButtonHandle |
std::weak_ptr< WaveTrackAffordanceHandle > | mAffordanceHandle |
std::weak_ptr< TrackPanelResizeHandle > | mResizeHandle |
std::weak_ptr< WaveClipTitleEditHandle > | mTitleEditHandle |
std::weak_ptr< SelectHandle > | mSelectHandle |
std::weak_ptr< WaveClipAdjustBorderHandle > | mClipBorderAdjustHandle |
IntervalIterator | mEditedInterval |
std::shared_ptr< TextEditHelper > | mTextEditHelper |
wxFont | mClipNameFont |
std::vector< IntervalIterator > | mVisibleIntervals |
Observer::Subscription | mTrackListEventSubscription |
Observer::Subscription | mSelectionChangeSubscription |
Additional Inherited Members | |
Static Public Member Functions inherited from TrackPanelDrawable | |
static wxRect | MaximizeWidth (const wxRect &rect, const wxRect &panelRect) |
static wxRect | MaximizeHeight (const wxRect &rect, const wxRect &panelRect) |
Protected Member Functions inherited from CommonTrackPanelCell | |
virtual std::shared_ptr< Track > | DoFindTrack ()=0 |
unsigned | DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override |
unsigned | HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
Definition at line 38 of file WaveTrackAffordanceControls.h.
|
private |
Definition at line 43 of file WaveTrackAffordanceControls.h.
WaveTrackAffordanceControls::WaveTrackAffordanceControls | ( | const std::shared_ptr< Track > & | pTrack | ) |
Definition at line 152 of file WaveTrackAffordanceControls.cpp.
References ViewInfo::Get(), mSelectionChangeSubscription, mTrackListEventSubscription, OnSelectionChange(), OnTrackListEvent(), project, and Observer::Publisher< Message, NotifyAll >::Subscribe().
|
overridevirtual |
Reimplemented from TrackPanelCell.
Definition at line 484 of file WaveTrackAffordanceControls.cpp.
References mTextEditHelper, and RefreshCode::RefreshNone.
|
overridevirtual |
Reimplemented from TrackPanelCell.
Definition at line 509 of file WaveTrackAffordanceControls.cpp.
References mTextEditHelper, project, RefreshCode::RefreshCell, and RefreshCode::RefreshNone.
|
overridevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 273 of file WaveTrackAffordanceControls.cpp.
References WaveChannelView::ClipDetailsVisible(), ThemeBase::Colour(), TrackPanelDrawingContext::dc, TrackArt::DrawBackgroundWithSelection(), TrackArt::DrawClipAffordance(), TrackArt::DrawClipFolded(), TrackArt::DrawClipTitle(), CommonTrackPanelCell::FindTrack(), TrackArtist::Get(), ClipParameters::GetClipRect(), GetSelectedInterval(), TrackPanelDrawingContext::lastState, mClipNameFont, mEditedInterval, mOverflowButtonHandle, mTextEditHelper, mVisibleIntervals, TrackArtist::PassBackground, and theTheme.
|
private |
Definition at line 566 of file WaveTrackAffordanceControls.cpp.
References CommonTrackPanelCell::FindTrack(), mTextEditHelper, RefreshCode::RefreshCell, RefreshCode::RefreshNone, and ResetClipNameEdit().
Referenced by LoseFocus(), OnAffordanceClick(), OnSelectionChange(), and OnTrackListEvent().
|
overridevirtual |
Return a list of items for DoContextMenu() (empties for separators)
If the vector is empty (as in the default), there is no context menu.
Commands are invoked with temporary selection fields of CommandContext set to a point selected region at the mouse pick, and the cell's track.
A function may be given, but if it is null, then the command can be found by name in the CommandManager.
An item in the list with no command name marks a menu separator.
The menu item is enabled only if it contains a true flag, but if looked up in the command manager, it must also satisfy the command manager's conditions.
Reimplemented from CommonTrackPanelCell.
Definition at line 709 of file WaveTrackAffordanceControls.cpp.
References WaveClipUIUtilities::GetWaveClipMenuItems().
auto WaveTrackAffordanceControls::GetSelectedInterval | ( | ) | const |
Definition at line 403 of file WaveTrackAffordanceControls.cpp.
References mAffordanceHandle, and mFocusInterval.
Referenced by Draw().
|
overridevirtual |
Implements TrackPanelCell.
Definition at line 172 of file WaveTrackAffordanceControls.cpp.
References AssignUIHandlePtr(), CommonTrackPanelCell::FindTrack(), ViewInfo::Get(), PendingTracks::Get(), ProjectSettings::Get(), WaveChannelView::GetFirst(), WaveClipAdjustBorderHandle::HitAnywhere(), WaveChannelView::HitTest(), SelectHandle::HitTest(), mAffordanceHandle, mClipBorderAdjustHandle, mEditedInterval, mFocusInterval, mOverflowButtonHandle, mPitchButtonHandle, mSelectHandle, mSpeedButtonHandle, mTextEditHelper, mTitleEditHandle, ToolCodes::multiTool, ClipPitchAndSpeedButtonHandle::Pitch, TrackPanelMouseState::rect, ToolCodes::selectTool, settings(), ClipPitchAndSpeedButtonHandle::Speed, TrackPanelMouseState::state, and PendingTracks::SubstitutePendingChangedTrack().
|
privatenoexcept |
Definition at line 359 of file WaveTrackAffordanceControls.cpp.
Referenced by StartEditClipName().
|
overridevirtual |
Reimplemented from TrackPanelCell.
Definition at line 494 of file WaveTrackAffordanceControls.cpp.
References TextEditHelper::IsGoodEditKeyCode(), mTextEditHelper, project, RefreshCode::RefreshCell, and RefreshCode::RefreshNone.
|
overridevirtual |
Reimplemented from TrackPanelCell.
Definition at line 516 of file WaveTrackAffordanceControls.cpp.
References ExitTextEditing().
|
private |
Definition at line 701 of file WaveTrackAffordanceControls.cpp.
References ThemeBase::Colour(), mClipNameFont, and theTheme.
Referenced by StartEditClipName().
unsigned WaveTrackAffordanceControls::OnAffordanceClick | ( | const TrackPanelMouseEvent & | event, |
AudacityProject * | project | ||
) |
Definition at line 621 of file WaveTrackAffordanceControls.cpp.
References TrackPanelMouseEvent::event, ExitTextEditing(), ViewInfo::Get(), ClipParameters::GetClipRect(), mEditedInterval, mFocusInterval, mTextEditHelper, project, TrackPanelMouseEvent::rect, RefreshCode::RefreshCell, RefreshCode::RefreshNone, and StartEditClipName().
void WaveTrackAffordanceControls::OnRenderClipStretching | ( | AudacityProject & | project | ) | const |
Definition at line 674 of file WaveTrackAffordanceControls.cpp.
References CommonTrackPanelCell::FindTrack(), ProjectHistory::Get(), project, ProjectHistory::PushState(), WaveClipUIUtilities::SelectClip(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedIntervalOfFocusedTrack(), TimeStretching::WithClipRenderingProgress(), and XO().
|
private |
Definition at line 561 of file WaveTrackAffordanceControls.cpp.
References ExitTextEditing().
Referenced by WaveTrackAffordanceControls().
|
overridevirtual |
Implements TextEditDelegate.
Definition at line 545 of file WaveTrackAffordanceControls.cpp.
bool WaveTrackAffordanceControls::OnTextCopy | ( | AudacityProject & | project | ) |
Definition at line 581 of file WaveTrackAffordanceControls.cpp.
References mTextEditHelper, and project.
Referenced by WaveChannelView::CopySelectedText().
bool WaveTrackAffordanceControls::OnTextCut | ( | AudacityProject & | project | ) |
Definition at line 591 of file WaveTrackAffordanceControls.cpp.
References mTextEditHelper, and project.
Referenced by WaveChannelView::CutSelectedText().
|
overridevirtual |
Implements TextEditDelegate.
Definition at line 535 of file WaveTrackAffordanceControls.cpp.
References ResetClipNameEdit().
|
overridevirtual |
Implements TextEditDelegate.
Definition at line 521 of file WaveTrackAffordanceControls.cpp.
References ProjectHistory::Get(), mEditedInterval, ProjectHistory::PushState(), ResetClipNameEdit(), and XO().
|
overridevirtual |
Implements TextEditDelegate.
Definition at line 540 of file WaveTrackAffordanceControls.cpp.
bool WaveTrackAffordanceControls::OnTextPaste | ( | AudacityProject & | project | ) |
Definition at line 601 of file WaveTrackAffordanceControls.cpp.
References mTextEditHelper, and project.
Referenced by WaveChannelView::PasteText().
bool WaveTrackAffordanceControls::OnTextSelect | ( | AudacityProject & | project | ) |
Definition at line 611 of file WaveTrackAffordanceControls.cpp.
References mTextEditHelper.
Referenced by WaveChannelView::SelectAllText().
|
private |
Definition at line 555 of file WaveTrackAffordanceControls.cpp.
References ExitTextEditing(), TrackListEvent::mType, and TrackListEvent::SELECTION_CHANGE.
Referenced by WaveTrackAffordanceControls().
|
private |
Definition at line 549 of file WaveTrackAffordanceControls.cpp.
References mEditedInterval, and mTextEditHelper.
Referenced by ExitTextEditing(), OnTextEditCancelled(), and OnTextEditFinished().
|
private |
Starts in-place clip name editing or shows a Clip Name Edit dialog, depending on prefs.
clip | to be edited. Should belong to the same WaveTrack as returned by FindTrack() |
Definition at line 366 of file WaveTrackAffordanceControls.cpp.
References MenuRegistry::Command, ProjectHistory::Get(), gPrefs, IsIntervalVisible(), MakeTextEditHelper(), mEditedInterval, mTextEditHelper, project, ProjectHistory::PushState(), audacity::BasicSettings::Read(), wxT(), and XO().
Referenced by OnAffordanceClick(), and StartEditSelectedClipName().
void WaveTrackAffordanceControls::StartEditSelectedClipName | ( | AudacityProject & | project | ) |
Definition at line 649 of file WaveTrackAffordanceControls.cpp.
References CommonTrackPanelCell::FindTrack(), project, anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedIntervalOfFocusedTrack(), and StartEditClipName().
void WaveTrackAffordanceControls::StartEditSelectedClipSpeed | ( | AudacityProject & | project | ) |
Definition at line 657 of file WaveTrackAffordanceControls.cpp.
References CommonTrackPanelCell::FindTrack(), PitchAndSpeedDialog::Get(), project, PitchAndSpeedDialog::Retarget(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedIntervalOfFocusedTrack(), and PitchAndSpeedDialog::SetFocus().
|
private |
Definition at line 49 of file WaveTrackAffordanceControls.h.
Referenced by GetSelectedInterval(), and HitTest().
|
private |
Definition at line 53 of file WaveTrackAffordanceControls.h.
Referenced by HitTest().
|
private |
Definition at line 58 of file WaveTrackAffordanceControls.h.
Referenced by Draw(), and MakeTextEditHelper().
|
private |
Definition at line 55 of file WaveTrackAffordanceControls.h.
Referenced by Draw(), HitTest(), OnAffordanceClick(), OnTextEditFinished(), ResetClipNameEdit(), and StartEditClipName().
|
private |
Definition at line 45 of file WaveTrackAffordanceControls.h.
Referenced by GetSelectedInterval(), HitTest(), and OnAffordanceClick().
|
private |
Definition at line 46 of file WaveTrackAffordanceControls.h.
|
private |
Definition at line 47 of file WaveTrackAffordanceControls.h.
Referenced by HitTest().
|
private |
Definition at line 50 of file WaveTrackAffordanceControls.h.
|
private |
Definition at line 52 of file WaveTrackAffordanceControls.h.
Referenced by HitTest().
|
private |
Definition at line 124 of file WaveTrackAffordanceControls.h.
Referenced by WaveTrackAffordanceControls().
|
private |
Definition at line 48 of file WaveTrackAffordanceControls.h.
Referenced by HitTest().
|
private |
Definition at line 56 of file WaveTrackAffordanceControls.h.
Referenced by CaptureKey(), Char(), Draw(), ExitTextEditing(), HitTest(), KeyDown(), OnAffordanceClick(), OnTextCopy(), OnTextCut(), OnTextPaste(), OnTextSelect(), ResetClipNameEdit(), and StartEditClipName().
|
private |
Definition at line 51 of file WaveTrackAffordanceControls.h.
Referenced by HitTest().
|
private |
Definition at line 123 of file WaveTrackAffordanceControls.h.
Referenced by WaveTrackAffordanceControls().
|
private |
Definition at line 61 of file WaveTrackAffordanceControls.h.
Referenced by Draw().