diff --git a/src/appshell/qml/MuseScore/AppShell/notationpagemodel.cpp b/src/appshell/qml/MuseScore/AppShell/notationpagemodel.cpp index ef1755cff835b..14dc7b477b784 100644 --- a/src/appshell/qml/MuseScore/AppShell/notationpagemodel.cpp +++ b/src/appshell/qml/MuseScore/AppShell/notationpagemodel.cpp @@ -19,22 +19,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "notationpagemodel.h" -#include "internal/applicationuiactions.h" -#include "dockwindow/idockwindow.h" +#include "notationpagemodel.h" #include "async/async.h" +#include "log.h" + +#include "engraving/dom/part.h" +#include "engraving/dom/score.h" +#include "engraving/dom/staff.h" #include "notation/inotationelements.h" // IWYU pragma: keep #include "notation/inotationinteraction.h" #include "notation/inotationnoteinput.h" #include "notation/inotationselection.h" -#include "log.h" +#include "internal/applicationuiactions.h" +#include "dockwindow/idockwindow.h" using namespace mu::appshell; using namespace mu::notation; +using namespace mu::engraving; using namespace muse::actions; NotationPageModel::NotationPageModel(QObject* parent) @@ -253,10 +258,10 @@ void NotationPageModel::doUpdatePercussionPanelVisibility() return; } - const mu::engraving::Score* score = notation->elements()->msScore(); + const Score* score = notation->elements()->msScore(); if (score) { - const mu::engraving::InputState& inputState = score->inputState(); - const mu::engraving::Staff* staff = inputState.staff(); + const InputState& inputState = score->inputState(); + const Staff* staff = inputState.staff(); if (inputState.noteEntryMode() && staff && staff->isDrumStaff(inputState.tick())) { setPercussionPanelOpen(true); return; diff --git a/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.cpp b/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.cpp index 964448f820e63..052817f928f2f 100644 --- a/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.cpp +++ b/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.cpp @@ -32,6 +32,8 @@ #include "workspace/qml/Muse/Workspace/workspacesmenumodel.h" #endif +#include "engraving/dom/score.h" + #include "notation/inotationaccessibility.h" #include "notation/inotationstyle.h" // IWYU pragma: keep #include "notation/inotationundostack.h" // IWYU pragma: keep diff --git a/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.h b/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.h index 4251b3e564040..3132fc06d182b 100644 --- a/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.h +++ b/src/appshell/qml/MuseScore/AppShell/notationstatusbarmodel.h @@ -38,9 +38,6 @@ #include "workspace/iworkspaceconfiguration.h" #include "notation/inotationconfiguration.h" #include "context/iglobalcontext.h" - -#include "notation/notationtypes.h" - #include "global/iglobalconfiguration.h" namespace mu::appshell { diff --git a/src/braille/internal/brailleinput.h b/src/braille/internal/brailleinput.h index 6e9a01b71a0b8..97ea1c58ea3f3 100644 --- a/src/braille/internal/brailleinput.h +++ b/src/braille/internal/brailleinput.h @@ -20,8 +20,9 @@ * along with this program. If not, see . */ -#ifndef MU_BRAILLE_BRAILLEINPUT_H -#define MU_BRAILLE_BRAILLEINPUT_H +#pragma once + +#include "engraving/dom/accidental.h" #include "notation/notationtypes.h" @@ -68,7 +69,7 @@ class BrailleInputState bool isDurationMatch(); DurationType getCloseDuration(); - notation::SymbolId articulation(); + engraving::SymId articulation(); int octave(); int dots(); int addedOctave(); @@ -83,7 +84,7 @@ class BrailleInputState void setNoteName(const notation::NoteName notename, const bool chord_base = true); void setCurrentDuration(const DurationType duration); void setNoteDurations(const std::vector durations); - void setArticulation(const notation::SymbolId articulation); + void setArticulation(const engraving::SymId articulation); void setOctave(const int octave, const bool chord_base = false); void setDots(const int dots); void setAddedOctave(const int octave); @@ -116,16 +117,16 @@ class BrailleInputState int tupletNumber(); void setTupletNumber(const int num); - notation::Duration tupletDuration(); - void setTupletDuration(const notation::Duration d); + engraving::TDuration tupletDuration(); + void setTupletDuration(const engraving::TDuration d); void clearTuplet(); bool tupletIndicator(); void setTupletIndicator(bool val); private: - AccidentalType _accidental = AccidentalType::NONE; + engraving::AccidentalType _accidental = engraving::AccidentalType::NONE; notation::NoteName _note_name = notation::NoteName::C; notation::NoteName _chordbase_note_name = notation::NoteName::C; - notation::SymbolId _articulation = notation::SymbolId::noSym; + engraving::SymId _articulation = engraving::SymId::noSym; int _octave = 4; int _chordbase_note_octave = 4; int _added_octave = -1; @@ -149,7 +150,7 @@ class BrailleInputState bool _accord; int _tuplet_number = -1; - notation::Duration _tuplet_duration; + engraving::TDuration _tuplet_duration; bool _tuplet_indicator = false; }; @@ -162,9 +163,8 @@ int getInterval(const braille_code* code); bool isNoteName(const braille_code* code); QString fromNoteName(notation::NoteName); AccidentalType getAccidentalType(const braille_code* code); -notation::SymbolId getArticulation(const braille_code* code); +engraving::SymId getArticulation(const braille_code* code); int getOctave(const braille_code* code); int getOctaveDiff(notation::NoteName source, notation::NoteName note); std::pair applyInterval(notation::NoteName source, int interval, IntervalDirection direction); } -#endif // MU_BRAILLE_BRAILLEINPUT_H diff --git a/src/braille/internal/notationbraille.cpp b/src/braille/internal/notationbraille.cpp index 2df1866daf826..1ae148c4a7551 100644 --- a/src/braille/internal/notationbraille.cpp +++ b/src/braille/internal/notationbraille.cpp @@ -26,7 +26,9 @@ #include "engraving/dom/factory.h" #include "engraving/dom/measure.h" +#include "engraving/dom/score.h" #include "engraving/dom/segment.h" +#include "engraving/dom/select.h" #include "engraving/dom/slur.h" #include "engraving/dom/staff.h" #include "engraving/dom/tie.h" diff --git a/src/braille/internal/notationbraille.h b/src/braille/internal/notationbraille.h index 623b83572d7cd..a88a2f6a5fd0e 100644 --- a/src/braille/internal/notationbraille.h +++ b/src/braille/internal/notationbraille.h @@ -20,8 +20,7 @@ * along with this program. If not, see . */ -#ifndef MU_BRAILLE_NOTATIONBRAILLE_H -#define MU_BRAILLE_NOTATIONBRAILLE_H +#pragma once #include "accessibility/iaccessibilitycontroller.h" #include "async/asyncable.h" @@ -31,7 +30,7 @@ #include "ibrailleconfiguration.h" #include "inotationbraille.h" #include "modularity/ioc.h" -#include "notation/notationtypes.h" +#include "notation/types/noteinputtypes.h" #include "playback/iplaybackcontroller.h" #include "actions/iactionsdispatcher.h" @@ -41,6 +40,7 @@ namespace mu::engraving { class Score; class Selection; +class TDuration; class NotationBraille : public mu::braille::INotationBraille, public muse::Contextable, public muse::async::Asyncable { @@ -69,8 +69,8 @@ class NotationBraille : public mu::braille::INotationBraille, public muse::Conte bool incDuration(); bool decDuration(); bool setArticulation(); - void setInputNoteDuration(notation::Duration d); - void setTupletDuration(int tuplet, notation::Duration d); + void setInputNoteDuration(engraving::TDuration d); + void setTupletDuration(int tuplet, engraving::TDuration d); muse::ValCh brailleInfo() const override; muse::ValCh cursorPosition() const override; @@ -138,5 +138,3 @@ class NotationBraille : public mu::braille::INotationBraille, public muse::Conte muse::async::Notification m_selectionChanged; }; } - -#endif // MU_BRAILLE_NOTATIONBRAILLE_H diff --git a/src/converter/internal/compat/backendapi.cpp b/src/converter/internal/compat/backendapi.cpp index d6507165d3da2..ef0284154bdab 100644 --- a/src/converter/internal/compat/backendapi.cpp +++ b/src/converter/internal/compat/backendapi.cpp @@ -34,6 +34,7 @@ #include "engraving/infrastructure/mscwriter.h" #include "engraving/dom/excerpt.h" +#include "engraving/dom/score.h" #include "engraving/rw/mscsaver.h" #include "engraving/types/typesconv.h" diff --git a/src/converter/internal/compat/notationmeta.cpp b/src/converter/internal/compat/notationmeta.cpp index aade5243aa3e0..bbfda7c3cd236 100644 --- a/src/converter/internal/compat/notationmeta.cpp +++ b/src/converter/internal/compat/notationmeta.cpp @@ -30,6 +30,8 @@ #include "audio/common/audioutils.h" #include "audio/common/audiotypes.h" +#include "engraving/dom/part.h" +#include "engraving/dom/score.h" #include "engraving/dom/tempotext.h" #include "engraving/dom/text.h" diff --git a/src/converter/internal/convertercontroller.h b/src/converter/internal/convertercontroller.h index 592342bfaa788..c7f51e80acf41 100644 --- a/src/converter/internal/convertercontroller.h +++ b/src/converter/internal/convertercontroller.h @@ -26,6 +26,7 @@ #include "../iconvertercontroller.h" #include "modularity/ioc.h" +#include "notation/notationtypes.h" #include "project/iprojectcreator.h" #include "project/inotationwritersregister.h" #include "context/iglobalcontext.h" diff --git a/src/engraving/api/v1/score.h b/src/engraving/api/v1/score.h index afc09320759c5..e2177572624f1 100644 --- a/src/engraving/api/v1/score.h +++ b/src/engraving/api/v1/score.h @@ -27,6 +27,9 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" +#include "engraving/dom/score.h" +#include "engraving/dom/segment.h" + // api #include "excerpt.h" #include "apistructs.h" diff --git a/src/engraving/dom/mscore.h b/src/engraving/dom/mscore.h index 4c69dca7ae52f..6ae45b4e9d309 100644 --- a/src/engraving/dom/mscore.h +++ b/src/engraving/dom/mscore.h @@ -107,14 +107,6 @@ enum class SelectType : char { SINGLE, RANGE, ADD, REPLACE }; -//--------------------------------------------------------- -// UpDownMode -//--------------------------------------------------------- - -enum class UpDownMode : char { - CHROMATIC, OCTAVE, DIATONIC -}; - //--------------------------------------------------------- // OffsetType //--------------------------------------------------------- diff --git a/src/engraving/dom/realizedharmony.h b/src/engraving/dom/realizedharmony.h index 399a26574810f..3e5be03f41172 100644 --- a/src/engraving/dom/realizedharmony.h +++ b/src/engraving/dom/realizedharmony.h @@ -20,12 +20,10 @@ * along with this program. If not, see . */ -#ifndef MU_ENGRAVING_REALIZEDHARMONY_H -#define MU_ENGRAVING_REALIZEDHARMONY_H +#pragma once #include -#include "containers.h" #include "../types/fraction.h" namespace mu::engraving { @@ -105,5 +103,3 @@ class RealizedHarmony bool m_literal = false; //use all notes when possible and do not add any notes }; } - -#endif // __REALIZEDHARMONY_H__ diff --git a/src/engraving/dom/score.h b/src/engraving/dom/score.h index c89e670e10ef0..efc3e4e210198 100644 --- a/src/engraving/dom/score.h +++ b/src/engraving/dom/score.h @@ -170,28 +170,6 @@ enum class LoopBoundaryType : signed char { LoopOut = 1 }; -enum class Pad : char { - NOTE00, - NOTE0, - NOTE1, - NOTE2, - NOTE4, - NOTE8, - NOTE16, - NOTE32, - NOTE64, - NOTE128, - NOTE256, - NOTE512, - NOTE1024, - //-------------------- - REST, - DOT, - DOT2, - DOT3, - DOT4 -}; - struct Position { Segment* segment = nullptr; staff_idx_t staffIdx = muse::nidx; @@ -201,11 +179,6 @@ struct Position { bool beyondScore = false; }; -struct NoteInputParams { - int step = 0; - int drumPitch = -1; -}; - struct ShowAnchors { ShowAnchors() = default; ShowAnchors(voice_idx_t vIdx, staff_idx_t stfIdx, const Fraction& sTickMain, const Fraction& eTickMain, diff --git a/src/engraving/editing/editnote.h b/src/engraving/editing/editnote.h index 10bb376c82cd9..db36a81573a48 100644 --- a/src/engraving/editing/editnote.h +++ b/src/engraving/editing/editnote.h @@ -30,12 +30,15 @@ namespace mu::engraving { enum class SymId; enum class AccidentalType : unsigned char; -enum class UpDownMode : char; enum class Key : signed char; class Score; class EngravingItem; class Articulation; +enum class UpDownMode : char { + CHROMATIC, OCTAVE, DIATONIC +}; + class EditNote { public: diff --git a/src/engraving/editing/noteinput.h b/src/engraving/editing/noteinput.h index d67210250ba47..8c6510467b3ca 100644 --- a/src/engraving/editing/noteinput.h +++ b/src/engraving/editing/noteinput.h @@ -41,14 +41,39 @@ class Score; class Segment; class Transaction; -struct NoteInputParams; struct NoteVal; struct Position; enum class AccidentalType : unsigned char; -enum class Pad : char; enum class SymId; +struct NoteInputParams { + int step = 0; + int drumPitch = -1; +}; + +enum class Pad : char { + NOTE00, + NOTE0, + NOTE1, + NOTE2, + NOTE4, + NOTE8, + NOTE16, + NOTE32, + NOTE64, + NOTE128, + NOTE256, + NOTE512, + NOTE1024, + //-------------------- + REST, + DOT, + DOT2, + DOT3, + DOT4 +}; + class NoteInput { public: diff --git a/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.cpp b/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.cpp index 0850d9ae6914e..0fe8faa2bc381 100644 --- a/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.cpp +++ b/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.cpp @@ -27,6 +27,7 @@ #include "global/types/string.h" +#include "engraving/style/style.h" #include "engraving/style/styledef.h" #include "log.h" diff --git a/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.h b/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.h index 9ef48c90f10b9..ca2a05bcd9b32 100644 --- a/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.h +++ b/src/engraving/qml/MuseScore/Engraving/devtools/engravingstylemodel.h @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include @@ -30,6 +31,8 @@ #include "context/iglobalcontext.h" #include "modularity/ioc.h" +#include "types/propertyvalue.h" + namespace mu::engraving { class EngravingStyleModel : public QAbstractListModel, public muse::async::Asyncable, public muse::Contextable { diff --git a/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.cpp b/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.cpp index ca3f67732d196..2cd992a663659 100644 --- a/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.cpp +++ b/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.cpp @@ -24,6 +24,7 @@ #include "notation/inotation.h" +#include "engraving/dom/score.h" #include "engraving/editing/transaction/undoablecommand.h" #include "engraving/editing/transaction/undostack.h" diff --git a/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.h b/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.h index af628a50751e3..9197e6d562e67 100644 --- a/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.h +++ b/src/engraving/qml/MuseScore/Engraving/devtools/engravingundostackmodel.h @@ -85,7 +85,6 @@ class EngravingUndoStackModel : public QAbstractItemModel, public muse::async::A Item* createItem(Item* parent, const engraving::UndoableTransaction* transaction, bool isCurrent = false); Item* createItem(Item* parent, const engraving::UndoableCommand* command, bool isCurrent = false); Item* itemByModelIndex(const QModelIndex& index) const; - QVariantMap makeData(const mu::engraving::EngravingObject* el) const; void load(const engraving::UndoableTransaction* transaction, Item* parent); diff --git a/src/engraving/style/styledef.h b/src/engraving/style/styledef.h index cb41782749a79..5cac33544ecae 100644 --- a/src/engraving/style/styledef.h +++ b/src/engraving/style/styledef.h @@ -2270,6 +2270,7 @@ Q_ENUM_NS(Sid) using _Sid::Sid; #endif +using StyleId = Sid; using StyleIdSet = std::unordered_set; //--------------------------------------------------------- diff --git a/src/importexport/midi/internal/notationmidiwriter.cpp b/src/importexport/midi/internal/notationmidiwriter.cpp index cbff918ebedcb..9f7c901c02592 100644 --- a/src/importexport/midi/internal/notationmidiwriter.cpp +++ b/src/importexport/midi/internal/notationmidiwriter.cpp @@ -24,6 +24,8 @@ #include +#include "engraving/dom/score.h" + #include "notation/inotationelements.h" // IWYU pragma: keep #include "midiexport/exportmidi.h" diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/abstractlayoutpaneltreeitem.h b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/abstractlayoutpaneltreeitem.h index dba88d208e2b9..275ad44ab4dd7 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/abstractlayoutpaneltreeitem.h +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/abstractlayoutpaneltreeitem.h @@ -34,6 +34,10 @@ #include "layoutpanelitemtype.h" +namespace mu::engraving { +struct ScoreChanges; +} + namespace mu::instrumentsscene { struct MoveParams { muse::IDList objectIdListToMove; diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentlistmodel.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentlistmodel.cpp index 74bed9617f2ee..22ac63c74e163 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentlistmodel.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentlistmodel.cpp @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "instrumentlistmodel.h" #include "translation.h" diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentsettingsmodel.h b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentsettingsmodel.h index 7bbfe822c06be..49a1752f99dea 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentsettingsmodel.h +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/instrumentsettingsmodel.h @@ -30,7 +30,7 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" -#include "notation/notationtypes.h" +#include "notation/types/instrumentstypes.h" namespace mu::instrumentsscene { class InstrumentSettingsModel : public QObject, public muse::async::Asyncable, public muse::Contextable diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.cpp index 8b321cffe430f..314618b1efde1 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.cpp @@ -28,6 +28,8 @@ #include "translation.h" +#include "engraving/dom/score.h" + #include "notation/inotationinteraction.h" // IWYU pragma: keep #include "notation/inotationselection.h" // IWYU pragma: keep #include "notation/inotationstyle.h" // IWYU pragma: keep @@ -453,12 +455,12 @@ void LayoutPanelTreeModel::toggleStaveSharing(bool on) updateIsStaveSharingEnabled(); } -void LayoutPanelTreeModel::sortParts(notation::PartList& parts, notation::PartList& referenceParts) +void LayoutPanelTreeModel::sortParts(PartList& parts, const PartList& referenceParts) { // First collect ids of referenceParts to use in sorting further std::vector referenceIdOrder; - referenceParts.reserve(referenceParts.size()); + referenceIdOrder.reserve(referenceParts.size()); for (const Part* part : referenceParts) { referenceIdOrder.push_back(part->id()); @@ -493,7 +495,7 @@ void LayoutPanelTreeModel::setLayoutPanelVisible(bool visible) updateSelectedRows(); if (m_scoreChanged) { - onScoreChanged(); + onScoreChanged({}); m_shouldUpdateSystemObjectLayers = true; updateSystemObjectLayers(); } diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.h b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.h index 4906662b15d8b..0e91b750a0d04 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.h +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/layoutpaneltreemodel.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "abstractlayoutpaneltreeitem.h" @@ -161,14 +160,15 @@ private slots: void onBeforeChangeNotation(); void setLoadingBlocked(bool blocked); - static void sortParts(notation::PartList& parts, notation::PartList& referenceParts); + using PartList = std::vector; + static void sortParts(PartList& parts, const PartList& referenceParts); void setupPartsConnections(); void setupStavesConnections(const muse::ID& partId); void setupNotationConnections(); void updateSelectedRows(); - void onScoreChanged(const mu::engraving::ScoreChanges& changes = {}); + void onScoreChanged(const mu::engraving::ScoreChanges& changes); void clear(); void deleteItems(); diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/parttreeitem.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/parttreeitem.cpp index efe4a2b9f1965..90bfe3fbb99f1 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/parttreeitem.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/parttreeitem.cpp @@ -23,6 +23,8 @@ #include "async/notifylist.h" +#include "engraving/dom/sharedpart.h" + #include "notation/inotation.h" #include "notation/inotationparts.h" @@ -30,6 +32,7 @@ using namespace mu::instrumentsscene; using namespace mu::notation; +using namespace mu::engraving; using namespace muse; PartTreeItem::PartTreeItem(IMasterNotationPtr masterNotation, INotationPtr notation, QObject* parent, LayoutPanelItemType::ItemType type) diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/roottreeitem.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/roottreeitem.cpp index 23938bf879227..22a18115cfe94 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/roottreeitem.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/roottreeitem.cpp @@ -21,6 +21,8 @@ */ #include "roottreeitem.h" +#include "engraving/dom/score.h" + #include "parttreeitem.h" #include "systemobjectslayertreeitem.h" diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/sharedparttreeitem.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/sharedparttreeitem.cpp index dad85177b8cf6..50d45405fc98c 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/sharedparttreeitem.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/sharedparttreeitem.cpp @@ -21,6 +21,8 @@ */ #include "sharedparttreeitem.h" +#include "engraving/dom/sharedpart.h" + #include "notation/inotation.h" using namespace mu::instrumentsscene; diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/staffsettingsmodel.h b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/staffsettingsmodel.h index 5cca8ca8f2e00..4c2d0c2673f9a 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/staffsettingsmodel.h +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/staffsettingsmodel.h @@ -27,7 +27,7 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" -#include "notation/notationtypes.h" +#include "notation/types/staffparttypes.h" namespace mu::instrumentsscene { class StaffSettingsModel : public QObject, public muse::Contextable diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayersettingsmodel.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayersettingsmodel.cpp index 851c866502634..608fd0d184302 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayersettingsmodel.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayersettingsmodel.cpp @@ -108,7 +108,7 @@ void SystemObjectsLayerSettingsModel::setSystemObjectsGroupVisible(int index, bo DO_ASSERT(group.staff); group.staff->undoSetShowMeasureNumbers(visible); } else { - for (EngravingItem* item : group.items) { + for (engraving::EngravingItem* item : group.items) { item->undoSetVisible(visible); } } diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayertreeitem.cpp b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayertreeitem.cpp index 88f6639dd0e5e..3d3c7d35a802d 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayertreeitem.cpp +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/internal/systemobjectslayertreeitem.cpp @@ -22,6 +22,7 @@ #include "systemobjectslayertreeitem.h" +#include "engraving/dom/score.h" #include "engraving/dom/timesig.h" #include "engraving/editing/transaction/undoablecommand.h" diff --git a/src/notation/CMakeLists.txt b/src/notation/CMakeLists.txt index e0d14b95e0903..d1cfc27a56bd6 100644 --- a/src/notation/CMakeLists.txt +++ b/src/notation/CMakeLists.txt @@ -50,6 +50,14 @@ target_sources(notation PRIVATE iinstrumentsrepository.h notationtypes.h + types/instrumentstypes.h + types/loopboundaries.h + types/noteinputtypes.h + types/propertystyletypes.h + types/scorecreateoptions.h + types/staffparttypes.h + types/stringtunings.h + types/tempo.h types/viewmode.h types/zoomtype.h diff --git a/src/notation/iinstrumentsrepository.h b/src/notation/iinstrumentsrepository.h index 6f2c1ff537418..e271c681a52c9 100644 --- a/src/notation/iinstrumentsrepository.h +++ b/src/notation/iinstrumentsrepository.h @@ -24,7 +24,8 @@ #include "modularity/imoduleinterface.h" -#include "notationtypes.h" +#include "types/instrumentstypes.h" +#include "types/stringtunings.h" namespace mu::notation { class IInstrumentsRepository : MODULE_GLOBAL_INTERFACE diff --git a/src/notation/inotationconfiguration.h b/src/notation/inotationconfiguration.h index da74c456cca24..096bedf7c416f 100644 --- a/src/notation/inotationconfiguration.h +++ b/src/notation/inotationconfiguration.h @@ -31,7 +31,7 @@ #include "io/path.h" #include "global/globaltypes.h" -#include "notationtypes.h" +#include "types/noteinputtypes.h" #include "types/zoomtype.h" namespace mu::notation { diff --git a/src/notation/inotationinteraction.h b/src/notation/inotationinteraction.h index 1f86f5c71ee90..ecd9568d4adec 100644 --- a/src/notation/inotationinteraction.h +++ b/src/notation/inotationinteraction.h @@ -28,10 +28,20 @@ #include "inotation_fwd.h" #include "notationtypes.h" +#include "types/noteinputtypes.h" class QKeyEvent; class QInputMethodEvent; +namespace mu::engraving { +class EngravingItem; +class ShadowNote; +class Staff; + +enum class HDuration : signed char; +enum class Voicing : signed char; +} + namespace mu::notation { class INotationInteraction { @@ -57,12 +67,12 @@ class INotationInteraction // Hit virtual EngravingItem* hitElement(const muse::PointF& pos, float width) const = 0; virtual std::vector hitElements(const muse::PointF& pos, float width) const = 0; - virtual Staff* hitStaff(const muse::PointF& pos) const = 0; + virtual engraving::Staff* hitStaff(const muse::PointF& pos) const = 0; struct HitElementContext { - notation::EngravingItem* element = nullptr; - notation::Staff* staff = nullptr; + engraving::EngravingItem* element = nullptr; + engraving::Staff* staff = nullptr; bool operator ==(const HitElementContext& other) const { @@ -259,7 +269,7 @@ class INotationInteraction virtual void explodeSelectedStaff() = 0; virtual void implodeSelectedStaff() = 0; - virtual void realizeSelectedChordSymbols(bool literal, Voicing voicing, HarmonyDurationType durationType) = 0; + virtual void realizeSelectedChordSymbols(bool literal, engraving::Voicing voicing, engraving::HDuration durationType) = 0; virtual void extendToNextNote() = 0; virtual void removeSelectedMeasures() = 0; virtual void removeSelectedRange() = 0; diff --git a/src/notation/inotationnoteinput.h b/src/notation/inotationnoteinput.h index d6571316bd287..99c41110b9e2a 100644 --- a/src/notation/inotationnoteinput.h +++ b/src/notation/inotationnoteinput.h @@ -25,7 +25,7 @@ #include "async/notification.h" #include "types/ret.h" -#include "notationtypes.h" +#include "types/noteinputtypes.h" namespace mu::notation { class INotationNoteInput @@ -65,15 +65,15 @@ class INotationNoteInput // Used in the input-by-duration mode virtual void setInputNote(const NoteInputParams& params) = 0; - virtual void setInputNotes(const NoteValList& notes) = 0; - virtual void moveInputNotes(bool up, PitchMode mode) = 0; + virtual void setInputNotes(const engraving::NoteValList& notes) = 0; + virtual void moveInputNotes(bool up, engraving::UpDownMode mode) = 0; virtual void setRestMode(bool rest) = 0; - virtual void setAccidental(AccidentalType accidentalType) = 0; - virtual void setArticulation(SymbolId articulationSymbolId) = 0; + virtual void setAccidental(engraving::AccidentalType accidentalType) = 0; + virtual void setArticulation(engraving::SymId articulationSymbolId) = 0; virtual void setDrumNote(int note) = 0; - virtual void setCurrentVoice(voice_idx_t voiceIndex) = 0; - virtual void setCurrentTrack(track_idx_t trackIndex) = 0; + virtual void setCurrentVoice(engraving::voice_idx_t voiceIndex) = 0; + virtual void setCurrentTrack(engraving::track_idx_t trackIndex) = 0; virtual muse::RectF cursorRect() const = 0; diff --git a/src/notation/inotationparts.h b/src/notation/inotationparts.h index 73ef540b46055..f2867fe945561 100644 --- a/src/notation/inotationparts.h +++ b/src/notation/inotationparts.h @@ -24,7 +24,8 @@ #include "async/notification.h" -#include "notationtypes.h" +#include "types/instrumentstypes.h" +#include "types/staffparttypes.h" namespace muse::async { template @@ -48,7 +49,7 @@ class INotationParts virtual const Staff* staff(const muse::ID& staffId) const = 0; virtual bool staffExists(const muse::ID& staffId) const = 0; - virtual StaffConfig staffConfig(const muse::ID& staffId, Fraction tick = Fraction(0, 1)) const = 0; + virtual StaffConfig staffConfig(const muse::ID& staffId, engraving::Fraction tick = { 0, 1 }) const = 0; virtual ScoreOrder scoreOrder() const = 0; virtual void setParts(const PartInstrumentList& instruments, const ScoreOrder& order) = 0; @@ -63,7 +64,7 @@ class INotationParts const QString& shortName) = 0; virtual void setInstrumentNumber(const InstrumentKey& instrumentKey, int v) = 0; virtual void setStaffType(const muse::ID& staffId, StaffTypeId type) = 0; - virtual void setStaffConfig(const muse::ID& staffId, const StaffConfig& config, Fraction tick = Fraction(0, 1)) = 0; + virtual void setStaffConfig(const muse::ID& staffId, const StaffConfig& config, engraving::Fraction tick = { 0, 1 }) = 0; virtual void setSharedPartEnabled(const muse::ID& partId, bool enable) = 0; virtual void removeParts(const muse::IDList& partsIds) = 0; diff --git a/src/notation/inotationplayback.h b/src/notation/inotationplayback.h index 03398f01abb85..99ddc32b4632f 100644 --- a/src/notation/inotationplayback.h +++ b/src/notation/inotationplayback.h @@ -29,7 +29,13 @@ #include "mpe/events.h" #include "engraving/types/types.h" -#include "notationtypes.h" +#include "types/loopboundaries.h" +#include "types/tempo.h" + +namespace mu::engraving { +class EngravingItem; +class StaffText; +} namespace mu::notation { class INotationPlayback @@ -40,10 +46,10 @@ class INotationPlayback virtual void init() = 0; virtual void reload() = 0; - virtual void setSendEventsOnScoreChange(const InstrumentTrackId& trackId, bool send) = 0; + virtual void setSendEventsOnScoreChange(const engraving::InstrumentTrackId& trackId, bool send) = 0; virtual void sendEventsForChangedTracks() = 0; - virtual muse::async::Channel tracksDataChanged() const = 0; + virtual muse::async::Channel tracksDataChanged() const = 0; virtual const engraving::InstrumentTrackId& metronomeTrackId() const = 0; virtual engraving::InstrumentTrackId chordSymbolsTrackId(const muse::ID& partId) const = 0; @@ -51,10 +57,11 @@ class INotationPlayback virtual const muse::mpe::PlaybackData& trackPlaybackData(const engraving::InstrumentTrackId& trackId) const = 0; - virtual void triggerEventsForItems(const std::vector& items, muse::mpe::duration_t duration, bool flushSound) = 0; + virtual void triggerEventsForItems(const std::vector& items, muse::mpe::duration_t duration, + bool flushSound) = 0; virtual void triggerMetronome(muse::midi::tick_t tick) = 0; virtual void triggerCountIn(muse::midi::tick_t tick, muse::secs_t& countInDuration) = 0; - virtual void triggerControllers(const muse::mpe::ControllerChangeEventList& list, notation::staff_idx_t staffIdx, int tick) = 0; + virtual void triggerControllers(const muse::mpe::ControllerChangeEventList& list, engraving::staff_idx_t staffIdx, int tick) = 0; virtual engraving::InstrumentTrackIdSet existingTrackIdSet() const = 0; virtual muse::async::Channel trackAdded() const = 0; @@ -68,7 +75,7 @@ class INotationPlayback virtual muse::midi::tick_t secToTick(muse::audio::secs_t sec) const = 0; virtual muse::RetVal playPositionTickByRawTick(muse::midi::tick_t tick) const = 0; - virtual muse::RetVal playPositionTickByElement(const EngravingItem* element) const = 0; + virtual muse::RetVal playPositionTickByElement(const engraving::EngravingItem* element) const = 0; enum BoundaryTick { FirstScoreTick = 0, @@ -84,7 +91,7 @@ class INotationPlayback virtual muse::async::Notification loopBoundariesChanged() const = 0; virtual const Tempo& multipliedTempo(muse::midi::tick_t tick) const = 0; - virtual MeasureBeat beat(muse::midi::tick_t tick) const = 0; + virtual engraving::MeasureBeat beat(muse::midi::tick_t tick) const = 0; virtual muse::midi::tick_t beatToRawTick(int measureIndex, int beatIndex) const = 0; virtual double tempoMultiplier() const = 0; diff --git a/src/notation/inotationselection.h b/src/notation/inotationselection.h index 6edb5b60e7bab..e1c1aeaaac160 100644 --- a/src/notation/inotationselection.h +++ b/src/notation/inotationselection.h @@ -28,11 +28,27 @@ #include "types/ret.h" #include "inotationselectionrange.h" -#include "notationtypes.h" class QMimeData; +namespace mu::engraving { +class EngravingItem; +class MeasureBase; +class Note; +class System; +enum class SelState : char; +} + namespace mu::notation { +using SelectionState = mu::engraving::SelState; + +enum class NoteFilter : unsigned char +{ + All, + WithTie, + WithSlur +}; + class INotationSelection { public: @@ -46,16 +62,16 @@ class INotationSelection virtual muse::ByteArray mimeData() const = 0; virtual QMimeData* qMimeData() const = 0; - virtual EngravingItem* element() const = 0; - virtual const std::vector& elements() const = 0; + virtual engraving::EngravingItem* element() const = 0; + virtual const std::vector& elements() const = 0; - virtual std::vector notes(NoteFilter filter = NoteFilter::All) const = 0; + virtual std::vector notes(NoteFilter filter = NoteFilter::All) const = 0; virtual muse::RectF canvasBoundingRect() const = 0; virtual INotationSelectionRangePtr range() const = 0; - virtual EngravingItem* lastElementHit() const = 0; + virtual engraving::EngravingItem* lastElementHit() const = 0; virtual mu::engraving::MeasureBase* startMeasureBase() const = 0; virtual mu::engraving::MeasureBase* endMeasureBase() const = 0; diff --git a/src/notation/inotationselectionfilter.h b/src/notation/inotationselectionfilter.h index 2336d26d42d6f..794a70e1d7e0d 100644 --- a/src/notation/inotationselectionfilter.h +++ b/src/notation/inotationselectionfilter.h @@ -22,7 +22,7 @@ #pragma once -#include "notationtypes.h" +#include "engraving/dom/selectionfilter.h" namespace mu::notation { class INotationSelectionFilter @@ -30,8 +30,8 @@ class INotationSelectionFilter public: virtual ~INotationSelectionFilter() = default; - virtual bool isSelectionTypeFiltered(const SelectionFilterTypesVariant& variant) const = 0; - virtual void setSelectionTypeFiltered(const SelectionFilterTypesVariant& variant, bool filtered) = 0; + virtual bool isSelectionTypeFiltered(const engraving::SelectionFilterTypesVariant& variant) const = 0; + virtual void setSelectionTypeFiltered(const engraving::SelectionFilterTypesVariant& variant, bool filtered) = 0; virtual bool includeSingleNotes() const = 0; virtual void setIncludeSingleNotes(bool include) = 0; diff --git a/src/notation/inotationselectionrange.h b/src/notation/inotationselectionrange.h index d44a98d487f2e..0b62aa99b3a30 100644 --- a/src/notation/inotationselectionrange.h +++ b/src/notation/inotationselectionrange.h @@ -24,7 +24,14 @@ #include -#include "notationtypes.h" +#include "engraving/types/types.h" + +namespace mu::engraving { +class EngravingItem; +class Measure; +class Part; +class Segment; +} namespace mu::notation { class INotationSelectionRange @@ -34,24 +41,24 @@ class INotationSelectionRange virtual engraving::staff_idx_t startStaffIndex() const = 0; virtual engraving::Segment* rangeStartSegment() const = 0; - virtual Fraction startTick() const = 0; + virtual engraving::Fraction startTick() const = 0; virtual engraving::staff_idx_t endStaffIndex() const = 0; virtual engraving::Segment* rangeEndSegment() const = 0; - virtual Fraction endTick() const = 0; + virtual engraving::Fraction endTick() const = 0; struct MeasureRange { - Measure* startMeasure = nullptr; - Measure* endMeasure = nullptr; + engraving::Measure* startMeasure = nullptr; + engraving::Measure* endMeasure = nullptr; }; virtual MeasureRange measureRange() const = 0; - virtual std::vector selectedParts() const = 0; + virtual std::vector selectedParts() const = 0; virtual std::vector boundingArea() const = 0; virtual bool containsPoint(const muse::PointF& point) const = 0; - virtual bool containsItem(const EngravingItem* item, engraving::staff_idx_t staffIdx = muse::nidx) const = 0; + virtual bool containsItem(const engraving::EngravingItem* item, engraving::staff_idx_t staffIdx = muse::nidx) const = 0; virtual bool containsMultiNoteChords() const = 0; }; diff --git a/src/notation/inotationstyle.h b/src/notation/inotationstyle.h index a8ea9b2576b00..8bcd8416ab0f7 100644 --- a/src/notation/inotationstyle.h +++ b/src/notation/inotationstyle.h @@ -22,8 +22,10 @@ #pragma once -#include "notationtypes.h" #include "async/notification.h" +#include "io/path.h" + +#include "types/propertystyletypes.h" namespace mu::notation { class INotationStyle diff --git a/src/notation/inotationundostack.h b/src/notation/inotationundostack.h index 991d2a514f4b7..504753e0acaf2 100644 --- a/src/notation/inotationundostack.h +++ b/src/notation/inotationundostack.h @@ -25,11 +25,12 @@ #include "async/notification.h" #include "async/channel.h" -#include "notationtypes.h" +#include "types/translatablestring.h" namespace mu::engraving { class EditData; class Transaction; +struct ScoreChanges; enum class ElementType : unsigned char; } @@ -68,7 +69,7 @@ class INotationUndoStack virtual const muse::TranslatableString lastActionNameAtIdx(size_t) const = 0; virtual muse::async::Notification stackChanged() const = 0; - virtual muse::async::Channel changesChannel() const = 0; + virtual muse::async::Channel changesChannel() const = 0; virtual muse::async::Notification undoRedoNotification() const = 0; }; diff --git a/src/notation/internal/engravingfontscontroller.h b/src/notation/internal/engravingfontscontroller.h index 6108d3a522deb..c8fcda0d94bae 100644 --- a/src/notation/internal/engravingfontscontroller.h +++ b/src/notation/internal/engravingfontscontroller.h @@ -23,9 +23,11 @@ #pragma once #include "async/asyncable.h" + #include "modularity/ioc.h" -#include "inotationconfiguration.h" #include "draw/internal/ifontsdatabase.h" +#include "engraving/iengravingfontsprovider.h" +#include "inotationconfiguration.h" #include "ui/iuiconfiguration.h" namespace mu::notation { diff --git a/src/notation/internal/excerptnotation.h b/src/notation/internal/excerptnotation.h index 6d7aa063f081b..df387b20f3411 100644 --- a/src/notation/internal/excerptnotation.h +++ b/src/notation/internal/excerptnotation.h @@ -25,6 +25,10 @@ #include "iexcerptnotation.h" #include "notation.h" +namespace mu::engraving { +class Excerpt; +} + namespace mu::notation { class ExcerptNotation : public IExcerptNotation, public Notation, public std::enable_shared_from_this { diff --git a/src/notation/internal/masternotation.cpp b/src/notation/internal/masternotation.cpp index a26adf3818d6e..97817b3b1bc91 100644 --- a/src/notation/internal/masternotation.cpp +++ b/src/notation/internal/masternotation.cpp @@ -51,6 +51,7 @@ #include "excerptnotation.h" #include "masternotationparts.h" #include "notationautomation.h" +#include "types/scorecreateoptions.h" #ifdef MUE_BUILD_ENGRAVING_PLAYBACK #include "notationplayback.h" diff --git a/src/notation/internal/masternotation.h b/src/notation/internal/masternotation.h index a8566f521e45d..586e73b0a66cf 100644 --- a/src/notation/internal/masternotation.h +++ b/src/notation/internal/masternotation.h @@ -29,6 +29,7 @@ #include "../imasternotation.h" namespace mu::engraving { +class Excerpt; class MasterScore; } diff --git a/src/notation/internal/masternotationparts.h b/src/notation/internal/masternotationparts.h index b4b97eca57927..0ccd828d4c676 100644 --- a/src/notation/internal/masternotationparts.h +++ b/src/notation/internal/masternotationparts.h @@ -20,11 +20,9 @@ * along with this program. If not, see . */ -#ifndef MU_NOTATION_MASTERNOTATIONPARTS_H -#define MU_NOTATION_MASTERNOTATIONPARTS_H +#pragma once #include "notationparts.h" -#include "imasternotation.h" namespace mu::notation { class MasterNotationParts : public NotationParts @@ -65,5 +63,3 @@ class MasterNotationParts : public NotationParts ExcerptNotationList m_excerpts; }; } - -#endif // MU_NOTATION_MASTERNOTATIONPARTS_H diff --git a/src/notation/internal/notationaccessibility.h b/src/notation/internal/notationaccessibility.h index 5c6bc35748ff0..1f5e89efae124 100644 --- a/src/notation/internal/notationaccessibility.h +++ b/src/notation/internal/notationaccessibility.h @@ -20,14 +20,16 @@ * along with this program. If not, see . */ -#ifndef MU_NOTATION_NOTATIONACCESSIBILITY_H -#define MU_NOTATION_NOTATIONACCESSIBILITY_H +#pragma once #include "inotationaccessibility.h" -#include "notationtypes.h" #include "async/asyncable.h" -#include "async/notification.h" + +namespace mu::engraving { +class Score; +class Selection; +} namespace mu::notation { class IGetScore; @@ -58,5 +60,3 @@ class NotationAccessibility : public INotationAccessibility, public muse::async: muse::ValCh m_accessibilityInfo; }; } - -#endif // MU_NOTATION_NOTATIONACCESSIBILITY_H diff --git a/src/notation/internal/notationautomation.h b/src/notation/internal/notationautomation.h index 6b47e12902131..2d0bb6261f494 100644 --- a/src/notation/internal/notationautomation.h +++ b/src/notation/internal/notationautomation.h @@ -23,13 +23,7 @@ #include "../inotationautomation.h" -#include "notationtypes.h" -#include "engraving/automation/automationtypes.h" - -#include "async/channel.h" - -#include "igetscore.h" -#include "draw/types/geometry.h" +#include "async/notification.h" namespace mu::engraving { class IAutomation; diff --git a/src/notation/internal/notationelements.cpp b/src/notation/internal/notationelements.cpp index 446a4f1d4dd09..5da2870d4811b 100644 --- a/src/notation/internal/notationelements.cpp +++ b/src/notation/internal/notationelements.cpp @@ -25,6 +25,7 @@ #include "engraving/dom/note.h" #include "engraving/dom/page.h" #include "engraving/dom/rehearsalmark.h" +#include "engraving/dom/score.h" #include "engraving/dom/segment.h" #include "searchcommandsparser.h" @@ -182,7 +183,7 @@ std::vector NotationElements::allScoreElements() const std::vector NotationElements::filterElements(const FilterElementsOptions* elementsOptions) const { - ElementPattern pattern = constructElementPattern(elementsOptions); + mu::engraving::ElementPattern pattern = constructElementPattern(elementsOptions); score()->scanElements([&](EngravingItem* item) { mu::engraving::Score::collectMatch(&pattern, item); }); @@ -217,7 +218,7 @@ mu::engraving::Score* NotationElements::score() const return m_getScore->score(); } -ElementPattern NotationElements::constructElementPattern(const FilterElementsOptions* elementOptions) const +mu::engraving::ElementPattern NotationElements::constructElementPattern(const FilterElementsOptions* elementOptions) const { mu::engraving::ElementPattern pattern; pattern.type = static_cast(elementOptions->elementType); diff --git a/src/notation/internal/notationelements.h b/src/notation/internal/notationelements.h index d94d238985e71..be9fe9c1102fd 100644 --- a/src/notation/internal/notationelements.h +++ b/src/notation/internal/notationelements.h @@ -25,6 +25,11 @@ #include "inotationelements.h" #include "igetscore.h" +namespace mu::engraving { +struct ElementPattern; +struct NotePattern; +} + namespace mu::notation { class NotationElements : public INotationElements { @@ -51,7 +56,7 @@ class NotationElements : public INotationElements std::vector filterElements(const FilterElementsOptions* elementsOptions) const; std::vector filterNotes(const FilterNotesOptions* notesOptions) const; - ElementPattern constructElementPattern(const FilterElementsOptions* elementsOptions) const; + mu::engraving::ElementPattern constructElementPattern(const FilterElementsOptions* elementsOptions) const; mu::engraving::NotePattern constructNotePattern(const FilterNotesOptions* notesOptions) const; IGetScore* m_getScore = nullptr; diff --git a/src/notation/internal/notationinteraction.cpp b/src/notation/internal/notationinteraction.cpp index b4bd44c817274..1516f114b143c 100644 --- a/src/notation/internal/notationinteraction.cpp +++ b/src/notation/internal/notationinteraction.cpp @@ -78,6 +78,7 @@ #include "engraving/dom/page.h" #include "engraving/dom/part.h" #include "engraving/dom/pitchspelling.h" +#include "engraving/dom/realizedharmony.h" #include "engraving/dom/rest.h" #include "engraving/dom/shadownote.h" #include "engraving/dom/slur.h" @@ -6573,7 +6574,7 @@ void NotationInteraction::implodeSelectedStaff() checkAndShowError(); } -void NotationInteraction::realizeSelectedChordSymbols(bool literal, Voicing voicing, HarmonyDurationType durationType) +void NotationInteraction::realizeSelectedChordSymbols(bool literal, Voicing voicing, HDuration durationType) { if (selection()->isNone()) { return; diff --git a/src/notation/internal/notationinteraction.h b/src/notation/internal/notationinteraction.h index 796b6dcb42937..cbed8a5ecb582 100644 --- a/src/notation/internal/notationinteraction.h +++ b/src/notation/internal/notationinteraction.h @@ -42,17 +42,20 @@ #include "engraving/dom/engravingitem.h" #include "engraving/dom/elementgroup.h" +#include "engraving/dom/score.h" #include "engraving/rendering/paintoptions.h" #include "engraving/types/symid.h" #include "previewmeasure.h" #include "scorecallbacks.h" +class QDrag; + namespace mu::engraving { class Lasso; class Transaction; -} -class QDrag; +enum class HarmonyType : unsigned char; +} namespace mu::notation { class Notation; @@ -91,7 +94,7 @@ class NotationInteraction : public INotationInteraction, public muse::Contextabl // Hit EngravingItem* hitElement(const muse::PointF& pos, float width) const override; std::vector hitElements(const muse::PointF& pos, float width) const override; - Staff* hitStaff(const muse::PointF& pos) const override; + engraving::Staff* hitStaff(const muse::PointF& pos) const override; const HitElementContext& hitElementContext() const override; void setHitElementContext(const HitElementContext& context) override; @@ -275,7 +278,7 @@ class NotationInteraction : public INotationInteraction, public muse::Contextabl void explodeSelectedStaff() override; void implodeSelectedStaff() override; - void realizeSelectedChordSymbols(bool literal, Voicing voicing, HarmonyDurationType durationType) override; + void realizeSelectedChordSymbols(bool literal, engraving::Voicing voicing, engraving::HDuration durationType) override; void extendToNextNote() override; void removeSelectedMeasures() override; void removeSelectedRange() override; @@ -406,8 +409,8 @@ private slots: void toggleVerticalAlignment(mu::engraving::VerticalAlignment); void navigateToLyrics(bool, bool, bool); - Harmony* editedHarmony() const; - Segment* harmonySegment(const Harmony* harmony) const; + mu::engraving::Harmony* editedHarmony() const; + mu::engraving::Segment* harmonySegment(const mu::engraving::Harmony* harmony) const; mu::engraving::Harmony* findHarmonyInSegment(const mu::engraving::Segment* segment, engraving::track_idx_t track, mu::engraving::TextStyleType textStyleType) const; mu::engraving::Harmony* createHarmony(mu::engraving::Segment* segment, engraving::track_idx_t track, @@ -492,8 +495,8 @@ private slots: struct HitMeasureData { - Measure* measure = nullptr; - Staff* staff = nullptr; + engraving::Measure* measure = nullptr; + engraving::Staff* staff = nullptr; }; HitMeasureData hitMeasure(const muse::PointF& pos) const; diff --git a/src/notation/internal/notationnoteinput.cpp b/src/notation/internal/notationnoteinput.cpp index 455a7a21d6f05..ed19ddc6bae38 100644 --- a/src/notation/internal/notationnoteinput.cpp +++ b/src/notation/internal/notationnoteinput.cpp @@ -28,6 +28,7 @@ #include "engraving/dom/masterscore.h" #include "engraving/dom/mscore.h" #include "engraving/dom/note.h" +#include "engraving/dom/part.h" #include "engraving/dom/segment.h" #include "engraving/dom/slur.h" #include "engraving/dom/staff.h" diff --git a/src/notation/internal/notationparts.h b/src/notation/internal/notationparts.h index bcf1e6d9c41dd..2adeba7283057 100644 --- a/src/notation/internal/notationparts.h +++ b/src/notation/internal/notationparts.h @@ -25,6 +25,8 @@ #include "async/asyncable.h" #include "async/notifylist.h" +#include "engraving/dom/score.h" + #include "inotationparts.h" #include "inotationstyle.h" #include "inotationundostack.h" diff --git a/src/notation/internal/notationplayback.cpp b/src/notation/internal/notationplayback.cpp index f980319e14285..8115dfaf6b42e 100644 --- a/src/notation/internal/notationplayback.cpp +++ b/src/notation/internal/notationplayback.cpp @@ -37,7 +37,6 @@ #include "engraving/dom/staff.h" #include "engraving/dom/stafftext.h" #include "engraving/dom/tempo.h" -#include "engraving/dom/tempotext.h" #include "engraving/dom/utils.h" #include "notationerrors.h" @@ -179,7 +178,7 @@ void NotationPlayback::triggerCountIn(muse::midi::tick_t tick, muse::secs_t& cou countInDuration = muse::usecs_to_secs(durationInMicrosecs); } -void NotationPlayback::triggerControllers(const muse::mpe::ControllerChangeEventList& list, notation::staff_idx_t staffIdx, int tick) +void NotationPlayback::triggerControllers(const muse::mpe::ControllerChangeEventList& list, staff_idx_t staffIdx, int tick) { if (list.empty()) { return; diff --git a/src/notation/internal/notationplayback.h b/src/notation/internal/notationplayback.h index 039b267de8fb9..0ed987fd97752 100644 --- a/src/notation/internal/notationplayback.h +++ b/src/notation/internal/notationplayback.h @@ -19,8 +19,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_NOTATION_NOTATIONPLAYBACK_H -#define MU_NOTATION_NOTATIONPLAYBACK_H + +#pragma once #include "modularity/ioc.h" #include "async/asyncable.h" @@ -45,10 +45,10 @@ class NotationPlayback : public INotationPlayback, public muse::async::Asyncable void init() override; void reload() override; - void setSendEventsOnScoreChange(const InstrumentTrackId& trackId, bool send) override; + void setSendEventsOnScoreChange(const engraving::InstrumentTrackId& trackId, bool send) override; void sendEventsForChangedTracks() override; - muse::async::Channel tracksDataChanged() const override; + muse::async::Channel tracksDataChanged() const override; const engraving::InstrumentTrackId& metronomeTrackId() const override; engraving::InstrumentTrackId chordSymbolsTrackId(const muse::ID& partId) const override; @@ -56,10 +56,11 @@ class NotationPlayback : public INotationPlayback, public muse::async::Asyncable const muse::mpe::PlaybackData& trackPlaybackData(const engraving::InstrumentTrackId& trackId) const override; - void triggerEventsForItems(const std::vector& items, muse::mpe::duration_t duration, bool flushSound) override; + void triggerEventsForItems(const std::vector& items, muse::mpe::duration_t duration, + bool flushSound) override; void triggerMetronome(muse::midi::tick_t tick) override; void triggerCountIn(muse::midi::tick_t tick, muse::secs_t& countInDuration) override; - void triggerControllers(const muse::mpe::ControllerChangeEventList& list, notation::staff_idx_t staffIdx, int tick) override; + void triggerControllers(const muse::mpe::ControllerChangeEventList& list, engraving::staff_idx_t staffIdx, int tick) override; engraving::InstrumentTrackIdSet existingTrackIdSet() const override; muse::async::Channel trackAdded() const override; @@ -73,7 +74,7 @@ class NotationPlayback : public INotationPlayback, public muse::async::Asyncable muse::midi::tick_t secToTick(muse::audio::secs_t sec) const override; muse::RetVal playPositionTickByRawTick(muse::midi::tick_t tick) const override; - muse::RetVal playPositionTickByElement(const EngravingItem* element) const override; + muse::RetVal playPositionTickByElement(const engraving::EngravingItem* element) const override; void addLoopBoundary(LoopBoundaryType boundaryType, muse::midi::tick_t tick) override; void setLoopBoundariesEnabled(bool enabled) override; @@ -83,7 +84,7 @@ class NotationPlayback : public INotationPlayback, public muse::async::Asyncable muse::async::Notification loopBoundariesChanged() const override; const Tempo& multipliedTempo(muse::midi::tick_t tick) const override; - MeasureBeat beat(muse::midi::tick_t tick) const override; + engraving::MeasureBeat beat(muse::midi::tick_t tick) const override; muse::midi::tick_t beatToRawTick(int measureIndex, int beatIndex) const override; double tempoMultiplier() const override; @@ -122,5 +123,3 @@ class NotationPlayback : public INotationPlayback, public muse::async::Asyncable mutable engraving::PlaybackModel m_playbackModel; }; } - -#endif // MU_NOTATION_NOTATIONPLAYBACK_H diff --git a/src/notation/internal/notationselection.cpp b/src/notation/internal/notationselection.cpp index f4353d627bec1..bd27b479c2133 100644 --- a/src/notation/internal/notationselection.cpp +++ b/src/notation/internal/notationselection.cpp @@ -23,7 +23,7 @@ #include -#include "engraving/dom/masterscore.h" +#include "engraving/dom/score.h" #include "engraving/dom/segment.h" #include "engraving/dom/measure.h" @@ -36,6 +36,7 @@ using namespace muse; using namespace mu::notation; +using namespace mu::engraving; NotationSelection::NotationSelection(IGetScore* getScore) : m_getScore(getScore) @@ -137,7 +138,7 @@ INotationSelectionRangePtr NotationSelection::range() const return m_range; } -mu::engraving::Score* NotationSelection::score() const +Score* NotationSelection::score() const { return m_getScore->score(); } @@ -147,17 +148,17 @@ void NotationSelection::onElementHit(EngravingItem* el) m_lastElementHit = el; } -mu::engraving::MeasureBase* NotationSelection::startMeasureBase() const +MeasureBase* NotationSelection::startMeasureBase() const { return score()->selection().startMeasureBase(); } -mu::engraving::MeasureBase* NotationSelection::endMeasureBase() const +MeasureBase* NotationSelection::endMeasureBase() const { return score()->selection().endMeasureBase(); } -std::vector NotationSelection::selectedSystems() const +std::vector NotationSelection::selectedSystems() const { return score()->selection().selectedSystems(); } diff --git a/src/notation/internal/notationselection.h b/src/notation/internal/notationselection.h index 121aec8c17bd0..147fa14b3bb93 100644 --- a/src/notation/internal/notationselection.h +++ b/src/notation/internal/notationselection.h @@ -19,19 +19,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_NOTATION_NOTATIONSELECTION_H -#define MU_NOTATION_NOTATIONSELECTION_H + +#pragma once #include "../inotationselection.h" #include "igetscore.h" -namespace mu::engraving { -class MeasureBase; -class Score; -class System; -} - namespace mu::notation { class NotationSelection : public INotationSelection { @@ -46,18 +40,18 @@ class NotationSelection : public INotationSelection muse::ByteArray mimeData() const override; QMimeData* qMimeData() const override; - EngravingItem* element() const override; - const std::vector& elements() const override; + engraving::EngravingItem* element() const override; + const std::vector& elements() const override; - std::vector notes(NoteFilter filter) const override; + std::vector notes(NoteFilter filter) const override; muse::RectF canvasBoundingRect() const override; INotationSelectionRangePtr range() const override; - EngravingItem* lastElementHit() const override; + engraving::EngravingItem* lastElementHit() const override; - void onElementHit(EngravingItem*); + void onElementHit(engraving::EngravingItem*); mu::engraving::MeasureBase* startMeasureBase() const override; mu::engraving::MeasureBase* endMeasureBase() const override; @@ -68,10 +62,8 @@ class NotationSelection : public INotationSelection private: mu::engraving::Score* score() const; - EngravingItem* m_lastElementHit = nullptr; + engraving::EngravingItem* m_lastElementHit = nullptr; IGetScore* m_getScore = nullptr; INotationSelectionRangePtr m_range; }; } - -#endif // MU_NOTATION_NOTATIONSELECTION_H diff --git a/src/notation/internal/notationselectionfilter.cpp b/src/notation/internal/notationselectionfilter.cpp index 0c9090b849e21..dc616a1660537 100644 --- a/src/notation/internal/notationselectionfilter.cpp +++ b/src/notation/internal/notationselectionfilter.cpp @@ -22,10 +22,11 @@ #include "notationselectionfilter.h" -#include "log.h" +#include "engraving/dom/score.h" using namespace muse; using namespace mu::notation; +using namespace mu::engraving; NotationSelectionFilter::NotationSelectionFilter(const IGetScore* getScore, const std::function& selectionChangedCallback) : m_getScore(getScore), m_selectionChangedCallback(selectionChangedCallback) diff --git a/src/notation/internal/notationselectionfilter.h b/src/notation/internal/notationselectionfilter.h index b51cdcb62c50f..3d7815d456da7 100644 --- a/src/notation/internal/notationselectionfilter.h +++ b/src/notation/internal/notationselectionfilter.h @@ -25,7 +25,6 @@ #include "../inotationselectionfilter.h" #include "igetscore.h" -#include "inotationinteraction.h" namespace mu::notation { class NotationSelectionFilter : public INotationSelectionFilter @@ -33,8 +32,8 @@ class NotationSelectionFilter : public INotationSelectionFilter public: NotationSelectionFilter(const IGetScore* getScore, const std::function& selectionChangedCallback); - bool isSelectionTypeFiltered(const SelectionFilterTypesVariant& variant) const override; - void setSelectionTypeFiltered(const SelectionFilterTypesVariant& variant, bool filtered) override; + bool isSelectionTypeFiltered(const engraving::SelectionFilterTypesVariant& variant) const override; + void setSelectionTypeFiltered(const engraving::SelectionFilterTypesVariant& variant, bool filtered) override; bool includeSingleNotes() const override; void setIncludeSingleNotes(bool include) override; diff --git a/src/notation/internal/notationselectionrange.cpp b/src/notation/internal/notationselectionrange.cpp index 7a30c5501819e..2eb25ea98cc64 100644 --- a/src/notation/internal/notationselectionrange.cpp +++ b/src/notation/internal/notationselectionrange.cpp @@ -19,15 +19,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include #include "notationselectionrange.h" #include "utilities/scorerangeutilities.h" -#include "engraving/dom/segment.h" -#include "engraving/dom/measure.h" #include "engraving/dom/chordrest.h" +#include "engraving/dom/measure.h" +#include "engraving/dom/score.h" +#include "engraving/dom/segment.h" +#include "engraving/dom/select.h" #include "engraving/dom/staff.h" using namespace mu::notation; diff --git a/src/notation/internal/notationselectionrange.h b/src/notation/internal/notationselectionrange.h index 8db7d37e41387..d6e717f811698 100644 --- a/src/notation/internal/notationselectionrange.h +++ b/src/notation/internal/notationselectionrange.h @@ -19,8 +19,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_NOTATION_NOTATIONSELECTIONRANGE_H -#define MU_NOTATION_NOTATIONSELECTIONRANGE_H + +#pragma once #include "inotationselectionrange.h" @@ -38,19 +38,19 @@ class NotationSelectionRange : public INotationSelectionRange engraving::staff_idx_t startStaffIndex() const override; engraving::Segment* rangeStartSegment() const override; - Fraction startTick() const override; + engraving::Fraction startTick() const override; engraving::staff_idx_t endStaffIndex() const override; engraving::Segment* rangeEndSegment() const override; - Fraction endTick() const override; + engraving::Fraction endTick() const override; MeasureRange measureRange() const override; - std::vector selectedParts() const override; + std::vector selectedParts() const override; std::vector boundingArea() const override; bool containsPoint(const muse::PointF& point) const override; - bool containsItem(const EngravingItem* item, engraving::staff_idx_t staffIdx = muse::nidx) const override; + bool containsItem(const engraving::EngravingItem* item, engraving::staff_idx_t staffIdx = muse::nidx) const override; bool containsMultiNoteChords() const override; @@ -60,5 +60,3 @@ class NotationSelectionRange : public INotationSelectionRange IGetScore* m_getScore = nullptr; }; } - -#endif // MU_NOTATION_NOTATIONSELECTIONRANGE_H diff --git a/src/notation/internal/notationundostack.cpp b/src/notation/internal/notationundostack.cpp index 3fb3fb3b84c86..03f09617af90b 100644 --- a/src/notation/internal/notationundostack.cpp +++ b/src/notation/internal/notationundostack.cpp @@ -259,10 +259,10 @@ muse::async::Notification NotationUndoStack::stackChanged() const return m_stackStateChanged; } -muse::async::Channel NotationUndoStack::changesChannel() const +muse::async::Channel NotationUndoStack::changesChannel() const { IF_ASSERT_FAILED(score()) { - return muse::async::Channel(); + return muse::async::Channel(); } return score()->changesChannel(); diff --git a/src/notation/internal/notationundostack.h b/src/notation/internal/notationundostack.h index 9abce45ca9a00..3a9cb5d569bf4 100644 --- a/src/notation/internal/notationundostack.h +++ b/src/notation/internal/notationundostack.h @@ -22,6 +22,8 @@ #pragma once +#include "draw/types/geometry.h" + #include "inotationundostack.h" #include "igetscore.h" @@ -68,7 +70,7 @@ class NotationUndoStack : public INotationUndoStack const muse::TranslatableString lastActionNameAtIdx(size_t idx) const override; muse::async::Notification stackChanged() const override; - muse::async::Channel changesChannel() const override; + muse::async::Channel changesChannel() const override; muse::async::Notification undoRedoNotification() const override; private: diff --git a/src/notation/internal/previewmeasure.cpp b/src/notation/internal/previewmeasure.cpp index 18794849dc7a7..a46ff7e6c7d80 100644 --- a/src/notation/internal/previewmeasure.cpp +++ b/src/notation/internal/previewmeasure.cpp @@ -22,14 +22,17 @@ #include "previewmeasure.h" -#include "engraving/dom/staff.h" -#include "engraving/dom/measure.h" -#include "engraving/dom/shadownote.h" +#include +#include + #include "draw/painter.h" #include "draw/internal/qpainterprovider.h" -#include -#include +#include "engraving/dom/measure.h" +#include "engraving/dom/score.h" +#include "engraving/dom/shadownote.h" +#include "engraving/dom/staff.h" +#include "engraving/dom/system.h" using namespace mu::notation; using namespace mu::engraving; diff --git a/src/notation/notationtypes.h b/src/notation/notationtypes.h index 72caea203d3d7..fa8454358f7bc 100644 --- a/src/notation/notationtypes.h +++ b/src/notation/notationtypes.h @@ -19,141 +19,77 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include #include -#include "translation.h" - -#include "types/id.h" -#include "types/translatablestring.h" - #include "engraving/dom/articulation.h" #include "engraving/dom/chord.h" #include "engraving/dom/durationtype.h" #include "engraving/dom/engravingitem.h" #include "engraving/dom/guitarbend.h" #include "engraving/dom/hairpin.h" -#include "engraving/dom/harmony.h" #include "engraving/dom/hook.h" -#include "engraving/dom/instrtemplate.h" -#include "engraving/dom/instrtemplate.h" -#include "engraving/dom/instrument.h" #include "engraving/dom/key.h" #include "engraving/dom/measure.h" #include "engraving/dom/mscore.h" #include "engraving/dom/note.h" #include "engraving/dom/ottava.h" #include "engraving/dom/page.h" -#include "engraving/dom/part.h" -#include "engraving/dom/sharedpart.h" -#include "engraving/dom/realizedharmony.h" #include "engraving/dom/rest.h" -#include "engraving/dom/score.h" #include "engraving/dom/slur.h" -#include "engraving/dom/staff.h" -#include "engraving/dom/stafftype.h" #include "engraving/dom/stem.h" #include "engraving/dom/system.h" #include "engraving/dom/timesig.h" -#include "engraving/dom/tuplet.h" +#include "engraving/types/types.h" namespace mu::notation { using Page = mu::engraving::Page; using System = mu::engraving::System; -using SysStaff = mu::engraving::SysStaff; using EngravingItem = mu::engraving::EngravingItem; using ElementType = mu::engraving::ElementType; -using PropertyValue = engraving::PropertyValue; using Note = mu::engraving::Note; using Measure = mu::engraving::Measure; using DurationType = mu::engraving::DurationType; using Duration = mu::engraving::TDuration; using SelectType = mu::engraving::SelectType; -using SelectionState = mu::engraving::SelState; -using Pad = mu::engraving::Pad; -using PitchMode = mu::engraving::UpDownMode; -using StyleId = mu::engraving::Sid; -using StyleIdSet = mu::engraving::StyleIdSet; using SymbolId = mu::engraving::SymId; using Key = mu::engraving::Key; using KeyMode = mu::engraving::KeyMode; using TimeSigType = mu::engraving::TimeSigType; using TimeSignature = mu::engraving::TimeSig; -using Part = mu::engraving::Part; -using SharedPart = mu::engraving::SharedPart; -using Staff = mu::engraving::Staff; using NoteHead = mu::engraving::NoteHead; -using SharpFlat = mu::engraving::PreferSharpFlat; using TransposeMode = mu::engraving::TransposeMode; using TransposeDirection = mu::engraving::TransposeDirection; using Fraction = mu::engraving::Fraction; -using ElementPattern = mu::engraving::ElementPattern; -using SelectionFilterTypesVariant = mu::engraving::SelectionFilterTypesVariant; using Chord = mu::engraving::Chord; using ChordRest = mu::engraving::ChordRest; -using Harmony = mu::engraving::Harmony; -using RealisedHarmony = mu::engraving::RealizedHarmony; using Articulation = mu::engraving::Articulation; using SlurSegment = mu::engraving::SlurSegment; using Rest = mu::engraving::Rest; using Stem = mu::engraving::Stem; using Hook = mu::engraving::Hook; using Fraction = mu::engraving::Fraction; -using NoteInputMethod = mu::engraving::NoteEntryMethod; -using NoteInputParams = mu::engraving::NoteInputParams; using AccidentalType = mu::engraving::AccidentalType; using OttavaType = mu::engraving::OttavaType; using HairpinType = mu::engraving::HairpinType; using TextBase = mu::engraving::TextBase; -using TupletNumberType = mu::engraving::TupletNumberType; -using TupletBracketType = mu::engraving::TupletBracketType; using GraceNoteType = mu::engraving::NoteType; using BeamMode = mu::engraving::BeamMode; using LayoutBreakType = mu::engraving::LayoutBreakType; using Interval = mu::engraving::Interval; -using Drumset = mu::engraving::Drumset; -using StringData = mu::engraving::StringData; -using Clef = mu::engraving::Clef; -using ClefType = mu::engraving::ClefType; -using ClefTypeList = mu::engraving::ClefTypeList; using BracketType = mu::engraving::BracketType; -using StaffGroup = mu::engraving::StaffGroup; -using StaffType = mu::engraving::StaffType; -using StaffTypeId = mu::engraving::StaffTypes; -using StaffLabel = mu::engraving::StaffLabel; -using InstrumentLabel = mu::engraving::InstrumentLabel; using Segment = mu::engraving::Segment; using TextStyleType = mu::engraving::TextStyleType; -using TraitType = mu::engraving::TraitType; -using HarmonyDurationType = mu::engraving::HDuration; -using Voicing = mu::engraving::Voicing; -using Instrument = mu::engraving::Instrument; -using InstrumentTemplate = mu::engraving::InstrumentTemplate; -using InstrumentTrait = mu::engraving::Trait; -using ScoreOrder = mu::engraving::ScoreOrder; -using InstrumentGenre = mu::engraving::InstrumentGenre; -using InstrumentGroup = mu::engraving::InstrumentGroup; using PageList = std::vector; -using PartList = std::vector; -using InstrumentTemplateList = std::vector; -using InstrumentGenreList = std::vector; -using ScoreOrderList = std::vector; -using InstrumentGroupList = std::vector; -using InstrumentTrackId = mu::engraving::InstrumentTrackId; -using InstrumentTrackIdSet = mu::engraving::InstrumentTrackIdSet; using voice_idx_t = mu::engraving::voice_idx_t; using track_idx_t = mu::engraving::track_idx_t; using staff_idx_t = mu::engraving::staff_idx_t; -using ScoreChanges = mu::engraving::ScoreChanges; using GuitarBendType = mu::engraving::GuitarBendType; -using engraving::LoopBoundaryType; using Pid = mu::engraving::Pid; using VoiceAssignment = mu::engraving::VoiceAssignment; -using MeasureBeat = mu::engraving::MeasureBeat; - -static const muse::String COMMON_GENRE_ID("common"); enum class DragMode : unsigned char { @@ -226,16 +162,6 @@ enum class NoteName : unsigned char B }; -using NoteVal = mu::engraving::NoteVal; -using NoteValList = mu::engraving::NoteValList; - -enum class NoteAddingMode : unsigned char -{ - CurrentChord, - NextChord, - InsertChord -}; - enum class PastingType : unsigned char { Default, Half, @@ -243,111 +169,6 @@ enum class PastingType : unsigned char { Special }; -using NoteInputState = mu::engraving::InputState; - -enum class NoteFilter : unsigned char -{ - All, - WithTie, - WithSlur -}; - -struct Tempo -{ - int valueBpm = 0; - DurationType duration = DurationType::V_QUARTER; - bool withDot = false; - - bool operator==(const Tempo& other) const - { - return valueBpm == other.valueBpm && duration == other.duration && withDot == other.withDot; - } -}; - -static constexpr int MAX_STAVES = 4; - -struct InstrumentKey -{ - muse::String instrumentId; - muse::ID partId; - Fraction tick = mu::engraving::Fraction(0, 1); -}; - -inline bool isMainInstrumentForPart(const InstrumentKey& instrumentKey, const Part* part) -{ - return instrumentKey.instrumentId == part->instrumentId() && instrumentKey.tick == Part::MAIN_INSTRUMENT_TICK; -} - -inline QString formatInstrumentTitle(const QString& instrumentName, const InstrumentTrait& trait) -{ - // Comments for translators start with //: - switch (trait.type) { - case TraitType::Tuning: - //: %1=tuning ("D"), %2=name ("Tin Whistle"). Example: "D Tin Whistle" - return muse::qtrc("notation", "%1 %2", "Tuned instrument displayed in the UI") - .arg(trait.name, instrumentName); - case TraitType::Transposition: - //: %1=name ("Horn"), %2=transposition ("C alto"). Example: "Horn in C alto" - return muse::qtrc("notation", "%1 in %2", "Transposing instrument displayed in the UI") - .arg(instrumentName, trait.name); - case TraitType::Course: - //: %1=name ("Tenor Lute"), %2=course/strings ("7-course"). Example: "Tenor Lute (7-course)" - return muse::qtrc("notation", "%1 (%2)", "String instrument displayed in the UI") - .arg(instrumentName, trait.name); - case TraitType::Unknown: - return instrumentName; // Example: "Flute" - } - Q_UNREACHABLE(); -} - -inline QString formatInstrumentTitle(const QString& instrumentName, const InstrumentTrait& trait, int instrumentNumber) -{ - if (instrumentNumber == 0) { - // Only one instance of this instrument in the score - return formatInstrumentTitle(instrumentName, trait); - } - - QString number = QString::number(instrumentNumber); - - // Comments for translators start with //: - switch (trait.type) { - case TraitType::Tuning: - //: %1=tuning ("D"), %2=name ("Tin Whistle"), %3=number ("2"). Example: "D Tin Whistle 2" - return muse::qtrc("notation", "%1 %2 %3", "One of several tuned instruments displayed in the UI") - .arg(trait.name, instrumentName, number); - case TraitType::Transposition: - //: %1=name ("Horn"), %2=transposition ("C alto"), %3=number ("2"). Example: "Horn in C alto 2" - return muse::qtrc("notation", "%1 in %2 %3", "One of several transposing instruments displayed in the UI") - .arg(instrumentName, trait.name, number); - case TraitType::Course: - //: %1=name ("Tenor Lute"), %2=course/strings ("7-course"), %3=number ("2"). Example: "Tenor Lute (7-course) 2" - return muse::qtrc("notation", "%1 (%2) %3", "One of several string instruments displayed in the UI") - .arg(instrumentName, trait.name, number); - case TraitType::Unknown: - //: %1=name ("Flute"), %2=number ("2"). Example: "Flute 2" - return muse::qtrc("notation", "%1 %2", "One of several instruments displayed in the UI") - .arg(instrumentName, number); - } - Q_UNREACHABLE(); -} - -struct PartInstrument -{ - muse::ID partId; - InstrumentTemplate instrumentTemplate; - - bool isExistingPart = false; - bool isSoloist = false; -}; - -using PartInstrumentList = QList; - -struct PartInstrumentListScoreOrder -{ - PartInstrumentList instruments; - ScoreOrder scoreOrder; -}; - struct FilterElementsOptions { ElementType elementType = ElementType::INVALID; @@ -380,37 +201,6 @@ struct FilterNotesOptions : FilterElementsOptions mu::engraving::NoteType noteType = mu::engraving::NoteType::INVALID; }; -struct StaffConfig -{ - bool visible = false; - engraving::Spatium userDistance = engraving::Spatium(0.0); - bool cutaway = false; - bool hideSystemBarline = false; - engraving::AutoOnOff mergeMatchingRests = engraving::AutoOnOff::AUTO; - bool reflectTranspositionInLinkedTab = false; - ClefTypeList clefTypeList; - engraving::StaffType staffType; - - bool operator==(const StaffConfig& conf) const - { - bool equal = visible == conf.visible; - equal &= userDistance == conf.userDistance; - equal &= cutaway == conf.cutaway; - equal &= hideSystemBarline == conf.hideSystemBarline; - equal &= mergeMatchingRests == conf.mergeMatchingRests; - equal &= clefTypeList == conf.clefTypeList; - equal &= staffType == conf.staffType; - equal &= reflectTranspositionInLinkedTab == conf.reflectTranspositionInLinkedTab; - - return equal; - } - - bool operator!=(const StaffConfig& conf) const - { - return !(*this == conf); - } -}; - struct TransposeOptions { TransposeMode mode = TransposeMode::UNKNOWN; @@ -422,42 +212,6 @@ struct TransposeOptions bool needTransposeDoubleSharpsFlats = false; }; -struct TupletOptions -{ - Fraction ratio = { -1, -1 }; - TupletNumberType numberType = TupletNumberType::SHOW_NUMBER; - TupletBracketType bracketType = TupletBracketType::AUTO_BRACKET; - bool autoBaseLen = false; -}; - -struct LoopBoundaries -{ - Fraction loopInTick; - Fraction loopOutTick; - bool enabled = false; - - bool isNull() const - { - return loopInTick.isZero() && loopOutTick.isZero(); - } - - bool operator==(const LoopBoundaries& boundaries) const - { - bool equals = true; - - equals &= loopInTick == boundaries.loopInTick; - equals &= loopOutTick == boundaries.loopOutTick; - equals &= enabled == boundaries.enabled; - - return equals; - } - - bool operator!=(const LoopBoundaries& boundaries) const - { - return !(*this == boundaries); - } -}; - enum class ScoreConfigType : unsigned char { ShowInvisibleElements, @@ -490,12 +244,6 @@ struct ScoreConfig } }; -inline QString staffTypeToString(StaffTypeId type) -{ - const StaffType* preset = StaffType::preset(type); - return preset ? preset->staffTypeName().toQString() : QString(); -} - enum class BracketsType : unsigned char { Brackets, @@ -503,34 +251,6 @@ enum class BracketsType : unsigned char Parentheses }; -struct ScoreCreateOptions -{ - bool withTempo = false; - Tempo tempo; - - Fraction globalTimesig; - TimeSigType timesigType = TimeSigType::NORMAL; - - Key key = Key::C; - - int totalMeasures = 0; - - bool withPickupMeasure = false; - Fraction pickupTimesig; - - PartInstrumentList parts; - ScoreOrder order; -}; - -inline const ScoreOrder& customOrder() -{ - static ScoreOrder order; - order.id = "custom"; - order.name = muse::TranslatableString("engraving/scoreorder", "Custom"); - - return order; -} - static constexpr int MIN_NOTES_INTERVAL = -10; static constexpr int MAX_NOTES_INTERVAL = 10; @@ -560,21 +280,6 @@ inline bool isVerticalBoxTextStyle(TextStyleType type) return muse::contains(types, type); } -struct StringTuningPreset -{ - std::string name; - std::vector value; - bool useFlats = false; -}; - -struct StringTuningsInfo -{ - size_t number = 0; - std::vector presets; -}; - -using InstrumentStringTuningsMap = std::map >; - static const mu::engraving::ElementTypeSet NOTE_REST_TYPES { mu::engraving::ElementType::NOTE, mu::engraving::ElementType::REST, diff --git a/src/notation/tests/mocks/notationinteractionmock.h b/src/notation/tests/mocks/notationinteractionmock.h index 8269962de6366..c6d92c423595f 100644 --- a/src/notation/tests/mocks/notationinteractionmock.h +++ b/src/notation/tests/mocks/notationinteractionmock.h @@ -42,9 +42,9 @@ class NotationInteractionMock : public INotationInteraction MOCK_METHOD(void, toggleVisible, (), (override)); MOCK_METHOD(void, setSelectionVisible, (bool), (override)); - MOCK_METHOD(EngravingItem*, hitElement, (const muse::PointF&, float), (const, override)); - MOCK_METHOD(std::vector, hitElements, (const muse::PointF&, float), (const, override)); - MOCK_METHOD(Staff*, hitStaff, (const muse::PointF&), (const, override)); + MOCK_METHOD(engraving::EngravingItem*, hitElement, (const muse::PointF&, float), (const, override)); + MOCK_METHOD(std::vector, hitElements, (const muse::PointF&, float), (const, override)); + MOCK_METHOD(engraving::Staff*, hitStaff, (const muse::PointF&), (const, override)); MOCK_METHOD(const HitElementContext&, hitElementContext, (), (const, override)); MOCK_METHOD(void, setHitElementContext, (const HitElementContext&), (override)); @@ -219,7 +219,7 @@ class NotationInteractionMock : public INotationInteraction MOCK_METHOD(void, explodeSelectedStaff, (), (override)); MOCK_METHOD(void, implodeSelectedStaff, (), (override)); - MOCK_METHOD(void, realizeSelectedChordSymbols, (bool, Voicing, HarmonyDurationType), (override)); + MOCK_METHOD(void, realizeSelectedChordSymbols, (bool, engraving::Voicing, engraving::HDuration), (override)); MOCK_METHOD(void, extendToNextNote, (), (override)); MOCK_METHOD(void, removeSelectedMeasures, (), (override)); MOCK_METHOD(void, removeSelectedRange, (), (override)); diff --git a/src/notation/tests/mocks/notationselectionrangemock.h b/src/notation/tests/mocks/notationselectionrangemock.h index 8bf8926f83837..7a8db9ac74715 100644 --- a/src/notation/tests/mocks/notationselectionrangemock.h +++ b/src/notation/tests/mocks/notationselectionrangemock.h @@ -19,8 +19,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_NOTATION_NOTATIONSELECTIONRANGEMOCK_H -#define MU_NOTATION_NOTATIONSELECTIONRANGEMOCK_H + +#pragma once #include @@ -32,15 +32,15 @@ class NotationSelectionRangeMock : public INotationSelectionRange public: MOCK_METHOD(engraving::staff_idx_t, startStaffIndex, (), (const, override)); MOCK_METHOD(engraving::Segment*, rangeStartSegment, (), (const, override)); - MOCK_METHOD(Fraction, startTick, (), (const, override)); + MOCK_METHOD(engraving::Fraction, startTick, (), (const, override)); MOCK_METHOD(engraving::staff_idx_t, endStaffIndex, (), (const, override)); MOCK_METHOD(engraving::Segment*, rangeEndSegment, (), (const, override)); - MOCK_METHOD(Fraction, endTick, (), (const, override)); + MOCK_METHOD(engraving::Fraction, endTick, (), (const, override)); MOCK_METHOD(MeasureRange, measureRange, (), (const, override)); - MOCK_METHOD(std::vector, selectedParts, (), (const, override)); + MOCK_METHOD(std::vector, selectedParts, (), (const, override)); MOCK_METHOD(std::vector, boundingArea, (), (const, override)); MOCK_METHOD(bool, containsPoint, (const muse::PointF&), (const, override)); @@ -49,5 +49,3 @@ class NotationSelectionRangeMock : public INotationSelectionRange MOCK_METHOD(bool, containsMultiNoteChords, (), (const, override)); }; } - -#endif // MU_NOTATION_NOTATIONSELECTIONRANGEMOCK_H diff --git a/src/notation/types/instrumentstypes.h b/src/notation/types/instrumentstypes.h new file mode 100644 index 0000000000000..3b8d6f0eceeb5 --- /dev/null +++ b/src/notation/types/instrumentstypes.h @@ -0,0 +1,148 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "types/id.h" + +#include "engraving/dom/instrtemplate.h" +#include "engraving/dom/instrument.h" +#include "engraving/dom/part.h" +#include "engraving/dom/scoreorder.h" +#include "engraving/types/types.h" + +namespace mu::notation { +static constexpr int MAX_STAVES = 4; + +using Instrument = mu::engraving::Instrument; +using InstrumentTemplate = mu::engraving::InstrumentTemplate; +using InstrumentTrait = mu::engraving::Trait; +using TraitType = mu::engraving::TraitType; +using ScoreOrder = mu::engraving::ScoreOrder; +using InstrumentGenre = mu::engraving::InstrumentGenre; +using InstrumentGroup = mu::engraving::InstrumentGroup; + +using Drumset = mu::engraving::Drumset; +using StringData = mu::engraving::StringData; + +using SharpFlat = mu::engraving::PreferSharpFlat; + +using InstrumentTemplateList = std::vector; +using InstrumentGenreList = std::vector; +using ScoreOrderList = std::vector; +using InstrumentGroupList = std::vector; +using InstrumentTrackId = mu::engraving::InstrumentTrackId; +using InstrumentTrackIdSet = mu::engraving::InstrumentTrackIdSet; + +static const muse::String COMMON_GENRE_ID(u"common"); + +struct InstrumentKey +{ + muse::String instrumentId; + muse::ID partId; + engraving::Fraction tick = engraving::Fraction(0, 1); +}; + +inline bool isMainInstrumentForPart(const InstrumentKey& instrumentKey, const engraving::Part* part) +{ + return instrumentKey.instrumentId == part->instrumentId() && instrumentKey.tick == engraving::Part::MAIN_INSTRUMENT_TICK; +} + +inline QString formatInstrumentTitle(const QString& instrumentName, const InstrumentTrait& trait) +{ + // Comments for translators start with //: + switch (trait.type) { + case TraitType::Tuning: + //: %1=tuning ("D"), %2=name ("Tin Whistle"). Example: "D Tin Whistle" + return muse::qtrc("notation", "%1 %2", "Tuned instrument displayed in the UI") + .arg(trait.name, instrumentName); + case TraitType::Transposition: + //: %1=name ("Horn"), %2=transposition ("C alto"). Example: "Horn in C alto" + return muse::qtrc("notation", "%1 in %2", "Transposing instrument displayed in the UI") + .arg(instrumentName, trait.name); + case TraitType::Course: + //: %1=name ("Tenor Lute"), %2=course/strings ("7-course"). Example: "Tenor Lute (7-course)" + return muse::qtrc("notation", "%1 (%2)", "String instrument displayed in the UI") + .arg(instrumentName, trait.name); + case TraitType::Unknown: + return instrumentName; // Example: "Flute" + } + Q_UNREACHABLE(); +} + +inline QString formatInstrumentTitle(const QString& instrumentName, const InstrumentTrait& trait, int instrumentNumber) +{ + if (instrumentNumber == 0) { + // Only one instance of this instrument in the score + return formatInstrumentTitle(instrumentName, trait); + } + + QString number = QString::number(instrumentNumber); + + // Comments for translators start with //: + switch (trait.type) { + case TraitType::Tuning: + //: %1=tuning ("D"), %2=name ("Tin Whistle"), %3=number ("2"). Example: "D Tin Whistle 2" + return muse::qtrc("notation", "%1 %2 %3", "One of several tuned instruments displayed in the UI") + .arg(trait.name, instrumentName, number); + case TraitType::Transposition: + //: %1=name ("Horn"), %2=transposition ("C alto"), %3=number ("2"). Example: "Horn in C alto 2" + return muse::qtrc("notation", "%1 in %2 %3", "One of several transposing instruments displayed in the UI") + .arg(instrumentName, trait.name, number); + case TraitType::Course: + //: %1=name ("Tenor Lute"), %2=course/strings ("7-course"), %3=number ("2"). Example: "Tenor Lute (7-course) 2" + return muse::qtrc("notation", "%1 (%2) %3", "One of several string instruments displayed in the UI") + .arg(instrumentName, trait.name, number); + case TraitType::Unknown: + //: %1=name ("Flute"), %2=number ("2"). Example: "Flute 2" + return muse::qtrc("notation", "%1 %2", "One of several instruments displayed in the UI") + .arg(instrumentName, number); + } + Q_UNREACHABLE(); +} + +struct PartInstrument +{ + muse::ID partId; + InstrumentTemplate instrumentTemplate; + + bool isExistingPart = false; + bool isSoloist = false; +}; + +using PartInstrumentList = QList; + +struct PartInstrumentListScoreOrder +{ + PartInstrumentList instruments; + ScoreOrder scoreOrder; +}; + +inline const ScoreOrder& customOrder() +{ + static ScoreOrder order; + order.id = "custom"; + order.name = muse::TranslatableString("engraving/scoreorder", "Custom"); + + return order; +} +} diff --git a/src/notation/types/loopboundaries.h b/src/notation/types/loopboundaries.h new file mode 100644 index 0000000000000..7df2d4bd68a6c --- /dev/null +++ b/src/notation/types/loopboundaries.h @@ -0,0 +1,58 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "engraving/dom/score.h" +#include "engraving/types/fraction.h" + +namespace mu::notation { +using engraving::LoopBoundaryType; + +struct LoopBoundaries +{ + engraving::Fraction loopInTick; + engraving::Fraction loopOutTick; + bool enabled = false; + + bool isNull() const + { + return loopInTick.isZero() && loopOutTick.isZero(); + } + + bool operator==(const LoopBoundaries& boundaries) const + { + bool equals = true; + + equals &= loopInTick == boundaries.loopInTick; + equals &= loopOutTick == boundaries.loopOutTick; + equals &= enabled == boundaries.enabled; + + return equals; + } + + bool operator!=(const LoopBoundaries& boundaries) const + { + return !(*this == boundaries); + } +}; +} diff --git a/src/notation/types/noteinputtypes.h b/src/notation/types/noteinputtypes.h new file mode 100644 index 0000000000000..0fce789d94a6b --- /dev/null +++ b/src/notation/types/noteinputtypes.h @@ -0,0 +1,55 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "engraving/dom/input.h" +#include "engraving/dom/noteval.h" +#include "engraving/dom/tuplet.h" +#include "engraving/editing/editnote.h" +#include "engraving/editing/noteinput.h" + +namespace mu::notation { +using NoteInputState = mu::engraving::InputState; +using NoteInputMethod = mu::engraving::NoteEntryMethod; +using NoteInputParams = mu::engraving::NoteInputParams; +using Pad = mu::engraving::Pad; +using PitchMode = mu::engraving::UpDownMode; + +using NoteVal = mu::engraving::NoteVal; +using NoteValList = mu::engraving::NoteValList; + +enum class NoteAddingMode : unsigned char +{ + CurrentChord, + NextChord, + InsertChord +}; + +struct TupletOptions +{ + engraving::Fraction ratio = { -1, -1 }; + engraving::TupletNumberType numberType = engraving::TupletNumberType::SHOW_NUMBER; + engraving::TupletBracketType bracketType = engraving::TupletBracketType::AUTO_BRACKET; + bool autoBaseLen = false; +}; +} diff --git a/src/notation/types/propertystyletypes.h b/src/notation/types/propertystyletypes.h new file mode 100644 index 0000000000000..3ef2b05b4ed31 --- /dev/null +++ b/src/notation/types/propertystyletypes.h @@ -0,0 +1,33 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "engraving/style/styledef.h" +#include "engraving/types/propertyvalue.h" + +namespace mu::notation { +using engraving::PropertyValue; + +using engraving::StyleId; +using engraving::StyleIdSet; +} diff --git a/src/notation/types/scorecreateoptions.h b/src/notation/types/scorecreateoptions.h new file mode 100644 index 0000000000000..78b68b1cfe9d4 --- /dev/null +++ b/src/notation/types/scorecreateoptions.h @@ -0,0 +1,50 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "engraving/dom/timesig.h" +#include "engraving/types/types.h" + +#include "instrumentstypes.h" +#include "tempo.h" + +namespace mu::notation { +struct ScoreCreateOptions +{ + bool withTempo = false; + Tempo tempo; + + engraving::Fraction globalTimesig; + engraving::TimeSigType timesigType = engraving::TimeSigType::NORMAL; + + engraving::Key key = engraving::Key::C; + + int totalMeasures = 0; + + bool withPickupMeasure = false; + engraving::Fraction pickupTimesig; + + PartInstrumentList parts; + engraving::ScoreOrder order; +}; +} diff --git a/src/notation/types/staffparttypes.h b/src/notation/types/staffparttypes.h new file mode 100644 index 0000000000000..ec546ccdb2f7f --- /dev/null +++ b/src/notation/types/staffparttypes.h @@ -0,0 +1,72 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "engraving/dom/part.h" +#include "engraving/dom/staff.h" + +namespace mu::notation { +using Part = mu::engraving::Part; +using SharedPart = mu::engraving::SharedPart; +using Staff = mu::engraving::Staff; +using StaffGroup = mu::engraving::StaffGroup; +using StaffType = mu::engraving::StaffType; +using StaffTypeId = mu::engraving::StaffTypes; + +struct StaffConfig +{ + bool visible = false; + engraving::Spatium userDistance = engraving::Spatium(0.0); + bool cutaway = false; + bool hideSystemBarline = false; + engraving::AutoOnOff mergeMatchingRests = engraving::AutoOnOff::AUTO; + bool reflectTranspositionInLinkedTab = false; + engraving::ClefTypeList clefTypeList; + engraving::StaffType staffType; + + bool operator==(const StaffConfig& conf) const + { + bool equal = visible == conf.visible; + equal &= userDistance == conf.userDistance; + equal &= cutaway == conf.cutaway; + equal &= hideSystemBarline == conf.hideSystemBarline; + equal &= mergeMatchingRests == conf.mergeMatchingRests; + equal &= clefTypeList == conf.clefTypeList; + equal &= staffType == conf.staffType; + equal &= reflectTranspositionInLinkedTab == conf.reflectTranspositionInLinkedTab; + + return equal; + } + + bool operator!=(const StaffConfig& conf) const + { + return !(*this == conf); + } +}; + +inline QString staffTypeToString(StaffTypeId type) +{ + const StaffType* preset = StaffType::preset(type); + return preset ? preset->staffTypeName().toQString() : QString(); +} +} diff --git a/src/notation/types/stringtunings.h b/src/notation/types/stringtunings.h new file mode 100644 index 0000000000000..e78389f622bf6 --- /dev/null +++ b/src/notation/types/stringtunings.h @@ -0,0 +1,40 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +namespace mu::notation { +struct StringTuningPreset +{ + std::string name; + std::vector value; + bool useFlats = false; +}; + +struct StringTuningsInfo +{ + size_t number = 0; + std::vector presets; +}; + +using InstrumentStringTuningsMap = std::map >; +} diff --git a/src/notation/types/tempo.h b/src/notation/types/tempo.h new file mode 100644 index 0000000000000..b2386fb5c6261 --- /dev/null +++ b/src/notation/types/tempo.h @@ -0,0 +1,39 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "engraving/types/types.h" + +namespace mu::notation { +struct Tempo +{ + int valueBpm = 0; + engraving::DurationType duration = engraving::DurationType::V_QUARTER; + bool withDot = false; + + bool operator==(const Tempo& other) const + { + return valueBpm == other.valueBpm && duration == other.duration && withDot == other.withDot; + } +}; +} diff --git a/src/notationscene/inotationcommandscontroller.h b/src/notationscene/inotationcommandscontroller.h index 126de8be2d6c3..b5134157af20e 100644 --- a/src/notationscene/inotationcommandscontroller.h +++ b/src/notationscene/inotationcommandscontroller.h @@ -26,7 +26,7 @@ #include "global/async/channel.h" #include "global/async/notification.h" -#include "notation/notationtypes.h" +#include "notation/types/noteinputtypes.h" namespace mu::notation { class INotationCommandsController : MODULE_CONTEXT_INTERFACE @@ -54,11 +54,11 @@ class INotationCommandsController : MODULE_CONTEXT_INTERFACE virtual muse::async::Notification noteInputStateChanged() const = 0; virtual bool isNoteInputMode() const = 0; virtual NoteInputMethod noteInputMethod() const = 0; - virtual DurationType currentDurationType() const = 0; + virtual engraving::DurationType currentDurationType() const = 0; virtual int currentDotCount() const = 0; virtual bool currentIsRest() const = 0; - virtual AccidentalType currentAccidentalType() const = 0; - virtual std::set currentArticulations() const = 0; - virtual voice_idx_t currentVoice() const = 0; + virtual engraving::AccidentalType currentAccidentalType() const = 0; + virtual std::set currentArticulations() const = 0; + virtual engraving::voice_idx_t currentVoice() const = 0; }; } diff --git a/src/notationscene/internal/notationactioncontroller.cpp b/src/notationscene/internal/notationactioncontroller.cpp index 19b59d361cb10..57106f4ea9280 100644 --- a/src/notationscene/internal/notationactioncontroller.cpp +++ b/src/notationscene/internal/notationactioncontroller.cpp @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "notationactioncontroller.h" #include @@ -26,6 +27,7 @@ #include "global/io/file.h" #include "global/translation.h" +#include "engraving/dom/harmony.h" #include "engraving/dom/masterscore.h" #include "engraving/dom/note.h" #include "engraving/dom/chord.h" @@ -1384,9 +1386,9 @@ void NotationActionController::putTuplet(int tupletCount) // get the bracket type from score style settings if (INotationStylePtr style = currentNotationStyle()) { int bracketType = style->styleValue(StyleId::tupletBracketType).toInt(); - options.bracketType = static_cast(bracketType); + options.bracketType = static_cast(bracketType); int numberType = style->styleValue(StyleId::tupletNumberType).toInt(); - options.numberType = static_cast(numberType); + options.numberType = static_cast(numberType); } putTuplet(options); @@ -1505,7 +1507,7 @@ muse::Ret NotationActionController::moveWithRet(MoveDirection direction, bool qu case MoveDirection::Right: case MoveDirection::Left: if (globalContext()->playbackState()->isPlaying()) { - MeasureBeat beat = playbackController()->currentBeat(); + engraving::MeasureBeat beat = playbackController()->currentBeat(); int targetBeatIdx = static_cast(beat.beat); int targetMeasureIdx = beat.measureIndex; int increment = (direction == MoveDirection::Right ? 1 : -1); @@ -2436,7 +2438,7 @@ void NotationActionController::navigateToTextElement(MoveDirection direction, bo if (element->isLyrics()) { currentNotationInteraction()->navigateToLyrics(direction, moveOnly); } else if (element->isHarmony()) { - const Harmony* chordSymbol = editedChordSymbol(); + const engraving::Harmony* chordSymbol = editedChordSymbol(); // otherwise, chord symbol will be deleted when navigating away from it const bool canPlay = chordSymbol && !chordSymbol->harmonyName().empty(); @@ -2461,7 +2463,7 @@ void NotationActionController::navigateToTextElementByFraction(const Fraction& f } if (element->isHarmony()) { - const Harmony* chordSymbol = editedChordSymbol(); + const engraving::Harmony* chordSymbol = editedChordSymbol(); // otherwise, chord symbol will be deleted when navigating away from it const bool canPlay = chordSymbol && !chordSymbol->harmonyName().empty(); @@ -2484,7 +2486,7 @@ void NotationActionController::navigateToTextElementInNearMeasure(MoveDirection } if (element->isHarmony()) { - const Harmony* chordSymbol = editedChordSymbol(); + const engraving::Harmony* chordSymbol = editedChordSymbol(); // otherwise, chord symbol will be deleted when navigating away from it const bool canPlay = chordSymbol && !chordSymbol->harmonyName().empty(); diff --git a/src/notationscene/internal/notationactioncontroller.h b/src/notationscene/internal/notationactioncontroller.h index 7e721d9a8724e..cc98ea28c2687 100644 --- a/src/notationscene/internal/notationactioncontroller.h +++ b/src/notationscene/internal/notationactioncontroller.h @@ -41,7 +41,8 @@ #include "engraving/iengravingconfiguration.h" #include "notation/inotationconfiguration.h" -#include "notation/inotation.h" +#include "notation/inotation_fwd.h" +#include "notation/notationtypes.h" namespace mu::notation { class NotationActionController : public INotationCommandsController, public muse::actions::Actionable, public muse::rcommand::Commandable, @@ -87,12 +88,12 @@ class NotationActionController : public INotationCommandsController, public muse muse::async::Notification noteInputStateChanged() const override; bool isNoteInputMode() const override; NoteInputMethod noteInputMethod() const override; - DurationType currentDurationType() const override; + engraving::DurationType currentDurationType() const override; int currentDotCount() const override; bool currentIsRest() const override; - AccidentalType currentAccidentalType() const override; - std::set currentArticulations() const override; - voice_idx_t currentVoice() const override; + engraving::AccidentalType currentAccidentalType() const override; + std::set currentArticulations() const override; + engraving::voice_idx_t currentVoice() const override; muse::async::Notification currentNotationChanged() const; @@ -128,7 +129,7 @@ class NotationActionController : public INotationCommandsController, public muse void halveNoteInputDuration(); void realtimeAdvance(); - void toggleAccidental(AccidentalType type); + void toggleAccidental(engraving::AccidentalType type); void toggleArticulation(SymbolId articulationSymbolId); void putTuplet(const muse::actions::ActionData& data); diff --git a/src/notationscene/internal/notationcommandsstate.cpp b/src/notationscene/internal/notationcommandsstate.cpp index 79e7289ae4e9d..f48be3f810494 100644 --- a/src/notationscene/internal/notationcommandsstate.cpp +++ b/src/notationscene/internal/notationcommandsstate.cpp @@ -28,6 +28,7 @@ using namespace muse; using namespace muse::rcommand; using namespace mu::notation; +using namespace mu::engraving; static const muse::Uri PROJECT_PAGE_URI("musescore://notation"); @@ -109,11 +110,11 @@ static const std::vector ADD_COMMANDS = { ADD_LV_COMMAND }; -static const std::map ADD_ARTICULATION_COMMANDS = { - { ADD_MARCATO_COMMAND, SymbolId::articMarcatoAbove }, - { ADD_SFORZATO_COMMAND, SymbolId::articAccentAbove }, - { ADD_TENUTO_COMMAND, SymbolId::articTenutoAbove }, - { ADD_STACCATO_COMMAND, SymbolId::articStaccatoAbove } +static const std::map ADD_ARTICULATION_COMMANDS = { + { ADD_MARCATO_COMMAND, SymId::articMarcatoAbove }, + { ADD_SFORZATO_COMMAND, SymId::articAccentAbove }, + { ADD_TENUTO_COMMAND, SymId::articTenutoAbove }, + { ADD_STACCATO_COMMAND, SymId::articStaccatoAbove } }; static const std::map VOICE_COMMANDS = { diff --git a/src/notationscene/iselectinstrumentscenario.h b/src/notationscene/iselectinstrumentscenario.h index dbd9cec6af370..498f5130d53aa 100644 --- a/src/notationscene/iselectinstrumentscenario.h +++ b/src/notationscene/iselectinstrumentscenario.h @@ -19,12 +19,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_NOTATION_ISELECTINSTRUMENTSSCENARIO_H -#define MU_NOTATION_ISELECTINSTRUMENTSSCENARIO_H +#pragma once + +#include "async/promise.h" #include "modularity/imoduleinterface.h" -#include "notation/notationtypes.h" -#include "global/async/promise.h" + +#include "notation/types/instrumentstypes.h" namespace mu::notation { class ISelectInstrumentsScenario : MODULE_CONTEXT_INTERFACE @@ -39,5 +40,3 @@ class ISelectInstrumentsScenario : MODULE_CONTEXT_INTERFACE const InstrumentKey& currentInstrumentKey = InstrumentKey()) const = 0; }; } - -#endif // MU_NOTATION_ISELECTINSTRUMENTSSCENARIO_H diff --git a/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.cpp index e29b6e551f0af..dfc9353a3ab5f 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.cpp @@ -23,6 +23,7 @@ #include "abstractelementpopupmodel.h" #include "engraving/dom/property.h" +#include "engraving/dom/score.h" #include "notation/inotationinteraction.h" #include "notation/inotationselection.h" @@ -202,7 +203,7 @@ INotationPtr AbstractElementPopupModel::currentNotation() const return globalContext()->currentNotation(); } -void AbstractElementPopupModel::changeItemProperty(mu::engraving::Pid id, const PropertyValue& value) +void AbstractElementPopupModel::changeItemProperty(mu::engraving::Pid id, const engraving::PropertyValue& value) { IF_ASSERT_FAILED(m_item) { return; @@ -219,7 +220,8 @@ void AbstractElementPopupModel::changeItemProperty(mu::engraving::Pid id, const updateNotation(); } -void AbstractElementPopupModel::changeItemProperty(mu::engraving::Pid id, const PropertyValue& value, mu::engraving::PropertyFlags flags) +void AbstractElementPopupModel::changeItemProperty(mu::engraving::Pid id, const engraving::PropertyValue& value, + mu::engraving::PropertyFlags flags) { IF_ASSERT_FAILED(m_item) { return; @@ -259,7 +261,7 @@ void AbstractElementPopupModel::init() m_item = selection->element(); - undoStack->changesChannel().onReceive(this, [this] (const ScoreChanges& changes) { + undoStack->changesChannel().onReceive(this, [this] (const engraving::ScoreChanges& changes) { if (ignoreTextEditingChanges() && changes.isTextEditing) { return; } diff --git a/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.h b/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.h index a441ac6424926..9c8db2cd39ebc 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/abstractelementpopupmodel.h @@ -92,10 +92,10 @@ class AbstractElementPopupModel : public QObject, public muse::Contextable, publ notation::INotationPtr currentNotation() const; INotationInteractionPtr interaction() const; - void changeItemProperty(engraving::Pid id, const PropertyValue& value); - void changeItemProperty(engraving::Pid id, const PropertyValue& value, engraving::PropertyFlags flags); + void changeItemProperty(engraving::Pid id, const engraving::PropertyValue& value); + void changeItemProperty(engraving::Pid id, const engraving::PropertyValue& value, engraving::PropertyFlags flags); - EngravingItem* m_item = nullptr; + engraving::EngravingItem* m_item = nullptr; QRect m_itemRect; private: diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/caposettingsmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/caposettingsmodel.cpp index 127a3a0eb14c5..13f6486eedf54 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/caposettingsmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/caposettingsmodel.cpp @@ -23,6 +23,9 @@ #include "caposettingsmodel.h" #include "engraving/dom/capo.h" +#include "engraving/dom/part.h" +#include "engraving/dom/staff.h" +#include "engraving/dom/stringdata.h" using namespace mu::notation; diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.cpp index 4858ef825173c..59926348cc013 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.cpp @@ -24,6 +24,7 @@ #include "engraving/dom/dynamic.h" #include "engraving/dom/factory.h" +#include "engraving/dom/score.h" #include "engraving/editing/edithairpin.h" #include "engraving/editing/transaction/transaction.h" #include "engraving/types/symnames.h" diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.h b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.h index 8455ce1bb4a4a..d5638bffa04e4 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/dynamicpopupmodel.h @@ -27,6 +27,8 @@ #include #include +#include "engraving/iengravingfont.h" + #include "../abstractelementpopupmodel.h" namespace mu::notation { diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/harppedalpopupmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/harppedalpopupmodel.cpp index e561760c4e9e6..a496cf915af3b 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/harppedalpopupmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/harppedalpopupmodel.cpp @@ -21,10 +21,12 @@ */ #include "harppedalpopupmodel.h" -#include "engraving/dom/stafflines.h" -#include "log.h" +#include "engraving/dom/measure.h" +#include "engraving/dom/part.h" +#include "engraving/dom/stafflines.h" +using namespace mu::engraving; using namespace mu::notation; HarpPedalPopupModel::HarpPedalPopupModel(QObject* parent) diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.cpp index 77efbafe96931..06cf53a654ab2 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.cpp @@ -23,6 +23,7 @@ #include "partialtiepopupmodel.h" #include "engraving/dom/partialtie.h" +#include "engraving/dom/score.h" #include "engraving/dom/tie.h" #include "notation/inotationinteraction.h" // IWYU pragma: keep diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.h b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.h index 25b523b4cbcd5..a3664b74d3a29 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/partialtiepopupmodel.h @@ -29,6 +29,7 @@ #include "../abstractelementpopupmodel.h" namespace mu::engraving { +class EngravingItem; class Tie; class TieJumpPoint; } @@ -48,7 +49,7 @@ class PartialTiePopupModel : public AbstractElementPopupModel QVariantList items() const; bool tieDirection() const; - static bool canOpen(const EngravingItem* element); + static bool canOpen(const engraving::EngravingItem* element); QPointF dialogPosition() const; Q_INVOKABLE void init() override; diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.cpp index 7b5cdd3bd7737..49e11c9e4fd23 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.cpp @@ -23,12 +23,14 @@ #include "percussionnotepopupcontentmodel.h" #include "engraving/dom/drumset.h" +#include "engraving/dom/part.h" #include "engraving/dom/shadownote.h" #include "notation/inotationinteraction.h" #include "notation/inotationnoteinput.h" using namespace mu::notation; +using namespace mu::engraving; PercussionNotePopupContentModel::PercussionNotePopupContentModel(QObject* parent) : QObject{parent}, muse::Contextable(muse::iocCtxForQmlObject(this)) @@ -47,7 +49,7 @@ void PercussionNotePopupContentModel::init() void PercussionNotePopupContentModel::prevDrumNote() { const Drumset* ds = currentDrumset(); - const mu::engraving::ShadowNote* shadowNote = currentShadowNote(); + const ShadowNote* shadowNote = currentShadowNote(); IF_ASSERT_FAILED(ds && shadowNote) { return; } @@ -77,7 +79,7 @@ void PercussionNotePopupContentModel::prevDrumNote() void PercussionNotePopupContentModel::nextDrumNote() { const Drumset* ds = currentDrumset(); - const mu::engraving::ShadowNote* shadowNote = currentShadowNote(); + const ShadowNote* shadowNote = currentShadowNote(); IF_ASSERT_FAILED(ds && shadowNote) { return; } @@ -161,14 +163,14 @@ INotationNoteInputPtr PercussionNotePopupContentModel::noteInput() const return interaction() ? interaction()->noteInput() : nullptr; } -const mu::engraving::ShadowNote* PercussionNotePopupContentModel::currentShadowNote() const +const ShadowNote* PercussionNotePopupContentModel::currentShadowNote() const { return interaction() ? interaction()->shadowNote() : nullptr; } const Drumset* PercussionNotePopupContentModel::currentDrumset() const { - const mu::engraving::ShadowNote* shadowNote = currentShadowNote(); + const ShadowNote* shadowNote = currentShadowNote(); if (!shadowNote) { return nullptr; } @@ -185,7 +187,7 @@ const Drumset* PercussionNotePopupContentModel::currentDrumset() const int PercussionNotePopupContentModel::currentDrumPitch() const { const Drumset* ds = currentDrumset(); - const mu::engraving::ShadowNote* shadowNote = currentShadowNote(); + const ShadowNote* shadowNote = currentShadowNote(); if (!noteInput() || !ds || !shadowNote) { return -1; } diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.h b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.h index 3de6350b27d27..aa09b29194ad7 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/percussionnotepopupcontentmodel.h @@ -30,6 +30,11 @@ #include "async/asyncable.h" +namespace mu::engraving { +class Drumset; +class ShadowNote; +} + namespace mu::notation { class PercussionNotePopupContentModel : public QObject, public muse::Contextable, public muse::async::Asyncable { @@ -63,8 +68,8 @@ class PercussionNotePopupContentModel : public QObject, public muse::Contextable INotationInteractionPtr interaction() const; INotationNoteInputPtr noteInput() const; - const mu::engraving::ShadowNote* currentShadowNote() const; - const Drumset* currentDrumset() const; + const engraving::ShadowNote* currentShadowNote() const; + const engraving::Drumset* currentDrumset() const; int currentDrumPitch() const; }; diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.cpp index 0e34ff951b6ec..10009f6e47433 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.cpp @@ -23,6 +23,7 @@ #include "shadownotepopupmodel.h" #include "engraving/dom/shadownote.h" +#include "engraving/dom/staff.h" #include "notation/inotationinteraction.h" // IWYU pragma: keep diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.h b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.h index e034c831c5ac6..c09dc6fa0f361 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/shadownotepopupmodel.h @@ -27,6 +27,10 @@ #include "../abstractelementpopupmodel.h" +namespace mu::engraving { +class EngravingItem; +} + namespace mu::notation { namespace ShadowNotePopupContent { Q_NAMESPACE; @@ -52,7 +56,7 @@ class ShadowNotePopupModel : public AbstractElementPopupModel public: explicit ShadowNotePopupModel(QObject* parent = nullptr); - static bool canOpen(const EngravingItem* shadowNote); + static bool canOpen(const engraving::EngravingItem* shadowNote); Q_INVOKABLE void init() override; diff --git a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/staffvisibilitypopupmodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/staffvisibilitypopupmodel.cpp index acfe8fd241a21..ba5a7c034d34d 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/elementpopups/staffvisibilitypopupmodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/elementpopups/staffvisibilitypopupmodel.cpp @@ -30,6 +30,8 @@ #include "containers.h" #include "engraving/dom/measure.h" +#include "engraving/dom/part.h" +#include "engraving/dom/score.h" #include "engraving/dom/staff.h" #include "engraving/dom/staffvisibilityindicator.h" #include "engraving/dom/system.h" @@ -43,6 +45,7 @@ #include "log.h" using namespace mu::notation; +using namespace mu::engraving; using mu::engraving::rendering::score::SystemLayout; StaffVisibilityPopupModel::StaffVisibilityPopupModel(QObject* parent) @@ -103,7 +106,7 @@ EmptyStavesVisibilityModel::EmptyStavesVisibilityModel(QObject* parent) EmptyStavesVisibilityModel::~EmptyStavesVisibilityModel() = default; -void EmptyStavesVisibilityModel::load(INotationPtr notation, engraving::System* system) +void EmptyStavesVisibilityModel::load(INotationPtr notation, System* system) { m_notation = notation; m_system = system; @@ -113,7 +116,7 @@ void EmptyStavesVisibilityModel::load(INotationPtr notation, engraving::System* void EmptyStavesVisibilityModel::reload() { - engraving::Fraction tick = m_system->tick(); + Fraction tick = m_system->tick(); assert(m_system && m_system->staves().size() == m_system->score()->nstaves()); diff --git a/src/notationscene/qml/MuseScore/NotationScene/loopmarker.cpp b/src/notationscene/qml/MuseScore/NotationScene/loopmarker.cpp index a1189754e49fd..8e8f78167cbe9 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/loopmarker.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/loopmarker.cpp @@ -25,14 +25,17 @@ #include "draw/painter.h" #include "draw/types/pen.h" +#include "engraving/dom/staff.h" #include "engraving/iengravingfont.h" +#include "notation/inotation.h" #include "notation/inotationelements.h" // IWYU pragma: keep #include "notation/inotationstyle.h" // IWYU pragma: keep using namespace muse; using namespace mu; using namespace mu::notation; +using namespace mu::engraving; LoopMarker::LoopMarker(LoopBoundaryType type, const modularity::ContextPtr& iocCtx) : muse::Contextable(iocCtx), m_type(type) diff --git a/src/notationscene/qml/MuseScore/NotationScene/loopmarker.h b/src/notationscene/qml/MuseScore/NotationScene/loopmarker.h index 8153f59fa8a95..793d37716549c 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/loopmarker.h +++ b/src/notationscene/qml/MuseScore/NotationScene/loopmarker.h @@ -20,14 +20,15 @@ * along with this program. If not, see . */ - #pragma once +#pragma once -#include "notation/inotationconfiguration.h" -#include "modularity/ioc.h" +#include "draw/types/geometry.h" -#include "notation/inotation.h" +#include "engraving/dom/score.h" -#include "draw/types/geometry.h" +#include "modularity/ioc.h" +#include "notation/inotationconfiguration.h" +#include "notation/inotation_fwd.h" namespace mu::notation { class LoopMarker : public muse::Contextable @@ -35,7 +36,7 @@ class LoopMarker : public muse::Contextable muse::GlobalInject configuration; public: - LoopMarker(LoopBoundaryType type, const muse::modularity::ContextPtr& iocCtx); + LoopMarker(engraving::LoopBoundaryType type, const muse::modularity::ContextPtr& iocCtx); void setNotation(INotationPtr notation); void setVisible(bool visible); @@ -47,7 +48,7 @@ class LoopMarker : public muse::Contextable private: muse::RectF resolveMarkerRectByTick(engraving::Fraction tick) const; - LoopBoundaryType m_type = LoopBoundaryType::Unknown; + engraving::LoopBoundaryType m_type = engraving::LoopBoundaryType::Unknown; muse::RectF m_rect; bool m_visible = false; INotationPtr m_notation; diff --git a/src/notationscene/qml/MuseScore/NotationScene/notationautomationcontroller.cpp b/src/notationscene/qml/MuseScore/NotationScene/notationautomationcontroller.cpp index f2002b0c97840..75c6a162dcdca 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/notationautomationcontroller.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/notationautomationcontroller.cpp @@ -26,6 +26,7 @@ #include "engraving/automation/iautomation.h" #include "engraving/dom/masterscore.h" +#include "engraving/dom/staff.h" #include "notation/inotationautomation.h" #include "notation/inotationelements.h" @@ -33,6 +34,7 @@ #include "defer.h" using namespace mu::notation; +using namespace mu::engraving; using namespace muse::uicomponents; static bool polylinePointIndexIsValid(const PolylinePlot* polyline, int pointIdx) diff --git a/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.cpp index 88f80a2a350a9..5d781a1acb300 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.cpp @@ -26,13 +26,16 @@ #include "ui/view/iconcodes.h" -#include "widgets/editstyleutils.h" - -#include "engraving/dom/gradualtempochange.h" #include "engraving/dom/fret.h" +#include "engraving/dom/gradualtempochange.h" +#include "engraving/dom/harmony.h" +#include "engraving/dom/part.h" +#include "engraving/dom/staff.h" #include "notation/inotationselection.h" +#include "widgets/editstyleutils.h" + using namespace mu::notation; using namespace muse; using namespace muse::uicomponents; diff --git a/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.h b/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.h index 0e86c8763849a..60e482e06d582 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/notationcontextmenumodel.h @@ -28,7 +28,6 @@ #include "uicomponents/qml/Muse/UiComponents/abstractmenumodel.h" #include "notation/inotationinteraction.h" -#include "notation/notationtypes.h" namespace mu::notation { class NotationContextMenuModel : public muse::uicomponents::AbstractMenuModel @@ -42,7 +41,7 @@ class NotationContextMenuModel : public muse::uicomponents::AbstractMenuModel Q_INVOKABLE void loadItems(int elementType); private: - muse::uicomponents::MenuItemList makeItemsByElementType(ElementType type); + muse::uicomponents::MenuItemList makeItemsByElementType(engraving::ElementType type); muse::uicomponents::MenuItemList makePageItems(); muse::uicomponents::MenuItemList makeDefaultCopyPasteItems(); @@ -65,7 +64,7 @@ class NotationContextMenuModel : public muse::uicomponents::AbstractMenuModel muse::uicomponents::MenuItemList makeGradualTempoChangeItems(); muse::uicomponents::MenuItemList makeTextItems(); - muse::uicomponents::MenuItem* makeEditStyle(const EngravingItem* element); + muse::uicomponents::MenuItem* makeEditStyle(const engraving::EngravingItem* element); bool isSingleSelection() const; bool canSelectSimilarInRange() const; @@ -75,7 +74,7 @@ class NotationContextMenuModel : public muse::uicomponents::AbstractMenuModel INotationInteractionPtr interaction() const; INotationSelectionPtr selection() const; - const EngravingItem* currentElement() const; + const engraving::EngravingItem* currentElement() const; const INotationInteraction::HitElementContext& hitElementContext() const; }; diff --git a/src/notationscene/qml/MuseScore/NotationScene/notationruler.cpp b/src/notationscene/qml/MuseScore/NotationScene/notationruler.cpp index 9d3c19a3d7f4a..fb78eef0264e2 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/notationruler.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/notationruler.cpp @@ -22,13 +22,19 @@ #include "notationruler.h" +#include "draw/types/color.h" #include "draw/types/drawtypes.h" -#include "notation/notationtypes.h" + +#include "engraving/dom/measure.h" +#include "engraving/dom/score.h" +#include "engraving/dom/segment.h" +#include "engraving/dom/staff.h" #include "engraving/dom/sig.h" +#include "engraving/dom/system.h" +#include "engraving/dom/timesig.h" #include "ui/view/iconcodes.h" #include "draw/painter.h" -#include "draw/types/color.h" using namespace mu::notation; using namespace mu::engraving; @@ -47,7 +53,7 @@ void NotationRuler::paint(Painter* painter, const NoteInputState& state) const System* system = currSegment->system(); const Measure* measure = currSegment->measure(); const SysStaff* sysStaff = system ? system->staff(state.staffIdx()) : nullptr; - const TimeSignature* timeSig = staff ? staff->timeSig(state.tick()) : nullptr; + const TimeSig* timeSig = staff ? staff->timeSig(state.tick()) : nullptr; if (!measure || !sysStaff || !timeSig) { return; @@ -139,7 +145,7 @@ NotationRuler::LineType NotationRuler::lineType(int lineTicks, int inputTicks, s void NotationRuler::paintLine(Painter* painter, LineType type, const PointF& point, double spatium, voice_idx_t voiceIdx) { muse::RectF rect; - Color color = configuration()->selectionColor(voiceIdx); + muse::Color color = configuration()->selectionColor(voiceIdx); switch (type) { case LineType::CurrentPosition: diff --git a/src/notationscene/qml/MuseScore/NotationScene/notationruler.h b/src/notationscene/qml/MuseScore/NotationScene/notationruler.h index 84b17bf2fa758..cab3875895ee9 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/notationruler.h +++ b/src/notationscene/qml/MuseScore/NotationScene/notationruler.h @@ -48,6 +48,6 @@ class NotationRuler : public muse::Contextable static LineType lineType(int lineTicks, int inputTicks, size_t lineIdx); - void paintLine(muse::draw::Painter* painter, LineType type, const muse::PointF& point, double spatium, voice_idx_t voiceIdx); + void paintLine(muse::draw::Painter* painter, LineType type, const muse::PointF& point, double spatium, engraving::voice_idx_t voiceIdx); }; } diff --git a/src/notationscene/qml/MuseScore/NotationScene/notationviewinputcontroller.cpp b/src/notationscene/qml/MuseScore/NotationScene/notationviewinputcontroller.cpp index efd844bbe0363..8ae2d8380bb42 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/notationviewinputcontroller.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/notationviewinputcontroller.cpp @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "notationviewinputcontroller.h" #include @@ -35,9 +36,11 @@ #include "abstractelementpopupmodel.h" #include "engraving/dom/drumset.h" -#include "engraving/dom/mscore.h" #include "engraving/dom/fret.h" +#include "engraving/dom/harmony.h" +#include "engraving/dom/mscore.h" #include "engraving/dom/shadownote.h" +#include "engraving/dom/staff.h" #include "notation/inotationelements.h" // IWYU pragma: keep #include "notation/inotationnoteinput.h" diff --git a/src/notationscene/qml/MuseScore/NotationScene/noteinputbarmodel.h b/src/notationscene/qml/MuseScore/NotationScene/noteinputbarmodel.h index 8cda49fc2bde3..609e09f676b08 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/noteinputbarmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/noteinputbarmodel.h @@ -24,7 +24,6 @@ #include #include -#include "notation/inotation.h" #include "uicomponents/qml/Muse/UiComponents/abstractmenumodel.h" #include "modularity/ioc.h" diff --git a/src/notationscene/qml/MuseScore/NotationScene/noteinputcursor.cpp b/src/notationscene/qml/MuseScore/NotationScene/noteinputcursor.cpp index d7f40dd8a6934..d5e0c454e206f 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/noteinputcursor.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/noteinputcursor.cpp @@ -24,6 +24,8 @@ #include "draw/painter.h" +#include "engraving/dom/staff.h" + #include "notation/inotationinteraction.h" // IWYU pragma: keep #include "notation/inotationnoteinput.h" diff --git a/src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardcontroller.h b/src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardcontroller.h index 87e593c25fb5c..cc08e0df20100 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardcontroller.h +++ b/src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardcontroller.h @@ -30,6 +30,10 @@ #include "pianokeyboardtypes.h" +namespace mu::engraving { +class Note; +} + namespace mu::notation { class PianoKeyboardController : public muse::Contextable, public muse::async::Asyncable { @@ -52,7 +56,7 @@ class PianoKeyboardController : public muse::Contextable, public muse::async::As INotationPtr currentNotation() const; void onNotationChanged(); - void updateNotesKeys(const std::vector& receivedNotes); + void updateNotesKeys(const std::vector& receivedNotes); void sendNoteOn(piano_key_t key); void sendNoteOff(piano_key_t key); diff --git a/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.cpp b/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.cpp index 5a6e5f1449ce2..963db4a67e2b8 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.cpp @@ -24,6 +24,9 @@ #include "draw/painter.h" +#include "engraving/dom/measure.h" +#include "engraving/dom/score.h" +#include "engraving/dom/staff.h" #include "engraving/dom/system.h" #include "notation/inotation.h" diff --git a/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.h b/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.h index c94ae37c88c57..d85bc1fa87cb7 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.h +++ b/src/notationscene/qml/MuseScore/NotationScene/playbackcursor.h @@ -58,12 +58,12 @@ class PlaybackCursor : public muse::Contextable, public muse::async::Asyncable muse::RectF resolveCursorRectByTick(int tick) const; struct PlaybackCursorCache { - const System* system = nullptr; - const Measure* measure = nullptr; - const Segment* segment = nullptr; + const engraving::System* system = nullptr; + const engraving::Measure* measure = nullptr; + const engraving::Segment* segment = nullptr; - Fraction segmentStartTick; - Fraction segmentEndTick; + engraving::Fraction segmentStartTick; + engraving::Fraction segmentEndTick; double segmentStartX = 0.0; double segmentEndX = 0.0; diff --git a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.cpp index e17394a8635ad..2e6b8e49ec4f8 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.cpp @@ -28,6 +28,7 @@ #include "notation/inotationselectionfilter.h" using namespace mu::notation; +using namespace mu::engraving; AbstractSelectionFilterModel::AbstractSelectionFilterModel(QObject* parent) : QAbstractListModel(parent), muse::Contextable(muse::iocCtxForQmlObject(this)) diff --git a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.h b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.h index 5658b2e51dd5b..424bc269efe1d 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/abstractselectionfiltermodel.h @@ -30,6 +30,8 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" +#include "engraving/dom/selectionfilter.h" + namespace mu::notation { class AbstractSelectionFilterModel : public QAbstractListModel, public muse::Contextable, public muse::async::Asyncable { @@ -75,24 +77,24 @@ class AbstractSelectionFilterModel : public QAbstractListModel, public muse::Con virtual bool isAllSelected() const; virtual bool isNoneSelected() const; - virtual SelectionFilterTypesVariant getAllMask() const = 0; - virtual SelectionFilterTypesVariant getNoneMask() const = 0; + virtual engraving::SelectionFilterTypesVariant getAllMask() const = 0; + virtual engraving::SelectionFilterTypesVariant getNoneMask() const = 0; INotationInteractionPtr currentNotationInteraction() const; INotationSelectionFilterPtr currentNotationSelectionFilter() const; - virtual bool isFiltered(const SelectionFilterTypesVariant& variant) const; - virtual void setFiltered(const SelectionFilterTypesVariant& variant, bool filtered); + virtual bool isFiltered(const engraving::SelectionFilterTypesVariant& variant) const; + virtual void setFiltered(const engraving::SelectionFilterTypesVariant& variant, bool filtered); - virtual bool isAllowed(const SelectionFilterTypesVariant&) const { return true; } - virtual QString titleForType(const SelectionFilterTypesVariant& variant) const = 0; - bool isIndeterminate(const SelectionFilterTypesVariant& variant) const; + virtual bool isAllowed(const engraving::SelectionFilterTypesVariant&) const { return true; } + virtual QString titleForType(const engraving::SelectionFilterTypesVariant& variant) const = 0; + bool isIndeterminate(const engraving::SelectionFilterTypesVariant& variant) const; virtual void onSelectionChanged(); virtual void onNotationChanged(); - void notifyAboutDataChanged(const QModelIndex& index, const SelectionFilterTypesVariant& variant); + void notifyAboutDataChanged(const QModelIndex& index, const engraving::SelectionFilterTypesVariant& variant); - QList m_types; + QList m_types; private: INotationPtr currentNotation() const; diff --git a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/elementsselectionfiltermodel.h b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/elementsselectionfiltermodel.h index 0ff4639cc2016..0038b6615e60a 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/elementsselectionfiltermodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/elementsselectionfiltermodel.h @@ -39,9 +39,9 @@ class ElementsSelectionFilterModel : public AbstractSelectionFilterModel private: void loadTypes() override; - SelectionFilterTypesVariant getAllMask() const override { return engraving::ElementsSelectionFilterTypes::ALL; } - SelectionFilterTypesVariant getNoneMask() const override { return engraving::ElementsSelectionFilterTypes::NONE; } + engraving::SelectionFilterTypesVariant getAllMask() const override { return engraving::ElementsSelectionFilterTypes::ALL; } + engraving::SelectionFilterTypesVariant getNoneMask() const override { return engraving::ElementsSelectionFilterTypes::NONE; } - QString titleForType(const SelectionFilterTypesVariant& variant) const override; + QString titleForType(const engraving::SelectionFilterTypesVariant& variant) const override; }; } diff --git a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/notesinchordselectionfiltermodel.h b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/notesinchordselectionfiltermodel.h index 30f76854022fc..60b2d674201c1 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/notesinchordselectionfiltermodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/notesinchordselectionfiltermodel.h @@ -52,20 +52,20 @@ class NotesInChordSelectionFilterModel : public AbstractSelectionFilterModel void loadTypes() override; - bool isFiltered(const SelectionFilterTypesVariant& variant) const override; - void setFiltered(const SelectionFilterTypesVariant& variant, bool filtered) override; + bool isFiltered(const engraving::SelectionFilterTypesVariant& variant) const override; + void setFiltered(const engraving::SelectionFilterTypesVariant& variant, bool filtered) override; - bool isAllowed(const SelectionFilterTypesVariant& variant) const override; + bool isAllowed(const engraving::SelectionFilterTypesVariant& variant) const override; - SelectionFilterTypesVariant getAllMask() const override { return engraving::NotesInChordSelectionFilterTypes::ALL; } - SelectionFilterTypesVariant getNoneMask() const override { return engraving::NotesInChordSelectionFilterTypes::NONE; } + engraving::SelectionFilterTypesVariant getAllMask() const override { return engraving::NotesInChordSelectionFilterTypes::ALL; } + engraving::SelectionFilterTypesVariant getNoneMask() const override { return engraving::NotesInChordSelectionFilterTypes::NONE; } bool includeSingleNotes() const; void setIncludeSingleNotes(bool include); bool multipleIndicesSelected() const; - QString titleForType(const SelectionFilterTypesVariant& variant) const override; + QString titleForType(const engraving::SelectionFilterTypesVariant& variant) const override; size_t noteIdxForType(const engraving::NotesInChordSelectionFilterTypes& type) const; engraving::NotesInChordSelectionFilterTypes typeForNoteIdx(size_t noteIdx) const; void updateTopNoteIdx(); diff --git a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/voicesselectionfiltermodel.h b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/voicesselectionfiltermodel.h index ce249dfa52ce5..78a35444a23d9 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/voicesselectionfiltermodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/selectionfilter/voicesselectionfiltermodel.h @@ -39,9 +39,9 @@ class VoicesSelectionFilterModel : public AbstractSelectionFilterModel private: void loadTypes() override; - SelectionFilterTypesVariant getAllMask() const override { return engraving::VoicesSelectionFilterTypes::ALL; } - SelectionFilterTypesVariant getNoneMask() const override { return engraving::VoicesSelectionFilterTypes::NONE; } + engraving::SelectionFilterTypesVariant getAllMask() const override { return engraving::VoicesSelectionFilterTypes::ALL; } + engraving::SelectionFilterTypesVariant getNoneMask() const override { return engraving::VoicesSelectionFilterTypes::NONE; } - QString titleForType(const SelectionFilterTypesVariant& variant) const override; + QString titleForType(const engraving::SelectionFilterTypesVariant& variant) const override; }; } diff --git a/src/notationscene/qml/MuseScore/NotationScene/styledialog/abstractstyledialogmodel.h b/src/notationscene/qml/MuseScore/NotationScene/styledialog/abstractstyledialogmodel.h index eda296fa4493a..7f24f68e7a761 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/styledialog/abstractstyledialogmodel.h +++ b/src/notationscene/qml/MuseScore/NotationScene/styledialog/abstractstyledialogmodel.h @@ -30,8 +30,8 @@ #include "async/asyncable.h" -#include "notation/notationtypes.h" #include "notation/inotationstyle.h" +#include "notation/types/propertystyletypes.h" #include "styleitem.h" diff --git a/src/notationscene/qml/MuseScore/NotationScene/styledialog/chordsymbolspagemodel.cpp b/src/notationscene/qml/MuseScore/NotationScene/styledialog/chordsymbolspagemodel.cpp index b85fa853ed953..27b2576e67085 100644 --- a/src/notationscene/qml/MuseScore/NotationScene/styledialog/chordsymbolspagemodel.cpp +++ b/src/notationscene/qml/MuseScore/NotationScene/styledialog/chordsymbolspagemodel.cpp @@ -21,6 +21,8 @@ */ #include "chordsymbolspagemodel.h" + +#include "engraving/dom/realizedharmony.h" #include "engraving/types/types.h" using namespace mu::notation; @@ -199,25 +201,25 @@ QVariantList ChordSymbolsPageModel::possibleHarmonyVoicingOptions() const QVariantList options { QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Automatic") }, - { "value", static_cast(Voicing::AUTO) } }, + { "value", static_cast(engraving::Voicing::AUTO) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Root only") }, - { "value", static_cast(Voicing::ROOT_ONLY) } }, + { "value", static_cast(engraving::Voicing::ROOT_ONLY) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Close") }, - { "value", static_cast(Voicing::CLOSE) } }, + { "value", static_cast(engraving::Voicing::CLOSE) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Drop two") }, - { "value", static_cast(Voicing::DROP_2) } }, + { "value", static_cast(engraving::Voicing::DROP_2) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Six note") }, - { "value", static_cast(Voicing::SIX_NOTE) } }, + { "value", static_cast(engraving::Voicing::SIX_NOTE) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Four note") }, - { "value", static_cast(Voicing::FOUR_NOTE) } }, + { "value", static_cast(engraving::Voicing::FOUR_NOTE) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Three note") }, - { "value", static_cast(Voicing::THREE_NOTE) } }, + { "value", static_cast(engraving::Voicing::THREE_NOTE) } }, }; return options; @@ -228,13 +230,13 @@ QVariantList ChordSymbolsPageModel::possibleHarmonyDurationOptions() const QVariantList options { QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Until next chord symbol") }, - { "value", static_cast(mu::engraving::HDuration::UNTIL_NEXT_CHORD_SYMBOL) } }, + { "value", static_cast(engraving::HDuration::UNTIL_NEXT_CHORD_SYMBOL) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Until end of measure") }, - { "value", static_cast(mu::engraving::HDuration::STOP_AT_MEASURE_END) } }, + { "value", static_cast(engraving::HDuration::STOP_AT_MEASURE_END) } }, QVariantMap{ { "text", muse::qtrc("notation/editstyle/chordsymbols", "Chord/rest duration") }, - { "value", static_cast(mu::engraving::HDuration::SEGMENT_DURATION) } }, + { "value", static_cast(engraving::HDuration::SEGMENT_DURATION) } }, }; return options; diff --git a/src/notationscene/widgets/editstaff.h b/src/notationscene/widgets/editstaff.h index bbacdf093f365..4a72b2a168311 100644 --- a/src/notationscene/widgets/editstaff.h +++ b/src/notationscene/widgets/editstaff.h @@ -25,7 +25,6 @@ #include "ui/view/widgetdialog.h" #include "ui_editstaff.h" -#include "engraving/dom/stafftype.h" #include "global/async/asyncable.h" @@ -97,7 +96,7 @@ private slots: void initStaff(); - Staff* staff(int staffIndex) const; + engraving::Staff* staff(int staffIndex) const; Instrument instrument() const; std::vector otherInstrumentsInSameGroup() const; @@ -107,13 +106,13 @@ private slots: QString midiCodeToStr(int midiCode); - mu::engraving::Staff* m_staff = nullptr; - mu::engraving::Staff* m_orgStaff = nullptr; + engraving::Staff* m_staff = nullptr; + engraving::Staff* m_orgStaff = nullptr; Instrument m_instrument; Instrument m_orgInstrument; InstrumentKey m_instrumentKey; int m_minPitchA, m_maxPitchA, m_minPitchP, m_maxPitchP; - mu::engraving::Fraction m_tick; + engraving::Fraction m_tick; EditStaffType* editStaffTypeDialog = nullptr; }; diff --git a/src/notationscene/widgets/editstafftype.h b/src/notationscene/widgets/editstafftype.h index b92d6c339542a..2a4de8dc98e8f 100644 --- a/src/notationscene/widgets/editstafftype.h +++ b/src/notationscene/widgets/editstafftype.h @@ -29,7 +29,9 @@ #include "engraving/dom/stafftype.h" -#include "notation/notationtypes.h" +namespace mu::engraving { +class Instrument; +} namespace mu::notation { class EditStaffType : public QDialog, private Ui::EditStaffType, public muse::Contextable @@ -74,7 +76,7 @@ private slots: void setStaffType(const mu::engraving::StaffType* staffType); mu::engraving::StaffType getStaffType() const { return staffType; } - void setInstrument(const Instrument& instrument); + void setInstrument(const engraving::Instrument& instrument); private: muse::Ret loadScore(mu::engraving::MasterScore* score, const muse::io::path_t& path); diff --git a/src/notationscene/widgets/editstringdata.cpp b/src/notationscene/widgets/editstringdata.cpp index c9af87b18f6de..a3cd153c53f94 100644 --- a/src/notationscene/widgets/editstringdata.cpp +++ b/src/notationscene/widgets/editstringdata.cpp @@ -29,6 +29,7 @@ #include "editpitch.h" +#include "engraving/dom/staff.h" #include "engraving/dom/stringdata.h" #include "engraving/dom/stringtunings.h" #include "engraving/editing/editpart.h" diff --git a/src/notationscene/widgets/editstringdata.h b/src/notationscene/widgets/editstringdata.h index d0e9fc842bca7..b45caae94051e 100644 --- a/src/notationscene/widgets/editstringdata.h +++ b/src/notationscene/widgets/editstringdata.h @@ -29,6 +29,10 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" +namespace mu::engraving { +class Instrument; +} + namespace mu::notation { //--------------------------------------------------------- // EditStringData @@ -76,6 +80,6 @@ private slots: std::vector _stringsLoc; // local working copy of string list bool m_updateOnExit = false; - Instrument* m_instrument = nullptr; + engraving::Instrument* m_instrument = nullptr; }; } diff --git a/src/notationscene/widgets/editstyle.h b/src/notationscene/widgets/editstyle.h index 0a70096a4bee1..fa66895ef3569 100644 --- a/src/notationscene/widgets/editstyle.h +++ b/src/notationscene/widgets/editstyle.h @@ -87,7 +87,7 @@ public slots: void setHeaderFooterMacroInfoText(); void adjustPagesStackSize(int currentPageIndex); - bool isBoolStyleRepresentedByButtonGroup(StyleId id); + bool isBoolStyleRepresentedByButtonGroup(engraving::Sid id); struct WidgetAndView { QWidget* widget = nullptr; @@ -102,14 +102,14 @@ public slots: typedef QWidget* EditStyle::* EditStylePage; struct StyleWidget { - StyleId idx = StyleId::NOSTYLE; + engraving::Sid idx = engraving::Sid::NOSTYLE; bool showPercent = false; QObject* widget = nullptr; QToolButton* reset = nullptr; }; QVector styleWidgets; - const StyleWidget& styleWidget(StyleId id) const; + const StyleWidget& styleWidget(engraving::Sid id) const; class LineStyleSelect; std::vector m_lineStyleSelects; @@ -119,20 +119,20 @@ public slots: QPushButton* buttonApplyToAllParts = nullptr; void unhandledType(const StyleWidget); - PropertyValue getValue(StyleId idx); + engraving::PropertyValue getValue(engraving::Sid idx); void setValues(); - const PropertyValue& styleValue(StyleId id) const; - const PropertyValue& defaultStyleValue(StyleId id) const; - bool hasDefaultStyleValue(StyleId id) const; + const engraving::PropertyValue& styleValue(engraving::Sid id) const; + const engraving::PropertyValue& defaultStyleValue(engraving::Sid id) const; + bool hasDefaultStyleValue(engraving::Sid id) const; bool dynamicsAndHairpinPosPropertiesHaveDefaultStyleValue() const; - void setStyleQVariantValue(StyleId id, const QVariant& value); - void setStyleValue(StyleId id, const PropertyValue& value); + void setStyleQVariantValue(engraving::Sid id, const QVariant& value); + void setStyleValue(engraving::Sid id, const engraving::PropertyValue& value); private slots: // void selectChordDescriptionFile(); // void setChordStyle(bool); - void enableStyleWidget(const StyleId idx, bool enable); + void enableStyleWidget(const engraving::Sid idx, bool enable); void enableVerticalSpreadClicked(bool); void disableVerticalSpreadClicked(bool); void toggleHeaderOddEven(bool); diff --git a/src/notationscene/widgets/exampleview.cpp b/src/notationscene/widgets/exampleview.cpp index 137ed18407c83..a51afe0609cd9 100644 --- a/src/notationscene/widgets/exampleview.cpp +++ b/src/notationscene/widgets/exampleview.cpp @@ -28,6 +28,7 @@ #include "engraving/dom/engravingitem.h" #include "engraving/dom/page.h" +#include "engraving/dom/score.h" #include "engraving/dom/system.h" #include "notation/inotationcontextconfiguration.h" diff --git a/src/notationscene/widgets/exampleview.h b/src/notationscene/widgets/exampleview.h index fd60755a6c0d3..db879daf48d1c 100644 --- a/src/notationscene/widgets/exampleview.h +++ b/src/notationscene/widgets/exampleview.h @@ -22,14 +22,15 @@ #pragma once -#include #include +#include + +#include "draw/types/transform.h" #include "engraving/editing/mscoreview.h" #include "modularity/ioc.h" #include "notation/inotationconfiguration.h" -#include "draw/types/transform.h" namespace mu::engraving { class EngravingItem; @@ -67,7 +68,7 @@ class ExampleView : public QFrame, public engraving::MuseScoreView muse::PointF toLogical(const QPointF& point); private: - void drawElements(muse::draw::Painter& painter, const std::vector& el); + void drawElements(muse::draw::Painter& painter, const std::vector& el); void paintEvent(QPaintEvent*) override; void wheelEvent(QWheelEvent*) override; void constraintCanvas(int* dxx); diff --git a/src/notationscene/widgets/pagesettings.cpp b/src/notationscene/widgets/pagesettings.cpp index 944a06c9cbeb7..ea86de325c82b 100644 --- a/src/notationscene/widgets/pagesettings.cpp +++ b/src/notationscene/widgets/pagesettings.cpp @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "pagesettings.h" #include diff --git a/src/notationscene/widgets/pagesettings.h b/src/notationscene/widgets/pagesettings.h index 741ed7c41a858..d9e1ccce2d0e7 100644 --- a/src/notationscene/widgets/pagesettings.h +++ b/src/notationscene/widgets/pagesettings.h @@ -19,8 +19,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_NOTATION_PAGESETTINGS_H -#define MU_NOTATION_PAGESETTINGS_H + +#pragma once #include "ui/view/widgetdialog.h" @@ -29,6 +29,8 @@ #include "context/iglobalcontext.h" #include "framework/global/iglobalconfiguration.h" +#include "engraving/style/styledef.h" + namespace mu::engraving { class Score; } @@ -61,9 +63,9 @@ public slots: void applyToScore(mu::engraving::Score*); mu::engraving::Score* score() const; - double styleValueDouble(StyleId styleId) const; - bool styleValueBool(StyleId styleId) const; - void setStyleValue(StyleId styleId, const PropertyValue& newValue) const; + double styleValueDouble(engraving::Sid styleId) const; + bool styleValueBool(engraving::Sid styleId) const; + void setStyleValue(engraving::Sid styleId, const engraving::PropertyValue& newValue) const; bool mmUnit = false; bool _changeFlag = false; @@ -93,4 +95,3 @@ private slots: void on_resetPageStyleButton_clicked(); }; } -#endif // MU_NOTATION_PAGESETTINGS_H diff --git a/src/notationscene/widgets/realizeharmonydialog.cpp b/src/notationscene/widgets/realizeharmonydialog.cpp index b7d5f6c0e2d30..b6d646a125ee0 100644 --- a/src/notationscene/widgets/realizeharmonydialog.cpp +++ b/src/notationscene/widgets/realizeharmonydialog.cpp @@ -23,6 +23,7 @@ #include "realizeharmonydialog.h" #include "engraving/dom/harmony.h" +#include "engraving/dom/realizedharmony.h" #include "notation/inotationinteraction.h" #include "notation/inotationselection.h" // IWYU pragma: keep @@ -30,6 +31,7 @@ #include "translation.h" using namespace mu::notation; +using namespace mu::engraving; RealizeHarmonyDialog::RealizeHarmonyDialog(QWidget* parent) : muse::ui::WidgetDialog(parent) @@ -53,12 +55,12 @@ void RealizeHarmonyDialog::componentComplete() return; } - const std::vector& selectedElements = interaction->selection()->elements(); - QList selectedHarmonyList; + const std::vector& selectedElements = interaction->selection()->elements(); + QList selectedHarmonyList; - for (mu::engraving::EngravingItem* element : selectedElements) { + for (EngravingItem* element : selectedElements) { if (element->isHarmony()) { - selectedHarmonyList << mu::engraving::toHarmony(element); + selectedHarmonyList << toHarmony(element); } } @@ -79,10 +81,8 @@ void RealizeHarmonyDialog::accept() } bool optionsOverride = optionsBox->isChecked(); - Voicing voicing = optionsOverride ? Voicing(voicingSelect->getVoicing()) - : Voicing::INVALID; - HarmonyDurationType durationType = optionsOverride ? HarmonyDurationType(voicingSelect->getDuration()) - : HarmonyDurationType::INVALID; + Voicing voicing = optionsOverride ? Voicing(voicingSelect->getVoicing()) : Voicing::INVALID; + HDuration durationType = optionsOverride ? HDuration(voicingSelect->getDuration()) : HDuration::INVALID; interaction->realizeSelectedChordSymbols(voicingSelect->getLiteral(), voicing, durationType); diff --git a/src/notationscene/widgets/selectdialog.cpp b/src/notationscene/widgets/selectdialog.cpp index 92bc675a84511..e9ce5cba8d7b6 100644 --- a/src/notationscene/widgets/selectdialog.cpp +++ b/src/notationscene/widgets/selectdialog.cpp @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "selectdialog.h" /** @@ -26,6 +27,7 @@ Implementation of class Selection plus other selection related functions. */ +#include "engraving/dom/score.h" #include "engraving/dom/system.h" #include "notation/inotationelements.h" diff --git a/src/notationscene/widgets/selectdialog.h b/src/notationscene/widgets/selectdialog.h index ca6cbc02af39a..b5afe0e883183 100644 --- a/src/notationscene/widgets/selectdialog.h +++ b/src/notationscene/widgets/selectdialog.h @@ -28,7 +28,10 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" +#include "notation/notationtypes.h" + namespace mu::engraving { +class EngravingItem; class System; } @@ -68,8 +71,8 @@ private slots: void apply() const; FilterElementsOptions elementOptions() const; - mu::engraving::System* elementSystem(const EngravingItem* element) const; + engraving::System* elementSystem(const engraving::EngravingItem* element) const; - const EngravingItem* m_element = nullptr; + const engraving::EngravingItem* m_element = nullptr; }; } diff --git a/src/notationscene/widgets/selectnotedialog.h b/src/notationscene/widgets/selectnotedialog.h index eb7ee79913188..66ce483e15d74 100644 --- a/src/notationscene/widgets/selectnotedialog.h +++ b/src/notationscene/widgets/selectnotedialog.h @@ -28,6 +28,8 @@ #include "modularity/ioc.h" #include "context/iglobalcontext.h" +#include "notation/notationtypes.h" + namespace mu::engraving { struct NotePattern; class Note; diff --git a/src/notationscene/widgets/timeline.h b/src/notationscene/widgets/timeline.h index 43186907052ef..989ec2738598b 100644 --- a/src/notationscene/widgets/timeline.h +++ b/src/notationscene/widgets/timeline.h @@ -20,10 +20,12 @@ * along with this program. If not, see . */ -#ifndef MU_NOTATION_TIMELINE_H -#define MU_NOTATION_TIMELINE_H +#pragma once -#include "engraving/dom/select.h" +#include + +#include +#include #include "modularity/ioc.h" #include "ui/iuiconfiguration.h" @@ -32,13 +34,13 @@ #include "actions/iactionsdispatcher.h" #include "playback/iplaybackcontroller.h" -#include -#include -#include - namespace mu::engraving { -class Score; +class Measure; class Page; +class Part; +class Score; +class Staff; +enum class SelState : char; } namespace mu::notation { @@ -154,7 +156,7 @@ class Timeline : public QGraphicsView, public muse::Contextable, public muse::as TimelineTheme _lightTheme, _darkTheme; - std::tuple _repeatInfo; + std::tuple _repeatInfo; std::tuple _oldHoverInfo; std::map _barlines; @@ -193,8 +195,8 @@ class Timeline : public QGraphicsView, public muse::Contextable, public muse::as bool addMetaValue(int x, int pos, QString metaText, int row, engraving::ElementType elementType, engraving::EngravingItem* element, engraving::Segment* seg, engraving::Measure* measure, QString tooltip = ""); - void setMetaData(QGraphicsItem* gi, int staff, engraving::ElementType et, Measure* m, bool full_measure, engraving::EngravingItem* e, - QGraphicsItem* pairItem = nullptr, engraving::Segment* seg = nullptr); + void setMetaData(QGraphicsItem* gi, int staff, engraving::ElementType et, engraving::Measure* m, bool full_measure, + engraving::EngravingItem* e, QGraphicsItem* pairItem = nullptr, engraving::Segment* seg = nullptr); unsigned getMetaRow(QString targetText); int _globalMeasureNumber { 0 }; @@ -274,5 +276,3 @@ private slots: void seekSelection(); }; } - -#endif // MU_NOTATION_TIMELINE_H diff --git a/src/notationscene/widgets/tupletdialog.cpp b/src/notationscene/widgets/tupletdialog.cpp index 94c3cf260815b..c525dddaacf5d 100644 --- a/src/notationscene/widgets/tupletdialog.cpp +++ b/src/notationscene/widgets/tupletdialog.cpp @@ -19,15 +19,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "tupletdialog.h" #include "engraving/dom/tuplet.h" #include "notation/inotationstyle.h" +#include "notation/types/noteinputtypes.h" #include "ui/view/widgetstatestore.h" using namespace mu::notation; +using namespace mu::engraving; using namespace muse::ui; using namespace muse::actions; diff --git a/src/notationscene/widgets/tupletdialog.h b/src/notationscene/widgets/tupletdialog.h index f4f72cc7e9c97..003575ca66355 100644 --- a/src/notationscene/widgets/tupletdialog.h +++ b/src/notationscene/widgets/tupletdialog.h @@ -29,6 +29,11 @@ #include "context/iglobalcontext.h" #include "actions/iactionsdispatcher.h" +namespace mu::engraving { +enum class TupletNumberType : unsigned char; +enum class TupletBracketType : unsigned char; +} + namespace mu::notation { class TupletDialog : public muse::ui::WidgetDialog, private Ui::TupletDialog { @@ -47,8 +52,8 @@ class TupletDialog : public muse::ui::WidgetDialog, private Ui::TupletDialog void defaultToStyleSettings(); - TupletNumberType numberType() const; - TupletBracketType bracketType() const; + engraving::TupletNumberType numberType() const; + engraving::TupletBracketType bracketType() const; INotationStylePtr style() const; INotationPtr notation() const; diff --git a/src/palette/widgets/customizekitdialog.h b/src/palette/widgets/customizekitdialog.h index 39739e2190314..f0eaba89bb298 100644 --- a/src/palette/widgets/customizekitdialog.h +++ b/src/palette/widgets/customizekitdialog.h @@ -19,8 +19,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef MU_PALETTE_CUSTOMIZEKITDIALOG_H -#define MU_PALETTE_CUSTOMIZEKITDIALOG_H + +#pragma once #include "ui/view/widgetdialog.h" @@ -36,6 +36,7 @@ #include "ui/iuiconfiguration.h" #include "engraving/dom/drumset.h" +#include "notation/types/instrumentstypes.h" namespace mu::palette { //--------------------------------------------------------- @@ -96,5 +97,3 @@ private slots: engraving::Drumset m_editedDrumset; }; } - -#endif // MU_PALETTE_CUSTOMIZEKITDIALOG_H diff --git a/src/palette/widgets/notegroupsexampleview.cpp b/src/palette/widgets/notegroupsexampleview.cpp index 8040b2896d571..59b2f0b49b4ef 100644 --- a/src/palette/widgets/notegroupsexampleview.cpp +++ b/src/palette/widgets/notegroupsexampleview.cpp @@ -24,16 +24,13 @@ #include -#include "engraving/rw/rwregister.h" - -#include "engraving/dom/engravingitem.h" #include "engraving/dom/actionicon.h" #include "engraving/dom/chord.h" +#include "engraving/dom/engravingitem.h" #include "engraving/dom/factory.h" +#include "engraving/dom/score.h" +#include "engraving/rw/rwregister.h" -#include "log.h" - -using namespace mu; using namespace mu::palette; using namespace mu::notation; using namespace mu::engraving; diff --git a/src/playback/internal/playbackcontroller.h b/src/playback/internal/playbackcontroller.h index d7214d7d045b5..04a78f1397c81 100644 --- a/src/playback/internal/playbackcontroller.h +++ b/src/playback/internal/playbackcontroller.h @@ -30,7 +30,6 @@ #include "rcommand/commandable.h" #include "actions/actionable.h" #include "context/iglobalcontext.h" -#include "notation/notationtypes.h" #include "engraving/types/types.h" #include "notation/inotationconfiguration.h" #include "notation/inotationplayback.h" @@ -94,15 +93,15 @@ class PlaybackController : public IPlaybackController, public muse::actions::Act const SoloMuteState& trackSoloMuteState(const engraving::InstrumentTrackId& trackId) const override; void setTrackSoloMuteState(const engraving::InstrumentTrackId& trackId, const SoloMuteState& state) override; - void playElements(const std::vector& elements, + void playElements(const std::vector& elements, const PlayParams& params = PlayParams(), bool isMidi = false) override; - void playNotes(const notation::NoteValList& notes, notation::staff_idx_t staffIdx, const notation::Segment* segment, + void playNotes(const engraving::NoteValList& notes, engraving::staff_idx_t staffIdx, const engraving::Segment* segment, const PlayParams& params = PlayParams()) override; void playMetronome(int tick) override; - void triggerControllers(const muse::mpe::ControllerChangeEventList& list, notation::staff_idx_t staffIdx, int tick) override; + void triggerControllers(const muse::mpe::ControllerChangeEventList& list, engraving::staff_idx_t staffIdx, int tick) override; - void seekElement(const notation::EngravingItem* element, bool flushSound = true) override; + void seekElement(const engraving::EngravingItem* element, bool flushSound = true) override; void seekBeat(int measureIndex, int beatIndex, bool flushSound = true) override; bool actionChecked(const muse::actions::ActionCode& actionCode) const override; @@ -114,7 +113,7 @@ class PlaybackController : public IPlaybackController, public muse::actions::Act const notation::Tempo& currentTempo() const override; muse::async::Notification currentTempoChanged() const override; - notation::MeasureBeat currentBeat() const override; + engraving::MeasureBeat currentBeat() const override; muse::audio::secs_t beatToSecs(int measureIndex, int beatIndex) const override; double tempoMultiplier() const override; @@ -186,7 +185,7 @@ class PlaybackController : public IPlaybackController, public muse::actions::Act muse::audio::secs_t playbackStartSecs() const; - notation::InstrumentTrackIdSet instrumentTrackIdSetForRangePlayback() const; + engraving::InstrumentTrackIdSet instrumentTrackIdSetForRangePlayback() const; muse::Ret togglePlayRepeats(); muse::Ret togglePlayChordSymbols(); @@ -202,8 +201,8 @@ class PlaybackController : public IPlaybackController, public muse::actions::Act muse::Ret showPlaybackSetup(); muse::Ret toggleLoopPlayback(); - muse::Ret addLoopBoundary(notation::LoopBoundaryType type); - void addLoopBoundaryToTick(notation::LoopBoundaryType type, int tick); + muse::Ret addLoopBoundary(engraving::LoopBoundaryType type); + void addLoopBoundaryToTick(engraving::LoopBoundaryType type, int tick); void updateLoop(); void enableLoop(); diff --git a/src/playback/iplaybackcontroller.h b/src/playback/iplaybackcontroller.h index 2839427b0cb81..5e057f4857a77 100644 --- a/src/playback/iplaybackcontroller.h +++ b/src/playback/iplaybackcontroller.h @@ -30,12 +30,19 @@ #include "global/progress.h" #include "modularity/imoduleinterface.h" +#include "engraving/dom/noteval.h" + #include "notation/inotation_fwd.h" #include "notation/inotationsolomutestate.h" -#include "notation/notationtypes.h" +#include "notation/types/tempo.h" #include "playbacktypes.h" +namespace mu::engraving { +class EngravingItem; +class Segment; +} + namespace mu::playback { class IPlaybackController : MODULE_CONTEXT_INTERFACE { @@ -83,15 +90,15 @@ class IPlaybackController : MODULE_CONTEXT_INTERFACE bool flushSound = true; }; - virtual void playElements(const std::vector& elements, + virtual void playElements(const std::vector& elements, const PlayParams& params = PlayParams(), bool isMidi = false) = 0; - virtual void playNotes(const notation::NoteValList& notes, notation::staff_idx_t staffIdx, const notation::Segment* segment, + virtual void playNotes(const engraving::NoteValList& notes, engraving::staff_idx_t staffIdx, const engraving::Segment* segment, const PlayParams& params = PlayParams()) = 0; virtual void playMetronome(int tick) = 0; - virtual void triggerControllers(const muse::mpe::ControllerChangeEventList& list, notation::staff_idx_t staffIdx, int tick) = 0; + virtual void triggerControllers(const muse::mpe::ControllerChangeEventList& list, engraving::staff_idx_t staffIdx, int tick) = 0; - virtual void seekElement(const notation::EngravingItem* element, bool flushSound = true) = 0; + virtual void seekElement(const engraving::EngravingItem* element, bool flushSound = true) = 0; virtual void seekBeat(int measureIndex, int beatIndex, bool flushSound = true) = 0; virtual bool actionChecked(const muse::actions::ActionCode& actionCode) const = 0; @@ -103,7 +110,7 @@ class IPlaybackController : MODULE_CONTEXT_INTERFACE virtual const notation::Tempo& currentTempo() const = 0; virtual muse::async::Notification currentTempoChanged() const = 0; - virtual notation::MeasureBeat currentBeat() const = 0; + virtual engraving::MeasureBeat currentBeat() const = 0; virtual muse::audio::secs_t beatToSecs(int measureIndex, int beatIndex) const = 0; virtual double tempoMultiplier() const = 0; diff --git a/src/playback/qml/MuseScore/Playback/notationregionsbeingprocessedmodel.cpp b/src/playback/qml/MuseScore/Playback/notationregionsbeingprocessedmodel.cpp index b61d4673c9cd2..460a0bbdd10ca 100644 --- a/src/playback/qml/MuseScore/Playback/notationregionsbeingprocessedmodel.cpp +++ b/src/playback/qml/MuseScore/Playback/notationregionsbeingprocessedmodel.cpp @@ -22,8 +22,12 @@ #include "notationregionsbeingprocessedmodel.h" -#include #include +#include + +#include "engraving/dom/score.h" +#include "engraving/dom/segment.h" +#include "engraving/dom/system.h" #include "notation/inotationparts.h" // IWYU pragma: keep #include "notation/inotationplayback.h" // IWYU pragma: keep diff --git a/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.cpp b/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.cpp index 6cc804597eef4..b1bdb12c713ed 100644 --- a/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.cpp +++ b/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.cpp @@ -178,8 +178,8 @@ void OnlineSoundsStatusModel::updateManualProcessingAllowed(bool enableByDefault setManualProcessingAllowed(enableByDefault); m_tracksDataChanged = master->playback()->tracksDataChanged(); - m_tracksDataChanged.onReceive(this, [this](const InstrumentTrackIdSet& changedTrackIdSet) { - for (const InstrumentTrackId& trackId : changedTrackIdSet) { + m_tracksDataChanged.onReceive(this, [this](const engraving::InstrumentTrackIdSet& changedTrackIdSet) { + for (const engraving::InstrumentTrackId& trackId : changedTrackIdSet) { if (muse::contains(m_onlineTrackIdSet, trackId)) { setManualProcessingAllowed(true); return; diff --git a/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.h b/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.h index c08a9a4a6bb88..c4adaea3249f5 100644 --- a/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.h +++ b/src/playback/qml/MuseScore/Playback/onlinesoundsstatusmodel.h @@ -90,11 +90,11 @@ class OnlineSoundsStatusModel : public QObject, public muse::async::Asyncable, p void setManualProcessingAllowed(bool allowed); void setStatus(Status status); - notation::InstrumentTrackIdSet m_onlineTrackIdSet; + engraving::InstrumentTrackIdSet m_onlineTrackIdSet; bool m_manualProcessingAllowed = false; bool m_shouldNotifyToursThatManualProcessingAllowed = true; Status m_status = Status::Success; muse::Ret m_ret; - muse::async::Channel m_tracksDataChanged; + muse::async::Channel m_tracksDataChanged; }; } diff --git a/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.cpp b/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.cpp index 54906dc12ed19..2c01459664f76 100644 --- a/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.cpp +++ b/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.cpp @@ -28,7 +28,7 @@ #include "playback/playbackcommands.h" using namespace mu::playback; -using namespace mu::notation; +using namespace mu::engraving; using namespace muse; using namespace muse::actions; using namespace muse::ui; @@ -345,7 +345,7 @@ QVariant PlaybackToolBarModel::tempo() const { DurationType::V_16TH, MusicalSymbolCodes::Code::SEMIQUAVER }, }; - const Tempo& tempo = playbackController()->currentTempo(); + const notation::Tempo& tempo = playbackController()->currentTempo(); const MusicalSymbolCodes::Code noteIcon = muse::value(DURATION_TO_ICON, tempo.duration, MusicalSymbolCodes::Code::CROTCHET); diff --git a/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.h b/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.h index fd2c7a612eca3..87f0fca3455b3 100644 --- a/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.h +++ b/src/playback/qml/MuseScore/Playback/playbacktoolbarmodel.h @@ -100,14 +100,14 @@ public slots: bool isAdditionalAction(const muse::actions::ActionCode& actionCode) const; muse::secs_t totalPlayTime() const; - notation::MeasureBeat measureBeat() const; + engraving::MeasureBeat measureBeat() const; muse::ui::UiAction playAction() const; void updatePlayPosition(muse::audio::secs_t secs); void rewind(muse::audio::secs_t secs); - void rewindToBeat(const notation::MeasureBeat& beat); + void rewindToBeat(const engraving::MeasureBeat& beat); bool m_isToolbarFloating = false; muse::secs_t m_playbackPositionSecs = 0.0; diff --git a/src/playback/tests/mocks/playbackcontrollermock.h b/src/playback/tests/mocks/playbackcontrollermock.h index 37ab357eba273..866202c7dc82d 100644 --- a/src/playback/tests/mocks/playbackcontrollermock.h +++ b/src/playback/tests/mocks/playbackcontrollermock.h @@ -61,14 +61,14 @@ class PlaybackControllerMock : public IPlaybackController MOCK_METHOD(void, setTrackSoloMuteState, (const engraving::InstrumentTrackId&, const SoloMuteState&), (override)); - MOCK_METHOD(void, playElements, (const std::vector&, const PlayParams&, bool), (override)); - MOCK_METHOD(void, playNotes, (const notation::NoteValList&, notation::staff_idx_t, const notation::Segment*, const PlayParams&), + MOCK_METHOD(void, playElements, (const std::vector&, const PlayParams&, bool), (override)); + MOCK_METHOD(void, playNotes, (const engraving::NoteValList&, engraving::staff_idx_t, const engraving::Segment*, const PlayParams&), (override)); MOCK_METHOD(void, playMetronome, (int), (override)); - MOCK_METHOD(void, triggerControllers, (const muse::mpe::ControllerChangeEventList&, notation::staff_idx_t, int), (override)); + MOCK_METHOD(void, triggerControllers, (const muse::mpe::ControllerChangeEventList&, engraving::staff_idx_t, int), (override)); - MOCK_METHOD(void, seekElement, (const notation::EngravingItem*, bool), (override)); + MOCK_METHOD(void, seekElement, (const engraving::EngravingItem*, bool), (override)); MOCK_METHOD(void, seekBeat, (int, int, bool), (override)); MOCK_METHOD(bool, actionChecked, (const muse::actions::ActionCode&), (const, override)); @@ -80,7 +80,7 @@ class PlaybackControllerMock : public IPlaybackController MOCK_METHOD(const notation::Tempo&, currentTempo, (), (const, override)); MOCK_METHOD(muse::async::Notification, currentTempoChanged, (), (const, override)); - MOCK_METHOD(notation::MeasureBeat, currentBeat, (), (const, override)); + MOCK_METHOD(engraving::MeasureBeat, currentBeat, (), (const, override)); MOCK_METHOD(muse::audio::secs_t, beatToSecs, (int, int), (const, override)); MOCK_METHOD(double, tempoMultiplier, (), (const, override)); diff --git a/src/project/CMakeLists.txt b/src/project/CMakeLists.txt index 1ed94a21bc7b6..40e4cff18fb7f 100644 --- a/src/project/CMakeLists.txt +++ b/src/project/CMakeLists.txt @@ -41,6 +41,7 @@ target_sources(project PRIVATE imscmetareader.h iprojectautosaver.h + types/projectcreateoptions.h types/projecttypes.h types/projectmeta.h diff --git a/src/project/inotationproject.h b/src/project/inotationproject.h index 5924509d94fd1..c387b5a841a15 100644 --- a/src/project/inotationproject.h +++ b/src/project/inotationproject.h @@ -33,6 +33,8 @@ #include "types/projecttypes.h" namespace mu::project { +struct ProjectCreateOptions; + class INotationProject { public: diff --git a/src/project/internal/exportprojectscenario.cpp b/src/project/internal/exportprojectscenario.cpp index 74fcc4c0253a7..2c79ce838a759 100644 --- a/src/project/internal/exportprojectscenario.cpp +++ b/src/project/internal/exportprojectscenario.cpp @@ -28,6 +28,8 @@ #include "defer.h" #include "log.h" +#include "engraving/dom/score.h" + #include "notation/iexcerptnotation.h" // IWYU pragma: keep #include "notation/inotationelements.h" // IWYU pragma: keep #include "notation/inotationpainting.h" // IWYU pragma: keep diff --git a/src/project/internal/notationproject.cpp b/src/project/internal/notationproject.cpp index 082417e7b11d7..47e15276d83aa 100644 --- a/src/project/internal/notationproject.cpp +++ b/src/project/internal/notationproject.cpp @@ -35,7 +35,9 @@ #include "engraving/compat/engravingcompat.h" #include "engraving/dom/excerpt.h" #include "engraving/dom/masterscore.h" +#include "engraving/dom/page.h" #include "engraving/dom/repeatlist.h" +#include "engraving/dom/system.h" #include "engraving/editing/editscoreproperties.h" #include "engraving/editing/editstyle.h" #include "engraving/editing/transaction/transaction.h" @@ -54,6 +56,7 @@ #include "projectaudiosettings.h" #include "projectfileinfoprovider.h" #include "projecterrors.h" +#include "types/projectcreateoptions.h" #include "global/concurrency/concurrent.h" diff --git a/src/project/internal/notationproject.h b/src/project/internal/notationproject.h index dc24385b1d95b..a2c0823fa61f6 100644 --- a/src/project/internal/notationproject.h +++ b/src/project/internal/notationproject.h @@ -19,6 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include "../inotationproject.h" diff --git a/src/project/qml/MuseScore/Project/internal/NewScore/newscoremodel.cpp b/src/project/qml/MuseScore/Project/internal/NewScore/newscoremodel.cpp index fa27d211bf582..851dcc85ffa7b 100644 --- a/src/project/qml/MuseScore/Project/internal/NewScore/newscoremodel.cpp +++ b/src/project/qml/MuseScore/Project/internal/NewScore/newscoremodel.cpp @@ -19,10 +19,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "newscoremodel.h" -#include "ui/view/musicalsymbolcodes.h" + #include "log.h" +#include "ui/view/musicalsymbolcodes.h" + +#include "types/projectcreateoptions.h" + using namespace mu::project; using namespace mu::notation; using namespace muse; diff --git a/src/project/types/projectcreateoptions.h b/src/project/types/projectcreateoptions.h new file mode 100644 index 0000000000000..3f6add02b6e41 --- /dev/null +++ b/src/project/types/projectcreateoptions.h @@ -0,0 +1,40 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2026 MuseScore Limited 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 . + */ + +#pragma once + +#include "notation/types/scorecreateoptions.h" + +namespace mu::project { +struct ProjectCreateOptions +{ + QString title; + QString subtitle; + QString composer; + QString lyricist; + QString copyright; + + muse::io::path_t templatePath; + + notation::ScoreCreateOptions scoreOptions; +}; +} diff --git a/src/project/types/projecttypes.h b/src/project/types/projecttypes.h index 0707e819cdcf8..1264ca9fa6342 100644 --- a/src/project/types/projecttypes.h +++ b/src/project/types/projecttypes.h @@ -34,24 +34,10 @@ #include "projectmeta.h" #include "cloud/cloudtypes.h" -#include "notation/inotation.h" -#include "notation/notationtypes.h" +#include "notation/inotation_fwd.h" #include "../inotationwriter.h" namespace mu::project { -struct ProjectCreateOptions -{ - QString title; - QString subtitle; - QString composer; - QString lyricist; - QString copyright; - - muse::io::path_t templatePath; - - notation::ScoreCreateOptions scoreOptions; -}; - struct OpenParams { OpenParams() {} diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/appearance/appearancesettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/appearance/appearancesettingsmodel.cpp index 0b05e32dbd1f0..52f54698cc440 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/appearance/appearancesettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/appearance/appearancesettingsmodel.cpp @@ -19,8 +19,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "appearancesettingsmodel.h" +#include "engraving/dom/page.h" + #include "types/commontypes.h" #include "translation.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/modelwithvoiceandpositionoptions.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/modelwithvoiceandpositionoptions.cpp index 12ad70d7d4e58..a8c41e02aa23d 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/modelwithvoiceandpositionoptions.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/modelwithvoiceandpositionoptions.cpp @@ -19,8 +19,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "modelwithvoiceandpositionoptions.h" +#include "engraving/dom/part.h" +#include "engraving/dom/staff.h" + using namespace mu::propertiespanel; using namespace mu::engraving; diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/accidentals/accidentalsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/accidentals/accidentalsettingsmodel.cpp index bed8946679c32..99e0bdde47cb0 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/accidentals/accidentalsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/accidentals/accidentalsettingsmodel.cpp @@ -19,11 +19,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "accidentalsettingsmodel.h" -#include "translation.h" +#include "accidentalsettingsmodel.h" #include "engraving/dom/accidental.h" +#include "engraving/dom/note.h" +#include "engraving/dom/segment.h" + +#include "translation.h" using namespace mu::propertiespanel; using namespace mu::engraving; diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/barlines/barlinesettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/barlines/barlinesettingsmodel.cpp index 773f42d480897..afe2bbbb3e10d 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/barlines/barlinesettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/barlines/barlinesettingsmodel.cpp @@ -19,11 +19,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "barlinesettingsmodel.h" #include "translation.h" #include "engraving/dom/barline.h" +#include "engraving/dom/score.h" +#include "engraving/dom/staff.h" #include "notation/inotationundostack.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/bends/bendsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/bends/bendsettingsmodel.cpp index 67f2de7b226da..63cb1ebdd27b1 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/bends/bendsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/bends/bendsettingsmodel.cpp @@ -19,14 +19,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "bendsettingsmodel.h" +#include "engraving/dom/guitarbend.h" +#include "engraving/dom/stafftype.h" + #include "translation.h" #include "types/bendtypes.h" -#include "engraving/dom/bend.h" -#include "engraving/dom/guitarbend.h" - using namespace mu::engraving; using namespace mu::propertiespanel; diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/chordsymbols/chordsymbolsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/chordsymbols/chordsymbolsettingsmodel.cpp index 650f31afe0269..b8ce0d77cd4a3 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/chordsymbols/chordsymbolsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/chordsymbols/chordsymbolsettingsmodel.cpp @@ -22,6 +22,8 @@ #include "chordsymbolsettingsmodel.h" +#include "engraving/dom/harmony.h" + #include "notation/inotationstyle.h" // IWYU pragma: keep #include "translation.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/fretcanvas.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/fretcanvas.cpp index 547a5694807ed..7b17e261837c2 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/fretcanvas.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/fretcanvas.cpp @@ -24,7 +24,10 @@ #include +#include "draw/fontmetrics.h" + #include "engraving/dom/fret.h" +#include "engraving/dom/score.h" #include "notation/inotationundostack.h" // IWYU pragma: keep diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/hairpinlinesettingsmodel.h b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/hairpinlinesettingsmodel.h index 388851d088013..0aab00e8b97e3 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/hairpinlinesettingsmodel.h +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/hairpinlinesettingsmodel.h @@ -19,10 +19,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include +#include "engraving/dom/hairpin.h" + #include "textlinesettingsmodel.h" namespace mu::propertiespanel { diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/ottavasettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/ottavasettingsmodel.cpp index e1dc2fdfd5b9c..ef077fa7317ec 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/ottavasettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/ottavasettingsmodel.cpp @@ -22,6 +22,8 @@ #include "ottavasettingsmodel.h" +#include "engraving/dom/ottava.h" + #include "translation.h" #include "ui/view/iconcodes.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/slurandtiesettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/slurandtiesettingsmodel.cpp index 809682c40eb13..37a59485c232e 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/slurandtiesettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/slurandtiesettingsmodel.cpp @@ -22,13 +22,13 @@ #include "slurandtiesettingsmodel.h" -#include "types/linetypes.h" -#include "types/commontypes.h" - +#include "engraving/style/style.h" #include "engraving/types/types.h" #include "translation.h" +#include "types/commontypes.h" + using namespace mu::propertiespanel; using namespace mu::engraving; diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/noteheads/noteheadsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/noteheads/noteheadsettingsmodel.cpp index a29899469029a..ad41f23dcb467 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/noteheads/noteheadsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/noteheads/noteheadsettingsmodel.cpp @@ -19,8 +19,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "noteheadsettingsmodel.h" +#include "engraving/dom/note.h" +#include "engraving/dom/score.h" #include "engraving/editing/editparentheses.h" #include "engraving/editing/transaction/transaction.h" #include "engraving/types/types.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/stems/stemsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/stems/stemsettingsmodel.cpp index a9f91fb9bc192..74e743f0602a8 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/stems/stemsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/stems/stemsettingsmodel.cpp @@ -19,9 +19,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "stemsettingsmodel.h" #include "engraving/dom/beam.h" +#include "engraving/dom/stem.h" #include "translation.h" #include "log.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/tuplets/tupletsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/tuplets/tupletsettingsmodel.cpp index 09e9b62a5257d..bc50c81dc61d3 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/tuplets/tupletsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/tuplets/tupletsettingsmodel.cpp @@ -22,10 +22,12 @@ #include "tupletsettingsmodel.h" -#include "types/commontypes.h" +#include "engraving/dom/tuplet.h" #include "translation.h" +#include "types/commontypes.h" + using namespace mu::propertiespanel; using Icon = muse::ui::IconCode::Code; diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/parts/partssettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/parts/partssettingsmodel.cpp index 71bcae13b0208..05ed0ca40b876 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/parts/partssettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/parts/partssettingsmodel.cpp @@ -22,6 +22,8 @@ #include "partssettingsmodel.h" +#include "engraving/dom/score.h" + #include "translation.h" using namespace mu::propertiespanel; diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanelabstractmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanelabstractmodel.cpp index 0f1a4e01dab25..ee5bf67689328 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanelabstractmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanelabstractmodel.cpp @@ -24,6 +24,7 @@ #include "engraving/dom/barline.h" #include "engraving/dom/dynamic.h" #include "engraving/dom/property.h" +#include "engraving/dom/score.h" #include "engraving/dom/tempotext.h" #include "notation/inotationinteraction.h" // IWYU pragma: keep diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.cpp index 1330e4ace029a..27d9211af57a2 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.cpp @@ -27,6 +27,8 @@ #include "notation/inotationselection.h" #include "notation/inotationundostack.h" // IWYU pragma: keep +#include "engraving/dom/score.h" + #include "general/generalsettingsmodel.h" #include "measures/measuressettingsmodel.h" #include "emptystaves/emptystavesvisiblitysettingsmodel.h" @@ -114,7 +116,7 @@ bool PropertiesPanelListModel::alwaysUpdateModelList(const QList& selectedElementList, - SelectionState selectionState) + engraving::SelState selectionState) { TRACEFUNC; @@ -391,7 +393,7 @@ void PropertiesPanelListModel::listenScoreChanges() } }, Asyncable::Mode::SetReplace /* FIXME */); - notation->undoStack()->changesChannel().onReceive(this, [this](const ScoreChanges& changes) { + notation->undoStack()->changesChannel().onReceive(this, [this](const engraving::ScoreChanges& changes) { if (changes.isTextEditing) { return; } diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.h b/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.h index 2812692c04c67..de1a116be4d54 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.h +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/propertiespanellistmodel.h @@ -29,6 +29,7 @@ #include #include "engraving/dom/engravingitem.h" +#include "engraving/dom/select.h" #include "modularity/ioc.h" #include "async/asyncable.h" @@ -74,7 +75,7 @@ class PropertiesPanelListModel : public QAbstractListModel, public QQmlParserSta bool alwaysUpdateModelList(const QList& selectedElementList); void setElementList(const QList& selectedElementList, - notation::SelectionState selectionState = notation::SelectionState::NONE); + engraving::SelState selectionState = engraving::SelState::NONE); void buildModelsForEmptySelection(); void buildModelsForSelectedElements(const ElementKeySet& selectedElementKeySet, bool isRangeSelection, diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/scoreappearancesettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/scoreappearancesettingsmodel.cpp index 41c869ab71f53..639fc89b5c8dc 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/scoreappearancesettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/scoreappearancesettingsmodel.cpp @@ -19,12 +19,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "scoreappearancesettingsmodel.h" #include "translation.h" using namespace mu::propertiespanel; using namespace mu::notation; +using namespace mu::engraving; ScoreAppearanceSettingsModel::ScoreAppearanceSettingsModel(QObject* parent, const muse::modularity::ContextPtr& iocCtx, IElementRepositoryService* repository) diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textsettingsmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textsettingsmodel.cpp index b2878251717de..70d3e6180f83c 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textsettingsmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textsettingsmodel.cpp @@ -27,6 +27,7 @@ #include "types/texttypes.h" #include "engraving/dom/dynamic.h" +#include "engraving/dom/score.h" #include "engraving/dom/textbase.h" #include "engraving/types/typesconv.h" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textstylepopup/textstylepopupmodel.cpp b/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textstylepopup/textstylepopupmodel.cpp index 452aa2797c6b4..c1d50935927c1 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textstylepopup/textstylepopupmodel.cpp +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/text/textstylepopup/textstylepopupmodel.cpp @@ -47,7 +47,7 @@ void TextStylePopupModel::doInit() m_textSettingsModel = new TextSettingsModel(this, iocContext(), m_elementRepositoryService.get()); m_textSettingsModel->init(); - m_elementRepositoryService->updateElementList({ m_item }, notation::SelectionState::LIST); + m_elementRepositoryService->updateElementList({ m_item }, engraving::SelState::LIST); } void TextStylePopupModel::init() diff --git a/src/stubs/instrumentsscene/selectinstrumentscenariostub.cpp b/src/stubs/instrumentsscene/selectinstrumentscenariostub.cpp index e997d261f69c9..5fe95e51c2586 100644 --- a/src/stubs/instrumentsscene/selectinstrumentscenariostub.cpp +++ b/src/stubs/instrumentsscene/selectinstrumentscenariostub.cpp @@ -19,8 +19,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "selectinstrumentscenariostub.h" +#include "types/ret.h" + using namespace mu::instrumentsscene; using namespace mu::notation; using namespace muse; diff --git a/src/stubs/playback/playbackcontrollerstub.cpp b/src/stubs/playback/playbackcontrollerstub.cpp index cb1238d7883cc..1a821783daaa1 100644 --- a/src/stubs/playback/playbackcontrollerstub.cpp +++ b/src/stubs/playback/playbackcontrollerstub.cpp @@ -113,11 +113,11 @@ void PlaybackControllerStub::setTrackSoloMuteState(const engraving::InstrumentTr { } -void PlaybackControllerStub::playElements(const std::vector&, const PlayParams&, bool) +void PlaybackControllerStub::playElements(const std::vector&, const PlayParams&, bool) { } -void PlaybackControllerStub::playNotes(const notation::NoteValList&, notation::staff_idx_t, const notation::Segment*, +void PlaybackControllerStub::playNotes(const engraving::NoteValList&, engraving::staff_idx_t, const engraving::Segment*, const PlayParams&) { } @@ -126,11 +126,11 @@ void PlaybackControllerStub::playMetronome(int) { } -void PlaybackControllerStub::triggerControllers(const muse::mpe::ControllerChangeEventList&, notation::staff_idx_t, int) +void PlaybackControllerStub::triggerControllers(const muse::mpe::ControllerChangeEventList&, engraving::staff_idx_t, int) { } -void PlaybackControllerStub::seekElement(const notation::EngravingItem*, bool) +void PlaybackControllerStub::seekElement(const engraving::EngravingItem*, bool) { } @@ -169,7 +169,7 @@ muse::async::Notification PlaybackControllerStub::currentTempoChanged() const return {}; } -mu::notation::MeasureBeat PlaybackControllerStub::currentBeat() const +mu::engraving::MeasureBeat PlaybackControllerStub::currentBeat() const { return {}; } diff --git a/src/stubs/playback/playbackcontrollerstub.h b/src/stubs/playback/playbackcontrollerstub.h index 59c3b249eb682..f9f1a6a6640c3 100644 --- a/src/stubs/playback/playbackcontrollerstub.h +++ b/src/stubs/playback/playbackcontrollerstub.h @@ -55,15 +55,15 @@ class PlaybackControllerStub : public IPlaybackController const SoloMuteState& trackSoloMuteState(const engraving::InstrumentTrackId& trackId) const override; void setTrackSoloMuteState(const engraving::InstrumentTrackId& trackId, const SoloMuteState& state) override; - void playElements(const std::vector& elements, + void playElements(const std::vector& elements, const PlayParams& params = PlayParams(), bool isMidi = false) override; - void playNotes(const notation::NoteValList& notes, notation::staff_idx_t staffIdx, const notation::Segment* segment, + void playNotes(const engraving::NoteValList& notes, engraving::staff_idx_t staffIdx, const engraving::Segment* segment, const PlayParams& params = PlayParams()) override; void playMetronome(int tick) override; - void triggerControllers(const muse::mpe::ControllerChangeEventList& list, notation::staff_idx_t staffIdx, int tick) override; + void triggerControllers(const muse::mpe::ControllerChangeEventList& list, engraving::staff_idx_t staffIdx, int tick) override; - void seekElement(const notation::EngravingItem* element, bool flushSound = true) override; + void seekElement(const engraving::EngravingItem* element, bool flushSound = true) override; void seekBeat(int measureIndex, int beatIndex, bool flushSound = true) override; bool actionChecked(const muse::actions::ActionCode& actionCode) const override; @@ -75,7 +75,7 @@ class PlaybackControllerStub : public IPlaybackController const notation::Tempo& currentTempo() const override; muse::async::Notification currentTempoChanged() const override; - notation::MeasureBeat currentBeat() const override; + engraving::MeasureBeat currentBeat() const override; muse::audio::secs_t beatToSecs(int measureIndex, int beatIndex) const override; double tempoMultiplier() const override; diff --git a/src/web/appshell/view/notationstatusbarmodel.h b/src/web/appshell/view/notationstatusbarmodel.h index 729f71a9a2029..68fe0ead406b0 100644 --- a/src/web/appshell/view/notationstatusbarmodel.h +++ b/src/web/appshell/view/notationstatusbarmodel.h @@ -38,8 +38,6 @@ #include "notation/inotationconfiguration.h" #include "context/iglobalcontext.h" -#include "notation/notationtypes.h" - #include "global/iglobalconfiguration.h" namespace mu::appshell {