Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-Studio-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2021 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #pragma once
24 :
25 : #include "types/string.h"
26 : #include "io/path.h"
27 : #include "modularity/imoduleinterface.h"
28 : #include "modularity/ioc.h"
29 : #include "async/channel.h"
30 : #include "async/notification.h"
31 : #include "engraving/types/types.h"
32 :
33 : namespace mu::engraving {
34 : class IEngravingConfiguration : MODULE_GLOBAL_INTERFACE
35 : {
36 23723 : INTERFACE_ID(IEngravingConfiguration)
37 : public:
38 17 : virtual ~IEngravingConfiguration() = default;
39 :
40 : virtual muse::io::path_t appDataPath() const = 0;
41 :
42 : virtual muse::io::path_t defaultStyleFilePath() const = 0;
43 : virtual void setDefaultStyleFilePath(const muse::io::path_t& path) = 0;
44 : virtual muse::async::Channel<muse::io::path_t> defaultStyleFilePathChanged() const = 0;
45 :
46 : virtual muse::io::path_t partStyleFilePath() const = 0;
47 : virtual void setPartStyleFilePath(const muse::io::path_t& path) = 0;
48 : virtual muse::async::Channel<muse::io::path_t> partStyleFilePathChanged() const = 0;
49 :
50 : virtual SizeF defaultPageSize() const = 0;
51 :
52 : virtual bool canLayoutIcons() const = 0;
53 : virtual String iconsFontFamily() const = 0;
54 :
55 : /* The default used for engraving items' actual color (saved and printed).
56 : * Can be overridden by changing the color property or style. */
57 : virtual Color defaultColor() const = 0;
58 :
59 : /* The color that will be used to display the engraving items that have the
60 : * default color. Affects the appearance of the elements in the score editor,
61 : * but it's not printed nor saved. */
62 : virtual Color displayedDefaultColor(bool inverted) const = 0;
63 : virtual void setDisplayedDefaultColor(Color color, bool inverted) = 0;
64 : virtual muse::async::Channel</* inverted */ bool, Color> displayedDefaultColorChanged() const = 0;
65 : virtual void resetDisplayedDefaultColors() = 0;
66 :
67 : virtual Color indicatorIconInvertedSelectionColor() const = 0;
68 : virtual Color lassoColor() const = 0;
69 : virtual Color warningColor() const = 0;
70 : virtual Color warningSelectedColor() const = 0;
71 : virtual Color criticalColor() const = 0;
72 : virtual Color criticalBackgroundColor() const = 0;
73 : virtual Color criticalSelectedColor() const = 0;
74 : virtual Color thumbnailBackgroundColor() const = 0;
75 : virtual Color noteBackgroundColor() const = 0;
76 : virtual Color fontPrimaryColor() const = 0;
77 : virtual Color voiceColor(voice_idx_t voiceIdx) const = 0;
78 :
79 : virtual Color selectionColor(voice_idx_t voiceIndex = 0, bool itemVisible = true, bool itemIsUnlinkedFromScore = false) const = 0;
80 : virtual void setSelectionColor(voice_idx_t voiceIndex, Color color) = 0;
81 : virtual muse::async::Channel<voice_idx_t, Color> selectionColorChanged() const = 0;
82 :
83 : virtual bool dynamicsApplyToAllVoices() const = 0;
84 : virtual void setDynamicsApplyToAllVoices(bool v) = 0;
85 : virtual muse::async::Channel<bool> dynamicsApplyToAllVoicesChanged() const = 0;
86 :
87 : virtual bool autoUpdateFretboardDiagrams() const = 0;
88 : virtual void setAutoUpdateFretboardDiagrams(bool v) = 0;
89 : virtual muse::async::Channel<bool> autoUpdateFretboardDiagramsChanged() const = 0;
90 :
91 : virtual Color formattingColor() const = 0;
92 : virtual muse::async::Channel<Color> formattingColorChanged() const = 0;
93 :
94 : virtual Color invisibleColor() const = 0;
95 : virtual muse::async::Channel<Color> invisibleColorChanged() const = 0;
96 :
97 : virtual Color unlinkedColor() const = 0;
98 : virtual muse::async::Channel<Color> unlinkedColorChanged() const = 0;
99 :
100 : virtual Color frameColor() const = 0;
101 : virtual muse::async::Channel<Color> frameColorChanged() const = 0;
102 :
103 : virtual Color scoreGreyColor() const = 0;
104 :
105 : virtual Color highlightSelectionColor(voice_idx_t voiceIndex = 0) const = 0;
106 :
107 : struct DebuggingOptions {
108 : bool showElementBoundingRects = false;
109 : bool colorElementShapes = false;
110 : bool showSegmentShapes = false;
111 : bool colorSegmentShapes = false;
112 : bool showSkylines = false;
113 : bool showSystemBoundingRects = false;
114 : bool showElementMasks = false;
115 : bool showLineAttachPoints = false;
116 : bool markEmptyStaffVisibilityOverrides = false;
117 : bool markCorruptedMeasures = true;
118 : bool showGapRests = false;
119 : bool showOriginAndCombinedStaves = false;
120 :
121 0 : bool anyEnabled() const
122 : {
123 0 : return showElementBoundingRects
124 0 : || colorElementShapes
125 0 : || showSegmentShapes
126 0 : || colorSegmentShapes
127 0 : || showSkylines
128 0 : || showSystemBoundingRects
129 0 : || showElementMasks
130 0 : || showLineAttachPoints
131 0 : || markEmptyStaffVisibilityOverrides
132 0 : || markCorruptedMeasures
133 0 : || showGapRests
134 0 : || showOriginAndCombinedStaves
135 : ;
136 : }
137 : };
138 :
139 : virtual const DebuggingOptions& debuggingOptions() const = 0;
140 : virtual void setDebuggingOptions(const DebuggingOptions& options) = 0;
141 : virtual muse::async::Notification debuggingOptionsChanged() const = 0;
142 :
143 : virtual bool allowReadingImagesFromOutsideMscz() const = 0;
144 :
145 : /// these configurations will be removed after solving https://github.com/musescore/MuseScore/issues/14294
146 : virtual bool guitarProImportExperimental() const = 0;
147 : virtual bool negativeFretsAllowed() const = 0;
148 : virtual void setGuitarProMultivoiceEnabled(bool multiVoice) = 0;
149 : virtual bool guitarProMultivoiceEnabled() const = 0;
150 : virtual bool minDistanceForPartialSkylineCalculated() const = 0;
151 : virtual bool specificSlursLayoutWorkaround() const = 0;
152 : virtual bool preferSameStringForTranspose() const = 0;
153 : virtual void setPreferSameStringForTranspose(bool preferSameString) = 0;
154 : virtual bool keepDeadNotesUnchangedOnTranspose() const = 0;
155 : };
156 : }
|