1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Use TypeSwitch and track_cast in TrackPanel

This commit is contained in:
Paul Licameli
2017-04-25 09:24:49 -04:00
parent e17c4acd5d
commit fd10ed26cd
7 changed files with 248 additions and 235 deletions

View File

@@ -373,26 +373,26 @@ wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
name->Printf(_("Track %d"), TrackNum( t ) );
}
if (t->GetKind() == Track::Label)
{
/* i18n-hint: This is for screen reader software and indicates that
this is a Label track.*/
name->Append( wxT(" ") + wxString(_("Label Track")));
}
else if (t->GetKind() == Track::Time)
{
/* i18n-hint: This is for screen reader software and indicates that
this is a Time track.*/
name->Append( wxT(" ") + wxString(_("Time Track")));
}
t->TypeSwitch(
[&](const LabelTrack *) {
/* i18n-hint: This is for screen reader software and indicates that
this is a Label track.*/
name->Append( wxT(" ") + wxString(_("Label Track")));
},
[&](const TimeTrack *) {
/* i18n-hint: This is for screen reader software and indicates that
this is a Time track.*/
name->Append( wxT(" ") + wxString(_("Time Track")));
}
#ifdef USE_MIDI
else if (t->GetKind() == Track::Note)
{
/* i18n-hint: This is for screen reader software and indicates that
this is a Note track.*/
name->Append( wxT(" ") + wxString(_("Note Track")));
}
,
[&](const NoteTrack *) {
/* i18n-hint: This is for screen reader software and indicates that
this is a Note track.*/
name->Append( wxT(" ") + wxString(_("Note Track")));
}
#endif
);
// LLL: Remove these during "refactor"
auto pt = dynamic_cast<PlayableTrack *>(t.get());