Audacity 3.2.0
|
#include <TrackFocus.h>
Public Member Functions | |
TrackFocus (AudacityProject &project) | |
~TrackFocus () final | |
TrackFocus (const TrackFocus &)=delete | |
TrackFocus & | operator= (const TrackFocus &)=delete |
void | SetCallbacks (std::unique_ptr< TrackFocusCallbacks > pCallbacks) |
Track * | Get () |
void | Set (Track *pTrack, bool focusPanel=false) |
Set the track focus to a given track or to null. More... | |
void | MessageForScreenReader (const TranslatableString &message) |
void | UpdateAccessibility () |
Called to signal changes to a track. More... | |
std::shared_ptr< Track > | PeekFocus () const |
int | TrackNum (const std::shared_ptr< Track > &track) const |
int | NumFocusedTrack () const |
std::shared_ptr< Track > | GetFocus () |
const TrackList & | GetTracks () const |
std::shared_ptr< Track > | FindTrack (int num) const |
std::shared_ptr< Track > | SetFocus (std::shared_ptr< Track > track={}, bool focusPanel=false) |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from Observer::Publisher< TrackFocusChangeMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Static Public Member Functions | |
static TrackFocus & | Get (AudacityProject &project) |
static const TrackFocus & | Get (const AudacityProject &project) |
Private Member Functions | |
TrackList & | GetTracks () |
Private Attributes | |
AudacityProject & | mProject |
std::unique_ptr< TrackFocusCallbacks > | mpCallbacks |
std::weak_ptr< Track > | mFocusedTrack |
int | mNumFocusedTrack { 0 } |
Additional Inherited Members | |
Public Types inherited from Observer::Publisher< TrackFocusChangeMessage > | |
using | message_type = TrackFocusChangeMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const TrackFocusChangeMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
Static Public Attributes inherited from Observer::Publisher< TrackFocusChangeMessage > | |
static constexpr bool | notifies_all |
Protected Member Functions inherited from Observer::Publisher< TrackFocusChangeMessage > | |
CallbackReturn | Publish (const TrackFocusChangeMessage &message) |
Send a message to connected callbacks. More... | |
Definition at line 38 of file TrackFocus.h.
|
explicit |
Definition at line 142 of file TrackFocus.cpp.
|
final |
Definition at line 147 of file TrackFocus.cpp.
|
delete |
std::shared_ptr< Track > TrackFocus::FindTrack | ( | int | num | ) | const |
Definition at line 113 of file TrackFocus.cpp.
References TrackList::Get(), and mProject.
Referenced by GetFocus().
Track * TrackFocus::Get | ( | ) |
This function is not const, because it may have a side effect of setting a focus if none was already set
Definition at line 156 of file TrackFocus.cpp.
References GetFocus().
Referenced by SetTrackStatusCommand::ApplyInner(), SelectHandle::Click(), LabelTrackView::DialogForLabelName(), anonymous_namespace{LabelMenus.cpp}::DoAddLabel(), anonymous_namespace{ClipMenus.cpp}::DoClipLeftOrRight(), anonymous_namespace{ClipMenus.cpp}::DoClipMove(), anonymous_namespace{ClipMenus.cpp}::DoCursorClipBoundary(), AudacityApplicationLogic::DoEffect(), LabelTrackView::DoKeyDown(), SelectUtilities::DoListSelection(), anonymous_namespace{PluginMenus.cpp}::DoManageRealtimeEffectsSidePanel(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), anonymous_namespace{TransportMenus.cpp}::DoMoveToLabel(), anonymous_namespace{NavigationMenus.cpp}::DoNextTrack(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), anonymous_namespace{NavigationMenus.cpp}::DoPrevTrack(), ProjectAudioManager::DoRecord(), TrackUtilities::DoRemoveTrack(), TrackUtilities::DoRemoveTracks(), anonymous_namespace{ClipMenus.cpp}::DoSelectClip(), anonymous_namespace{ClipMenus.cpp}::DoSelectClipBoundary(), TrackUtilities::DoTrackMute(), TrackUtilities::DoTrackSolo(), anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::Draw(), Get(), TrackPanel::GetFocusedCell(), anonymous_namespace{PluginMenus.cpp}::HasTrackFocusFlag(), LabelTrackView::IsValidIndex(), SelectHandle::MoveSnappingFreqSelection(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnChangePitchAndSpeed(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnEditClipName(), NavigationActions::Handler::OnFirstTrack(), NavigationActions::Handler::OnLastTrack(), TrackPanel::OnMouseEvent(), anonymous_namespace{LabelMenus.cpp}::OnNewLabelTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewStereoTrack(), anonymous_namespace{TimeTrackMenuItems.cpp}::OnNewTimeTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewWaveTrack(), anonymous_namespace{EditMenus.cpp}::OnPaste(), anonymous_namespace{LabelMenus.cpp}::OnPasteNewLabel(), anonymous_namespace{EditMenus.cpp}::OnRedo(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnRenderClipStretching(), WaveTrackMenuTable::OnSwapChannels(), NavigationActions::Handler::OnToggle(), anonymous_namespace{TrackMenus.cpp}::OnTrackClose(), anonymous_namespace{TrackMenus.cpp}::OnTrackGain(), anonymous_namespace{TrackMenus.cpp}::OnTrackGainDec(), anonymous_namespace{TrackMenus.cpp}::OnTrackGainInc(), anonymous_namespace{TrackMenus.cpp}::OnTrackMoveBottom(), anonymous_namespace{TrackMenus.cpp}::OnTrackMoveDown(), anonymous_namespace{TrackMenus.cpp}::OnTrackMoveTop(), anonymous_namespace{TrackMenus.cpp}::OnTrackMoveUp(), anonymous_namespace{TrackMenus.cpp}::OnTrackMute(), anonymous_namespace{TrackMenus.cpp}::OnTrackPan(), anonymous_namespace{TrackMenus.cpp}::OnTrackPanLeft(), anonymous_namespace{TrackMenus.cpp}::OnTrackPanRight(), anonymous_namespace{TrackMenus.cpp}::OnTrackSolo(), anonymous_namespace{EditMenus.cpp}::OnUndo(), TrackPanel::OnUndoReset(), ProjectFileManager::OpenProjectFile(), TrackPanel::ProcessUIHandleResult(), RealtimeEffectPanel::RealtimeEffectPanel(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedIntervalOfFocusedTrack(), WaveChannelView::SelectNextClip(), GetInfoCommand::SendTracks(), TrackPanel::SetFocusedCell(), MuteButtonHandle::Tip(), SoloButtonHandle::Tip(), EffectsButtonHandle::Tip(), MenuButtonHandle::Tip(), CloseButtonHandle::Tip(), TrackPanel::TrackPanel(), and Viewport::ZoomFitHorizontallyAndShowTrack().
|
static |
Definition at line 132 of file TrackFocus.cpp.
Referenced by TrackPanel::OnTrackListDeletion().
|
static |
Definition at line 137 of file TrackFocus.cpp.
References Get(), and project.
std::shared_ptr< Track > TrackFocus::GetFocus | ( | ) |
Definition at line 33 of file TrackFocus.cpp.
References FindTrack(), GetTracks(), mFocusedTrack, mNumFocusedTrack, SetFocus(), Track::SharedPointer(), and TrackNum().
Referenced by Get().
|
private |
Definition at line 19 of file TrackFocus.cpp.
References TrackList::Get(), and mProject.
const TrackList & TrackFocus::GetTracks | ( | ) | const |
Definition at line 24 of file TrackFocus.cpp.
References TrackList::Get(), and mProject.
Referenced by GetFocus(), SetFocus(), and TrackNum().
void TrackFocus::MessageForScreenReader | ( | const TranslatableString & | message | ) |
Definition at line 166 of file TrackFocus.cpp.
References mpCallbacks.
|
inline |
Definition at line 80 of file TrackFocus.h.
|
delete |
std::shared_ptr< Track > TrackFocus::PeekFocus | ( | ) | const |
Definition at line 62 of file TrackFocus.cpp.
References mFocusedTrack.
Referenced by SetFocus().
void TrackFocus::Set | ( | Track * | pTrack, |
bool | focusPanel = false |
||
) |
Set the track focus to a given track or to null.
focusPanel | whether also to focus the window that shows tracks |
Definition at line 161 of file TrackFocus.cpp.
References SetFocus(), and Track::SharedPointer().
void TrackFocus::SetCallbacks | ( | std::unique_ptr< TrackFocusCallbacks > | pCallbacks | ) |
Definition at line 151 of file TrackFocus.cpp.
References mpCallbacks.
std::shared_ptr< Track > TrackFocus::SetFocus | ( | std::shared_ptr< Track > | track = {} , |
bool | focusPanel = false |
||
) |
Definition at line 68 of file TrackFocus.cpp.
References details::begin(), BasicUI::CallAfter(), GetTracks(), mFocusedTrack, mNumFocusedTrack, mpCallbacks, PeekFocus(), Track::SharedPointer(), and TrackNum().
Referenced by GetFocus(), and Set().
int TrackFocus::TrackNum | ( | const std::shared_ptr< Track > & | track | ) | const |
Definition at line 96 of file TrackFocus.cpp.
References GetTracks().
Referenced by GetFocus(), and SetFocus().
void TrackFocus::UpdateAccessibility | ( | ) |
Called to signal changes to a track.
Definition at line 172 of file TrackFocus.cpp.
References mpCallbacks.
|
private |
Definition at line 100 of file TrackFocus.h.
Referenced by GetFocus(), PeekFocus(), and SetFocus().
|
private |
Definition at line 101 of file TrackFocus.h.
Referenced by GetFocus(), and SetFocus().
|
private |
Definition at line 99 of file TrackFocus.h.
Referenced by MessageForScreenReader(), SetCallbacks(), SetFocus(), and UpdateAccessibility().
|
private |
Definition at line 98 of file TrackFocus.h.
Referenced by FindTrack(), and GetTracks().