LCOV - code coverage report
Current view: top level - src/notation - inotationconfiguration.h Coverage Total Hit
Test: filtered_coverage.info Lines: 100.0 % 2 2
Test Date: 2026-11-19 04:14:36

            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 <QColor>
      26              : #include <optional>
      27              : 
      28              : #include "modularity/imoduleinterface.h"
      29              : #include "async/channel.h"
      30              : #include "types/retval.h"
      31              : #include "io/path.h"
      32              : #include "global/globaltypes.h"
      33              : 
      34              : #include "types/noteinputtypes.h"
      35              : #include "types/zoomtype.h"
      36              : #include "types/automationlane.h"
      37              : 
      38              : namespace mu::notation {
      39              : class INotationConfiguration : MODULE_GLOBAL_INTERFACE
      40              : {
      41           76 :     INTERFACE_ID(INotationConfiguration)
      42              : 
      43              : public:
      44           98 :     virtual ~INotationConfiguration() = default;
      45              : 
      46              :     virtual QColor notationColor() const = 0;
      47              :     virtual void setNotationColor(const QColor& color) = 0;
      48              :     virtual muse::async::Notification notationColorChanged() const = 0;
      49              :     virtual void resetNotationColor() = 0;
      50              : 
      51              :     virtual QColor backgroundColor() const = 0;
      52              :     virtual void setBackgroundColor(const QColor& color) = 0;
      53              : 
      54              :     virtual muse::io::path_t backgroundWallpaperPath() const = 0;
      55              :     virtual const QPixmap& backgroundWallpaper() const = 0;
      56              :     virtual void setBackgroundWallpaperPath(const muse::io::path_t& path) = 0;
      57              : 
      58              :     virtual bool backgroundUseColor() const = 0;
      59              :     virtual void setBackgroundUseColor(bool value) = 0;
      60              : 
      61              :     virtual void resetBackground() = 0;
      62              : 
      63              :     virtual muse::async::Notification backgroundChanged() const = 0;
      64              : 
      65              :     virtual QColor foregroundColor() const = 0;
      66              :     virtual void setForegroundColor(const QColor& color) = 0;
      67              : 
      68              :     virtual muse::io::path_t foregroundWallpaperPath() const = 0;
      69              :     virtual const QPixmap& foregroundWallpaper() const = 0;
      70              :     virtual void setForegroundWallpaperPath(const muse::io::path_t& path) = 0;
      71              : 
      72              :     virtual bool foregroundUseColor() const = 0;
      73              :     virtual void setForegroundUseColor(bool value) = 0;
      74              : 
      75              :     virtual void resetForeground() = 0;
      76              : 
      77              :     virtual muse::async::Notification foregroundChanged() const = 0;
      78              : 
      79              :     virtual muse::io::path_t wallpapersDefaultDirPath() const = 0;
      80              : 
      81              :     virtual bool shouldInvertScore() const = 0;  // Whether score should be inverted now, based on theme.
      82              : 
      83              :     virtual bool scoreInversionEnabled() const = 0;
      84              :     virtual void setScoreInversionEnabled(bool value) = 0;
      85              :     virtual muse::async::Notification scoreInversionChanged() const = 0;
      86              : 
      87              :     virtual bool isOnlyInvertInDarkTheme() const = 0;
      88              :     virtual void setOnlyInvertInDarkTheme(bool value) = 0;
      89              :     virtual muse::async::Notification isOnlyInvertInDarkThemeChanged() const = 0;
      90              : 
      91              :     virtual QColor borderColor() const = 0;
      92              :     virtual int borderWidth() const = 0;
      93              : 
      94              :     virtual QColor playbackCursorColor() const = 0;
      95              :     virtual QColor loopMarkerColor() const = 0;
      96              :     virtual int cursorOpacity() const = 0;
      97              : 
      98              :     virtual bool thinNoteInputCursor() const = 0;
      99              : 
     100              :     virtual bool enableJianpu() const = 0;
     101              : 
     102              :     virtual QColor selectionColor(engraving::voice_idx_t voiceIndex = 0) const = 0;
     103              :     virtual QColor highlightSelectionColor(engraving::voice_idx_t voiceIndex = 0) const = 0;
     104              : 
     105              :     virtual QColor dropRectColor() const = 0;
     106              : 
     107              :     virtual muse::draw::Color noteInputPreviewColor() const = 0;
     108              : 
     109              :     virtual bool useNoteInputCursorInInputByDuration() const = 0;
     110              :     virtual void setUseNoteInputCursorInInputByDuration(bool use) = 0;
     111              :     virtual muse::async::Notification useNoteInputCursorInInputByDurationChanged() const = 0;
     112              : 
     113              :     virtual int selectionProximity() const = 0;
     114              :     virtual void setSelectionProximity(int proximity) = 0;
     115              :     virtual muse::async::Channel<int> selectionProximityChanged() const = 0;
     116              : 
     117              :     virtual ZoomType defaultZoomType() const = 0;
     118              :     virtual void setDefaultZoomType(ZoomType zoomType) = 0;
     119              : 
     120              :     virtual int defaultZoom() const = 0;
     121              :     virtual void setDefaultZoom(int zoomPercentage) = 0;
     122              :     virtual muse::async::Notification defaultZoomChanged() const = 0;
     123              : 
     124              :     virtual QList<int> possibleZoomPercentageList() const = 0;
     125              : 
     126              :     virtual AutomationLane currentAutomationLane() const = 0;
     127              :     virtual void setCurrentAutomationLane(AutomationLane lane) = 0;
     128              :     virtual muse::async::Notification currentAutomationLaneChanged() const = 0;
     129              : 
     130              :     virtual int mouseZoomPrecision() const = 0;
     131              :     virtual void setMouseZoomPrecision(int precision) = 0;
     132              :     virtual muse::async::Notification mouseZoomPrecisionChanged() const = 0;
     133              : 
     134              :     virtual std::string fontFamily() const = 0;
     135              :     virtual int fontSize() const = 0;
     136              : 
     137              :     virtual muse::io::path_t userStylesPath() const = 0;
     138              :     virtual void setUserStylesPath(const muse::io::path_t& path) = 0;
     139              :     virtual muse::async::Channel<muse::io::path_t> userStylesPathChanged() const = 0;
     140              : 
     141              :     virtual muse::io::path_t defaultStyleFilePath() const = 0;
     142              :     virtual void setDefaultStyleFilePath(const muse::io::path_t& path) = 0;
     143              :     virtual muse::async::Channel<muse::io::path_t> defaultStyleFilePathChanged() const = 0;
     144              : 
     145              :     virtual muse::io::path_t partStyleFilePath() const = 0;
     146              :     virtual void setPartStyleFilePath(const muse::io::path_t& path) = 0;
     147              :     virtual muse::async::Channel<muse::io::path_t> partStyleFilePathChanged() const = 0;
     148              : 
     149              :     virtual NoteInputMethod defaultNoteInputMethod() const = 0;
     150              :     virtual void setDefaultNoteInputMethod(NoteInputMethod method) = 0;
     151              :     virtual muse::async::Notification defaultNoteInputMethodChanged() const = 0;
     152              : 
     153              :     virtual bool addAccidentalDotsArticulationsToNextNoteEntered() const = 0;
     154              :     virtual void setAddAccidentalDotsArticulationsToNextNoteEntered(bool value) = 0;
     155              :     virtual muse::async::Notification addAccidentalDotsArticulationsToNextNoteEnteredChanged() const = 0;
     156              : 
     157              :     // what the tuplet commands (duplet to nonuplet) use the selected duration as (see TupletOptions::selectedDurationAs)
     158              :     virtual engraving::TupletSelectedDuration tupletCommandsSelectedDurationAs() const = 0;
     159              :     virtual void setTupletCommandsSelectedDurationAs(engraving::TupletSelectedDuration selectedDurationAs) = 0;
     160              :     virtual muse::async::Notification tupletCommandsSelectedDurationAsChanged() const = 0;
     161              : 
     162              :     virtual muse::io::path_t userMusicFontsPath() const = 0;
     163              :     virtual void setUserMusicFontsPath(const muse::io::path_t& path) = 0;
     164              :     virtual muse::async::Channel<muse::io::path_t> userMusicFontsPathChanged() const = 0;
     165              : 
     166              :     virtual bool isMidiInputEnabled() const = 0;
     167              :     virtual void setIsMidiInputEnabled(bool enabled) = 0;
     168              :     virtual muse::async::Notification isMidiInputEnabledChanged() const = 0;
     169              : 
     170              :     virtual bool startNoteInputAtSelectedNoteRestWhenPressingMidiKey() const = 0;
     171              :     virtual void setStartNoteInputAtSelectedNoteRestWhenPressingMidiKey(bool value) = 0;
     172              :     virtual muse::async::Notification startNoteInputAtSelectedNoteRestWhenPressingMidiKeyChanged() const = 0;
     173              : 
     174              :     virtual bool isAutomaticallyPanEnabled() const = 0;
     175              :     virtual void setIsAutomaticallyPanEnabled(bool enabled) = 0;
     176              :     virtual muse::async::Notification isAutomaticallyPanEnabledChanged() const = 0;
     177              : 
     178              :     virtual bool isPlayRepeatsEnabled() const = 0;
     179              :     virtual void setIsPlayRepeatsEnabled(bool enabled) = 0;
     180              :     virtual muse::async::Notification isPlayRepeatsChanged() const = 0;
     181              : 
     182              :     virtual bool isPlayChordSymbolsEnabled() const = 0;
     183              :     virtual void setIsPlayChordSymbolsEnabled(bool enabled) = 0;
     184              :     virtual muse::async::Notification isPlayChordSymbolsChanged() const = 0;
     185              : 
     186              :     virtual bool isPlayPreviewNotesInInputByDuration() const = 0;
     187              :     virtual void setIsPlayPreviewNotesInInputByDuration(bool play) = 0;
     188              :     virtual muse::async::Notification isPlayPreviewNotesInInputByDurationChanged() const = 0;
     189              : 
     190              :     virtual bool playPreviewNotesWithScoreDynamics() const = 0;
     191              :     virtual void setPlayPreviewNotesWithScoreDynamics(bool use) = 0;
     192              :     virtual muse::async::Notification playPreviewNotesWithScoreDynamicsChanged() const = 0;
     193              : 
     194              :     virtual bool isMetronomeEnabled() const = 0;
     195              :     virtual void setIsMetronomeEnabled(bool enabled) = 0;
     196              :     virtual muse::async::Notification isMetronomeEnabledChanged() const = 0;
     197              : 
     198              :     virtual bool isCountInEnabled() const = 0;
     199              :     virtual void setIsCountInEnabled(bool enabled) = 0;
     200              :     virtual muse::async::Notification isCountInEnabledChanged() const = 0;
     201              : 
     202              :     virtual muse::ValCh<muse::Orientation> canvasOrientation() const = 0;
     203              :     virtual void setCanvasOrientation(muse::Orientation orientation) = 0;
     204              : 
     205              :     virtual bool colorNotesOutsideOfUsablePitchRange() const = 0;
     206              :     virtual void setColorNotesOutsideOfUsablePitchRange(bool value) = 0;
     207              :     virtual muse::async::Channel<bool> colorNotesOutsideOfUsablePitchRangeChanged() const = 0;
     208              : 
     209              :     virtual bool warnGuitarBends() const = 0;
     210              :     virtual void setWarnGuitarBends(bool value) = 0;
     211              :     virtual muse::async::Channel<bool> warnGuitarBendsChanged() const = 0;
     212              : 
     213              :     virtual int delayBetweenNotesInRealTimeModeMilliseconds() const = 0;
     214              :     virtual void setDelayBetweenNotesInRealTimeModeMilliseconds(int delayMs) = 0;
     215              :     virtual muse::async::Channel<int> delayBetweenNotesInRealTimeModeMillisecondsChanged() const = 0;
     216              : 
     217              :     virtual bool useMidiVelocityAndDurationDuringNoteInput() const = 0;
     218              :     virtual void setUseMidiVelocityAndDurationDuringNoteInput(bool use) = 0;
     219              :     virtual muse::async::Channel<bool> useMidiVelocityAndDurationDuringNoteInputChanged() const = 0;
     220              : 
     221              :     virtual int notePlayDurationMilliseconds() const = 0;
     222              :     virtual void setNotePlayDurationMilliseconds(int durationMs) = 0;
     223              :     virtual muse::async::Channel<int> notePlayDurationMillisecondsChanged() const = 0;
     224              : 
     225              :     virtual void setTemplateModeEnabled(std::optional<bool> enabled) = 0;
     226              :     virtual void setTestModeEnabled(std::optional<bool> enabled) = 0;
     227              : 
     228              :     virtual muse::io::path_t instrumentsXmlPath() const = 0;
     229              :     virtual muse::io::path_t scoreOrdersXmlPath() const = 0;
     230              : 
     231              :     virtual muse::io::path_t userInstrumentsFolder() const = 0;
     232              :     virtual muse::io::paths_t userInstrumentsAndScoreOrdersPaths() const = 0;
     233              :     virtual void setUserInstrumentsFolder(const muse::io::path_t& path) = 0;
     234              :     virtual muse::async::Channel<muse::io::path_t> userInstrumentsFolderChanged() const = 0;
     235              : 
     236              :     virtual muse::io::path_t stringTuningsPresetsPath() const = 0;
     237              : 
     238              :     virtual bool isSnappedToGrid(muse::Orientation gridOrientation) const = 0;
     239              :     virtual void setIsSnappedToGrid(muse::Orientation gridOrientation, bool isSnapped) = 0;
     240              : 
     241              :     virtual int gridSizeSpatium(muse::Orientation gridOrientation) const = 0;
     242              :     virtual void setGridSize(muse::Orientation gridOrientation, int sizeSpatium) = 0;
     243              : 
     244              :     virtual bool needToShowMScoreError(const std::string& errorKey) const = 0;
     245              :     virtual void setNeedToShowMScoreError(const std::string& errorKey, bool show) = 0;
     246              : 
     247              :     virtual muse::ValCh<bool> midiUseWrittenPitch() const = 0;
     248              :     virtual void setMidiUseWrittenPitch(bool useWrittenPitch) = 0;
     249              : 
     250              :     virtual muse::io::path_t styleFileImportPath() const = 0;
     251              :     virtual void setStyleFileImportPath(const muse::io::path_t& path) = 0;
     252              :     virtual muse::async::Channel<std::string> styleFileImportPathChanged() const = 0;
     253              : };
     254              : }
        

Generated by: LCOV version 2.0-1