Audacity  3.0.3
TrackPanelAx.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  TrackPanelAx.cpp
6 
7  Leland Lucius
8  and lots of other contributors
9 
10 ******************************************************************//*******************************************************************/
16 
17 
18 #include "TrackPanelAx.h"
19 
20 // For compilers that support precompilation, includes "wx/wx.h".
21 #include <wx/wxprec.h>
22 
23 #include <wx/setup.h> // for wxUSE_* macros
24 
25 #ifndef WX_PRECOMP
26 // Include your minimal set of headers here, or wx.h
27 #include <wx/wx.h>
28 #endif
29 
30 
31 #include <wx/intl.h>
32 
33 #include "Project.h"
34 #include "Track.h"
35 
36 
37 wxDEFINE_EVENT(EVT_TRACK_FOCUS_CHANGE, wxCommandEvent);
38 
40  :
41 #if wxUSE_ACCESSIBILITY
42  WindowAccessible( nullptr ) // window pointer must be set after construction
43  ,
44 #endif
45  mProject{ project }
46 {
47  mTrackName = true;
48  mMessageCount = 0;
49  mNumFocusedTrack = 0;
50 }
51 
52 TrackPanelAx::~TrackPanelAx()
53 {
54 }
55 
57 {
58  return TrackList::Get( mProject );
59 }
60 
61 // Returns currently focused track
62 // if that track no longer exists, if there is a track at
63 // the same position, use that, else if there is a first
64 // track, use that.
65 std::shared_ptr<Track> TrackPanelAx::GetFocus()
66 {
67  auto focusedTrack = mFocusedTrack.lock();
68  if( !focusedTrack ) {
69  if (mNumFocusedTrack >=1) {
70  // This prevents the focus from being unnecessarily set to track 1
71  // when effects are applied. (Applying an effect can change
72  // the pointers of the selected tracks.)
73  focusedTrack = FindTrack(mNumFocusedTrack);
74  }
75  if (!focusedTrack) {
76  focusedTrack =
77  Track::SharedPointer( *GetTracks().Any().first );
78  // only call SetFocus if the focus has changed to avoid
79  // unnecessary focus events
80  if (focusedTrack)
81  focusedTrack = SetFocus();
82  }
83  }
84 
85  if( !TrackNum( focusedTrack ) )
86  {
87  mFocusedTrack.reset();
88  return {};
89  }
90 
91  return( focusedTrack );
92 }
93 
94 // Changes focus to a specified track
95 std::shared_ptr<Track> TrackPanelAx::SetFocus( std::shared_ptr<Track> track )
96 {
97  mTrackName = true;
98 
99 #if wxUSE_ACCESSIBILITY
100 
101  auto focusedTrack = mFocusedTrack.lock();
102  if( focusedTrack && !focusedTrack->GetSelected() )
103  {
104  NotifyEvent( wxACC_EVENT_OBJECT_SELECTIONREMOVE,
105  GetWindow(),
106  wxOBJID_CLIENT,
107  TrackNum( focusedTrack ) );
108  }
109 #endif
110 
111  if( !track )
112  track = Track::SharedPointer( *GetTracks().Any().begin() );
113 
114  if ( mFocusedTrack.lock() != track ) {
115  mFocusedTrack = track;
116  mProject.QueueEvent( safenew wxCommandEvent{ EVT_TRACK_FOCUS_CHANGE } );
117  }
118  mNumFocusedTrack = TrackNum(track);
119 
120 #if wxUSE_ACCESSIBILITY
121  if( track )
122  {
123  if (GetWindow() == wxWindow::FindFocus())
124  {
125  NotifyEvent( wxACC_EVENT_OBJECT_FOCUS,
126  GetWindow(),
127  wxOBJID_CLIENT,
129  }
130 
131  if( track->GetSelected() )
132  {
133  NotifyEvent( wxACC_EVENT_OBJECT_SELECTION,
134  GetWindow(),
135  wxOBJID_CLIENT,
137  }
138  }
139  else
140  {
141  NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
142  GetWindow(),
143  wxOBJID_CLIENT,
144  wxACC_SELF);
145  }
146 
147 #endif
148 
149  return track;
150 }
151 
152 // Returns TRUE if passed track has the focus
153 bool TrackPanelAx::IsFocused( const Track *track )
154 {
155  auto focusedTrack = mFocusedTrack.lock();
156  if( !focusedTrack )
157  focusedTrack = SetFocus();
158 
159  // Remap track pointer if there are outstanding pending updates
160  auto origTrack =
161  GetTracks().FindById( track->GetId() );
162  if (origTrack)
163  track = origTrack;
164 
165  return focusedTrack
166  ? TrackList::Channels(focusedTrack.get()).contains(track)
167  : !track;
168 }
169 
170 int TrackPanelAx::TrackNum( const std::shared_ptr<Track> &target )
171 {
172  // Find 1-based position of the target in the visible tracks, or 0 if not
173  // found
174  int ndx = 0;
175 
176  for ( auto t : GetTracks().Leaders() )
177  {
178  ndx++;
179  if( t == target.get() )
180  {
181  return ndx;
182  }
183  }
184 
185  return 0;
186 }
187 
188 std::shared_ptr<Track> TrackPanelAx::FindTrack( int num )
189 {
190  int ndx = 0;
191 
192  for ( auto t : GetTracks().Leaders() )
193  {
194  ndx++;
195  if( ndx == num )
196  return t->SharedPointer();
197  }
198 
199  return {};
200 }
201 
203 {
204 #if wxUSE_ACCESSIBILITY
205  auto t = GetFocus();
206  mTrackName = true;
207 
208  // The object_focus event is only needed by Window-Eyes
209  // and can be removed when we cease to support this screen reader.
210  NotifyEvent(wxACC_EVENT_OBJECT_FOCUS,
211  GetWindow(),
212  wxOBJID_CLIENT,
213  TrackNum(t));
214 
215  NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE,
216  GetWindow(),
217  wxOBJID_CLIENT,
218  TrackNum(t));
219 #endif
220 }
221 
223 {
224 #if wxUSE_ACCESSIBILITY
225  if (GetWindow() == wxWindow::FindFocus())
226  {
227  auto t = GetFocus();
228  int childId = t ? TrackNum(t) : 0;
229 
230  mMessage = message.Translation();
231 
232  // append \a alternatively, so that the string is never the same as the previous string.
233  // This ensures that screen readers read it.
234  if (mMessageCount % 2 == 0)
235  mMessage.Append('\a');
236  mMessageCount++;
237 
238  mTrackName = false;
239  NotifyEvent(wxACC_EVENT_OBJECT_NAMECHANGE,
240  GetWindow(),
241  wxOBJID_CLIENT,
242  childId);
243  }
244 
245 #endif
246 }
247 
248 #if wxUSE_ACCESSIBILITY
249 
250 // Retrieves the address of an IDispatch interface for the specified child.
251 // All objects must support this property.
252 wxAccStatus TrackPanelAx::GetChild( int childId, wxAccessible** child )
253 {
254  if( childId == wxACC_SELF )
255  {
256  *child = this;
257  }
258  else
259  {
260  *child = NULL;
261  }
262 
263  return wxACC_OK;
264 }
265 
266 // Gets the number of children.
267 wxAccStatus TrackPanelAx::GetChildCount( int* childCount )
268 {
269  *childCount = GetTracks().Leaders().size();
270  return wxACC_OK;
271 }
272 
273 // Gets the default action for this object (0) or > 0 (the action for a child).
274 // Return wxACC_OK even if there is no action. actionName is the action, or the empty
275 // string if there is no action.
276 // The retrieved string describes the action that is performed on an object,
277 // not what the object does as a result. For example, a toolbar button that prints
278 // a document has a default action of "Press" rather than "Prints the current document."
279 wxAccStatus TrackPanelAx::GetDefaultAction( int WXUNUSED(childId), wxString *actionName )
280 {
281  actionName->clear();
282 
283  return wxACC_OK;
284 }
285 
286 // Returns the description for this object or a child.
287 wxAccStatus TrackPanelAx::GetDescription( int WXUNUSED(childId), wxString *description )
288 {
289  description->clear();
290 
291  return wxACC_OK;
292 }
293 
294 // Returns help text for this object or a child, similar to tooltip text.
295 wxAccStatus TrackPanelAx::GetHelpText( int WXUNUSED(childId), wxString *helpText )
296 {
297  helpText->clear();
298 
299  return wxACC_OK;
300 }
301 
302 // Returns the keyboard shortcut for this object or child.
303 // Return e.g. ALT+K
304 wxAccStatus TrackPanelAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut )
305 {
306  shortcut->clear();
307 
308  return wxACC_OK;
309 }
310 
311 // Returns the rectangle for this object (id = 0) or a child element (id > 0).
312 // rect is in screen coordinates.
313 wxAccStatus TrackPanelAx::GetLocation( wxRect& rect, int elementId )
314 {
315  wxRect client;
316 
317  if( elementId == wxACC_SELF )
318  {
319  rect = GetWindow()->GetRect();
320  }
321  else
322  {
323  auto t = FindTrack( elementId );
324 
325  if( t == NULL )
326  {
327  return wxACC_FAIL;
328  }
329 
330  rect = mFinder ? mFinder( *t ) : wxRect{};
331  // Inflate the screen reader's rectangle so it overpaints Audacity's own
332  // yellow focus rectangle.
333 #ifdef __WXMAC__
334  const int dx = 2;
335 #else
336  const int dx = 1;
337 #endif
338  rect.Inflate(dx, dx);
339  }
340 
341  rect.SetPosition( GetWindow()->GetParent()->ClientToScreen( rect.GetPosition() ) );
342 
343  return wxACC_OK;
344 }
345 
346 // Gets the name of the specified object.
347 wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
348 {
349 #if defined(__WXMSW__) || defined(__WXMAC__)
350  if (mTrackName)
351  {
352  if( childId == wxACC_SELF )
353  {
354  *name = _( "TrackView" );
355  }
356  else
357  {
358  auto t = FindTrack( childId );
359 
360  if( t == NULL )
361  {
362  return wxACC_FAIL;
363  }
364  else
365  {
366  *name = t->GetName();
367  if( *name == t->GetDefaultName() )
368  {
369  /* i18n-hint: The %d is replaced by the number of the track.*/
370  name->Printf(_("Track %d"), TrackNum( t ) );
371  }
372 
373  t->TypeSwitch(
374  [&](const LabelTrack *) {
375  /* i18n-hint: This is for screen reader software and indicates that
376  this is a Label track.*/
377  name->Append( wxT(" ") + wxString(_("Label Track")));
378  },
379  [&](const TimeTrack *) {
380  /* i18n-hint: This is for screen reader software and indicates that
381  this is a Time track.*/
382  name->Append( wxT(" ") + wxString(_("Time Track")));
383  }
384 #ifdef USE_MIDI
385  ,
386  [&](const NoteTrack *) {
387  /* i18n-hint: This is for screen reader software and indicates that
388  this is a Note track.*/
389  name->Append( wxT(" ") + wxString(_("Note Track")));
390  }
391 #endif
392  );
393 
394  // LLL: Remove these during "refactor"
395  auto pt = dynamic_cast<PlayableTrack *>(t.get());
396  if( pt && pt->GetMute() )
397  {
398  // The following comment also applies to the solo, selected,
399  // and synclockselected states.
400  // Many of translations of the strings with a leading space omitted
401  // the leading space. Therefore a space has been added using wxT(" ").
402  // Because screen readers won't be affected by multiple spaces, the
403  // leading spaces have not been removed, so that no NEW translations are needed.
404  /* i18n-hint: This is for screen reader software and indicates that
405  this track is muted. (The mute button is on.)*/
406  name->Append( wxT(" ") + wxString(_( " Muted" )) );
407  }
408 
409  if( pt && pt->GetSolo() )
410  {
411  /* i18n-hint: This is for screen reader software and indicates that
412  this track is soloed. (The Solo button is on.)*/
413  name->Append( wxT(" ") + wxString(_( " Soloed" )) );
414  }
415  if( t->GetSelected() )
416  {
417  /* i18n-hint: This is for screen reader software and indicates that
418  this track is selected.*/
419  name->Append( wxT(" ") + wxString(_( " Selected" )) );
420  }
421  if( t->IsSyncLockSelected() )
422  {
423  /* i18n-hint: This is for screen reader software and indicates that
424  this track is shown with a sync-locked icon.*/
425  // The absence of a dash between Sync and Locked is deliberate -
426  // if present, Jaws reads it as "dash".
427  name->Append( wxT(" ") + wxString(_( " Sync Locked" )) );
428  }
429  }
430  }
431  }
432  else
433  {
434  *name = mMessage;
435  }
436 
437  return wxACC_OK;
438 #endif
439 
440 #if defined(__WXMAC__)
441  return wxACC_NOT_IMPLEMENTED;
442 #endif
443 }
444 
445 // Returns a role constant.
446 wxAccStatus TrackPanelAx::GetRole( int childId, wxAccRole* role )
447 {
448 #if defined(__WXMSW__)
449  if (mTrackName)
450  {
451  if( childId == wxACC_SELF )
452  {
453  *role = wxROLE_SYSTEM_TABLE;
454  }
455  else
456  {
457  *role = wxROLE_SYSTEM_ROW;
458  }
459  }
460  else
461  {
462  *role = wxROLE_NONE;
463  }
464 #endif
465 
466 #if defined(__WXMAC__)
467  if( childId == wxACC_SELF )
468  {
469  *role = wxROLE_SYSTEM_PANE;
470  }
471  else
472  {
473  *role = wxROLE_SYSTEM_STATICTEXT;
474  }
475 #endif
476 
477  return wxACC_OK;
478 }
479 
480 // Gets a variant representing the selected children
481 // of this object.
482 // Acceptable values:
483 // - a null variant (IsNull() returns TRUE)
484 // - a list variant (GetType() == wxT("list"))
485 // - an integer representing the selected child element,
486 // or 0 if this object is selected (GetType() == wxT("long"))
487 // - a "void*" pointer to a wxAccessible child object
488 wxAccStatus TrackPanelAx::GetSelections( wxVariant * WXUNUSED(selections) )
489 {
490  return wxACC_NOT_IMPLEMENTED;
491 }
492 
493 // Returns a state constant.
494 wxAccStatus TrackPanelAx::GetState( int childId, long* state )
495 {
496 #if defined(__WXMSW__)
497  if( childId > 0 )
498  {
499  auto t = FindTrack( childId );
500 
501  *state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
502  if (t)
503  {
504  if( t == mFocusedTrack.lock() )
505  {
506  *state |= wxACC_STATE_SYSTEM_FOCUSED;
507  }
508 
509  if( t->GetSelected() && mTrackName )
510  {
511  *state |= wxACC_STATE_SYSTEM_SELECTED;
512  }
513  }
514  }
515  else // childId == wxACC_SELF
516  {
517  *state = wxACC_STATE_SYSTEM_FOCUSABLE + wxACC_STATE_SYSTEM_FOCUSED;
518  }
519 #endif
520 
521 #if defined(__WXMAC__)
522  *state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
523 
524  if( childId > 0 )
525  {
526  auto t = FindTrack( childId );
527 
528  if (t)
529  {
530  if( t == mFocusedTrack.lock() )
531  {
532  *state |= wxACC_STATE_SYSTEM_FOCUSED;
533  }
534 
535  if( t->GetSelected() )
536  {
537  *state |= wxACC_STATE_SYSTEM_SELECTED;
538  }
539  }
540  }
541 #endif
542 
543  return wxACC_OK;
544 }
545 
546 // Returns a localized string representing the value for the object
547 // or child.
548 #if defined(__WXMAC__)
549 wxAccStatus TrackPanelAx::GetValue( int childId, wxString* strValue )
550 #else
551 wxAccStatus TrackPanelAx::GetValue( int WXUNUSED(childId), wxString* WXUNUSED(strValue) )
552 #endif
553 {
554 #if defined(__WXMSW__)
555  return wxACC_NOT_IMPLEMENTED;
556 #endif
557 
558 #if defined(__WXMAC__)
559  if( childId == wxACC_SELF )
560  {
561  *strValue = _( "TrackView" );
562  }
563  else
564  {
565  auto t = FindTrack( childId );
566 
567  if( t == NULL )
568  {
569  return wxACC_FAIL;
570  }
571  else
572  {
573  *strValue = t->GetName();
574  if( *strValue == t->GetDefaultName() )
575  {
576  strValue->Printf(_("Track %d"), TrackNum( t ) );
577  }
578 
579  // LLL: Remove these during "refactor"
580  auto pt = dynamic_cast<PlayableTrack *>(t.get());
581  if( pt && pt->GetMute() )
582  {
583  strValue->Append( _( " Mute On" ) );
584  }
585 
586  if( pt && pt->GetSolo() )
587  {
588  strValue->Append( _( " Solo On" ) );
589  }
590  if( t->GetSelected() )
591  {
592  strValue->Append( _( " Select On" ) );
593  }
594  }
595  }
596  return wxACC_OK;
597 #endif
598 }
599 
600 // Gets the window with the keyboard focus.
601 // If childId is 0 and child is NULL, no object in
602 // this subhierarchy has the focus.
603 // If this object has the focus, child should be 'this'.
604 wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child )
605 {
606 #if defined(__WXMSW__)
607 
608  if (GetWindow() == wxWindow::FindFocus())
609  {
610  auto focusedTrack = mFocusedTrack.lock();
611  if (focusedTrack)
612  {
613  *childId = TrackNum(focusedTrack);
614  }
615  else
616  {
617  *child = this;
618  }
619  }
620 
621  return wxACC_OK;
622 #endif
623 
624 #if defined(__WXMAC__)
625  if( GetWindow() == wxWindow::FindFocus() )
626  {
627  auto focusedTrack = mFocusedTrack.lock();
628  if( focusedTrack )
629  {
630  *childId = TrackNum( focusedTrack );
631  }
632  else
633  {
634  *childId = wxACC_SELF;
635  }
636 
637  return wxACC_OK;
638  }
639 
640  return wxACC_NOT_IMPLEMENTED;
641 #endif
642 }
643 
644 // Navigates from fromId to toId/toObject
645 wxAccStatus TrackPanelAx::Navigate(wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject)
646 {
647  int childCount;
648  GetChildCount( &childCount );
649 
650  if (fromId > childCount)
651  return wxACC_FAIL;
652 
653  switch (navDir) {
654  case wxNAVDIR_FIRSTCHILD:
655  if (fromId == wxACC_SELF && childCount > 0 )
656  *toId = 1;
657  else
658  return wxACC_FALSE;
659  break;
660 
661  case wxNAVDIR_LASTCHILD:
662  if (fromId == wxACC_SELF && childCount > 0 )
663  *toId = childCount;
664  else
665  return wxACC_FALSE;
666  break;
667 
668  case wxNAVDIR_NEXT:
669  case wxNAVDIR_DOWN:
670  if (fromId != wxACC_SELF) {
671  *toId = fromId + 1;
672  if (*toId > childCount)
673  return wxACC_FALSE;
674  }
675  else
676  return wxACC_NOT_IMPLEMENTED;
677  break;
678 
679  case wxNAVDIR_PREVIOUS:
680  case wxNAVDIR_UP:
681  if (fromId != wxACC_SELF) {
682  *toId = fromId - 1;
683  if (*toId < 1)
684  return wxACC_FALSE;
685  }
686  else
687  return wxACC_NOT_IMPLEMENTED;
688  break;
689 
690  case wxNAVDIR_LEFT:
691  case wxNAVDIR_RIGHT:
692  if (fromId != wxACC_SELF)
693  return wxACC_FALSE;
694  else
695  return wxACC_NOT_IMPLEMENTED;
696  break;
697  }
698 
699  *toObject = nullptr;
700  return wxACC_OK;
701 }
702 
703 // Modify focus or selection
704 wxAccStatus TrackPanelAx::Select(int childId, wxAccSelectionFlags selectFlags)
705 {
706  // Only support change of focus
707  if (selectFlags != wxACC_SEL_TAKEFOCUS)
708  return wxACC_NOT_IMPLEMENTED;
709 
710  if (childId != wxACC_SELF) {
711  int childCount;
712  GetChildCount( &childCount );
713  if (childId > childCount)
714  return wxACC_FAIL;
715 
716  Track* t = FindTrack(childId).get();
717  if (t) {
718  SetFocus( t->SharedPointer() );
719  t->EnsureVisible();
720  }
721  }
722  else
723  return wxACC_NOT_IMPLEMENTED;
724 
725  return wxACC_OK;
726 }
727 
728 #endif // wxUSE_ACCESSIBILITY
729 
731  []( AudacityProject &parent ){
732  return std::make_shared< TrackFocus >( parent );
733  }
734 };
735 
737 {
738  return project.AttachedObjects::Get< TrackFocus >( key );
739 }
740 
742 {
743  return Get( const_cast< AudacityProject & >( project ) );
744 }
745 
747  : mProject{ project }
748 {
749 }
750 
752 {
753 }
754 
756 {
757  if (mAx)
758  return mAx->GetFocus().get();
759  return nullptr;
760 }
761 
762 void TrackFocus::Set( Track *pTrack )
763 {
764  if (mAx) {
765  pTrack = *TrackList::Get( mProject ).FindLeader( pTrack );
766  mAx->SetFocus( Track::SharedPointer( pTrack ) );
767  }
768 }
769 
770 bool TrackFocus::IsFocused( const Track *pTrack )
771 {
772  if (mAx)
773  return mAx->IsFocused( pTrack );
774  return false;
775 }
776 
778  wxWindow &owner,
779  std::unique_ptr< TrackPanelAx > pAx
780 )
781 {
782 #if wxUSE_ACCESSIBILITY
783  // wxWidgets owns the accessible object
784  owner.SetAccessible(mAx = pAx.release());
785 #else
786  // wxWidgets does not own the object, but we need to retain it
787  mAx = std::move(pAx);
788 #endif
789 }
790 
792 {
793  if (mAx)
794  mAx->MessageForScreenReader( message );
795 }
796 
798 {
799  if (mAx)
800  mAx->Updated();
801 }
TrackPanelAx::TrackPanelAx
TrackPanelAx(AudacityProject &project)
Definition: TrackPanelAx.cpp:39
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
TrackFocus::Set
void Set(Track *pTrack)
Definition: TrackPanelAx.cpp:762
TrackPanelAx::mMessage
wxString mMessage
Definition: TrackPanelAx.h:154
TrackPanelAx::mMessageCount
int mMessageCount
Definition: TrackPanelAx.h:156
TrackPanelAx::mFocusedTrack
std::weak_ptr< Track > mFocusedTrack
Definition: TrackPanelAx.h:151
TrackList::FindById
Track * FindById(TrackId id)
Definition: Track.cpp:682
TrackPanelAx::SetFocus
std::shared_ptr< Track > SetFocus(std::shared_ptr< Track > track={})
Definition: TrackPanelAx.cpp:95
TrackFocus
Definition: TrackPanelAx.h:161
wxDEFINE_EVENT
wxDEFINE_EVENT(EVT_TRACK_FOCUS_CHANGE, wxCommandEvent)
Project.h
TrackPanelAx::Updated
void Updated()
Definition: TrackPanelAx.cpp:202
Track::EnsureVisible
void EnsureVisible(bool modifyState=false)
Definition: Track.cpp:100
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1484
TrackList
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1280
TrackFocus::SetAccessible
void SetAccessible(wxWindow &owner, std::unique_ptr< TrackPanelAx > pAccessible)
Definition: TrackPanelAx.cpp:777
Track::SharedPointer
std::shared_ptr< Subclass > SharedPointer()
Definition: Track.h:291
TrackPanelAx.h
TrackFocus::~TrackFocus
~TrackFocus() override
Definition: TrackPanelAx.cpp:751
TrackPanelAx::GetTracks
TrackList & GetTracks()
Definition: TrackPanelAx.cpp:56
TrackPanelAx::MessageForScreenReader
void MessageForScreenReader(const TranslatableString &message)
Definition: TrackPanelAx.cpp:222
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
ClientData::Site::RegisteredFactory
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
Definition: ClientData.h:266
TrackPanelAx::GetWindow
wxWindow * GetWindow() const
Definition: TrackPanelAx.h:133
TrackFocus::TrackFocus
TrackFocus(AudacityProject &project)
Definition: TrackPanelAx.cpp:746
TrackPanelAx::mTrackName
bool mTrackName
Definition: TrackPanelAx.h:155
TrackList::FindLeader
TrackIter< Track > FindLeader(Track *pTrack)
Definition: Track.cpp:659
Track::GetId
TrackId GetId() const
Definition: Track.h:281
TrackFocus::IsFocused
bool IsFocused(const Track *pTrack)
Definition: TrackPanelAx.cpp:770
name
const TranslatableString name
Definition: Distortion.cpp:98
TrackFocus::mProject
AudacityProject & mProject
Definition: TrackPanelAx.h:195
TrackFocus::Get
Track * Get()
Definition: TrackPanelAx.cpp:755
WindowAccessible
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
TrackPanelAx::GetFocus
std::shared_ptr< Track > GetFocus()
Definition: TrackPanelAx.cpp:65
TrackPanelAx::mProject
AudacityProject & mProject
Definition: TrackPanelAx.h:143
TrackPanelAx::mFinder
RectangleFinder mFinder
Definition: TrackPanelAx.h:149
anonymous_namespace{TrackPanel.cpp}::FindTrack
std::shared_ptr< Track > FindTrack(TrackPanelCell *pCell)
Definition: TrackPanel.cpp:530
PlayableTrack
AudioTrack subclass that can also be audibly replayed by the program.
Definition: Track.h:854
TrackFocus::MessageForScreenReader
void MessageForScreenReader(const TranslatableString &message)
Definition: TrackPanelAx.cpp:791
Track::GetSelected
bool GetSelected() const
Definition: Track.h:431
TrackPanelAx::IsFocused
bool IsFocused(const Track *track)
Definition: TrackPanelAx.cpp:153
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
TrackList::Leaders
auto Leaders() -> TrackIterRange< TrackType >
Definition: Track.h:1405
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
TrackFocus::UpdateAccessibility
void UpdateAccessibility()
Definition: TrackPanelAx.cpp:797
TrackPanelAx::FindTrack
std::shared_ptr< Track > FindTrack(int num)
Definition: TrackPanelAx.cpp:188
_
#define _(s)
Definition: Internat.h:75
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
Track.h
declares abstract base class Track, TrackList, and iterators over TrackList
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
TrackPanelAx::mNumFocusedTrack
int mNumFocusedTrack
Definition: TrackPanelAx.h:152
TrackFocus::mAx
std::unique_ptr< TrackPanelAx > mAx
Definition: TrackPanelAx.h:200
safenew
#define safenew
Definition: MemoryX.h:10
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: TrackPanelAx.cpp:730
TrackPanelAx::TrackNum
int TrackNum(const std::shared_ptr< Track > &track)
Definition: TrackPanelAx.cpp:170
TimeTrack
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
NoteTrack
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:67