40#if wxUSE_ACCESSIBILITY
90 return( focusedTrack );
98#if wxUSE_ACCESSIBILITY
101 if( focusedTrack && !focusedTrack->GetSelected() )
103 NotifyEvent( wxACC_EVENT_OBJECT_SELECTIONREMOVE,
116 if (
auto pFocus = wFocus.lock())
122#if wxUSE_ACCESSIBILITY
127 NotifyEvent( wxACC_EVENT_OBJECT_FOCUS,
133 if( track->GetSelected() )
135 NotifyEvent( wxACC_EVENT_OBJECT_SELECTION,
143 NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
162 if( t == target.get() )
178 return t->SharedPointer();
186#if wxUSE_ACCESSIBILITY
192 NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
197 NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE,
206#if wxUSE_ACCESSIBILITY
221 NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE,
230#if wxUSE_ACCESSIBILITY
234wxAccStatus TrackPanelAx::GetChild(
int childId, wxAccessible** child )
236 if( childId == wxACC_SELF )
249wxAccStatus TrackPanelAx::GetChildCount(
int* childCount )
261wxAccStatus TrackPanelAx::GetDefaultAction(
int WXUNUSED(childId), wxString *actionName )
269wxAccStatus TrackPanelAx::GetDescription(
int WXUNUSED(childId), wxString *description )
271 description->clear();
277wxAccStatus TrackPanelAx::GetHelpText(
int WXUNUSED(childId), wxString *helpText )
286wxAccStatus TrackPanelAx::GetKeyboardShortcut(
int WXUNUSED(childId), wxString *shortcut )
295wxAccStatus TrackPanelAx::GetLocation( wxRect& rect,
int elementId )
299 if( elementId == wxACC_SELF )
320 rect.Inflate(dx, dx);
321 rect.SetPosition(
GetWindow()->ClientToScreen(rect.GetPosition()));
328wxAccStatus TrackPanelAx::GetName(
int childId, wxString*
name )
330#if defined(__WXMSW__) || defined(__WXMAC__)
333 if( childId == wxACC_SELF )
335 *
name =
_(
"TrackView");
348 const auto trackNameLower = t->GetName().Lower();
352 if(trackNameLower.Find(wxString(
_(
"Label Track")).Lower()) == wxNOT_FOUND &&
356 name->Append(
wxT(
" ") + wxString(
_(
"Label Track")));
358 else if(
dynamic_cast<TimeTrack*
>(t.get()))
363 name->Append(
wxT(
" ") + wxString(
_(
"Time Track")));
366 else if(
dynamic_cast<NoteTrack*
>(t.get()))
369 name->Append(
wxT(
" ") + wxString(
_(
"Note Track")));
374 if( pt && pt->GetMute() )
384 name->Append(
wxT(
" ") + wxString(
_(
" Muted" )) );
387 if( pt && pt->GetSolo() )
391 name->Append(
wxT(
" ") + wxString(
_(
" Soloed" )) );
393 if( t->GetSelected() )
397 name->Append(
wxT(
" ") + wxString(
_(
" Selected" )) );
405 name->Append(
wxT(
" ") + wxString(
_(
" Sync Locked" )) );
417#if defined(__WXMAC__)
418 return wxACC_NOT_IMPLEMENTED;
423wxAccStatus TrackPanelAx::GetRole(
int childId, wxAccRole* role )
425#if defined(__WXMSW__)
428 if( childId == wxACC_SELF )
430 *role = wxROLE_SYSTEM_TABLE;
434 *role = wxROLE_SYSTEM_ROW;
443#if defined(__WXMAC__)
444 if( childId == wxACC_SELF )
446 *role = wxROLE_SYSTEM_PANE;
450 *role = wxROLE_SYSTEM_STATICTEXT;
465wxAccStatus TrackPanelAx::GetSelections( wxVariant * WXUNUSED(selections) )
467 return wxACC_NOT_IMPLEMENTED;
471wxAccStatus TrackPanelAx::GetState(
int childId,
long* state )
473#if defined(__WXMSW__)
478 *state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
483 *state |= wxACC_STATE_SYSTEM_FOCUSED;
488 *state |= wxACC_STATE_SYSTEM_SELECTED;
494 *state = wxACC_STATE_SYSTEM_FOCUSABLE + wxACC_STATE_SYSTEM_FOCUSED;
498#if defined(__WXMAC__)
499 *state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
509 *state |= wxACC_STATE_SYSTEM_FOCUSED;
512 if( t->GetSelected() )
514 *state |= wxACC_STATE_SYSTEM_SELECTED;
525#if defined(__WXMAC__)
526wxAccStatus TrackPanelAx::GetValue(
int childId, wxString* strValue )
528wxAccStatus TrackPanelAx::GetValue(
int WXUNUSED(childId), wxString* WXUNUSED(strValue) )
531#if defined(__WXMSW__)
532 return wxACC_NOT_IMPLEMENTED;
535#if defined(__WXMAC__)
536 if( childId == wxACC_SELF )
538 *strValue =
_(
"TrackView");
551 strValue->Printf(
_(
"Track %d"), TrackNum(t));
552 strValue->Append(
" " + t->GetName());
556 if( pt && pt->GetMute() )
558 strValue->Append(
_(
" Mute On" ) );
561 if( pt && pt->GetSolo() )
563 strValue->Append(
_(
" Solo On" ) );
565 if( t->GetSelected() )
567 strValue->Append(
_(
" Select On" ) );
581#if defined(__WXMSW__)
599#if defined(__WXMAC__)
605 *childId =
TrackNum( focusedTrack );
609 *childId = wxACC_SELF;
615 return wxACC_NOT_IMPLEMENTED;
620wxAccStatus TrackPanelAx::Navigate(wxNavDir navDir,
int fromId,
int* toId, wxAccessible** toObject)
623 GetChildCount( &childCount );
625 if (fromId > childCount)
629 case wxNAVDIR_FIRSTCHILD:
630 if (fromId == wxACC_SELF && childCount > 0 )
636 case wxNAVDIR_LASTCHILD:
637 if (fromId == wxACC_SELF && childCount > 0 )
645 if (fromId != wxACC_SELF) {
647 if (*toId > childCount)
651 return wxACC_NOT_IMPLEMENTED;
654 case wxNAVDIR_PREVIOUS:
656 if (fromId != wxACC_SELF) {
662 return wxACC_NOT_IMPLEMENTED;
667 if (fromId != wxACC_SELF)
670 return wxACC_NOT_IMPLEMENTED;
679wxAccStatus TrackPanelAx::Select(
int childId, wxAccSelectionFlags selectFlags)
682 if (selectFlags != wxACC_SEL_TAKEFOCUS)
683 return wxACC_NOT_IMPLEMENTED;
685 if (childId != wxACC_SELF) {
687 GetChildCount( &childCount );
688 if (childId > childCount)
698 return wxACC_NOT_IMPLEMENTED;
707 return std::make_shared< TrackFocus >( parent );
733 return mAx->GetFocus().get();
747 std::unique_ptr< TrackPanelAx > pAx
750#if wxUSE_ACCESSIBILITY
752 owner.SetAccessible(
mAx = pAx.release());
755 mAx = std::move(pAx);
762 mAx->MessageForScreenReader( message );
Toolkit-neutral facade for basic user interface services.
const TranslatableString name
declares abstract base class Track, TrackList, and iterators over TrackList
static const AudacityProject::AttachedObjects::RegisteredFactory key
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
A LabelTrack is a Track that holds labels (LabelStruct).
static wxString GetDefaultName()
A Track that is used for Midi notes. (Somewhat old code).
AudioTrack subclass that can also be audibly replayed by the program.
static bool IsSyncLockSelected(const Track *pTrack)
A kind of Track used to 'warp time'.
static wxString GetDefaultName()
void UpdateAccessibility()
void SetAccessible(wxWindow &owner, std::unique_ptr< TrackPanelAx > pAccessible)
void MessageForScreenReader(const TranslatableString &message)
TrackFocus(AudacityProject &project)
std::unique_ptr< TrackPanelAx > mAx
AudacityProject & mProject
Abstract base class for an object holding data associated with points on a time axis.
void EnsureVisible(bool modifyState=false)
std::shared_ptr< Subclass > SharedPointer()
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
TrackIter< Track > Find(Track *pTrack)
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
TrackPanelAx(AudacityProject &project)
std::weak_ptr< Track > mFocusedTrack
void MessageForScreenReader(const TranslatableString &message)
std::shared_ptr< Track > GetFocus()
AudacityProject & mProject
int TrackNum(const std::shared_ptr< Track > &track)
std::shared_ptr< Track > SetFocus(std::shared_ptr< Track > track={})
std::shared_ptr< Track > FindTrack(int num)
wxWindow * GetWindow() const
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
std::shared_ptr< Track > FindTrack(TrackPanelCell *pCell)