Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
TrackFocus Class Referencefinal

#include <TrackPanelAx.h>

Inheritance diagram for TrackFocus:
[legend]
Collaboration diagram for TrackFocus:
[legend]

Public Member Functions

 TrackFocus (AudacityProject &project)
 
 ~TrackFocus () override
 
 TrackFocus (const TrackFocus &) PROHIBITED
 
TrackFocusoperator= (const TrackFocus &) PROHIBITED
 
TrackGet ()
 
void Set (Track *pTrack)
 
bool IsFocused (const Track *pTrack)
 
void SetAccessible (wxWindow &owner, std::unique_ptr< TrackPanelAx > pAccessible)
 
void MessageForScreenReader (const TranslatableString &message)
 
void UpdateAccessibility ()
 
- 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
 
Publisheroperator= (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 TrackFocusGet (AudacityProject &project)
 
static const TrackFocusGet (const AudacityProject &project)
 

Private Attributes

friend TrackPanelAx
 
AudacityProjectmProject
 
std::unique_ptr< TrackPanelAxmAx
 

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...
 

Detailed Description

Definition at line 158 of file TrackPanelAx.h.

Constructor & Destructor Documentation

◆ TrackFocus() [1/2]

TrackFocus::TrackFocus ( AudacityProject project)
explicit

Definition at line 745 of file TrackPanelAx.cpp.

746 : mProject{ project }
747{
748}
AudacityProject & mProject
Definition: TrackPanelAx.h:197

◆ ~TrackFocus()

TrackFocus::~TrackFocus ( )
override

Definition at line 750 of file TrackPanelAx.cpp.

751{
752}

◆ TrackFocus() [2/2]

TrackFocus::TrackFocus ( const TrackFocus )

Member Function Documentation

◆ Get() [1/3]

Track * TrackFocus::Get ( )

Definition at line 754 of file TrackPanelAx.cpp.

755{
756 if (mAx)
757 return mAx->GetFocus().get();
758 return nullptr;
759}
std::unique_ptr< TrackPanelAx > mAx
Definition: TrackPanelAx.h:202

References mAx.

Referenced by SetTrackStatusCommand::ApplyInner(), SelectHandle::Click(), LabelTrackView::DialogForLabelName(), anonymous_namespace{LabelMenus.cpp}::DoAddLabel(), anonymous_namespace{ClipMenus.cpp}::DoClipLeftOrRight(), anonymous_namespace{ClipMenus.cpp}::DoCursorClipBoundary(), EffectUI::DoEffect(), LabelTrackView::DoKeyDown(), SelectUtilities::DoListSelection(), 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(), LabelTrackView::IsValidIndex(), SelectHandle::MoveSnappingFreqSelection(), NavigationActions::Handler::OnFirstTrack(), NavigationActions::Handler::OnLastTrack(), TrackPanel::OnMouseEvent(), LabelEditActions::Handler::OnNewLabelTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::Handler::OnNewStereoTrack(), anonymous_namespace{TimeTrackMenuItems.cpp}::Handler::OnNewTimeTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::Handler::OnNewWaveTrack(), LabelEditActions::Handler::OnPasteNewLabel(), EditActions::Handler::OnRedo(), WaveTrackMenuTable::OnSwapChannels(), NavigationActions::Handler::OnToggle(), TrackActions::Handler::OnTrackClose(), TrackActions::Handler::OnTrackGain(), TrackActions::Handler::OnTrackGainDec(), TrackActions::Handler::OnTrackGainInc(), TrackActions::Handler::OnTrackMoveBottom(), TrackActions::Handler::OnTrackMoveDown(), TrackActions::Handler::OnTrackMoveTop(), TrackActions::Handler::OnTrackMoveUp(), TrackActions::Handler::OnTrackMute(), TrackActions::Handler::OnTrackPan(), TrackActions::Handler::OnTrackPanLeft(), TrackActions::Handler::OnTrackPanRight(), TrackActions::Handler::OnTrackSolo(), EditActions::Handler::OnUndo(), TrackPanel::OnUndoReset(), ProjectFileManager::OpenProjectFile(), TrackPanel::ProcessUIHandleResult(), ProjectWindow::ProjectWindow(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedClipOfFocusedTrack(), WaveTrackView::SelectNextClip(), GetInfoCommand::SendTracks(), TrackPanelAx::SetFocus(), TrackPanel::SetFocusedCell(), MuteButtonHandle::Tip(), SoloButtonHandle::Tip(), EffectsButtonHandle::Tip(), MenuButtonHandle::Tip(), CloseButtonHandle::Tip(), TrackPanel::TrackPanel(), and ProjectWindow::ZoomAfterImport().

◆ Get() [2/3]

TrackFocus & TrackFocus::Get ( AudacityProject project)
static

Definition at line 735 of file TrackPanelAx.cpp.

736{
737 return project.AttachedObjects::Get< TrackFocus >( key );
738}
static const AudacityProject::AttachedObjects::RegisteredFactory key

References key.

Referenced by TrackPanel::OnTrackListDeletion().

Here is the caller graph for this function:

◆ Get() [3/3]

const TrackFocus & TrackFocus::Get ( const AudacityProject project)
static

Definition at line 740 of file TrackPanelAx.cpp.

741{
742 return Get( const_cast< AudacityProject & >( project ) );
743}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
Track * Get()

References Get().

Here is the call graph for this function:

◆ IsFocused()

bool TrackFocus::IsFocused ( const Track pTrack)

Definition at line 769 of file TrackPanelAx.cpp.

770{
771 if (mAx)
772 return mAx->IsFocused( pTrack );
773 return false;
774}

References mAx.

◆ MessageForScreenReader()

void TrackFocus::MessageForScreenReader ( const TranslatableString message)

Definition at line 790 of file TrackPanelAx.cpp.

791{
792 if (mAx)
793 mAx->MessageForScreenReader( message );
794}

References mAx.

◆ operator=()

TrackFocus & TrackFocus::operator= ( const TrackFocus )

◆ Set()

void TrackFocus::Set ( Track pTrack)

Definition at line 761 of file TrackPanelAx.cpp.

762{
763 if (mAx) {
764 pTrack = *TrackList::Get( mProject ).FindLeader( pTrack );
765 mAx->SetFocus( Track::SharedPointer( pTrack ) );
766 }
767}
std::shared_ptr< Subclass > SharedPointer()
Definition: Track.h:290
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:468
TrackIter< Track > FindLeader(Track *pTrack)
Definition: Track.cpp:630

References TrackList::FindLeader(), TrackList::Get(), mAx, mProject, and Track::SharedPointer().

Here is the call graph for this function:

◆ SetAccessible()

void TrackFocus::SetAccessible ( wxWindow &  owner,
std::unique_ptr< TrackPanelAx pAccessible 
)

Definition at line 776 of file TrackPanelAx.cpp.

780{
781#if wxUSE_ACCESSIBILITY
782 // wxWidgets owns the accessible object
783 owner.SetAccessible(mAx = pAx.release());
784#else
785 // wxWidgets does not own the object, but we need to retain it
786 mAx = std::move(pAx);
787#endif
788}

References mAx.

◆ UpdateAccessibility()

void TrackFocus::UpdateAccessibility ( )

Definition at line 796 of file TrackPanelAx.cpp.

797{
798 if (mAx)
799 mAx->Updated();
800}

References mAx.

Member Data Documentation

◆ mAx

std::unique_ptr<TrackPanelAx> TrackFocus::mAx
private

◆ mProject

AudacityProject& TrackFocus::mProject
private

Definition at line 197 of file TrackPanelAx.h.

Referenced by Set().

◆ TrackPanelAx

friend TrackFocus::TrackPanelAx
private

Definition at line 195 of file TrackPanelAx.h.


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