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 "vstcommandsregister.h"
24 :
25 : #include "../vstcommands.h"
26 :
27 : using namespace muse;
28 : using namespace muse::rcommand;
29 : using namespace muse::vst;
30 :
31 : static const std::vector<CommandInfo> s_commandInfos = {
32 : CommandInfo{
33 : VST_USE_OLDVIEW_COMMAND,
34 : TranslatableString("vst", "Use old view"),
35 : TranslatableString("vst", "Use old view"),
36 : InputSchema(),
37 : Decoration(Checkable::Yes),
38 : Availability::Dispatch
39 : },
40 : CommandInfo{
41 : VST_USE_NEWVIEW_COMMAND,
42 : TranslatableString("vst", "Use new view"),
43 : TranslatableString("vst", "Use new view"),
44 : InputSchema(),
45 : Decoration(Checkable::Yes),
46 : Availability::Dispatch
47 : },
48 : CommandInfo{
49 : VST_OPEN_FX_EDITOR_COMMAND,
50 : TranslatableString("vst", "Open FX editor"),
51 : TranslatableString("vst", "Open FX editor"),
52 : InputSchema({
53 : { "resourceId", Arg(DataType::String, u"VST FX resource ID") },
54 : { "trackId", Arg(DataType::Int, u"Track ID (optional)") },
55 : { "chainOrder", Arg(DataType::Int, u"FX chain order (optional)") },
56 : { "operation", Arg(DataType::String, u"Editor operation: open or close (optional)") },
57 : { "sync", Arg(DataType::Bool, u"Use synchronous open/close (optional)") }
58 : }),
59 : Decoration(),
60 : Availability::Dispatch
61 : },
62 : CommandInfo{
63 : VST_OPEN_INSTRUMENT_EDITOR_COMMAND,
64 : TranslatableString("vst", "Open instrument editor"),
65 : TranslatableString("vst", "Open instrument editor"),
66 : InputSchema({
67 : { "resourceId", Arg(DataType::String, u"VST instrument resource ID") },
68 : { "trackId", Arg(DataType::Int, u"Track ID (optional)") },
69 : { "operation", Arg(DataType::String, u"Editor operation: open or close (optional)") },
70 : { "sync", Arg(DataType::Bool, u"Use synchronous open/close (optional)") }
71 : }),
72 : Decoration(),
73 : Availability::Dispatch
74 : },
75 : };
76 :
77 0 : std::string VstCommandsRegister::moduleName() const
78 : {
79 0 : return "vst";
80 : }
81 :
82 0 : const std::vector<muse::rcommand::Command>& VstCommandsRegister::commandList() const
83 : {
84 0 : static std::vector<muse::rcommand::Command> commands;
85 0 : if (commands.empty()) {
86 0 : commands.reserve(s_commandInfos.size());
87 0 : for (const auto& info : s_commandInfos) {
88 0 : commands.push_back(info.command);
89 : }
90 : }
91 0 : return commands;
92 : }
93 :
94 0 : const std::vector<CommandInfo>& VstCommandsRegister::commandInfoList() const
95 : {
96 0 : return s_commandInfos;
97 : }
|