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 "CommandManager.h"
16#include "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 MenuRegistry;
47
49{
50 static auto menu = std::shared_ptr{ Menu(
51 wxT("Timeline"), XXO("Tim&eline"),
52 Command(
53 wxT("MinutesAndSeconds"), XXO("Minutes and Seconds"),
56 [](const AudacityProject& project) {
59 })),
60 Command(
61 wxT("BeatsAndMeasures"), XXO("Beats and Measures"),
64 [](const AudacityProject& project) {
67 }))) };
68 return menu;
69}
70
72 wxT("View/Other/Toolbars") };
73
74} // 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
static CommandManager & Get(AudacityProject &project)
Generates classes whose instances register items at construction.
Definition: Registry.h:388
constexpr auto Command
Definition: MenuRegistry.h:456
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
std::unique_ptr< detail::IndirectItem< Item > > Indirect(const std::shared_ptr< Item > &ptr)
A convenience function.
Definition: Registry.h:175
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) &&
Definition: MenuRegistry.h:74