Skip to content

Commit

Permalink
Merge pull request musescore#25879 from alexpavlov96/disable_playback…
Browse files Browse the repository at this point in the history
…_option

added cmake option to disable playback build
  • Loading branch information
alexpavlov96 authored Dec 18, 2024
2 parents 1d73047 + fe60ad7 commit 8de35b2
Show file tree
Hide file tree
Showing 9 changed files with 377 additions and 75 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ option(MUE_BUILD_BRAILLE_TESTS "Build braille tests" ON)
option(MUE_BUILD_CONVERTER_MODULE "Build converter module" ON)
option(MUE_BUILD_ENGRAVING_TESTS "Build engraving tests" ON)
option(MUE_BUILD_ENGRAVING_DEVTOOLS "Build engraving devtools" ON)
option(MUE_BUILD_ENGRAVING_PLAYBACK "Build engraving playback" ON)
option(MUE_BUILD_IMPORTEXPORT_MODULE "Build importexport module" ON)
option(MUE_BUILD_IMPORTEXPORT_TESTS "Build importexport tests" ON)
option(MUE_BUILD_VIDEOEXPORT_MODULE "Build videoexport module" OFF)
Expand Down
73 changes: 5 additions & 68 deletions src/engraving/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ if (MUE_BUILD_ENGRAVING_DEVTOOLS)
include(${CMAKE_CURRENT_LIST_DIR}/devtools/devtools.cmake)
endif()

if (MUE_BUILD_ENGRAVING_PLAYBACK)
include(${CMAKE_CURRENT_LIST_DIR}/playback/playback.cmake)
endif()

