-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99531ef
commit bd31f7f
Showing
15 changed files
with
377 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
src/appshell/view/preferences/percussionpreferencesmodel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-Studio-CLA-applies | ||
* | ||
* MuseScore Studio | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2024 MuseScore Limited | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "percussionpreferencesmodel.h" | ||
|
||
PercussionPreferencesModel::PercussionPreferencesModel(QObject* parent) | ||
: QObject(parent), muse::Injectable(muse::iocCtxForQmlObject(this)) | ||
{ | ||
} | ||
|
||
void PercussionPreferencesModel::init() | ||
{ | ||
configuration()->useNewPercussionPanelChanged().onNotify(this, [this]() { | ||
emit useNewPercussionPanelChanged(); | ||
}); | ||
|
||
configuration()->autoShowPercussionPanelChanged().onNotify(this, [this]() { | ||
emit autoShowPercussionPanelChanged(); | ||
}); | ||
|
||
configuration()->showPercussionPanelPadSwapDialogChanged().onNotify(this, [this]() { | ||
emit showPercussionPanelPadSwapDialogChanged(); | ||
}); | ||
|
||
configuration()->percussionPanelMoveMidiNotesAndShortcutsChanged().onNotify(this, [this]() { | ||
emit percussionPanelMoveMidiNotesAndShortcutsChanged(); | ||
}); | ||
} | ||
|
||
bool PercussionPreferencesModel::useNewPercussionPanel() const | ||
{ | ||
return configuration()->useNewPercussionPanel(); | ||
} | ||
|
||
void PercussionPreferencesModel::setUseNewPercussionPanel(bool use) | ||
{ | ||
configuration()->setUseNewPercussionPanel(use); | ||
} | ||
|
||
bool PercussionPreferencesModel::autoShowPercussionPanel() const | ||
{ | ||
return configuration()->autoShowPercussionPanel(); | ||
} | ||
|
||
void PercussionPreferencesModel::setAutoShowPercussionPanel(bool autoShow) | ||
{ | ||
configuration()->setAutoShowPercussionPanel(autoShow); | ||
} | ||
|
||
bool PercussionPreferencesModel::showPercussionPanelPadSwapDialog() const | ||
{ | ||
return configuration()->showPercussionPanelPadSwapDialog(); | ||
} | ||
|
||
void PercussionPreferencesModel::setShowPercussionPanelPadSwapDialog(bool show) | ||
{ | ||
configuration()->setShowPercussionPanelPadSwapDialog(show); | ||
} | ||
|
||
bool PercussionPreferencesModel::percussionPanelMoveMidiNotesAndShortcuts() const | ||
{ | ||
return configuration()->percussionPanelMoveMidiNotesAndShortcuts(); | ||
} | ||
|
||
void PercussionPreferencesModel::setPercussionPanelMoveMidiNotesAndShortcuts(bool move) | ||
{ | ||
configuration()->setPercussionPanelMoveMidiNotesAndShortcuts(move); | ||
} |
70 changes: 70 additions & 0 deletions
70
src/appshell/view/preferences/percussionpreferencesmodel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-Studio-CLA-applies | ||
* | ||
* MuseScore Studio | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2024 MuseScore Limited | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <QObject> | ||
|
||
#include "modularity/ioc.h" | ||
#include "notation/inotationconfiguration.h" | ||
|
||
#include "async/asyncable.h" | ||
|
||
class PercussionPreferencesModel : public QObject, public muse::Injectable, public muse::async::Asyncable | ||
{ | ||
Q_OBJECT | ||
|
||
Q_PROPERTY(bool useNewPercussionPanel READ useNewPercussionPanel WRITE setUseNewPercussionPanel NOTIFY useNewPercussionPanelChanged) | ||
|
||
Q_PROPERTY(bool autoShowPercussionPanel READ autoShowPercussionPanel | ||
WRITE setAutoShowPercussionPanel NOTIFY autoShowPercussionPanelChanged) | ||
|
||
Q_PROPERTY(bool showPercussionPanelPadSwapDialog READ showPercussionPanelPadSwapDialog WRITE setShowPercussionPanelPadSwapDialog NOTIFY showPercussionPanelPadSwapDialogChanged) | ||
|
||
Q_PROPERTY(bool percussionPanelMoveMidiNotesAndShortcuts READ percussionPanelMoveMidiNotesAndShortcuts | ||
WRITE setPercussionPanelMoveMidiNotesAndShortcuts NOTIFY percussionPanelMoveMidiNotesAndShortcutsChanged) | ||
|
||
muse::Inject<mu::notation::INotationConfiguration> configuration = { this }; | ||
|
||
public: | ||
explicit PercussionPreferencesModel(QObject* parent = nullptr); | ||
|
||
Q_INVOKABLE void init(); | ||
|
||
bool useNewPercussionPanel() const; | ||
void setUseNewPercussionPanel(bool use); | ||
|
||
bool autoShowPercussionPanel() const; | ||
void setAutoShowPercussionPanel(bool autoShow); | ||
|
||
bool showPercussionPanelPadSwapDialog() const; | ||
void setShowPercussionPanelPadSwapDialog(bool show); | ||
|
||
bool percussionPanelMoveMidiNotesAndShortcuts() const; | ||
void setPercussionPanelMoveMidiNotesAndShortcuts(bool move); | ||
|
||
signals: | ||
void useNewPercussionPanelChanged(); | ||
void autoShowPercussionPanelChanged(); | ||
void showPercussionPanelPadSwapDialogChanged(); | ||
void percussionPanelMoveMidiNotesAndShortcutsChanged(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.