Skip to content

Commit

Permalink
added musesounds module
Browse files Browse the repository at this point in the history
  • Loading branch information
Eism committed Nov 29, 2024
1 parent 2732fea commit 6b067d2
Show file tree
Hide file tree
Showing 20 changed files with 168 additions and 84 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ option(MUE_BUILD_VIDEOEXPORT_MODULE "Build videoexport module" OFF)
option(MUE_BUILD_IMAGESEXPORT_MODULE "Build imagesexport module" ON)
option(MUE_BUILD_INSPECTOR_MODULE "Build inspector module" ON)
option(MUE_BUILD_INSTRUMENTSSCENE_MODULE "Build instruments scene module" ON)
option(MUE_BUILD_MUSESOUNDS_MODULE "Build muse sounds module" ON)
option(MUE_BUILD_NOTATION_MODULE "Build notation module" ON)
option(MUE_BUILD_NOTATION_TESTS "Build notation tests" ON)
option(MUE_BUILD_PALETTE_MODULE "Build palette module" ON)
Expand Down
2 changes: 2 additions & 0 deletions SetupConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ if(BUILD_CONFIGURE MATCHES "VTEST")
set(MUSE_MODULE_LANGUAGES OFF)
set(MUSE_MODULE_LEARN OFF)
set(MUSE_MODULE_MULTIINSTANCES OFF)
set(MUE_BUILD_MUSESOUNDS_MODULE OFF)
set(MUE_BUILD_PALETTE_MODULE OFF)
set(MUE_BUILD_PLAYBACK_MODULE OFF)
set(MUSE_MODULE_EXTENSIONS OFF)
Expand Down Expand Up @@ -265,6 +266,7 @@ def_opt(MUE_BUILD_BRAILLE_MODULE ${MUE_BUILD_BRAILLE_MODULE})
def_opt(MUE_BUILD_CONVERTER_MODULE ${MUE_BUILD_CONVERTER_MODULE})
def_opt(MUE_BUILD_INSPECTOR_MODULE ${MUE_BUILD_INSPECTOR_MODULE})
def_opt(MUE_BUILD_INSTRUMENTSSCENE_MODULE ${MUE_BUILD_INSTRUMENTSSCENE_MODULE})
def_opt(MUE_BUILD_MUSESOUNDS_MODULE ${MUE_BUILD_MUSESOUNDS_MODULE})
def_opt(MUE_BUILD_NOTATION_MODULE ${MUE_BUILD_NOTATION_MODULE})
def_opt(MUE_BUILD_PALETTE_MODULE ${MUE_BUILD_PALETTE_MODULE})
def_opt(MUE_BUILD_PLAYBACK_MODULE ${MUE_BUILD_PLAYBACK_MODULE})
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ if (MUE_BUILD_INSTRUMENTSSCENE_MODULE)
add_subdirectory(instrumentsscene)
endif()

if (MUE_BUILD_MUSESOUNDS_MODULE)
add_subdirectory(musesounds)
endif()

if (MUE_BUILD_NOTATION_MODULE)
add_subdirectory(notation)
endif()
Expand Down
4 changes: 4 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ if (MUE_BUILD_APPSHELL_MODULE)
list(APPEND LINK_LIB appshell)
endif()

if (MUE_BUILD_MUSESOUNDS_MODULE)
list(APPEND LINK_LIB musesounds)
endif()

if (NOT CC_IS_EMSCRIPTEN)
list(APPEND LINK_LIB muse::cloud)
list(APPEND LINK_LIB muse::languages)
Expand Down
7 changes: 7 additions & 0 deletions src/app/appfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
#include "stubs/instrumentsscene/instrumentsscenestubmodule.h"
#endif

#ifdef MUE_BUILD_MUSESOUNDS_MODULE
#include "musesounds/musesoundsmodule.h"
#endif

#ifdef MUE_BUILD_NOTATION_MODULE
#include "notation/notationmodule.h"
#else
Expand Down Expand Up @@ -299,6 +303,9 @@ std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const CmdOptions& opti
app->addModule(new muse::languages::LanguagesModule());
app->addModule(new muse::learn::LearnModule());
app->addModule(new muse::mi::MultiInstancesModule());
#ifdef MUE_BUILD_MUSESOUNDS_MODULE
app->addModule(new mu::musesounds::MuseSoundsModule());
#endif
app->addModule(new mu::notation::NotationModule());
app->addModule(new mu::palette::PaletteModule());
app->addModule(new mu::playback::PlaybackModule());
Expand Down
2 changes: 0 additions & 2 deletions src/appshell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/view/internal/splashscreen/loadingscreenview.h
${CMAKE_CURRENT_LIST_DIR}/view/internal/splashscreen/newinstanceloadingscreenview.cpp
${CMAKE_CURRENT_LIST_DIR}/view/internal/splashscreen/newinstanceloadingscreenview.h
${CMAKE_CURRENT_LIST_DIR}/view/internal/musesounds/musesoundslistmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/internal/musesounds/musesoundslistmodel.h
)


