Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore/Audacity CLA applies
4 : *
5 : * Copyright (C) 2026 MuseScore/Audacity and others
6 : *
7 : * This program is free software: you can redistribute it and/or modify
8 : * it under the terms of the GNU General Public License version 3 as
9 : * published by the Free Software Foundation.
10 : *
11 : * This program is distributed in the hope that it will be useful,
12 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : * GNU General Public License for more details.
15 : *
16 : * You should have received a copy of the GNU General Public License
17 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 : */
19 :
20 : #include "rcontrolmodule.h"
21 :
22 : #include "mcp/mcpcontroller.h"
23 :
24 : using namespace muse;
25 : using namespace muse::rcontrol;
26 :
27 : static const std::string mname("rcontrol");
28 :
29 0 : std::string RControlModule::moduleName() const
30 : {
31 0 : return mname;
32 : }
33 :
34 0 : modularity::IContextSetup* RControlModule::newContext(const muse::modularity::ContextPtr& ctx) const
35 : {
36 0 : return new RControlContext(ctx);
37 : }
38 :
39 0 : void RControlContext::registerExports()
40 : {
41 0 : m_mcpController = std::make_shared<mcp::McpController>(iocContext());
42 0 : }
43 :
44 0 : void RControlContext::onInit(const IApplication::RunMode& mode)
45 : {
46 0 : if (mode != IApplication::RunMode::GuiApp) {
47 0 : return;
48 : }
49 :
50 0 : m_mcpController->init();
51 : }
52 :
53 0 : void RControlContext::onDeinit()
54 : {
55 0 : m_mcpController->deinit();
56 0 : }
|