-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0ebf09
commit c1d5fa9
Showing
10 changed files
with
265 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SPDX-License-Identifier: GPL-3.0-only | ||
# MuseScore-CLA-applies | ||
# | ||
# MuseScore | ||
# Music Composition & Notation | ||
# | ||
# Copyright (C) 2021 MuseScore BVBA and others | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
set(MODULE multiinstances) | ||
|
||
set(MODULE_SRC | ||
${CMAKE_CURRENT_LIST_DIR}/multiinstancesstubmodule.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/multiinstancesstubmodule.h | ||
${CMAKE_CURRENT_LIST_DIR}/multiinstancesstubprovider.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/multiinstancesstubprovider.h | ||
) | ||
|
||
include(${PROJECT_SOURCE_DIR}/build/module.cmake) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2021 MuseScore BVBA and others | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
#include "multiinstancesstubmodule.h" | ||
|
||
#include "modularity/ioc.h" | ||
#include "multiinstancesstubprovider.h" | ||
|
||
using namespace mu::mi; | ||
using namespace mu::framework; | ||
|
||
std::string MultiInstancesModule::moduleName() const | ||
{ | ||
return "multiinstances_stub"; | ||
} | ||
|
||
void MultiInstancesModule::registerExports() | ||
{ | ||
ioc()->registerExport<IMultiInstancesProvider>(moduleName(), new MultiInstancesStubProvider()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2021 MuseScore BVBA and others | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef MU_MI_MULTIINSTANCESSTUBMODULE_H | ||
#define MU_MI_MULTIINSTANCESSTUBMODULE_H | ||
|
||
#include "modularity/imodulesetup.h" | ||
|
||
namespace mu::mi { | ||
class MultiInstancesModule : public framework::IModuleSetup | ||
{ | ||
public: | ||
std::string moduleName() const override; | ||
|
||
void registerExports() override; | ||
}; | ||
} | ||
|
||
#endif // MU_MI_MULTIINSTANCESSTUBMODULE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2021 MuseScore BVBA and others | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
#include "multiinstancesstubprovider.h" | ||
|
||
using namespace mu::mi; | ||
|
||
// Score opening | ||
bool MultiInstancesStubProvider::isScoreAlreadyOpened(const io::path&) const | ||
{ | ||
return false; | ||
} | ||
|
||
void MultiInstancesStubProvider::activateWindowWithScore(const io::path&) | ||
{ | ||
} | ||
|
||
// Settings | ||
bool MultiInstancesStubProvider::isPreferencesAlreadyOpened() const | ||
{ | ||
return false; | ||
} | ||
|
||
void MultiInstancesStubProvider::activateWindowWithOpenedPreferences() const | ||
{ | ||
} | ||
|
||
void MultiInstancesStubProvider::settingsBeginTransaction() | ||
{ | ||
} | ||
|
||
void MultiInstancesStubProvider::settingsCommitTransaction() | ||
{ | ||
} | ||
|
||
void MultiInstancesStubProvider::settingsRollbackTransaction() | ||
{ | ||
} | ||
|
||
void MultiInstancesStubProvider::settingsSetValue(const std::string&, const Val&) | ||
{ | ||
} | ||
|
||
// Resources (files) | ||
bool MultiInstancesStubProvider::lockResource(const std::string&) | ||
{ | ||
return true; | ||
} | ||
|
||
bool MultiInstancesStubProvider::unlockResource(const std::string&) | ||
{ | ||
return true; | ||
} | ||
|
||
// Instances info | ||
const std::string& MultiInstancesStubProvider::selfID() const | ||
{ | ||
static std::string id("stub"); | ||
return id; | ||
} | ||
|
||
std::vector<InstanceMeta> MultiInstancesStubProvider::instances() const | ||
{ | ||
static std::vector<InstanceMeta> v; | ||
return v; | ||
} | ||
|
||
mu::async::Notification MultiInstancesStubProvider::instancesChanged() const | ||
{ | ||
static mu::async::Notification n; | ||
return n; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2021 MuseScore BVBA and others | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef MU_MI_MULTIINSTANCESSTUBPROVIDER_H | ||
#define MU_MI_MULTIINSTANCESSTUBPROVIDER_H | ||
|
||
#include "multiinstances/imultiinstancesprovider.h" | ||
|
||
namespace mu::mi { | ||
class MultiInstancesStubProvider : public IMultiInstancesProvider | ||
{ | ||
public: | ||
MultiInstancesStubProvider() = default; | ||
|
||
// Score opening | ||
bool isScoreAlreadyOpened(const io::path& scorePath) const override; | ||
void activateWindowWithScore(const io::path& scorePath) override; | ||
|
||
// Settings | ||
bool isPreferencesAlreadyOpened() const override; | ||
void activateWindowWithOpenedPreferences() const override; | ||
void settingsBeginTransaction() override; | ||
void settingsCommitTransaction() override; | ||
void settingsRollbackTransaction() override; | ||
void settingsSetValue(const std::string& key, const Val& value) override; | ||
|
||
// Resources (files) | ||
bool lockResource(const std::string& name) override; | ||
bool unlockResource(const std::string& name) override; | ||
|
||
// Instances info | ||
const std::string& selfID() const override; | ||
std::vector<InstanceMeta> instances() const override; | ||
async::Notification instancesChanged() const override; | ||
}; | ||
} | ||
|
||
#endif // MU_MI_MULTIINSTANCESSTUBPROVIDER_H |