Skip to content

Commit 3e6c4a1

Browse files
committed
Implemented the muse sounds page
1 parent dd0c7af commit 3e6c4a1

33 files changed

+1372
-85
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ option(MUE_BUILD_VIDEOEXPORT_MODULE "Build videoexport module" OFF)
7474
option(MUE_BUILD_IMAGESEXPORT_MODULE "Build imagesexport module" ON)
7575
option(MUE_BUILD_INSPECTOR_MODULE "Build inspector module" ON)
7676
option(MUE_BUILD_INSTRUMENTSSCENE_MODULE "Build instruments scene module" ON)
77+
option(MUE_BUILD_MUSESOUNDS_MODULE "Build muse sounds module" ON)
7778
option(MUE_BUILD_NOTATION_MODULE "Build notation module" ON)
7879
option(MUE_BUILD_NOTATION_TESTS "Build notation tests" ON)
7980
option(MUE_BUILD_PALETTE_MODULE "Build palette module" ON)

SetupConfigure.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ if(BUILD_CONFIGURE MATCHES "VTEST")
143143
set(MUSE_MODULE_LANGUAGES OFF)
144144
set(MUSE_MODULE_LEARN OFF)
145145
set(MUSE_MODULE_MULTIINSTANCES OFF)
146+
set(MUE_BUILD_MUSESOUNDS_MODULE OFF)
146147
set(MUE_BUILD_PALETTE_MODULE OFF)
147148
set(MUE_BUILD_PLAYBACK_MODULE OFF)
148149
set(MUSE_MODULE_EXTENSIONS OFF)
@@ -265,6 +266,7 @@ def_opt(MUE_BUILD_BRAILLE_MODULE ${MUE_BUILD_BRAILLE_MODULE})
265266
def_opt(MUE_BUILD_CONVERTER_MODULE ${MUE_BUILD_CONVERTER_MODULE})
266267
def_opt(MUE_BUILD_INSPECTOR_MODULE ${MUE_BUILD_INSPECTOR_MODULE})
267268
def_opt(MUE_BUILD_INSTRUMENTSSCENE_MODULE ${MUE_BUILD_INSTRUMENTSSCENE_MODULE})
269+
def_opt(MUE_BUILD_MUSESOUNDS_MODULE ${MUE_BUILD_MUSESOUNDS_MODULE})
268270
def_opt(MUE_BUILD_NOTATION_MODULE ${MUE_BUILD_NOTATION_MODULE})
269271
def_opt(MUE_BUILD_PALETTE_MODULE ${MUE_BUILD_PALETTE_MODULE})
270272
def_opt(MUE_BUILD_PLAYBACK_MODULE ${MUE_BUILD_PLAYBACK_MODULE})

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ if (MUE_BUILD_INSTRUMENTSSCENE_MODULE)
5252
add_subdirectory(instrumentsscene)
5353
endif()
5454

55+
if (MUE_BUILD_MUSESOUNDS_MODULE)
56+
add_subdirectory(musesounds)
57+
endif()
58+
5559
if (MUE_BUILD_NOTATION_MODULE)
5660
add_subdirectory(notation)
5761
endif()

src/app/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ if (MUE_BUILD_APPSHELL_MODULE)
176176
list(APPEND LINK_LIB appshell)
177177
endif()
178178

179+
if (MUE_BUILD_MUSESOUNDS_MODULE)
180+
list(APPEND LINK_LIB musesounds)
181+
endif()
182+
179183
if (NOT CC_IS_EMSCRIPTEN)
180184
list(APPEND LINK_LIB muse::cloud)
181185
list(APPEND LINK_LIB muse::languages)

src/app/appfactory.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@
153153
#include "stubs/instrumentsscene/instrumentsscenestubmodule.h"
154154
#endif
155155

