Audacity 3.2.0
Public Member Functions | List of all members
anonymous_namespace{TimeTrackMenuItems.cpp}::Handler Struct Reference
Inheritance diagram for anonymous_namespace{TimeTrackMenuItems.cpp}::Handler:
[legend]
Collaboration diagram for anonymous_namespace{TimeTrackMenuItems.cpp}::Handler:
[legend]

Public Member Functions

void OnNewTimeTrack (const CommandContext &context)
 

Detailed Description

Definition at line 26 of file TimeTrackMenuItems.cpp.

Member Function Documentation

◆ OnNewTimeTrack()

void anonymous_namespace{TimeTrackMenuItems.cpp}::Handler::OnNewTimeTrack ( const CommandContext context)
inline

Definition at line 27 of file TimeTrackMenuItems.cpp.

28{
29 auto &project = context.project;
30 auto &tracks = TrackList::Get( project );
31 auto &viewInfo = ViewInfo::Get( project );
32 auto &window = ProjectWindow::Get( project );
33
34 if ( *tracks.Any<TimeTrack>().begin() ) {
36 XO(
37"This version of Audacity only allows one time track for each project window.") );
38 return;
39 }
40
41 auto t = tracks.AddToHead( std::make_shared<TimeTrack>(&viewInfo) );
42
44
45 t->SetSelected(true);
46
47 ProjectHistory::Get( project )
48 .PushState(XO("Created new time track"), XO("New Track"));
49
50 TrackFocus::Get(project).Set(t);
51 t->EnsureVisible();
52}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
#define XO(s)
Definition: Internat.h:31
AudacityProject & project
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
static ProjectWindow & Get(AudacityProject &project)
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
Track * Get()
void EnsureVisible(bool modifyState=false)
Definition: Track.cpp:97
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:486
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
void SelectNone(AudacityProject &project)

References AudacityMessageBox(), Track::EnsureVisible(), TrackFocus::Get(), ProjectHistory::Get(), ViewInfo::Get(), TrackList::Get(), ProjectWindow::Get(), CommandContext::project, ProjectHistory::PushState(), SelectUtilities::SelectNone(), and XO.

Here is the call graph for this function:

The documentation for this struct was generated from the following file: