Audacity 3.2.0
Functions | Variables
anonymous_namespace{TimeTrackMenuItems.cpp} Namespace Reference

Functions

void OnNewTimeTrack (const CommandContext &context)
 
const ReservedCommandFlagTimeTrackDoesNotExistFlag ()
 

Variables

AttachedItem sAttachment
 

Function Documentation

◆ OnNewTimeTrack()

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

Definition at line 27 of file TimeTrackMenuItems.cpp.

28{
29 auto &project = context.project;
30 auto &tracks = TrackList::Get( project );
31
32 auto t = tracks.AddToHead(std::make_shared<TimeTrack>());
33
35
36 t->SetSelected(true);
37
39 .PushState(XO("Created new time track"), XO("New Track"));
40
43}
XO("Cut/Copy/Paste")
const auto tracks
const auto project
AudacityProject & project
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
Track * Get()
Definition: TrackFocus.cpp:156
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
void ShowTrack(const Track &track)
Definition: Viewport.cpp:460
static Viewport & Get(AudacityProject &project)
Definition: Viewport.cpp:33
void SelectNone(AudacityProject &project)

References TrackFocus::Get(), ProjectHistory::Get(), TrackList::Get(), Viewport::Get(), CommandContext::project, project, ProjectHistory::PushState(), SelectUtilities::SelectNone(), Viewport::ShowTrack(), tracks, and XO().

Here is the call graph for this function:

◆ TimeTrackDoesNotExistFlag()

const ReservedCommandFlag & anonymous_namespace{TimeTrackMenuItems.cpp}::TimeTrackDoesNotExistFlag ( )

Definition at line 45 of file TimeTrackMenuItems.cpp.

46{
48 [](const AudacityProject &project){
49 return TrackList::Get(project).Any<const TimeTrack>().empty();
50 }
51 };
52 return flag;
53}
static std::once_flag flag
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:950

References TrackList::Any(), flag, TrackList::Get(), and project.

Here is the call graph for this function:

Variable Documentation

◆ sAttachment

AttachedItem anonymous_namespace{TimeTrackMenuItems.cpp}::sAttachment
Initial value:
{
Command( wxT("NewTimeTrack"), XXO("&Time Track"),
),
wxT("Tracks/Add/Add")
}
wxT("CloseDown"))
const ReservedCommandFlag & AudioIONotBusyFlag()
XXO("&Cut/Copy/Paste Toolbar")
constexpr auto Command
Definition: MenuRegistry.h:456
const ReservedCommandFlag & TimeTrackDoesNotExistFlag()
void OnNewTimeTrack(const CommandContext &context)

Definition at line 55 of file TimeTrackMenuItems.cpp.