Expand Down
3 changes: 0 additions & 3 deletions src/appshell/appshell.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,5 @@
<file>qml/Preferences/internal/MixerSection.qml</file>
<file>qml/DevTools/Extensions/ExtensionsListView.qml</file>
<file>qml/platform/PlatformMenuBar.qml</file>
<file>qml/HomePage/musesounds/MuseSoundItem.qml</file>
<file>qml/HomePage/musesounds/MuseSoundsListView.qml</file>
<file>qml/HomePage/musesounds/MuseSoundsPage.qml</file>
</qresource>
</RCC>
2 changes: 0 additions & 2 deletions src/appshell/appshellmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#include "view/framelesswindow/framelesswindowmodel.h"
#include "view/publish/publishtoolbarmodel.h"
#include "view/internal/maintoolbarmodel.h"
#include "view/internal/musesounds/musesoundslistmodel.h"

#ifdef Q_OS_MAC
#include "view/appmenumodel.h"
Expand Down Expand Up @@ -173,7 +172,6 @@ void AppShellModule::registerUiTypes()
qmlRegisterType<FramelessWindowModel>("MuseScore.AppShell", 1, 0, "FramelessWindowModel");
qmlRegisterType<PublishToolBarModel>("MuseScore.AppShell", 1, 0, "PublishToolBarModel");
qmlRegisterType<MainToolBarModel>("MuseScore.AppShell", 1, 0, "MainToolBarModel");
qmlRegisterType<MuseSoundsListModel>("MuseScore.AppShell", 1, 0, "MuseSoundsListModel");
}

void AppShellModule::onPreInit(const IApplication::RunMode& mode)
Expand Down
5 changes: 2 additions & 3 deletions src/appshell/qml/HomePage/HomePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import Muse.Ui 1.0
import Muse.UiComponents 1.0
import Muse.Dock 1.0

import MuseScore.Project 1.0
import Muse.Cloud 1.0
import Muse.Learn 1.0

import "musesounds"
import MuseScore.Project 1.0
import MuseScore.MuseSounds 1.0

DockPage {
id: root
Expand Down
34 changes: 34 additions & 0 deletions src/musesounds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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/>.

declare_module(musesounds)

set(MODULE_QRC musesounds.qrc)
set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml)

set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/musesoundsmodule.cpp
${CMAKE_CURRENT_LIST_DIR}/musesoundsmodule.h

${CMAKE_CURRENT_LIST_DIR}/view/musesoundslistmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/musesoundslistmodel.h
)

setup_module()
8 changes: 8 additions & 0 deletions src/musesounds/musesounds.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/">
<file>qml/MuseScore/MuseSounds/qmldir</file>
<file>qml/MuseScore/MuseSounds/MuseSoundsPage.qml</file>
<file>qml/MuseScore/MuseSounds/internal/MuseSoundsListView.qml</file>
<file>qml/MuseScore/MuseSounds/internal/MuseSoundItem.qml</file>
</qresource>
</RCC>
61 changes: 61 additions & 0 deletions src/musesounds/musesoundsmodule.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-Studio-CLA-applies
*
* MuseScore Studio
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore Limited
*
* 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 "musesoundsmodule.h"

#include <QQmlEngine>

#include "view/musesoundslistmodel.h"

using namespace mu::musesounds;
using namespace muse;

static void musesounds_init_qrc()
{
Q_INIT_RESOURCE(musesounds);
}

std::string MuseSoundsModule::moduleName() const
{
return "musesounds";
}

void MuseSoundsModule::registerExports()
{
}

void MuseSoundsModule::resolveImports()
{
}

void MuseSoundsModule::registerResources()
{
musesounds_init_qrc();
}

void MuseSoundsModule::registerUiTypes()
{
qmlRegisterType<MuseSoundsListModel>("MuseScore.AppShell", 1, 0, "MuseSoundsListModel");
}

void MuseSoundsModule::onInit(const IApplication::RunMode&)
{
}
41 changes: 41 additions & 0 deletions src/musesounds/musesoundsmodule.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-Studio-CLA-applies
*
* MuseScore Studio
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore Limited
*
* 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/>.
*/

#pragma once

#include <memory>

#include "modularity/imodulesetup.h"

namespace mu::musesounds {
class MuseSoundsModule : public muse::modularity::IModuleSetup
{
public:
std::string moduleName() const override;

void registerExports() override;
void resolveImports() override;
void registerResources() override;
void registerUiTypes() override;
void onInit(const muse::IApplication::RunMode& mode) override;
};
}
2 changes: 2 additions & 0 deletions src/musesounds/qml/MuseScore/MuseSounds/qmldir
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module MuseScore.MuseSounds
MuseSoundsPage 1.0 MuseSoundsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "log.h"

using namespace mu::appshell;
using namespace mu::musesounds;

MuseSoundsListModel::MuseSoundsListModel(QObject* parent)
: QAbstractListModel(parent), Injectable(muse::iocCtxForQmlObject(this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "context/iglobalcontext.h"
#include "iglobalconfiguration.h"

namespace mu::appshell {
namespace mu::musesounds {
struct MuseSoundCategoryInfo {
muse::String id;
muse::String title;
Expand Down
72 changes: 0 additions & 72 deletions src/update/internal/updatescenario.h

This file was deleted.

0 comments on commit 6b067d2

Please sign in to comment.