156+
#ifdef MUE_BUILD_MUSESOUNDS_MODULE
157+
#include "musesounds/musesoundsmodule.h"
158+
#endif
159+
156160
#ifdef MUE_BUILD_NOTATION_MODULE
157161
#include "notation/notationmodule.h"
158162
#else
@@ -287,6 +291,9 @@ std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const CmdOptions& opti
287291
app->addModule(new muse::languages::LanguagesModule());
288292
app->addModule(new muse::learn::LearnModule());
289293
app->addModule(new muse::mi::MultiInstancesModule());
294+
#ifdef MUE_BUILD_MUSESOUNDS_MODULE
295+
app->addModule(new mu::musesounds::MuseSoundsModule());
296+
#endif
290297
app->addModule(new mu::notation::NotationModule());
291298
app->addModule(new mu::palette::PaletteModule());
292299
app->addModule(new mu::playback::PlaybackModule());

src/appshell/qml/HomePage/HomeMenu.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ Item {
8787
model: [
8888
{ "name": "scores", "title": qsTrc("appshell", "Scores"), "icon": IconCode.MUSIC_NOTES },
8989
{ "name": "extensions", "title": qsTrc("appshell", "Plugins"), "icon": IconCode.PLUGIN },
90-
// TODO: need to implement
91-
// { "name": "audio", "title": qsTrc("appshell", "Audio"), "icon": IconCode.AUDIO },
90+
{ "name": "musesounds", "title": qsTrc("appshell", "Muse Sounds"), "icon": IconCode.PLAY },
9291
{ "name": "learn", "title": qsTrc("appshell", "Learn"), "icon": IconCode.MORTAR_BOARD }
9392
]
9493

src/appshell/qml/HomePage/HomePage.qml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ import Muse.Ui 1.0
2525
import Muse.UiComponents 1.0
2626
import Muse.Dock 1.0
2727

28-
import MuseScore.Project 1.0
2928
import Muse.Cloud 1.0
3029
import Muse.Learn 1.0
30+
import MuseScore.Project 1.0
31+
import MuseScore.MuseSounds 1.0
3132

3233
DockPage {
3334
id: root
@@ -65,7 +66,7 @@ DockPage {
6566
case "scores": root.central = scoresComp; break
6667
case "plugins": root.central = extensionsComp; break // backward compatibility
6768
case "extensions": root.central = extensionsComp; break
68-
case "audio": root.central = audioComp; break
69+
case "musesounds": root.central = museSoundsComp; break
6970
case "learn": root.central = learnComp; break
7071
case "account": root.central = accountComp; break
7172
}
@@ -125,12 +126,9 @@ DockPage {
125126
}
126127

127128
Component {
128-
id: audioComp
129+
id: museSoundsComp
129130

130-
StyledTextLabel {
131-
anchors.centerIn: parent
132-
text: "Audio & VST"
133-
}
131+
MuseSoundsPage {}
134132
}
135133

136134
Component {

src/framework/cloud/qml/Muse/Cloud/CloudScoresView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ ScoresView {
217217
anchors.rightMargin: root.sideMargin
218218

219219
title: qsTrc("project", "Unable to load online scores")
220-
body: qsTrc("project", "Please check your internet connection or try again later.")
220+
body: qsTrc("global", "Please check your internet connection or try again later.")
221221
}
222222
}
223223
}

src/framework/global/serialization/json.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,11 @@ void JsonArray::resize(size_t i)
412412
array_mut(m_data).resize(i);
413413
}
414414

415+
bool JsonArray::empty() const
416+
{
417+
return array_const(m_data).size() == 0;
418+
}
419+
415420
JsonValue JsonArray::at(size_t i) const
416421
{
417422
std::shared_ptr<JsonData> d = std::make_shared<JsonData>();

src/framework/global/serialization/json.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ class JsonArray
109109
size_t size() const;
110110
void resize(size_t i);
111111

112+
bool empty() const;
113+
112114
JsonValue at(size_t i) const;
113115

114116
JsonArray& set(size_t i, bool v);

0 commit comments

Comments
 (0)