Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-Studio-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #include "audiocommandsregister.h"
24 :
25 : #include "../audiocommands.h"
26 : #include "rcommand/commandtypes.h"
27 :
28 : using namespace muse;
29 : using namespace muse::rcommand;
30 : using namespace muse::audio;
31 :
32 : static const std::vector<CommandInfo> s_commandInfos = {
33 : CommandInfo{
34 : AUDIO_DEV_USE_DRIVER_MODE_COMMAND,
35 : TranslatableString::untranslatable("Use Driver Mode"),
36 : TranslatableString::untranslatable("Use Driver Mode (developer mode)"),
37 : InputSchema(),
38 : Decoration(rcommand::Checkable::Yes),
39 : Availability::Dispatch
40 : },
41 : CommandInfo{
42 : AUDIO_DEV_USE_HYBRID_MODE_COMMAND,
43 : TranslatableString::untranslatable("Use Hybrid Mode"),
44 : TranslatableString::untranslatable("Use Hybrid Mode (developer mode)"),
45 : InputSchema(),
46 : Decoration(rcommand::Checkable::Yes),
47 : Availability::Dispatch
48 : },
49 : };
50 :
51 0 : std::string AudioCommandsRegister::moduleName() const
52 : {
53 0 : return "audio";
54 : }
55 :
56 0 : const std::vector<muse::rcommand::Command>& AudioCommandsRegister::commandList() const
57 : {
58 0 : static std::vector<muse::rcommand::Command> commands;
59 0 : if (commands.empty()) {
60 0 : commands.reserve(s_commandInfos.size());
61 0 : for (const auto& info : s_commandInfos) {
62 0 : commands.push_back(info.command);
63 : }
64 : }
65 0 : return commands;
66 : }
67 :
68 0 : const std::vector<CommandInfo>& AudioCommandsRegister::commandInfoList() const
69 : {
70 0 : return s_commandInfos;
71 : }
|