set(MODULE_SRC

${CMAKE_CURRENT_LIST_DIR}/engravingmodule.cpp
Expand Down Expand Up @@ -211,74 +215,7 @@ set(MODULE_SRC
${RENDERING_SCORE_SRC}
${RENDERING_SINGLE_SRC}

${CMAKE_CURRENT_LIST_DIR}/playback/renderingcontext.h
${CMAKE_CURRENT_LIST_DIR}/playback/playbackcontext.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackcontext.h
${CMAKE_CURRENT_LIST_DIR}/playback/playbackmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackmodel.h
${CMAKE_CURRENT_LIST_DIR}/playback/playbackeventsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackeventsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/playbacksetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbacksetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/renderbase.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/ornamentsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/ornamentsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/glissandosrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/glissandosrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/arpeggiorenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/arpeggiorenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/gracechordsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/gracechordsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/tremolorenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/tremolorenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/chordarticulationsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/chordarticulationsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/noterenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/noterenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/bendsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/renderers/bendsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/symbolsmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/symbolsmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/annotationsmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/annotationsmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/spannersmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/spannersmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/tremolometaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/tremolometaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/arpeggiometaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/arpeggiometaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/gracenotesmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/gracenotesmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/chordlinemetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/internal/chordlinemetaparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/notearticulationsparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/notearticulationsparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/chordarticulationsparser.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/chordarticulationsparser.h
${CMAKE_CURRENT_LIST_DIR}/playback/metaparsers/metaparserbase.h
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/setupresolverbase.h
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/keyboardssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/keyboardssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/stringssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/stringssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/windssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/windssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/percussionssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/percussionssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/voicessetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/mapping/voicessetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/playback/filters/filterbase.h
${CMAKE_CURRENT_LIST_DIR}/playback/filters/chordfilter.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/filters/chordfilter.h
${CMAKE_CURRENT_LIST_DIR}/playback/filters/spannerfilter.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/filters/spannerfilter.h
${CMAKE_CURRENT_LIST_DIR}/playback/filters/internal/tremolofilter.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/filters/internal/tremolofilter.h

${CMAKE_CURRENT_LIST_DIR}/playback/utils/pitchutils.h
${CMAKE_CURRENT_LIST_DIR}/playback/utils/expressionutils.h
${CMAKE_CURRENT_LIST_DIR}/playback/utils/arrangementutils.h

${PLAYBACK_SRC}
${DEVTOOLS_SRC}
)

Expand Down
89 changes: 89 additions & 0 deletions src/engraving/playback/playback.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SPDX-License-Identifier: GPL-3.0-only
# MuseScore-Studio-CLA-applies
#
# MuseScore Studio
# Music Composition & Notation
#
# Copyright (C) 2024 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/>.

set(PLAYBACK_SRC
${CMAKE_CURRENT_LIST_DIR}/renderingcontext.h
${CMAKE_CURRENT_LIST_DIR}/playbackcontext.cpp
${CMAKE_CURRENT_LIST_DIR}/playbackcontext.h
${CMAKE_CURRENT_LIST_DIR}/playbackmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/playbackmodel.h
${CMAKE_CURRENT_LIST_DIR}/playbackeventsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/playbackeventsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/playbacksetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/playbacksetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/renderers/renderbase.h
${CMAKE_CURRENT_LIST_DIR}/renderers/ornamentsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/ornamentsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/glissandosrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/glissandosrenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/arpeggiorenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/arpeggiorenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/gracechordsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/gracechordsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/tremolorenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/tremolorenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/chordarticulationsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/chordarticulationsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/noterenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/noterenderer.h
${CMAKE_CURRENT_LIST_DIR}/renderers/bendsrenderer.cpp
${CMAKE_CURRENT_LIST_DIR}/renderers/bendsrenderer.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/symbolsmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/symbolsmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/annotationsmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/annotationsmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/spannersmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/spannersmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/tremolometaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/tremolometaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/arpeggiometaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/arpeggiometaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/gracenotesmetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/gracenotesmetaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/chordlinemetaparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/internal/chordlinemetaparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/notearticulationsparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/notearticulationsparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/chordarticulationsparser.cpp
${CMAKE_CURRENT_LIST_DIR}/metaparsers/chordarticulationsparser.h
${CMAKE_CURRENT_LIST_DIR}/metaparsers/metaparserbase.h
${CMAKE_CURRENT_LIST_DIR}/mapping/setupresolverbase.h
${CMAKE_CURRENT_LIST_DIR}/mapping/keyboardssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/mapping/keyboardssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/mapping/stringssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/mapping/stringssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/mapping/windssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/mapping/windssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/mapping/percussionssetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/mapping/percussionssetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/mapping/voicessetupdataresolver.cpp
${CMAKE_CURRENT_LIST_DIR}/mapping/voicessetupdataresolver.h
${CMAKE_CURRENT_LIST_DIR}/filters/filterbase.h
${CMAKE_CURRENT_LIST_DIR}/filters/chordfilter.cpp
${CMAKE_CURRENT_LIST_DIR}/filters/chordfilter.h
${CMAKE_CURRENT_LIST_DIR}/filters/spannerfilter.cpp
${CMAKE_CURRENT_LIST_DIR}/filters/spannerfilter.h
${CMAKE_CURRENT_LIST_DIR}/filters/internal/tremolofilter.cpp
${CMAKE_CURRENT_LIST_DIR}/filters/internal/tremolofilter.h

${CMAKE_CURRENT_LIST_DIR}/utils/pitchutils.h
${CMAKE_CURRENT_LIST_DIR}/utils/expressionutils.h
${CMAKE_CURRENT_LIST_DIR}/utils/arrangementutils.h
)
13 changes: 9 additions & 4 deletions src/engraving/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ set(MODULE_TEST_SRC
${CMAKE_CURRENT_LIST_DIR}/note_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/parts_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/pitchwheelrender_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackeventsrendering_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackmodel_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackcontext_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/bendsrenderer_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/readwriteundoreset_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/remove_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/repeat_tests.cpp
Expand Down Expand Up @@ -103,6 +99,15 @@ set(MODULE_TEST_SRC ${MODULE_TEST_SRC}
)
endif()

if(MUE_BUILD_ENGRAVING_PLAYBACK)
set(MODULE_TEST_SRC ${MODULE_TEST_SRC}
${CMAKE_CURRENT_LIST_DIR}/playback/playbackeventsrendering_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackmodel_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/playbackcontext_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/playback/bendsrenderer_tests.cpp
)
endif()

set(MODULE_TEST_LINK
engraving
)
Expand Down
16 changes: 14 additions & 2 deletions src/notation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml)
include(${CMAKE_CURRENT_LIST_DIR}/view/widgets/widgets.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/view/styledialog/styledialog.cmake)

if (MUE_BUILD_ENGRAVING_PLAYBACK)
set(NOTATION_PLAYBACK_SRC_FILES
${CMAKE_CURRENT_LIST_DIR}/internal/notationplayback.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/notationplayback.h
)
set(MODULE_DEF ${MODULE_DEF} -DMUE_BUILD_ENGRAVING_PLAYBACK)
else()
set(NOTATION_PLAYBACK_SRC_FILES
${CMAKE_CURRENT_LIST_DIR}/internal/notationplaybackstub.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/notationplaybackstub.h
)
endif()

set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/notationmodule.cpp
${CMAKE_CURRENT_LIST_DIR}/notationmodule.h
Expand Down Expand Up @@ -92,8 +105,7 @@ set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/internal/positionswriter.h
${CMAKE_CURRENT_LIST_DIR}/internal/mscnotationwriter.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/mscnotationwriter.h
${CMAKE_CURRENT_LIST_DIR}/internal/notationplayback.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/notationplayback.h
${NOTATION_PLAYBACK_SRC_FILES}
${CMAKE_CURRENT_LIST_DIR}/internal/midiinputoutputcontroller.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/midiinputoutputcontroller.h
${CMAKE_CURRENT_LIST_DIR}/internal/notationmidiinput.cpp
Expand Down
12 changes: 12 additions & 0 deletions src/notation/internal/masternotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@
#include "engraving/dom/box.h"
#include "engraving/dom/keysig.h"
#include "engraving/dom/rest.h"
#include "engraving/dom/sig.h"
#include "engraving/dom/tempotext.h"
#include "engraving/dom/undo.h"

#include "excerptnotation.h"
#include "masternotationparts.h"

#ifdef MUE_BUILD_ENGRAVING_PLAYBACK
#include "notationplayback.h"
#else
#include "notationplaybackstub.h"
#endif

#include "../notationerrors.h"

using namespace mu::notation;
Expand All @@ -69,7 +76,12 @@ MasterNotation::MasterNotation(const muse::modularity::ContextPtr& iocCtx)
: Notation(iocCtx)
{
m_parts = std::make_shared<MasterNotationParts>(this, interaction(), undoStack());

#ifdef MUE_BUILD_ENGRAVING_PLAYBACK
m_notationPlayback = std::make_shared<NotationPlayback>(this, m_notationChanged, iocCtx);
#else
m_notationPlayback = std::make_shared<NotationPlaybackStub>();
#endif

m_parts->partsChanged().onNotify(this, [this]() {
notifyAboutNotationChanged();
Expand Down
1 change: 0 additions & 1 deletion src/notation/internal/notation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "notationviewstate.h"
#include "notationsolomutestate.h"
#include "notationinteraction.h"
#include "notationplayback.h"
#include "notationundostack.h"
#include "notationstyle.h"
#include "notationelements.h"
Expand Down
Loading

0 comments on commit 8de35b2

Please sign in to comment.