Audacity 3.2.0
TimelineMenus.cpp
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 TimelineMenus.cpp
7
8 Dmitry Vedenko
9
10*/
11#include "../AdornedRulerPanel.h"
12
13#include "Project.h"
14
15#include "../commands/CommandManager.h"
16#include "../commands/CommandContext.h"
17
18namespace
19{
21{
22 auto& project = context.project;
23
25 ruler.SetTimeDisplayMode(type);
26
28}
29
31{
33}
34
36{
38}
39
41{
42 auto& panel = AdornedRulerPanel::Get(project);
43 return panel.GetTimeDisplayMode();
44}
45
46using namespace MenuTable;
47
49{
51 static BaseItemSharedPtr menu { Menu(
52 wxT("Timeline"), XXO("&Timeline"),
53 Command(
54 wxT("MinutesAndSeconds"), XXO("Minutes and Seconds"),
57 [](const AudacityProject& project) {
60 })),
61 Command(
62 wxT("BeatsAndMeasures"), XXO("Beats and Measures"),
65 [](const AudacityProject& project) {
68 }))) };
69 return menu;
70}
71
72AttachedItem sAttachment2 { wxT("Optional/Extra/Part1"),
74
75} // namespace
wxT("CloseDown"))
AttachedItem sAttachment2
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
XXO("&Cut/Copy/Paste Toolbar")
const auto project
TimeDisplayMode
static AdornedRulerPanel & Get(AudacityProject &project)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
AudacityProject & project
void UpdateCheckmarks(AudacityProject &project)
static CommandManager & Get(AudacityProject &project)
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
constexpr auto Command
std::unique_ptr< detail::IndirectItem< Item > > Indirect(const std::shared_ptr< Item > &ptr)
A convenience function.
Definition: Registry.h:113
std::shared_ptr< BaseItem > BaseItemSharedPtr
Definition: Registry.h:78
void OnSetBeatsAndMeasures(const CommandContext &context)
TimeDisplayMode GetTimeDisplayMode(const AudacityProject &project)
void SetTimeDisplayMode(const CommandContext &context, TimeDisplayMode type)
void OnSetMinutesSeconds(const CommandContext &context)
Options && CheckTest(const CheckFn &fn) &&