Merge pull request #7580 from RomanPudashkin/notation_stabilization
[MU4] Notation stabilization
This commit is contained in:
commit
cc3c72a459
|
@ -18,10 +18,6 @@ Rectangle {
|
||||||
title: qsTrc("appshell", "Score"),
|
title: qsTrc("appshell", "Score"),
|
||||||
uri: "musescore://notation"
|
uri: "musescore://notation"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: qsTrc("appshell", "Sequencer"),
|
|
||||||
uri: "musescore://sequencer"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: qsTrc("appshell", "Publish"),
|
title: qsTrc("appshell", "Publish"),
|
||||||
uri: "musescore://publish"
|
uri: "musescore://publish"
|
||||||
|
|
|
@ -15,6 +15,8 @@ DockPage {
|
||||||
objectName: "publishCentral"
|
objectName: "publishCentral"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
color: ui.theme.backgroundSecondaryColor
|
||||||
|
|
||||||
StyledTextLabel {
|
StyledTextLabel {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
|
@ -52,7 +52,7 @@ DockWindow {
|
||||||
toolbars: [
|
toolbars: [
|
||||||
DockToolBar {
|
DockToolBar {
|
||||||
objectName: "mainToolBar"
|
objectName: "mainToolBar"
|
||||||
minimumWidth: 376
|
minimumWidth: 282
|
||||||
minimumHeight: dockWindow.toolbarHeight
|
minimumHeight: dockWindow.toolbarHeight
|
||||||
|
|
||||||
color: dockWindow.color
|
color: dockWindow.color
|
||||||
|
@ -70,7 +70,7 @@ DockWindow {
|
||||||
|
|
||||||
DockToolBar {
|
DockToolBar {
|
||||||
objectName: "notationToolBar"
|
objectName: "notationToolBar"
|
||||||
minimumWidth: 188
|
minimumWidth: 192
|
||||||
minimumHeight: dockWindow.toolbarHeight
|
minimumHeight: dockWindow.toolbarHeight
|
||||||
|
|
||||||
color: dockWindow.color
|
color: dockWindow.color
|
||||||
|
@ -86,7 +86,7 @@ DockWindow {
|
||||||
id: playbackToolBar
|
id: playbackToolBar
|
||||||
|
|
||||||
objectName: "playbackToolBar"
|
objectName: "playbackToolBar"
|
||||||
minimumWidth: floating ? 492 : 420
|
minimumWidth: floating ? 508 : 430
|
||||||
minimumHeight: floating ? 76 : dockWindow.toolbarHeight
|
minimumHeight: floating ? 76 : dockWindow.toolbarHeight
|
||||||
|
|
||||||
color: dockWindow.color
|
color: dockWindow.color
|
||||||
|
|
|
@ -93,7 +93,6 @@ void DockWindow::componentComplete()
|
||||||
togglePage(nullptr, currentPage());
|
togglePage(nullptr, currentPage());
|
||||||
|
|
||||||
m_window->show();
|
m_window->show();
|
||||||
updateStyle();
|
|
||||||
|
|
||||||
m_isComponentComplete = true;
|
m_isComponentComplete = true;
|
||||||
}
|
}
|
||||||
|
@ -161,6 +160,8 @@ void DockWindow::togglePage(DockPage* old, DockPage* current)
|
||||||
if (current) {
|
if (current) {
|
||||||
showPage(current);
|
showPage(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockWindow::hidePage(DockPage* page)
|
void DockWindow::hidePage(DockPage* page)
|
||||||
|
|
|
@ -71,6 +71,11 @@ void Sequencer::pause()
|
||||||
void Sequencer::stop()
|
void Sequencer::stop()
|
||||||
{
|
{
|
||||||
ONLY_AUDIO_WORKER_THREAD;
|
ONLY_AUDIO_WORKER_THREAD;
|
||||||
|
|
||||||
|
if (m_status == STOPED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_nextStatus = STOPED;
|
m_nextStatus = STOPED;
|
||||||
rewind();
|
rewind();
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,9 +130,14 @@ std::string UiConfiguration::iconsFontFamily() const
|
||||||
return settings()->value(UI_ICONS_FONT_FAMILY_KEY).toString();
|
return settings()->value(UI_ICONS_FONT_FAMILY_KEY).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
int UiConfiguration::iconsFontSize() const
|
int UiConfiguration::iconsFontSize(IconSizeType type) const
|
||||||
{
|
{
|
||||||
return fontSize(FontSizeType::TAB);
|
switch (type) {
|
||||||
|
case IconSizeType::Regular: return 16;
|
||||||
|
case IconSizeType::Toolbar: return 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification UiConfiguration::iconsFontChanged() const
|
Notification UiConfiguration::iconsFontChanged() const
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
async::Notification fontChanged() const override;
|
async::Notification fontChanged() const override;
|
||||||
|
|
||||||
std::string iconsFontFamily() const override;
|
std::string iconsFontFamily() const override;
|
||||||
int iconsFontSize() const override;
|
int iconsFontSize(IconSizeType type) const override;
|
||||||
async::Notification iconsFontChanged() const override;
|
async::Notification iconsFontChanged() const override;
|
||||||
|
|
||||||
std::string musicalFontFamily() const override;
|
std::string musicalFontFamily() const override;
|
||||||
|
|
|
@ -55,6 +55,7 @@ public:
|
||||||
virtual QFont titleBoldFont() const = 0;
|
virtual QFont titleBoldFont() const = 0;
|
||||||
|
|
||||||
virtual QFont iconsFont() const = 0;
|
virtual QFont iconsFont() const = 0;
|
||||||
|
virtual QFont toolbarIconsFont() const = 0;
|
||||||
virtual QFont musicalFont() const = 0;
|
virtual QFont musicalFont() const = 0;
|
||||||
|
|
||||||
virtual qreal accentOpacityNormal() const = 0;
|
virtual qreal accentOpacityNormal() const = 0;
|
||||||
|
|
|
@ -54,12 +54,17 @@ public:
|
||||||
TITLE
|
TITLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class IconSizeType {
|
||||||
|
Regular,
|
||||||
|
Toolbar
|
||||||
|
};
|
||||||
|
|
||||||
virtual std::string fontFamily() const = 0;
|
virtual std::string fontFamily() const = 0;
|
||||||
virtual int fontSize(FontSizeType type) const = 0;
|
virtual int fontSize(FontSizeType type) const = 0;
|
||||||
virtual async::Notification fontChanged() const = 0;
|
virtual async::Notification fontChanged() const = 0;
|
||||||
|
|
||||||
virtual std::string iconsFontFamily() const = 0;
|
virtual std::string iconsFontFamily() const = 0;
|
||||||
virtual int iconsFontSize() const = 0;
|
virtual int iconsFontSize(IconSizeType type) const = 0;
|
||||||
virtual async::Notification iconsFontChanged() const = 0;
|
virtual async::Notification iconsFontChanged() const = 0;
|
||||||
|
|
||||||
virtual std::string musicalFontFamily() const = 0;
|
virtual std::string musicalFontFamily() const = 0;
|
||||||
|
|
|
@ -221,6 +221,11 @@ QFont Theme::iconsFont() const
|
||||||
return m_iconsFont;
|
return m_iconsFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFont Theme::toolbarIconsFont() const
|
||||||
|
{
|
||||||
|
return m_toolbarIconsFont;
|
||||||
|
}
|
||||||
|
|
||||||
QFont Theme::musicalFont() const
|
QFont Theme::musicalFont() const
|
||||||
{
|
{
|
||||||
return m_musicalFont;
|
return m_musicalFont;
|
||||||
|
@ -335,8 +340,13 @@ void Theme::setupUiFonts()
|
||||||
|
|
||||||
void Theme::setupIconsFont()
|
void Theme::setupIconsFont()
|
||||||
{
|
{
|
||||||
m_iconsFont.setFamily(QString::fromStdString(configuration()->iconsFontFamily()));
|
QString family = QString::fromStdString(configuration()->iconsFontFamily());
|
||||||
m_iconsFont.setPixelSize(configuration()->iconsFontSize());
|
|
||||||
|
m_iconsFont.setFamily(family);
|
||||||
|
m_iconsFont.setPixelSize(configuration()->iconsFontSize(IUiConfiguration::IconSizeType::Regular));
|
||||||
|
|
||||||
|
m_toolbarIconsFont.setFamily(family);
|
||||||
|
m_toolbarIconsFont.setPixelSize(configuration()->iconsFontSize(IUiConfiguration::IconSizeType::Toolbar));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Theme::setupMusicFont()
|
void Theme::setupMusicFont()
|
||||||
|
|
|
@ -67,6 +67,8 @@ class Theme : public QObject, public ITheme, public async::Asyncable
|
||||||
Q_PROPERTY(QFont titleBoldFont READ titleBoldFont NOTIFY dataChanged)
|
Q_PROPERTY(QFont titleBoldFont READ titleBoldFont NOTIFY dataChanged)
|
||||||
|
|
||||||
Q_PROPERTY(QFont iconsFont READ iconsFont NOTIFY dataChanged)
|
Q_PROPERTY(QFont iconsFont READ iconsFont NOTIFY dataChanged)
|
||||||
|
Q_PROPERTY(QFont toolbarIconsFont READ toolbarIconsFont NOTIFY dataChanged)
|
||||||
|
|
||||||
Q_PROPERTY(QFont musicalFont READ musicalFont NOTIFY dataChanged)
|
Q_PROPERTY(QFont musicalFont READ musicalFont NOTIFY dataChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -96,6 +98,7 @@ public:
|
||||||
QFont titleBoldFont() const override;
|
QFont titleBoldFont() const override;
|
||||||
|
|
||||||
QFont iconsFont() const override;
|
QFont iconsFont() const override;
|
||||||
|
QFont toolbarIconsFont() const override;
|
||||||
QFont musicalFont() const override;
|
QFont musicalFont() const override;
|
||||||
|
|
||||||
qreal accentOpacityNormal() const override;
|
qreal accentOpacityNormal() const override;
|
||||||
|
@ -138,6 +141,7 @@ private:
|
||||||
QFont m_headerBoldFont;
|
QFont m_headerBoldFont;
|
||||||
QFont m_titleBoldFont;
|
QFont m_titleBoldFont;
|
||||||
QFont m_iconsFont;
|
QFont m_iconsFont;
|
||||||
|
QFont m_toolbarIconsFont;
|
||||||
QFont m_musicalFont;
|
QFont m_musicalFont;
|
||||||
|
|
||||||
async::Notification m_themeChanged;
|
async::Notification m_themeChanged;
|
||||||
|
|
|
@ -10,6 +10,9 @@ Item {
|
||||||
property int maxValue: 999
|
property int maxValue: 999
|
||||||
property int value: 0
|
property int value: 0
|
||||||
|
|
||||||
|
property bool addLeadingZeros: true
|
||||||
|
property int displayedNumberLength: maxValue.toString().length
|
||||||
|
|
||||||
property alias font: textField.font
|
property alias font: textField.font
|
||||||
|
|
||||||
signal valueEdited(var newValue)
|
signal valueEdited(var newValue)
|
||||||
|
@ -22,12 +25,14 @@ Item {
|
||||||
QtObject {
|
QtObject {
|
||||||
id: privateProperties
|
id: privateProperties
|
||||||
|
|
||||||
property int maxNumberLength: root.maxValue.toString().length
|
|
||||||
|
|
||||||
function pad(value) {
|
function pad(value) {
|
||||||
var str = value.toString()
|
var str = value.toString()
|
||||||
|
|
||||||
while (str.length < maxNumberLength) {
|
if (!addLeadingZeros) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (str.length < root.displayedNumberLength) {
|
||||||
str = "0" + str
|
str = "0" + str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,22 +53,20 @@ Item {
|
||||||
text: privateProperties.pad(root.value)
|
text: privateProperties.pad(root.value)
|
||||||
|
|
||||||
onTextEdited: {
|
onTextEdited: {
|
||||||
var currentValue = parseInt(text)
|
var currentValue = text.length > 0 ? parseInt(text) : 0
|
||||||
var str = currentValue.toString()
|
var str = currentValue.toString()
|
||||||
var newValue = 0
|
var newValue = 0
|
||||||
|
|
||||||
if (str.length > privateProperties.maxNumberLength || currentValue > root.maxValue) {
|
if (str.length > privateProperties.displayedNumberLength || currentValue > root.maxValue) {
|
||||||
var lastDigit = str.charAt(str.length - 1)
|
var lastDigit = str.charAt(str.length - 1)
|
||||||
newValue = parseInt(lastDigit)
|
newValue = parseInt(lastDigit)
|
||||||
} else {
|
} else {
|
||||||
newValue = currentValue
|
newValue = currentValue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newValue > root.maxValue) {
|
newValue = Math.min(newValue, root.maxValue)
|
||||||
newValue = value
|
|
||||||
}
|
|
||||||
|
|
||||||
text = privateProperties.pad(newValue)
|
text = privateProperties.pad(newValue)
|
||||||
|
|
||||||
root.valueEdited(newValue)
|
root.valueEdited(newValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +76,6 @@ Item {
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
cursorDelegate: Item {}
|
|
||||||
selectByMouse: false
|
selectByMouse: false
|
||||||
|
|
||||||
color: ui.theme.fontPrimaryColor
|
color: ui.theme.fontPrimaryColor
|
||||||
|
@ -95,6 +97,7 @@ Item {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
textField.forceActiveFocus()
|
textField.forceActiveFocus()
|
||||||
|
textField.cursorPosition = textField.text.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ Row {
|
||||||
maxValue: hoursField.value === root.maxTime.getHours() ? root.maxTime.getMinutes() : 60
|
maxValue: hoursField.value === root.maxTime.getHours() ? root.maxTime.getMinutes() : 60
|
||||||
value: root.time.getMinutes()
|
value: root.time.getMinutes()
|
||||||
|
|
||||||
|
displayedNumberLength: 2
|
||||||
font: root.font
|
font: root.font
|
||||||
|
|
||||||
onValueEdited: {
|
onValueEdited: {
|
||||||
|
@ -65,6 +66,7 @@ Row {
|
||||||
maxValue: minutesField.value === root.maxTime.getMinutes() ? root.maxTime.getSeconds() : 60
|
maxValue: minutesField.value === root.maxTime.getMinutes() ? root.maxTime.getSeconds() : 60
|
||||||
value: root.time.getSeconds()
|
value: root.time.getSeconds()
|
||||||
|
|
||||||
|
displayedNumberLength: 2
|
||||||
font: root.font
|
font: root.font
|
||||||
|
|
||||||
onValueEdited: {
|
onValueEdited: {
|
||||||
|
|
|
@ -174,7 +174,7 @@ Fraction Score::pos()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Fraction(-1, 1);
|
return Fraction(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
|
@ -92,8 +92,8 @@ public:
|
||||||
virtual ValCh<bool> isNavigatorVisible() const = 0;
|
virtual ValCh<bool> isNavigatorVisible() const = 0;
|
||||||
virtual void setNavigatorVisible(bool visible) = 0;
|
virtual void setNavigatorVisible(bool visible) = 0;
|
||||||
|
|
||||||
virtual ValCh<framework::Orientation> navigatorOrientation() const = 0;
|
virtual ValCh<framework::Orientation> canvasOrientation() const = 0;
|
||||||
virtual void setNavigatorOrientation(framework::Orientation orientation) = 0;
|
virtual void setCanvasOrientation(framework::Orientation orientation) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void addLoopBoundary(LoopBoundaryType boundaryType, int tick) = 0;
|
virtual void addLoopBoundary(LoopBoundaryType boundaryType, int tick) = 0;
|
||||||
virtual void removeLoopBoundaries() = 0;
|
virtual void setLoopBoundariesVisible(bool visible) = 0;
|
||||||
virtual async::Channel<LoopBoundaries> loopBoundariesChanged() const = 0;
|
virtual ValCh<LoopBoundaries> loopBoundaries() const = 0;
|
||||||
|
|
||||||
virtual Tempo tempo(int tick) const = 0;
|
virtual Tempo tempo(int tick) const = 0;
|
||||||
virtual MeasureBeat beat(int tick) const = 0;
|
virtual MeasureBeat beat(int tick) const = 0;
|
||||||
|
|
|
@ -134,7 +134,7 @@ void Notation::init()
|
||||||
Ms::MScore::setNudgeStep10(1.0); // Ctrl + cursor key (default 1.0)
|
Ms::MScore::setNudgeStep10(1.0); // Ctrl + cursor key (default 1.0)
|
||||||
Ms::MScore::setNudgeStep50(0.01); // Alt + cursor key (default 0.01)
|
Ms::MScore::setNudgeStep50(0.01); // Alt + cursor key (default 0.01)
|
||||||
|
|
||||||
bool isVertical = configuration()->navigatorOrientation().val == framework::Orientation::Vertical;
|
bool isVertical = configuration()->canvasOrientation().val == framework::Orientation::Vertical;
|
||||||
Ms::MScore::setVerticalOrientation(isVertical);
|
Ms::MScore::setVerticalOrientation(isVertical);
|
||||||
|
|
||||||
Ms::MScore::pixelRatio = Ms::DPI / QGuiApplication::primaryScreen()->logicalDotsPerInch();
|
Ms::MScore::pixelRatio = Ms::DPI / QGuiApplication::primaryScreen()->logicalDotsPerInch();
|
||||||
|
|
|
@ -194,6 +194,7 @@ void NotationActionController::init()
|
||||||
dispatcher()->reg(this, "tempo", [this]() { addText(TextType::TEMPO); });
|
dispatcher()->reg(this, "tempo", [this]() { addText(TextType::TEMPO); });
|
||||||
|
|
||||||
dispatcher()->reg(this, "toggle-navigator", this, &NotationActionController::toggleNavigator);
|
dispatcher()->reg(this, "toggle-navigator", this, &NotationActionController::toggleNavigator);
|
||||||
|
dispatcher()->reg(this, "toggle-mixer", this, &NotationActionController::toggleMixer);
|
||||||
|
|
||||||
for (int i = MIN_NOTES_INTERVAL; i <= MAX_NOTES_INTERVAL; ++i) {
|
for (int i = MIN_NOTES_INTERVAL; i <= MAX_NOTES_INTERVAL; ++i) {
|
||||||
if (isNotesIntervalValid(i)) {
|
if (isNotesIntervalValid(i)) {
|
||||||
|
@ -984,6 +985,11 @@ void NotationActionController::toggleNavigator()
|
||||||
configuration()->setNavigatorVisible(!visible);
|
configuration()->setNavigatorVisible(!visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NotationActionController::toggleMixer()
|
||||||
|
{
|
||||||
|
NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
void NotationActionController::startNoteInputIfNeed()
|
void NotationActionController::startNoteInputIfNeed()
|
||||||
{
|
{
|
||||||
auto interaction = currentNotationInteraction();
|
auto interaction = currentNotationInteraction();
|
||||||
|
|
|
@ -111,6 +111,7 @@ private:
|
||||||
void openTupletOtherDialog();
|
void openTupletOtherDialog();
|
||||||
|
|
||||||
void toggleNavigator();
|
void toggleNavigator();
|
||||||
|
void toggleMixer();
|
||||||
|
|
||||||
bool isTextEditting() const;
|
bool isTextEditting() const;
|
||||||
|
|
||||||
|
|
|
@ -110,65 +110,86 @@ const ActionList NotationActions::m_actions = {
|
||||||
),
|
),
|
||||||
ActionItem("paste-half",
|
ActionItem("paste-half",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Paste Half Duration")
|
QT_TRANSLATE_NOOP("action", "Paste Half Duration"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Paste half duration")
|
||||||
),
|
),
|
||||||
ActionItem("paste-double",
|
ActionItem("paste-double",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Paste Double Duration")
|
QT_TRANSLATE_NOOP("action", "Paste Double Duration"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Paste double duration")
|
||||||
),
|
),
|
||||||
ActionItem("paste-special",
|
ActionItem("paste-special",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Paste Special")
|
QT_TRANSLATE_NOOP("action", "Paste Special"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Paste special")
|
||||||
),
|
),
|
||||||
ActionItem("swap",
|
ActionItem("swap",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Swap with Clipboard")
|
QT_TRANSLATE_NOOP("action", "Swap with Clipboard"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Swap with clipboard")
|
||||||
),
|
),
|
||||||
ActionItem("select-all",
|
ActionItem("select-all",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Select All")
|
QT_TRANSLATE_NOOP("action", "Select All"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Select all")
|
||||||
),
|
),
|
||||||
ActionItem("delete",
|
ActionItem("delete",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Delete"),
|
QT_TRANSLATE_NOOP("action", "Delete"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Delete the selected element(s)"),
|
||||||
IconCode::Code::DELETE_TANK
|
IconCode::Code::DELETE_TANK
|
||||||
),
|
),
|
||||||
ActionItem("select-similar",
|
ActionItem("select-similar",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Select: similar")
|
QT_TRANSLATE_NOOP("action", "Select: similar"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Select all similar elements")
|
||||||
),
|
),
|
||||||
ActionItem("select-similar-staff",
|
ActionItem("select-similar-staff",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Select: in same staff")
|
QT_TRANSLATE_NOOP("action", "Select: in same staff"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Select all similar elements in same staff")
|
||||||
),
|
),
|
||||||
ActionItem("select-similar-range",
|
ActionItem("select-similar-range",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Select: in the range")
|
QT_TRANSLATE_NOOP("action", "Select: in the range"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Select all similar elements in the range selection")
|
||||||
),
|
),
|
||||||
ActionItem("select-dialog",
|
ActionItem("select-dialog",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Select Dialog")
|
QT_TRANSLATE_NOOP("action", "Select Dialog"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Select all similar elements with more options")
|
||||||
),
|
),
|
||||||
ActionItem("edit-style",
|
ActionItem("edit-style",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Style")
|
QT_TRANSLATE_NOOP("action", "Style…"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Edit style")
|
||||||
),
|
),
|
||||||
ActionItem("page-settings",
|
ActionItem("page-settings",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Page Settings")
|
QT_TRANSLATE_NOOP("action", "Page Settings…"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Page settings")
|
||||||
),
|
),
|
||||||
ActionItem("load-style",
|
ActionItem("load-style",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Load Style")
|
QT_TRANSLATE_NOOP("action","Load Style…"),
|
||||||
|
QT_TRANSLATE_NOOP("action","Load style")
|
||||||
),
|
),
|
||||||
ActionItem("transpose",
|
ActionItem("transpose",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
|
QT_TRANSLATE_NOOP("action", "&Transpose…"),
|
||||||
QT_TRANSLATE_NOOP("action", "Transpose")
|
QT_TRANSLATE_NOOP("action", "Transpose")
|
||||||
),
|
),
|
||||||
ActionItem("parts",
|
ActionItem("parts",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Parts"),
|
QT_TRANSLATE_NOOP("action", "Parts"),
|
||||||
QT_TRANSLATE_NOOP("action", "Manage parts")
|
QT_TRANSLATE_NOOP("action", "Manage parts"),
|
||||||
|
IconCode::Code::PAGE
|
||||||
|
),
|
||||||
|
ActionItem("toggle-mixer",
|
||||||
|
ShortcutContext::NotationActive,
|
||||||
|
QT_TRANSLATE_NOOP("action", "Mixer"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Toggle mixer"),
|
||||||
|
IconCode::Code::MIXER
|
||||||
),
|
),
|
||||||
ActionItem("view-mode-page",
|
ActionItem("view-mode-page",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
|
@ -192,11 +213,13 @@ const ActionList NotationActions::m_actions = {
|
||||||
),
|
),
|
||||||
ActionItem("add-remove-breaks",
|
ActionItem("add-remove-breaks",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add/Remove System Breaks…"),
|
||||||
QT_TRANSLATE_NOOP("action", "Add/remove system breaks")
|
QT_TRANSLATE_NOOP("action", "Add/remove system breaks")
|
||||||
),
|
),
|
||||||
ActionItem("edit-info",
|
ActionItem("edit-info",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Score Properties")
|
QT_TRANSLATE_NOOP("action", "Score Properties…"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Edit score properties")
|
||||||
),
|
),
|
||||||
ActionItem("undo",
|
ActionItem("undo",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
|
@ -212,360 +235,448 @@ const ActionList NotationActions::m_actions = {
|
||||||
),
|
),
|
||||||
ActionItem("voice-x12",
|
ActionItem("voice-x12",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Exchange Voice 1-2")
|
QT_TRANSLATE_NOOP("action", "Exchange Voice 1-2"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Exchange voice 1-2")
|
||||||
),
|
),
|
||||||
ActionItem("voice-x13",
|
ActionItem("voice-x13",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Exchange Voice 1-3")
|
QT_TRANSLATE_NOOP("action", "Exchange Voice 1-3"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Exchange voice 1-3")
|
||||||
),
|
),
|
||||||
ActionItem("voice-x14",
|
ActionItem("voice-x14",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Exchange Voice 1-4")
|
QT_TRANSLATE_NOOP("action", "Exchange Voice 1-4"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Exchange voice 1-4")
|
||||||
),
|
),
|
||||||
ActionItem("voice-x23",
|
ActionItem("voice-x23",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Exchange Voice 2-3")
|
QT_TRANSLATE_NOOP("action", "Exchange Voice 2-3"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Exchange voice 2-3")
|
||||||
),
|
),
|
||||||
ActionItem("voice-x24",
|
ActionItem("voice-x24",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Exchange Voice 2-4")
|
QT_TRANSLATE_NOOP("action", "Exchange Voice 2-4"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Exchange voice 2-4")
|
||||||
),
|
),
|
||||||
ActionItem("voice-x34",
|
ActionItem("voice-x34",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Exchange Voice 3-4")
|
QT_TRANSLATE_NOOP("action", "Exchange Voice 3-4"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Exchange voice 3-4")
|
||||||
),
|
),
|
||||||
ActionItem("split-measure",
|
ActionItem("split-measure",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Split measure"),
|
QT_TRANSLATE_NOOP("action", "Split Measure Before Selected Note/Rest"),
|
||||||
QT_TRANSLATE_NOOP("action", "Split measure before selected note/rest")
|
QT_TRANSLATE_NOOP("action", "Split measure before selected note/rest")
|
||||||
),
|
),
|
||||||
ActionItem("join-measures",
|
ActionItem("join-measures",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Join Selected Measures")
|
QT_TRANSLATE_NOOP("action", "Join Selected Measures"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Join selected measures")
|
||||||
),
|
),
|
||||||
ActionItem("insert-measure",
|
ActionItem("insert-measure",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert Measure")
|
QT_TRANSLATE_NOOP("action", "Insert One Measure"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert one measure")
|
||||||
),
|
),
|
||||||
ActionItem("insert-measures",
|
ActionItem("insert-measures",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert Measures")
|
QT_TRANSLATE_NOOP("action", "Insert Measures"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert measures")
|
||||||
),
|
),
|
||||||
ActionItem("append-measure",
|
ActionItem("append-measure",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Append Measure")
|
QT_TRANSLATE_NOOP("action", "Append One Measure"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Append one measure")
|
||||||
),
|
),
|
||||||
ActionItem("append-measures",
|
ActionItem("append-measures",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Append Measures")
|
QT_TRANSLATE_NOOP("action", "Append Measures"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Append measures")
|
||||||
),
|
),
|
||||||
ActionItem("insert-hbox",
|
ActionItem("insert-hbox",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert Horizontal Frame")
|
QT_TRANSLATE_NOOP("action", "Insert Horizontal Frame"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert horizontal frame")
|
||||||
),
|
),
|
||||||
ActionItem("insert-vbox",
|
ActionItem("insert-vbox",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert Vertical Frame")
|
QT_TRANSLATE_NOOP("action", "Insert Vertical Frame"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert vertical frame")
|
||||||
),
|
),
|
||||||
ActionItem("insert-textframe",
|
ActionItem("insert-textframe",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert Text Frame")
|
QT_TRANSLATE_NOOP("action", "Insert Text Frame"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert text frame")
|
||||||
),
|
),
|
||||||
ActionItem("append-hbox",
|
ActionItem("append-hbox",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Append Horizontal Frame")
|
QT_TRANSLATE_NOOP("action", "Append Horizontal Frame"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Append horizontal frame")
|
||||||
),
|
),
|
||||||
ActionItem("append-vbox",
|
ActionItem("append-vbox",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Append Vertical Frame")
|
QT_TRANSLATE_NOOP("action", "Append Vertical Frame"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Append vertical frame")
|
||||||
),
|
),
|
||||||
ActionItem("append-textframe",
|
ActionItem("append-textframe",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Append Text Frame")
|
QT_TRANSLATE_NOOP("action", "Append Text Frame"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Append text frame")
|
||||||
),
|
),
|
||||||
ActionItem("interval1",
|
ActionItem("interval1",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Unison Above")
|
QT_TRANSLATE_NOOP("action", "Unison Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter unison above")
|
||||||
),
|
),
|
||||||
ActionItem("interval2",
|
ActionItem("interval2",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Second Above")
|
QT_TRANSLATE_NOOP("action", "Second Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter second above")
|
||||||
),
|
),
|
||||||
ActionItem("interval3",
|
ActionItem("interval3",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Third Above")
|
QT_TRANSLATE_NOOP("action", "Third Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter third above")
|
||||||
),
|
),
|
||||||
ActionItem("interval4",
|
ActionItem("interval4",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Fourth Above")
|
QT_TRANSLATE_NOOP("action", "Fourth Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter fourth above")
|
||||||
),
|
),
|
||||||
ActionItem("interval5",
|
ActionItem("interval5",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Fifth Above")
|
QT_TRANSLATE_NOOP("action", "Fifth Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter fifth above")
|
||||||
),
|
),
|
||||||
ActionItem("interval6",
|
ActionItem("interval6",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Sixth Above")
|
QT_TRANSLATE_NOOP("action", "Sixth Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter sixth above")
|
||||||
),
|
),
|
||||||
ActionItem("interval7",
|
ActionItem("interval7",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Seventh Above")
|
QT_TRANSLATE_NOOP("action", "Seventh Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter seventh above")
|
||||||
),
|
),
|
||||||
ActionItem("interval8",
|
ActionItem("interval8",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Octave Above")
|
QT_TRANSLATE_NOOP("action", "Octave Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter octave above")
|
||||||
),
|
),
|
||||||
ActionItem("interval9",
|
ActionItem("interval9",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Ninth Above")
|
QT_TRANSLATE_NOOP("action", "Ninth Above"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter ninth above")
|
||||||
),
|
),
|
||||||
ActionItem("interval-2",
|
ActionItem("interval-2",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Second Below")
|
QT_TRANSLATE_NOOP("action", "Second Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter second below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-3",
|
ActionItem("interval-3",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Third Below")
|
QT_TRANSLATE_NOOP("action", "Third Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter third below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-4",
|
ActionItem("interval-4",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Fourth Below")
|
QT_TRANSLATE_NOOP("action", "Fourth Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter fourth below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-5",
|
ActionItem("interval-5",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Fifth Below")
|
QT_TRANSLATE_NOOP("action", "Fifth Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter fifth below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-6",
|
ActionItem("interval-6",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Sixth Below")
|
QT_TRANSLATE_NOOP("action", "Sixth Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter sixth below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-7",
|
ActionItem("interval-7",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Seventh Below")
|
QT_TRANSLATE_NOOP("action", "Seventh Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter seventh below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-8",
|
ActionItem("interval-8",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Octave Below")
|
QT_TRANSLATE_NOOP("action", "Octave Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter octave below")
|
||||||
),
|
),
|
||||||
ActionItem("interval-9",
|
ActionItem("interval-9",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Ninth Below")
|
QT_TRANSLATE_NOOP("action", "Ninth Below"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter ninth below")
|
||||||
),
|
),
|
||||||
ActionItem("note-c",
|
ActionItem("note-c",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "C")
|
QT_TRANSLATE_NOOP("action", "C"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note C")
|
||||||
),
|
),
|
||||||
ActionItem("note-d",
|
ActionItem("note-d",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "D")
|
QT_TRANSLATE_NOOP("action", "D"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note D")
|
||||||
),
|
),
|
||||||
ActionItem("note-e",
|
ActionItem("note-e",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "E")
|
QT_TRANSLATE_NOOP("action", "E"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note E")
|
||||||
),
|
),
|
||||||
ActionItem("note-f",
|
ActionItem("note-f",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "F")
|
QT_TRANSLATE_NOOP("action", "F"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note F")
|
||||||
),
|
),
|
||||||
ActionItem("note-g",
|
ActionItem("note-g",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "G")
|
QT_TRANSLATE_NOOP("action", "G"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note G")
|
||||||
),
|
),
|
||||||
ActionItem("note-a",
|
ActionItem("note-a",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "A")
|
QT_TRANSLATE_NOOP("action", "A"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note A")
|
||||||
),
|
),
|
||||||
ActionItem("note-b",
|
ActionItem("note-b",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "B")
|
QT_TRANSLATE_NOOP("action", "B"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Enter note B")
|
||||||
),
|
),
|
||||||
ActionItem("chord-c",
|
ActionItem("chord-c",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add C to Chord")
|
QT_TRANSLATE_NOOP("action", "Add C to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note C to chord")
|
||||||
),
|
),
|
||||||
ActionItem("chord-d",
|
ActionItem("chord-d",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add D to Chord")
|
QT_TRANSLATE_NOOP("action", "Add D to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note D to chord")
|
||||||
),
|
),
|
||||||
ActionItem("chord-e",
|
ActionItem("chord-e",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add E to Chord")
|
QT_TRANSLATE_NOOP("action", "Add E to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note E to chord")
|
||||||
),
|
),
|
||||||
ActionItem("chord-f",
|
ActionItem("chord-f",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add F to Chord")
|
QT_TRANSLATE_NOOP("action", "Add F to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note F to chord")
|
||||||
),
|
),
|
||||||
ActionItem("chord-g",
|
ActionItem("chord-g",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add G to Chord")
|
QT_TRANSLATE_NOOP("action", "Add G to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note G to chord")
|
||||||
),
|
),
|
||||||
ActionItem("chord-a",
|
ActionItem("chord-a",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add A to Chord")
|
QT_TRANSLATE_NOOP("action", "Add A to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note A to chord")
|
||||||
),
|
),
|
||||||
ActionItem("chord-b",
|
ActionItem("chord-b",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Add B to Chord")
|
QT_TRANSLATE_NOOP("action", "Add B to Chord"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add note B to chord")
|
||||||
),
|
),
|
||||||
ActionItem("insert-c",
|
ActionItem("insert-c",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert C")
|
QT_TRANSLATE_NOOP("action", "Insert C"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note C")
|
||||||
),
|
),
|
||||||
ActionItem("insert-d",
|
ActionItem("insert-d",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert D")
|
QT_TRANSLATE_NOOP("action", "Insert D"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note D")
|
||||||
),
|
),
|
||||||
ActionItem("insert-e",
|
ActionItem("insert-e",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert E")
|
QT_TRANSLATE_NOOP("action", "Insert E"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note E")
|
||||||
),
|
),
|
||||||
ActionItem("insert-f",
|
ActionItem("insert-f",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert F")
|
QT_TRANSLATE_NOOP("action", "Insert F"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note F")
|
||||||
),
|
),
|
||||||
ActionItem("insert-g",
|
ActionItem("insert-g",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert G")
|
QT_TRANSLATE_NOOP("action", "Insert G"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note G")
|
||||||
),
|
),
|
||||||
ActionItem("insert-a",
|
ActionItem("insert-a",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert A")
|
QT_TRANSLATE_NOOP("action", "Insert A"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note A")
|
||||||
),
|
),
|
||||||
ActionItem("insert-b",
|
ActionItem("insert-b",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Insert B")
|
QT_TRANSLATE_NOOP("action", "Insert B"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Insert note B")
|
||||||
),
|
),
|
||||||
ActionItem("add-8va",
|
ActionItem("add-8va",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Ottava 8va alta")
|
QT_TRANSLATE_NOOP("action", "Ottava 8va alta"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add ottava 8va alta")
|
||||||
),
|
),
|
||||||
ActionItem("add-8vb",
|
ActionItem("add-8vb",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Ottava 8va bassa")
|
QT_TRANSLATE_NOOP("action", "Ottava 8va bassa"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add ottava 8va bassa")
|
||||||
),
|
),
|
||||||
ActionItem("add-hairpin",
|
ActionItem("add-hairpin",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Crescendo")
|
QT_TRANSLATE_NOOP("action", "Crescendo"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add crescendo")
|
||||||
),
|
),
|
||||||
ActionItem("add-hairpin-reverse",
|
ActionItem("add-hairpin-reverse",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Decrescendo")
|
QT_TRANSLATE_NOOP("action", "Decrescendo"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add decrescendo")
|
||||||
),
|
),
|
||||||
ActionItem("add-noteline",
|
ActionItem("add-noteline",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Note Anchored Line")
|
QT_TRANSLATE_NOOP("action","Note Anchored Line"),
|
||||||
|
QT_TRANSLATE_NOOP("action","Note anchored line")
|
||||||
),
|
),
|
||||||
ActionItem("title-text",
|
ActionItem("title-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Title")
|
QT_TRANSLATE_NOOP("action", "Title"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add title text")
|
||||||
),
|
),
|
||||||
ActionItem("subtitle-text",
|
ActionItem("subtitle-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Subtitle")
|
QT_TRANSLATE_NOOP("action", "Subtitle"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add subtitle text")
|
||||||
),
|
),
|
||||||
ActionItem("composer-text",
|
ActionItem("composer-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Composer")
|
QT_TRANSLATE_NOOP("action", "Composer"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add composer text")
|
||||||
),
|
),
|
||||||
ActionItem("poet-text",
|
ActionItem("poet-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Lirycist")
|
QT_TRANSLATE_NOOP("action", "Lirycist"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add lirycist text")
|
||||||
),
|
),
|
||||||
ActionItem("part-text",
|
ActionItem("part-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Part Name")
|
QT_TRANSLATE_NOOP("action", "Part Name"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add part name")
|
||||||
),
|
),
|
||||||
ActionItem("system-text",
|
ActionItem("system-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "System Text")
|
QT_TRANSLATE_NOOP("action", "System Text"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add system text")
|
||||||
),
|
),
|
||||||
ActionItem("staff-text",
|
ActionItem("staff-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Staff Text")
|
QT_TRANSLATE_NOOP("action", "Staff Text"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add staff text")
|
||||||
),
|
),
|
||||||
ActionItem("expression-text",
|
ActionItem("expression-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Expression Text")
|
QT_TRANSLATE_NOOP("action", "Expression Text"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add expression text")
|
||||||
),
|
),
|
||||||
ActionItem("rehearsalmark-text",
|
ActionItem("rehearsalmark-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Rehearsal Mark")
|
QT_TRANSLATE_NOOP("action", "Rehearsal Mark"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add rehearsal mark")
|
||||||
),
|
),
|
||||||
ActionItem("instrument-change-text",
|
ActionItem("instrument-change-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Instrument Change")
|
QT_TRANSLATE_NOOP("action", "Instrument Change"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add instrument change")
|
||||||
),
|
),
|
||||||
ActionItem("fingering-text",
|
ActionItem("fingering-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Fingering")
|
QT_TRANSLATE_NOOP("action", "Fingering"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add fingering")
|
||||||
),
|
),
|
||||||
ActionItem("sticking-text",
|
ActionItem("sticking-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Sticking")
|
QT_TRANSLATE_NOOP("action", "Sticking"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add sticking")
|
||||||
),
|
),
|
||||||
ActionItem("chord-text",
|
ActionItem("chord-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Chord Symbol")
|
QT_TRANSLATE_NOOP("action", "Chord Symbol"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add chord symbol")
|
||||||
),
|
),
|
||||||
ActionItem("roman-numeral-text",
|
ActionItem("roman-numeral-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Roman Numeral Analysis")
|
QT_TRANSLATE_NOOP("action", "Roman Numeral Analysis"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add Roman numeral analysis")
|
||||||
),
|
),
|
||||||
ActionItem("nashville-number-text",
|
ActionItem("nashville-number-text",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Nashville Number")
|
QT_TRANSLATE_NOOP("action", "Nashville Number"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add Nashville number")
|
||||||
),
|
),
|
||||||
ActionItem("lyrics",
|
ActionItem("lyrics",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Lyrics")
|
QT_TRANSLATE_NOOP("action", "Lyrics"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add lyrics")
|
||||||
),
|
),
|
||||||
ActionItem("figured-bass",
|
ActionItem("figured-bass",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Figured Bass")
|
QT_TRANSLATE_NOOP("action", "Figured Bass"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add figured bass")
|
||||||
),
|
),
|
||||||
ActionItem("tempo",
|
ActionItem("tempo",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Tempo Marking")
|
QT_TRANSLATE_NOOP("action", "Tempo Marking"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add tempo marking")
|
||||||
),
|
),
|
||||||
ActionItem("duplet",
|
ActionItem("duplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Duplet")
|
QT_TRANSLATE_NOOP("action", "Duplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add duplet")
|
||||||
),
|
),
|
||||||
ActionItem("triplet",
|
ActionItem("triplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Triplet")
|
QT_TRANSLATE_NOOP("action", "Triplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add triplet")
|
||||||
),
|
),
|
||||||
ActionItem("quadruplet",
|
ActionItem("quadruplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Quadruplet")
|
QT_TRANSLATE_NOOP("action", "Quadruplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add quadruplet")
|
||||||
),
|
),
|
||||||
ActionItem("quintuplet",
|
ActionItem("quintuplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Quintuplet")
|
QT_TRANSLATE_NOOP("action", "Quintuplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add quintuplet")
|
||||||
),
|
),
|
||||||
ActionItem("sextuplet",
|
ActionItem("sextuplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "sextuplet")
|
QT_TRANSLATE_NOOP("action", "sextuplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add sextuplet")
|
||||||
),
|
),
|
||||||
ActionItem("septuplet",
|
ActionItem("septuplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Septuplet")
|
QT_TRANSLATE_NOOP("action", "Septuplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add septuplet")
|
||||||
),
|
),
|
||||||
ActionItem("octuplet",
|
ActionItem("octuplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Octuplet")
|
QT_TRANSLATE_NOOP("action", "Octuplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add octuplet")
|
||||||
),
|
),
|
||||||
ActionItem("nonuplet",
|
ActionItem("nonuplet",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Nontuplet")
|
QT_TRANSLATE_NOOP("action", "Nontuplet"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add nontuplet")
|
||||||
),
|
),
|
||||||
ActionItem("tuplet-dialog",
|
ActionItem("tuplet-dialog",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Other")
|
QT_TRANSLATE_NOOP("action", "Other…"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Other tuplets")
|
||||||
),
|
),
|
||||||
ActionItem("toggle-navigator",
|
ActionItem("toggle-navigator",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Toggle Navigator")
|
QT_TRANSLATE_NOOP("action", "Navigator"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Toggle 'Navigator'")
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -609,146 +720,175 @@ const ActionList NotationActions::m_noteInputActions = {
|
||||||
ActionItem("note-longa",
|
ActionItem("note-longa",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Longo"),
|
QT_TRANSLATE_NOOP("action", "Longo"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: Longa"),
|
||||||
IconCode::Code::LONGO
|
IconCode::Code::LONGO
|
||||||
),
|
),
|
||||||
ActionItem("note-breve",
|
ActionItem("note-breve",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Double whole note"),
|
QT_TRANSLATE_NOOP("action", "Double whole note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: double whole note"),
|
||||||
IconCode::Code::NOTE_WHOLE_DOUBLE
|
IconCode::Code::NOTE_WHOLE_DOUBLE
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-1",
|
ActionItem("pad-note-1",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Whole note"),
|
QT_TRANSLATE_NOOP("action", "Whole note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: whole note"),
|
||||||
IconCode::Code::NOTE_WHOLE
|
IconCode::Code::NOTE_WHOLE
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-2",
|
ActionItem("pad-note-2",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Half note"),
|
QT_TRANSLATE_NOOP("action", "Half note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: half note"),
|
||||||
IconCode::Code::NOTE_HALF
|
IconCode::Code::NOTE_HALF
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-4",
|
ActionItem("pad-note-4",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Quarter note"),
|
QT_TRANSLATE_NOOP("action", "Quarter note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: quarter note"),
|
||||||
IconCode::Code::NOTE_QUARTER
|
IconCode::Code::NOTE_QUARTER
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-8",
|
ActionItem("pad-note-8",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "8th note"),
|
QT_TRANSLATE_NOOP("action", "8th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 8th note"),
|
||||||
IconCode::Code::NOTE_8TH
|
IconCode::Code::NOTE_8TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-16",
|
ActionItem("pad-note-16",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "16th note"),
|
QT_TRANSLATE_NOOP("action", "16th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 16th note"),
|
||||||
IconCode::Code::NOTE_16TH
|
IconCode::Code::NOTE_16TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-32",
|
ActionItem("pad-note-32",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "32th note"),
|
QT_TRANSLATE_NOOP("action", "32th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 32th note"),
|
||||||
IconCode::Code::NOTE_32TH
|
IconCode::Code::NOTE_32TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-64",
|
ActionItem("pad-note-64",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "64th note"),
|
QT_TRANSLATE_NOOP("action", "64th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 64th note"),
|
||||||
IconCode::Code::NOTE_64TH
|
IconCode::Code::NOTE_64TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-128",
|
ActionItem("pad-note-128",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "128th note"),
|
QT_TRANSLATE_NOOP("action", "128th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 128th note"),
|
||||||
IconCode::Code::NOTE_128TH
|
IconCode::Code::NOTE_128TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-256",
|
ActionItem("pad-note-256",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "256th note"),
|
QT_TRANSLATE_NOOP("action", "256th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 256th note"),
|
||||||
IconCode::Code::NOTE_256TH
|
IconCode::Code::NOTE_256TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-512",
|
ActionItem("pad-note-512",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "512th note"),
|
QT_TRANSLATE_NOOP("action", "512th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 512th note"),
|
||||||
IconCode::Code::NOTE_512TH
|
IconCode::Code::NOTE_512TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-note-1024",
|
ActionItem("pad-note-1024",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "1024th note"),
|
QT_TRANSLATE_NOOP("action", "1024th note"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: 1024th note"),
|
||||||
IconCode::Code::NOTE_1024TH
|
IconCode::Code::NOTE_1024TH
|
||||||
),
|
),
|
||||||
ActionItem("pad-dot",
|
ActionItem("pad-dot",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Dotted note"),
|
QT_TRANSLATE_NOOP("action", "Augmentation Dot"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: augmentation dot"),
|
||||||
IconCode::Code::NOTE_DOTTED
|
IconCode::Code::NOTE_DOTTED
|
||||||
),
|
),
|
||||||
ActionItem("pad-dotdot",
|
ActionItem("pad-dotdot",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Double dotted note"),
|
QT_TRANSLATE_NOOP("action", "Double Augmentation Dot"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: double augmentation dot"),
|
||||||
IconCode::Code::NOTE_DOTTED_2
|
IconCode::Code::NOTE_DOTTED_2
|
||||||
),
|
),
|
||||||
ActionItem("pad-dot3",
|
ActionItem("pad-dot3",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Triple dotted note"),
|
QT_TRANSLATE_NOOP("action", "Triple Augmentation Dot"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: triple augmentation dot"),
|
||||||
IconCode::Code::NOTE_DOTTED_3
|
IconCode::Code::NOTE_DOTTED_3
|
||||||
),
|
),
|
||||||
ActionItem("pad-dot4",
|
ActionItem("pad-dot4",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Quadruple dotted note"),
|
QT_TRANSLATE_NOOP("action", "Quadruple Augmentation Dot"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: quadruple augmentation dot"),
|
||||||
IconCode::Code::NOTE_DOTTED_4
|
IconCode::Code::NOTE_DOTTED_4
|
||||||
),
|
),
|
||||||
ActionItem("pad-rest",
|
ActionItem("pad-rest",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Rest"),
|
QT_TRANSLATE_NOOP("action", "Rest"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note input: Rest"),
|
||||||
IconCode::Code::REST
|
IconCode::Code::REST
|
||||||
),
|
),
|
||||||
ActionItem("flat",
|
ActionItem("flat",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Flat"),
|
QT_TRANSLATE_NOOP("action", "♭"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note input: ♭"),
|
||||||
IconCode::Code::FLAT
|
IconCode::Code::FLAT
|
||||||
),
|
),
|
||||||
ActionItem("flat2",
|
ActionItem("flat2",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Double flat"),
|
QT_TRANSLATE_NOOP("action", "Double ♭"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note input: Double ♭"),
|
||||||
IconCode::Code::FLAT_DOUBLE
|
IconCode::Code::FLAT_DOUBLE
|
||||||
),
|
),
|
||||||
ActionItem("nat",
|
ActionItem("nat",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Natural"),
|
QT_TRANSLATE_NOOP("action", "♮"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note input: ♮"),
|
||||||
IconCode::Code::NATURAL
|
IconCode::Code::NATURAL
|
||||||
),
|
),
|
||||||
ActionItem("sharp",
|
ActionItem("sharp",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Sharp"),
|
QT_TRANSLATE_NOOP("action", "♯"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note input: ♯"),
|
||||||
IconCode::Code::SHARP
|
IconCode::Code::SHARP
|
||||||
),
|
),
|
||||||
ActionItem("sharp2",
|
ActionItem("sharp2",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Double sharp"),
|
QT_TRANSLATE_NOOP("action", "Double ♯"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note input: Double ♯"),
|
||||||
IconCode::Code::SHARP_DOUBLE
|
IconCode::Code::SHARP_DOUBLE
|
||||||
),
|
),
|
||||||
ActionItem("tie",
|
ActionItem("tie",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Tie"),
|
QT_TRANSLATE_NOOP("action", "Tie"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Note duration: Tie"),
|
||||||
IconCode::Code::NOTE_TIE
|
IconCode::Code::NOTE_TIE
|
||||||
),
|
),
|
||||||
ActionItem("add-slur",
|
ActionItem("add-slur",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Slur"),
|
QT_TRANSLATE_NOOP("action", "Slur"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Add slur"),
|
||||||
IconCode::Code::NOTE_SLUR
|
IconCode::Code::NOTE_SLUR
|
||||||
),
|
),
|
||||||
ActionItem("add-marcato",
|
ActionItem("add-marcato",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Marcato"),
|
QT_TRANSLATE_NOOP("action", "Marcato"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Toggle marcato"),
|
||||||
IconCode::Code::MARCATO
|
IconCode::Code::MARCATO
|
||||||
),
|
),
|
||||||
ActionItem("add-sforzato", // TODO
|
ActionItem("add-sforzato",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Accent"),
|
QT_TRANSLATE_NOOP("action", "Accent"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Toggle accent"),
|
||||||
IconCode::Code::ACCENT
|
IconCode::Code::ACCENT
|
||||||
),
|
),
|
||||||
ActionItem("add-tenuto",
|
ActionItem("add-tenuto",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Tenuto"),
|
QT_TRANSLATE_NOOP("action", "Tenuto"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Toggle tenuto"),
|
||||||
IconCode::Code::TENUTO
|
IconCode::Code::TENUTO
|
||||||
),
|
),
|
||||||
ActionItem("add-staccato",
|
ActionItem("add-staccato",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Staccato"),
|
QT_TRANSLATE_NOOP("action", "Staccato"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Toggle staccato"),
|
||||||
IconCode::Code::STACCATO
|
IconCode::Code::STACCATO
|
||||||
),
|
),
|
||||||
ActionItem("tuplet",
|
ActionItem("tuplet",
|
||||||
|
@ -759,26 +899,31 @@ const ActionList NotationActions::m_noteInputActions = {
|
||||||
ActionItem("voice-1",
|
ActionItem("voice-1",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Voice 1"),
|
QT_TRANSLATE_NOOP("action", "Voice 1"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Voice 1"),
|
||||||
IconCode::Code::VOICE_1
|
IconCode::Code::VOICE_1
|
||||||
),
|
),
|
||||||
ActionItem("voice-2",
|
ActionItem("voice-2",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Voice 2"),
|
QT_TRANSLATE_NOOP("action", "Voice 2"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Voice 2"),
|
||||||
IconCode::Code::VOICE_2
|
IconCode::Code::VOICE_2
|
||||||
),
|
),
|
||||||
ActionItem("voice-3",
|
ActionItem("voice-3",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Voice 3"),
|
QT_TRANSLATE_NOOP("action", "Voice 3"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Voice 3"),
|
||||||
IconCode::Code::VOICE_3
|
IconCode::Code::VOICE_3
|
||||||
),
|
),
|
||||||
ActionItem("voice-4",
|
ActionItem("voice-4",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Voice 4"),
|
QT_TRANSLATE_NOOP("action", "Voice 4"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Voice 4"),
|
||||||
IconCode::Code::VOICE_4
|
IconCode::Code::VOICE_4
|
||||||
),
|
),
|
||||||
ActionItem("flip",
|
ActionItem("flip",
|
||||||
ShortcutContext::NotationActive,
|
ShortcutContext::NotationActive,
|
||||||
QT_TRANSLATE_NOOP("action", "Flip"),
|
QT_TRANSLATE_NOOP("action", "Flip Direction"),
|
||||||
|
QT_TRANSLATE_NOOP("action", "Flip direction"),
|
||||||
IconCode::Code::NOTE_FLIP
|
IconCode::Code::NOTE_FLIP
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,30 +66,24 @@ static const Settings::Key IS_COUNT_IN_ENABLED(module_name, "application/playbac
|
||||||
static const Settings::Key TOOLBAR_KEY(module_name, "ui/toolbar/");
|
static const Settings::Key TOOLBAR_KEY(module_name, "ui/toolbar/");
|
||||||
|
|
||||||
static const Settings::Key NAVIGATOR_VISIBLE_KEY(module_name, "ui/application/startup/showNavigator");
|
static const Settings::Key NAVIGATOR_VISIBLE_KEY(module_name, "ui/application/startup/showNavigator");
|
||||||
static const Settings::Key NAVIGATOR_ORIENTATION(module_name, "ui/canvas/scroll/verticalOrientation");
|
static const Settings::Key IS_CANVAS_ORIENTATION_VERTICAL_KEY(module_name, "ui/canvas/scroll/verticalOrientation");
|
||||||
static const bool NAVIGATOR_ORIENTATION_VERTICAL(true);
|
|
||||||
|
|
||||||
void NotationConfiguration::init()
|
void NotationConfiguration::init()
|
||||||
{
|
{
|
||||||
settings()->setDefaultValue(ANCHORLINE_COLOR, Val(QColor("#C31989")));
|
settings()->setDefaultValue(ANCHORLINE_COLOR, Val(QColor("#C31989")));
|
||||||
|
|
||||||
settings()->setDefaultValue(BACKGROUND_COLOR, Val(theme()->backgroundSecondaryColor()));
|
settings()->setDefaultValue(BACKGROUND_COLOR, Val(QColor("#385f94")));
|
||||||
settings()->valueChanged(BACKGROUND_COLOR).onReceive(nullptr, [this](const Val& val) {
|
settings()->valueChanged(BACKGROUND_COLOR).onReceive(nullptr, [this](const Val& val) {
|
||||||
LOGD() << "BACKGROUND_COLOR changed: " << val.toString();
|
LOGD() << "BACKGROUND_COLOR changed: " << val.toString();
|
||||||
m_backgroundColorChanged.send(val.toQColor());
|
m_backgroundColorChanged.send(val.toQColor());
|
||||||
});
|
});
|
||||||
|
|
||||||
settings()->setDefaultValue(FOREGROUND_COLOR, Val(theme()->backgroundPrimaryColor()));
|
settings()->setDefaultValue(FOREGROUND_COLOR, Val(QColor("#f9f9f9")));
|
||||||
settings()->valueChanged(FOREGROUND_COLOR).onReceive(nullptr, [this](const Val& val) {
|
settings()->valueChanged(FOREGROUND_COLOR).onReceive(nullptr, [this](const Val& val) {
|
||||||
LOGD() << "FOREGROUND_COLOR changed: " << val.toString();
|
LOGD() << "FOREGROUND_COLOR changed: " << val.toString();
|
||||||
m_foregroundColorChanged.send(foregroundColor());
|
m_foregroundColorChanged.send(foregroundColor());
|
||||||
});
|
});
|
||||||
|
|
||||||
theme()->themeChanged().onNotify(this, [this]() {
|
|
||||||
m_backgroundColorChanged.send(backgroundColor());
|
|
||||||
m_foregroundColorChanged.send(foregroundColor());
|
|
||||||
});
|
|
||||||
|
|
||||||
settings()->setDefaultValue(FOREGROUND_USE_USER_COLOR, Val(true));
|
settings()->setDefaultValue(FOREGROUND_USE_USER_COLOR, Val(true));
|
||||||
settings()->valueChanged(FOREGROUND_USE_USER_COLOR).onReceive(nullptr, [this](const Val& val) {
|
settings()->valueChanged(FOREGROUND_USE_USER_COLOR).onReceive(nullptr, [this](const Val& val) {
|
||||||
LOGD() << "FOREGROUND_USE_USER_COLOR changed: " << val.toString();
|
LOGD() << "FOREGROUND_USE_USER_COLOR changed: " << val.toString();
|
||||||
|
@ -113,9 +107,9 @@ void NotationConfiguration::init()
|
||||||
m_navigatorVisibleChanged.send(isNavigatorVisible().val);
|
m_navigatorVisibleChanged.send(isNavigatorVisible().val);
|
||||||
});
|
});
|
||||||
|
|
||||||
settings()->setDefaultValue(NAVIGATOR_ORIENTATION, Val(NAVIGATOR_ORIENTATION_VERTICAL));
|
settings()->setDefaultValue(IS_CANVAS_ORIENTATION_VERTICAL_KEY, Val(false));
|
||||||
settings()->valueChanged(NAVIGATOR_ORIENTATION).onReceive(nullptr, [this](const Val&) {
|
settings()->valueChanged(IS_CANVAS_ORIENTATION_VERTICAL_KEY).onReceive(nullptr, [this](const Val&) {
|
||||||
m_navigatorOrientationChanged.send(navigatorOrientation().val);
|
m_canvasOrientationChanged.send(canvasOrientation().val);
|
||||||
});
|
});
|
||||||
|
|
||||||
// libmscore
|
// libmscore
|
||||||
|
@ -129,12 +123,7 @@ QColor NotationConfiguration::anchorLineColor() const
|
||||||
|
|
||||||
QColor NotationConfiguration::backgroundColor() const
|
QColor NotationConfiguration::backgroundColor() const
|
||||||
{
|
{
|
||||||
QColor color = resolveColor(BACKGROUND_COLOR);
|
return settings()->value(BACKGROUND_COLOR).toQColor();
|
||||||
if (!color.isValid()) {
|
|
||||||
color = theme()->backgroundSecondaryColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
return color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async::Channel<QColor> NotationConfiguration::backgroundColorChanged() const
|
async::Channel<QColor> NotationConfiguration::backgroundColorChanged() const
|
||||||
|
@ -168,12 +157,7 @@ QColor NotationConfiguration::foregroundColor() const
|
||||||
return settings()->value(FOREGROUND_COLOR).toQColor();
|
return settings()->value(FOREGROUND_COLOR).toQColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor color = resolveColor(FOREGROUND_COLOR);
|
return settings()->defaultValue(FOREGROUND_COLOR).toQColor();
|
||||||
if (!color.isValid()) {
|
|
||||||
color = theme()->backgroundSecondaryColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
return color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async::Channel<QColor> NotationConfiguration::foregroundColorChanged() const
|
async::Channel<QColor> NotationConfiguration::foregroundColorChanged() const
|
||||||
|
@ -341,20 +325,20 @@ void NotationConfiguration::setNavigatorVisible(bool visible)
|
||||||
settings()->setValue(NAVIGATOR_VISIBLE_KEY, Val(visible));
|
settings()->setValue(NAVIGATOR_VISIBLE_KEY, Val(visible));
|
||||||
}
|
}
|
||||||
|
|
||||||
ValCh<Orientation> NotationConfiguration::navigatorOrientation() const
|
ValCh<Orientation> NotationConfiguration::canvasOrientation() const
|
||||||
{
|
{
|
||||||
ValCh<Orientation> orientation;
|
ValCh<Orientation> orientation;
|
||||||
orientation.ch = m_navigatorOrientationChanged;
|
orientation.ch = m_canvasOrientationChanged;
|
||||||
bool isVertical = settings()->value(NAVIGATOR_ORIENTATION).toBool() == NAVIGATOR_ORIENTATION_VERTICAL;
|
bool isVertical = settings()->value(IS_CANVAS_ORIENTATION_VERTICAL_KEY).toBool();
|
||||||
orientation.val = isVertical ? Orientation::Vertical : Orientation::Horizontal;
|
orientation.val = isVertical ? Orientation::Vertical : Orientation::Horizontal;
|
||||||
|
|
||||||
return orientation;
|
return orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotationConfiguration::setNavigatorOrientation(Orientation orientation)
|
void NotationConfiguration::setCanvasOrientation(Orientation orientation)
|
||||||
{
|
{
|
||||||
bool isVertical = orientation == Orientation::Vertical;
|
bool isVertical = orientation == Orientation::Vertical;
|
||||||
settings()->setValue(NAVIGATOR_ORIENTATION, Val(isVertical));
|
settings()->setValue(IS_CANVAS_ORIENTATION_VERTICAL_KEY, Val(isVertical));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> NotationConfiguration::parseToolbarActions(const std::string& actions) const
|
std::vector<std::string> NotationConfiguration::parseToolbarActions(const std::string& actions) const
|
||||||
|
@ -379,14 +363,3 @@ Settings::Key NotationConfiguration::toolbarSettingsKey(const std::string& toolb
|
||||||
toolbarKey.key += toolbarName;
|
toolbarKey.key += toolbarName;
|
||||||
return toolbarKey;
|
return toolbarKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor NotationConfiguration::resolveColor(const Settings::Key& key) const
|
|
||||||
{
|
|
||||||
QColor color = settings()->value(key).toQColor();
|
|
||||||
QColor defaultColor = settings()->defaultValue(key).toQColor();
|
|
||||||
if (!color.isValid() || color == defaultColor) {
|
|
||||||
return QColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
|
@ -25,14 +25,12 @@
|
||||||
#include "ui/iuiconfiguration.h"
|
#include "ui/iuiconfiguration.h"
|
||||||
#include "iglobalconfiguration.h"
|
#include "iglobalconfiguration.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "ui/itheme.h"
|
|
||||||
|
|
||||||
namespace mu::notation {
|
namespace mu::notation {
|
||||||
class NotationConfiguration : public INotationConfiguration, public async::Asyncable
|
class NotationConfiguration : public INotationConfiguration, public async::Asyncable
|
||||||
{
|
{
|
||||||
INJECT(notation, ui::IUiConfiguration, uiConfiguration)
|
INJECT(notation, ui::IUiConfiguration, uiConfiguration)
|
||||||
INJECT(notation, framework::IGlobalConfiguration, globalConfiguration)
|
INJECT(notation, framework::IGlobalConfiguration, globalConfiguration)
|
||||||
INJECT(notation, ui::ITheme, theme)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init();
|
void init();
|
||||||
|
@ -93,21 +91,19 @@ public:
|
||||||
ValCh<bool> isNavigatorVisible() const override;
|
ValCh<bool> isNavigatorVisible() const override;
|
||||||
void setNavigatorVisible(bool visible) override;
|
void setNavigatorVisible(bool visible) override;
|
||||||
|
|
||||||
ValCh<framework::Orientation> navigatorOrientation() const override;
|
ValCh<framework::Orientation> canvasOrientation() const override;
|
||||||
void setNavigatorOrientation(framework::Orientation orientation) override;
|
void setCanvasOrientation(framework::Orientation orientation) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::string> parseToolbarActions(const std::string& actions) const;
|
std::vector<std::string> parseToolbarActions(const std::string& actions) const;
|
||||||
|
|
||||||
framework::Settings::Key toolbarSettingsKey(const std::string& toolbarName) const;
|
framework::Settings::Key toolbarSettingsKey(const std::string& toolbarName) const;
|
||||||
|
|
||||||
QColor resolveColor(const framework::Settings::Key& key) const;
|
|
||||||
|
|
||||||
async::Channel<QColor> m_backgroundColorChanged;
|
async::Channel<QColor> m_backgroundColorChanged;
|
||||||
async::Channel<QColor> m_foregroundColorChanged;
|
async::Channel<QColor> m_foregroundColorChanged;
|
||||||
async::Channel<int> m_currentZoomChanged;
|
async::Channel<int> m_currentZoomChanged;
|
||||||
async::Channel<bool> m_navigatorVisibleChanged;
|
async::Channel<bool> m_navigatorVisibleChanged;
|
||||||
async::Channel<framework::Orientation> m_navigatorOrientationChanged;
|
async::Channel<framework::Orientation> m_canvasOrientationChanged;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ QRectF NotationNoteInput::cursorRect() const
|
||||||
|
|
||||||
QRectF result = QRectF(x, y, w, h);
|
QRectF result = QRectF(x, y, w, h);
|
||||||
|
|
||||||
if (configuration()->navigatorOrientation().val == framework::Orientation::Horizontal) {
|
if (configuration()->canvasOrientation().val == framework::Orientation::Horizontal) {
|
||||||
result.translate(system->page()->pos());
|
result.translate(system->page()->pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ void NotationPlayback::updateLoopBoundaries()
|
||||||
boundaries.loopOutTick = score()->loopOutTick().ticks();
|
boundaries.loopOutTick = score()->loopOutTick().ticks();
|
||||||
boundaries.loopInRect = loopBoundaryRectByTick(LoopBoundaryType::LoopIn, boundaries.loopInTick);
|
boundaries.loopInRect = loopBoundaryRectByTick(LoopBoundaryType::LoopIn, boundaries.loopInTick);
|
||||||
boundaries.loopOutRect = loopBoundaryRectByTick(LoopBoundaryType::LoopOut, boundaries.loopOutTick);
|
boundaries.loopOutRect = loopBoundaryRectByTick(LoopBoundaryType::LoopOut, boundaries.loopOutTick);
|
||||||
|
boundaries.visible = m_loopBoundaries.val.visible;
|
||||||
|
|
||||||
if (m_loopBoundaries.val != boundaries) {
|
if (m_loopBoundaries.val != boundaries) {
|
||||||
m_loopBoundaries.set(boundaries);
|
m_loopBoundaries.set(boundaries);
|
||||||
|
@ -636,11 +637,14 @@ void NotationPlayback::addLoopOut(int _tick)
|
||||||
score()->setLoopOutTick(tick);
|
score()->setLoopOutTick(tick);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotationPlayback::removeLoopBoundaries()
|
void NotationPlayback::setLoopBoundariesVisible(bool visible)
|
||||||
{
|
{
|
||||||
Fraction null = Fraction::fromTicks(0);
|
if (m_loopBoundaries.val.visible == visible) {
|
||||||
score()->setLoopInTick(null);
|
return;
|
||||||
score()->setLoopOutTick(null);
|
}
|
||||||
|
|
||||||
|
m_loopBoundaries.val.visible = visible;
|
||||||
|
m_loopBoundaries.set(m_loopBoundaries.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect NotationPlayback::loopBoundaryRectByTick(LoopBoundaryType boundaryType, int _tick) const
|
QRect NotationPlayback::loopBoundaryRectByTick(LoopBoundaryType boundaryType, int _tick) const
|
||||||
|
@ -723,9 +727,9 @@ QRect NotationPlayback::loopBoundaryRectByTick(LoopBoundaryType boundaryType, in
|
||||||
return QRect(x, y, width, height);
|
return QRect(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
mu::async::Channel<LoopBoundaries> NotationPlayback::loopBoundariesChanged() const
|
mu::ValCh<LoopBoundaries> NotationPlayback::loopBoundaries() const
|
||||||
{
|
{
|
||||||
return m_loopBoundaries.ch;
|
return m_loopBoundaries;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tempo NotationPlayback::tempo(int tick) const
|
Tempo NotationPlayback::tempo(int tick) const
|
||||||
|
@ -737,13 +741,14 @@ Tempo NotationPlayback::tempo(int tick) const
|
||||||
}
|
}
|
||||||
|
|
||||||
const Ms::TempoText* tempoText = this->tempoText(tick);
|
const Ms::TempoText* tempoText = this->tempoText(tick);
|
||||||
if (!tempoText) {
|
Ms::TDuration duration = tempoText ? tempoText->duration() : Ms::TDuration();
|
||||||
tempo.valueBpm = score()->tempo(Fraction::fromTicks(tick)) * 60;
|
|
||||||
|
if (!tempoText || !duration.isValid()) {
|
||||||
|
tempo.duration = DurationType::V_QUARTER;
|
||||||
|
tempo.valueBpm = std::round(score()->tempo(Fraction::fromTicks(tick)) * 60.);
|
||||||
return tempo;
|
return tempo;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ms::TDuration duration = tempoText->duration();
|
|
||||||
|
|
||||||
tempo.valueBpm = tempoText->tempoBpm();
|
tempo.valueBpm = tempoText->tempoBpm();
|
||||||
tempo.duration = duration.type();
|
tempo.duration = duration.type();
|
||||||
tempo.withDot = duration.dots() > 0;
|
tempo.withDot = duration.dots() > 0;
|
||||||
|
|
|
@ -61,8 +61,8 @@ public:
|
||||||
midi::MidiData playElementMidiData(const Element* element) const override;
|
midi::MidiData playElementMidiData(const Element* element) const override;
|
||||||
|
|
||||||
void addLoopBoundary(LoopBoundaryType boundaryType, int tick) override;
|
void addLoopBoundary(LoopBoundaryType boundaryType, int tick) override;
|
||||||
void removeLoopBoundaries() override;
|
void setLoopBoundariesVisible(bool visible) override;
|
||||||
async::Channel<LoopBoundaries> loopBoundariesChanged() const override;
|
ValCh<LoopBoundaries> loopBoundaries() const override;
|
||||||
|
|
||||||
Tempo tempo(int tick) const override;
|
Tempo tempo(int tick) const override;
|
||||||
MeasureBeat beat(int tick) const override;
|
MeasureBeat beat(int tick) const override;
|
||||||
|
|
|
@ -347,6 +347,8 @@ struct LoopBoundaries
|
||||||
QRect loopInRect;
|
QRect loopInRect;
|
||||||
QRect loopOutRect;
|
QRect loopOutRect;
|
||||||
|
|
||||||
|
bool visible = false;
|
||||||
|
|
||||||
bool isNull() const
|
bool isNull() const
|
||||||
{
|
{
|
||||||
return loopInTick == 0 && loopOutTick == 0;
|
return loopInTick == 0 && loopOutTick == 0;
|
||||||
|
@ -360,6 +362,7 @@ struct LoopBoundaries
|
||||||
equals &= loopOutTick == boundaries.loopOutTick;
|
equals &= loopOutTick == boundaries.loopOutTick;
|
||||||
equals &= loopInRect == boundaries.loopInRect;
|
equals &= loopInRect == boundaries.loopInRect;
|
||||||
equals &= loopOutRect == boundaries.loopOutRect;
|
equals &= loopOutRect == boundaries.loopOutRect;
|
||||||
|
equals &= visible == boundaries.visible;
|
||||||
|
|
||||||
return equals;
|
return equals;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,9 @@ Rectangle {
|
||||||
delegate: FlatButton {
|
delegate: FlatButton {
|
||||||
text: model.title
|
text: model.title
|
||||||
icon: model.icon
|
icon: model.icon
|
||||||
|
iconFont: ui.theme.toolbarIconsFont
|
||||||
|
|
||||||
|
hint: model.hint
|
||||||
enabled: model.enabled
|
enabled: model.enabled
|
||||||
textFont: ui.theme.tabFont
|
textFont: ui.theme.tabFont
|
||||||
|
|
||||||
|
@ -38,7 +41,7 @@ Rectangle {
|
||||||
orientation: Qt.Horizontal
|
orientation: Qt.Horizontal
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
toolbarModel.open(model.index)
|
toolbarModel.handleAction(model.code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ FocusScope {
|
||||||
|
|
||||||
orientation: notationNavigator.orientation
|
orientation: notationNavigator.orientation
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: notationView.backgroundColor
|
||||||
|
}
|
||||||
|
|
||||||
NotationPaintView {
|
NotationPaintView {
|
||||||
id: notationView
|
id: notationView
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,9 @@ Rectangle {
|
||||||
normalStateColor: Boolean(item) && item.checkedRole ? ui.theme.accentColor : "transparent"
|
normalStateColor: Boolean(item) && item.checkedRole ? ui.theme.accentColor : "transparent"
|
||||||
|
|
||||||
icon: Boolean(item) ? item.iconRole : IconCode.NONE
|
icon: Boolean(item) ? item.iconRole : IconCode.NONE
|
||||||
iconFont.pixelSize: 20
|
hint: Boolean(item) ? item.hintRole : ""
|
||||||
|
|
||||||
|
iconFont: ui.theme.toolbarIconsFont
|
||||||
|
|
||||||
width: gridView.cellWidth
|
width: gridView.cellWidth
|
||||||
height: gridView.cellWidth
|
height: gridView.cellWidth
|
||||||
|
|
|
@ -22,6 +22,8 @@ Rectangle {
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
icon: model.undoItem.icon
|
icon: model.undoItem.icon
|
||||||
|
iconFont: ui.theme.toolbarIconsFont
|
||||||
|
|
||||||
hint: model.undoItem.description
|
hint: model.undoItem.description
|
||||||
enabled: model.undoItem.enabled
|
enabled: model.undoItem.enabled
|
||||||
normalStateColor: "transparent"
|
normalStateColor: "transparent"
|
||||||
|
@ -33,6 +35,8 @@ Rectangle {
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
icon: model.redoItem.icon
|
icon: model.redoItem.icon
|
||||||
|
iconFont: ui.theme.toolbarIconsFont
|
||||||
|
|
||||||
hint: model.redoItem.description
|
hint: model.redoItem.description
|
||||||
enabled: model.redoItem.enabled
|
enabled: model.redoItem.enabled
|
||||||
normalStateColor: "transparent"
|
normalStateColor: "transparent"
|
||||||
|
|
|
@ -25,20 +25,24 @@ using namespace mu::notation;
|
||||||
NotationNavigator::NotationNavigator(QQuickItem* parent)
|
NotationNavigator::NotationNavigator(QQuickItem* parent)
|
||||||
: NotationPaintView(parent)
|
: NotationPaintView(parent)
|
||||||
{
|
{
|
||||||
setAcceptedMouseButtons(Qt::AllButtons);
|
|
||||||
setReadonly(true);
|
setReadonly(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NotationNavigator::load()
|
||||||
|
{
|
||||||
initOrientation();
|
initOrientation();
|
||||||
initVisible();
|
initVisible();
|
||||||
|
|
||||||
theme()->themeChanged().onNotify(this, [this]() {
|
theme()->themeChanged().onNotify(this, [this]() {
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
NotationPaintView::load();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotationNavigator::isVerticalOrientation() const
|
bool NotationNavigator::isVerticalOrientation() const
|
||||||
{
|
{
|
||||||
return configuration()->navigatorOrientation().val == framework::Orientation::Vertical;
|
return configuration()->canvasOrientation().val == framework::Orientation::Vertical;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF NotationNavigator::notationContentRect() const
|
QRectF NotationNavigator::notationContentRect() const
|
||||||
|
@ -180,7 +184,7 @@ void NotationNavigator::setCursorRect(const QRect& rect)
|
||||||
|
|
||||||
int NotationNavigator::orientation() const
|
int NotationNavigator::orientation() const
|
||||||
{
|
{
|
||||||
return static_cast<int>(configuration()->navigatorOrientation().val);
|
return static_cast<int>(configuration()->canvasOrientation().val);
|
||||||
}
|
}
|
||||||
|
|
||||||
INotationPtr NotationNavigator::currentNotation() const
|
INotationPtr NotationNavigator::currentNotation() const
|
||||||
|
@ -190,7 +194,7 @@ INotationPtr NotationNavigator::currentNotation() const
|
||||||
|
|
||||||
void NotationNavigator::initOrientation()
|
void NotationNavigator::initOrientation()
|
||||||
{
|
{
|
||||||
ValCh<framework::Orientation> orientation = configuration()->navigatorOrientation();
|
ValCh<framework::Orientation> orientation = configuration()->canvasOrientation();
|
||||||
orientation.ch.onReceive(this, [this](framework::Orientation) {
|
orientation.ch.onReceive(this, [this](framework::Orientation) {
|
||||||
moveCanvasToPosition(QPoint(0, 0));
|
moveCanvasToPosition(QPoint(0, 0));
|
||||||
emit orientationChanged();
|
emit orientationChanged();
|
||||||
|
|
|
@ -43,6 +43,7 @@ class NotationNavigator : public NotationPaintView
|
||||||
public:
|
public:
|
||||||
NotationNavigator(QQuickItem* parent = nullptr);
|
NotationNavigator(QQuickItem* parent = nullptr);
|
||||||
|
|
||||||
|
Q_INVOKABLE void load() override;
|
||||||
Q_INVOKABLE void setCursorRect(const QRect& rect);
|
Q_INVOKABLE void setCursorRect(const QRect& rect);
|
||||||
|
|
||||||
int orientation() const;
|
int orientation() const;
|
||||||
|
|
|
@ -83,17 +83,17 @@ void NotationPaintView::load()
|
||||||
|
|
||||||
void NotationPaintView::initBackground()
|
void NotationPaintView::initBackground()
|
||||||
{
|
{
|
||||||
m_backgroundColor = configuration()->backgroundColor();
|
setBackgroundColor(configuration()->backgroundColor());
|
||||||
|
|
||||||
configuration()->backgroundColorChanged().onReceive(this, [this](const QColor& color) {
|
configuration()->backgroundColorChanged().onReceive(this, [this](const QColor& color) {
|
||||||
m_backgroundColor = color;
|
setBackgroundColor(color);
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotationPaintView::initNavigatorOrientation()
|
void NotationPaintView::initNavigatorOrientation()
|
||||||
{
|
{
|
||||||
configuration()->navigatorOrientation().ch.onReceive(this, [this](framework::Orientation) {
|
configuration()->canvasOrientation().ch.onReceive(this, [this](framework::Orientation) {
|
||||||
moveCanvasToPosition(QPoint(0, 0));
|
moveCanvasToPosition(QPoint(0, 0));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ void NotationPaintView::onCurrentNotationChanged()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
notationPlayback()->loopBoundariesChanged().onReceive(this, [this](const LoopBoundaries& boundaries) {
|
notationPlayback()->loopBoundaries().ch.onReceive(this, [this](const LoopBoundaries& boundaries) {
|
||||||
updateLoopMarkers(boundaries);
|
updateLoopMarkers(boundaries);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -225,8 +225,8 @@ void NotationPaintView::updateLoopMarkers(const LoopBoundaries& boundaries)
|
||||||
m_loopInMarker->setRect(boundaries.loopInRect);
|
m_loopInMarker->setRect(boundaries.loopInRect);
|
||||||
m_loopOutMarker->setRect(boundaries.loopOutRect);
|
m_loopOutMarker->setRect(boundaries.loopOutRect);
|
||||||
|
|
||||||
m_loopInMarker->setVisible(!boundaries.isNull());
|
m_loopInMarker->setVisible(boundaries.visible);
|
||||||
m_loopOutMarker->setVisible(!boundaries.isNull());
|
m_loopOutMarker->setVisible(boundaries.visible);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -336,6 +336,11 @@ void NotationPaintView::paint(QPainter* painter)
|
||||||
m_loopOutMarker->paint(painter);
|
m_loopOutMarker->paint(painter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor NotationPaintView::backgroundColor() const
|
||||||
|
{
|
||||||
|
return m_backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
QRect NotationPaintView::viewport() const
|
QRect NotationPaintView::viewport() const
|
||||||
{
|
{
|
||||||
return toLogical(QRect(0, 0, width(), height()));
|
return toLogical(QRect(0, 0, width(), height()));
|
||||||
|
@ -628,6 +633,16 @@ void NotationPaintView::setReadonly(bool readonly)
|
||||||
m_inputController->setReadonly(readonly);
|
m_inputController->setReadonly(readonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NotationPaintView::setBackgroundColor(const QColor& color)
|
||||||
|
{
|
||||||
|
if (m_backgroundColor == color) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_backgroundColor = color;
|
||||||
|
emit backgroundColorChanged(color);
|
||||||
|
}
|
||||||
|
|
||||||
void NotationPaintView::clear()
|
void NotationPaintView::clear()
|
||||||
{
|
{
|
||||||
m_matrix = QTransform();
|
m_matrix = QTransform();
|
||||||
|
|
|
@ -52,6 +52,8 @@ class NotationPaintView : public QQuickPaintedItem, public IControlledView, publ
|
||||||
Q_PROPERTY(qreal horizontalScrollSize READ horizontalScrollSize NOTIFY horizontalScrollChanged)
|
Q_PROPERTY(qreal horizontalScrollSize READ horizontalScrollSize NOTIFY horizontalScrollChanged)
|
||||||
Q_PROPERTY(qreal startVerticalScrollPosition READ startVerticalScrollPosition NOTIFY verticalScrollChanged)
|
Q_PROPERTY(qreal startVerticalScrollPosition READ startVerticalScrollPosition NOTIFY verticalScrollChanged)
|
||||||
Q_PROPERTY(qreal verticalScrollSize READ verticalScrollSize NOTIFY verticalScrollChanged)
|
Q_PROPERTY(qreal verticalScrollSize READ verticalScrollSize NOTIFY verticalScrollChanged)
|
||||||
|
|
||||||
|
Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY backgroundColorChanged)
|
||||||
Q_PROPERTY(QRect viewport READ viewport NOTIFY viewportChanged)
|
Q_PROPERTY(QRect viewport READ viewport NOTIFY viewportChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -89,6 +91,7 @@ public:
|
||||||
qreal startVerticalScrollPosition() const;
|
qreal startVerticalScrollPosition() const;
|
||||||
qreal verticalScrollSize() const;
|
qreal verticalScrollSize() const;
|
||||||
|
|
||||||
|
QColor backgroundColor() const;
|
||||||
QRect viewport() const;
|
QRect viewport() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -98,11 +101,13 @@ signals:
|
||||||
void horizontalScrollChanged();
|
void horizontalScrollChanged();
|
||||||
void verticalScrollChanged();
|
void verticalScrollChanged();
|
||||||
|
|
||||||
|
void backgroundColorChanged(QColor color);
|
||||||
void viewportChanged(QRect viewport);
|
void viewportChanged(QRect viewport);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setNotation(INotationPtr notation);
|
void setNotation(INotationPtr notation);
|
||||||
void setReadonly(bool readonly);
|
void setReadonly(bool readonly);
|
||||||
|
void setBackgroundColor(const QColor& color);
|
||||||
|
|
||||||
void moveCanvasToCenter();
|
void moveCanvasToCenter();
|
||||||
void moveCanvasToPosition(const QPoint& logicPos);
|
void moveCanvasToPosition(const QPoint& logicPos);
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
using namespace mu::notation;
|
using namespace mu::notation;
|
||||||
using namespace mu::ui;
|
using namespace mu::ui;
|
||||||
|
using namespace mu::uicomponents;
|
||||||
|
using namespace mu::actions;
|
||||||
|
|
||||||
NotationToolBarModel::NotationToolBarModel(QObject* parent)
|
NotationToolBarModel::NotationToolBarModel(QObject* parent)
|
||||||
: QAbstractListModel(parent)
|
: QAbstractListModel(parent)
|
||||||
|
@ -42,11 +44,13 @@ QVariant NotationToolBarModel::data(const QModelIndex& index, int role) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolbarItem item = m_items[index.row()];
|
MenuItem item = m_items[index.row()];
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case TitleRole: return item.title;
|
case TitleRole: return QString::fromStdString(item.title);
|
||||||
case IconRole: return item.icon;
|
case CodeRole: return QString::fromStdString(item.code);
|
||||||
|
case HintRole: return QString::fromStdString(item.description);
|
||||||
|
case IconRole: return static_cast<int>(item.iconCode);
|
||||||
case EnabledRole: return item.enabled;
|
case EnabledRole: return item.enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,8 +61,10 @@ QHash<int, QByteArray> NotationToolBarModel::roleNames() const
|
||||||
{
|
{
|
||||||
static const QHash<int, QByteArray> roles {
|
static const QHash<int, QByteArray> roles {
|
||||||
{ TitleRole, "title" },
|
{ TitleRole, "title" },
|
||||||
|
{ CodeRole, "code" },
|
||||||
{ IconRole, "icon" },
|
{ IconRole, "icon" },
|
||||||
{ EnabledRole, "enabled" }
|
{ EnabledRole, "enabled" },
|
||||||
|
{ HintRole, "hint" }
|
||||||
};
|
};
|
||||||
|
|
||||||
return roles;
|
return roles;
|
||||||
|
@ -70,8 +76,8 @@ void NotationToolBarModel::load()
|
||||||
|
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
|
|
||||||
m_items << makeItem("Parts", IconCode::Code::PAGE, "musescore://notation/parts", hasNotation());
|
m_items << makeItem("parts");
|
||||||
m_items << makeItem("Mixer", IconCode::Code::MIXER, "musescore://notation/mixer");
|
m_items << makeItem("toggle-mixer");
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
|
||||||
|
@ -80,33 +86,15 @@ void NotationToolBarModel::load()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotationToolBarModel::open(int index)
|
void NotationToolBarModel::handleAction(const QString& actionCode)
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= m_items.size()) {
|
dispatcher()->dispatch(actions::codeFromQString(actionCode));
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ret ret = interactive()->open(m_items[index].uri).ret;
|
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
LOGE() << ret.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NotationToolBarModel::ToolbarItem NotationToolBarModel::makeItem(std::string_view title, IconCode::Code icon, std::string uri,
|
MenuItem NotationToolBarModel::makeItem(const ActionCode& actionCode) const
|
||||||
bool enabled) const
|
|
||||||
{
|
{
|
||||||
ToolbarItem item;
|
MenuItem item = actionsRegister()->action(actionCode);
|
||||||
|
item.enabled = context()->currentNotation() != nullptr;
|
||||||
item.title = qtrc("notation", title.data());
|
|
||||||
item.icon = static_cast<int>(icon);
|
|
||||||
item.uri = std::move(uri);
|
|
||||||
item.enabled = enabled;
|
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotationToolBarModel::hasNotation() const
|
|
||||||
{
|
|
||||||
return context()->currentNotation() != nullptr;
|
|
||||||
}
|
|
||||||
|
|
|
@ -23,11 +23,13 @@
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
|
|
||||||
#include "context/iglobalcontext.h"
|
#include "context/iglobalcontext.h"
|
||||||
#include "iinteractive.h"
|
|
||||||
#include "modularity/ioc.h"
|
#include "modularity/ioc.h"
|
||||||
#include "async/asyncable.h"
|
#include "async/asyncable.h"
|
||||||
|
#include "actions/iactionsregister.h"
|
||||||
|
#include "actions/iactionsdispatcher.h"
|
||||||
|
|
||||||
#include "framework/ui/view/iconcodes.h"
|
#include "framework/ui/view/iconcodes.h"
|
||||||
|
#include "framework/uicomponents/uicomponentstypes.h"
|
||||||
|
|
||||||
namespace mu::notation {
|
namespace mu::notation {
|
||||||
class NotationToolBarModel : public QAbstractListModel, public async::Asyncable
|
class NotationToolBarModel : public QAbstractListModel, public async::Asyncable
|
||||||
|
@ -35,37 +37,31 @@ class NotationToolBarModel : public QAbstractListModel, public async::Asyncable
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
INJECT(notation, context::IGlobalContext, context)
|
INJECT(notation, context::IGlobalContext, context)
|
||||||
INJECT(notation, framework::IInteractive, interactive)
|
INJECT(notation, actions::IActionsRegister, actionsRegister)
|
||||||
|
INJECT(notation, actions::IActionsDispatcher, dispatcher)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NotationToolBarModel(QObject* parent = nullptr);
|
explicit NotationToolBarModel(QObject* parent = nullptr);
|
||||||
|
|
||||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||||
QVariant data(const QModelIndex& index, int role) const override;
|
QVariant data(const QModelIndex& index, int role) const override;
|
||||||
QHash<int,QByteArray> roleNames() const override;
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
|
|
||||||
Q_INVOKABLE void load();
|
Q_INVOKABLE void load();
|
||||||
Q_INVOKABLE void open(int index);
|
Q_INVOKABLE void handleAction(const QString& actionCode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool hasNotation() const;
|
|
||||||
|
|
||||||
enum Roles {
|
enum Roles {
|
||||||
TitleRole = Qt::UserRole + 1,
|
TitleRole = Qt::UserRole + 1,
|
||||||
|
CodeRole,
|
||||||
IconRole,
|
IconRole,
|
||||||
EnabledRole
|
EnabledRole,
|
||||||
|
HintRole
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ToolbarItem {
|
uicomponents::MenuItem makeItem(const actions::ActionCode& actionCode) const;
|
||||||
QString title;
|
|
||||||
int icon = 0;
|
|
||||||
bool enabled = false;
|
|
||||||
std::string uri;
|
|
||||||
};
|
|
||||||
|
|
||||||
ToolbarItem makeItem(std::string_view title, ui::IconCode::Code, std::string uri, bool enabled = true) const;
|
QList<uicomponents::MenuItem> m_items;
|
||||||
|
|
||||||
QList<ToolbarItem> m_items;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ QVariant NoteInputBarModel::data(const QModelIndex& index, int role) const
|
||||||
case SectionRole: return QString::fromStdString(item.section);
|
case SectionRole: return QString::fromStdString(item.section);
|
||||||
case CodeRole: return QString::fromStdString(item.code);
|
case CodeRole: return QString::fromStdString(item.code);
|
||||||
case CheckedRole: return item.checked;
|
case CheckedRole: return item.checked;
|
||||||
|
case HintRole: return QString::fromStdString(item.description);
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -72,7 +73,8 @@ QHash<int,QByteArray> NoteInputBarModel::roleNames() const
|
||||||
{ IconRole, "iconRole" },
|
{ IconRole, "iconRole" },
|
||||||
{ SectionRole, "sectionRole" },
|
{ SectionRole, "sectionRole" },
|
||||||
{ CodeRole, "codeRole" },
|
{ CodeRole, "codeRole" },
|
||||||
{ CheckedRole, "checkedRole" }
|
{ CheckedRole, "checkedRole" },
|
||||||
|
{ HintRole, "hintRole" }
|
||||||
};
|
};
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,8 @@ private:
|
||||||
CodeRole = Qt::UserRole + 1,
|
CodeRole = Qt::UserRole + 1,
|
||||||
IconRole,
|
IconRole,
|
||||||
SectionRole,
|
SectionRole,
|
||||||
CheckedRole
|
CheckedRole,
|
||||||
|
HintRole
|
||||||
};
|
};
|
||||||
|
|
||||||
INotationPtr notation() const;
|
INotationPtr notation() const;
|
||||||
|
|
|
@ -66,9 +66,7 @@ void PlaybackController::init()
|
||||||
|
|
||||||
sequencer()->positionChanged().onNotify(this, [this]() {
|
sequencer()->positionChanged().onNotify(this, [this]() {
|
||||||
if (configuration()->cursorType() == PlaybackCursorType::SMOOTH) {
|
if (configuration()->cursorType() == PlaybackCursorType::SMOOTH) {
|
||||||
float seconds = sequencer()->playbackPositionInSeconds();
|
m_tickPlayed.send(currentTick());
|
||||||
int tick = m_notation->playback()->secToTick(seconds);
|
|
||||||
m_tickPlayed.set(tick);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_playbackPositionChanged.notify();
|
m_playbackPositionChanged.notify();
|
||||||
|
@ -76,13 +74,19 @@ void PlaybackController::init()
|
||||||
|
|
||||||
if (configuration()->cursorType() == PlaybackCursorType::STEPPED) {
|
if (configuration()->cursorType() == PlaybackCursorType::STEPPED) {
|
||||||
sequencer()->midiTickPlayed(MIDI_TRACK).onReceive(this, [this](midi::tick_t tick) {
|
sequencer()->midiTickPlayed(MIDI_TRACK).onReceive(this, [this](midi::tick_t tick) {
|
||||||
m_tickPlayed.set(tick);
|
m_tickPlayed.send(tick);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
m_needRewindBeforePlay = true;
|
m_needRewindBeforePlay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int PlaybackController::currentTick() const
|
||||||
|
{
|
||||||
|
float seconds = sequencer()->playbackPositionInSeconds();
|
||||||
|
return m_notation ? m_notation->playback()->secToTick(seconds) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool PlaybackController::isPlayAllowed() const
|
bool PlaybackController::isPlayAllowed() const
|
||||||
{
|
{
|
||||||
return m_notation != nullptr;
|
return m_notation != nullptr;
|
||||||
|
@ -103,6 +107,16 @@ bool PlaybackController::isPaused() const
|
||||||
return sequencer()->status() == ISequencer::PAUSED;
|
return sequencer()->status() == ISequencer::PAUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PlaybackController::isLoopVisible() const
|
||||||
|
{
|
||||||
|
return playback() ? playback()->loopBoundaries().val.visible : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaybackController::isPlaybackLooped() const
|
||||||
|
{
|
||||||
|
return playback() ? !playback()->loopBoundaries().val.isNull() : false;
|
||||||
|
}
|
||||||
|
|
||||||
Notification PlaybackController::isPlayingChanged() const
|
Notification PlaybackController::isPlayingChanged() const
|
||||||
{
|
{
|
||||||
return m_isPlayingChanged;
|
return m_isPlayingChanged;
|
||||||
|
@ -115,7 +129,7 @@ Notification PlaybackController::playbackPositionChanged() const
|
||||||
|
|
||||||
Channel<uint32_t> PlaybackController::midiTickPlayed() const
|
Channel<uint32_t> PlaybackController::midiTickPlayed() const
|
||||||
{
|
{
|
||||||
return m_tickPlayed.ch;
|
return m_tickPlayed;
|
||||||
}
|
}
|
||||||
|
|
||||||
float PlaybackController::playbackPositionInSeconds() const
|
float PlaybackController::playbackPositionInSeconds() const
|
||||||
|
@ -158,6 +172,8 @@ INotationSelectionPtr PlaybackController::selection() const
|
||||||
|
|
||||||
void PlaybackController::onNotationChanged()
|
void PlaybackController::onNotationChanged()
|
||||||
{
|
{
|
||||||
|
sequencer()->stop();
|
||||||
|
|
||||||
if (m_notation) {
|
if (m_notation) {
|
||||||
m_notation->playback()->playPositionTickChanged().resetOnReceive(this);
|
m_notation->playback()->playPositionTickChanged().resetOnReceive(this);
|
||||||
}
|
}
|
||||||
|
@ -168,8 +184,8 @@ void PlaybackController::onNotationChanged()
|
||||||
seek(tick);
|
seek(tick);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_notation->playback()->loopBoundariesChanged().onReceive(this, [this](const LoopBoundaries& boundary) {
|
m_notation->playback()->loopBoundaries().ch.onReceive(this, [this](const LoopBoundaries& boundaries) {
|
||||||
setLoop(boundary);
|
setLoop(boundaries);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,8 +301,13 @@ void PlaybackController::toggleCountIn()
|
||||||
|
|
||||||
void PlaybackController::toggleLoopPlayback()
|
void PlaybackController::toggleLoopPlayback()
|
||||||
{
|
{
|
||||||
if (m_isPlaybackLooped) {
|
if (isLoopVisible()) {
|
||||||
unsetLoop();
|
hideLoop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPlaybackLooped() && !selection()->isRange()) {
|
||||||
|
showLoop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,47 +319,55 @@ void PlaybackController::toggleLoopPlayback()
|
||||||
loopOutTick = selection()->range()->endTick().ticks();
|
loopOutTick = selection()->range()->endTick().ticks();
|
||||||
}
|
}
|
||||||
|
|
||||||
playback()->addLoopBoundary(LoopBoundaryType::LoopIn, loopInTick);
|
addLoopBoundaryToTick(LoopBoundaryType::LoopIn, loopInTick);
|
||||||
playback()->addLoopBoundary(LoopBoundaryType::LoopOut, loopOutTick);
|
addLoopBoundaryToTick(LoopBoundaryType::LoopOut, loopOutTick);
|
||||||
|
|
||||||
m_isPlaybackLooped = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaybackController::addLoopBoundary(LoopBoundaryType type)
|
void PlaybackController::addLoopBoundary(LoopBoundaryType type)
|
||||||
{
|
{
|
||||||
if (!playback()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPlaying()) {
|
if (isPlaying()) {
|
||||||
playback()->addLoopBoundary(type, m_tickPlayed.val);
|
addLoopBoundaryToTick(type, currentTick());
|
||||||
} else {
|
} else {
|
||||||
playback()->addLoopBoundary(type, INotationPlayback::SelectedNoteTick);
|
addLoopBoundaryToTick(type, INotationPlayback::SelectedNoteTick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaybackController::setLoop(const LoopBoundaries& boundary)
|
void PlaybackController::addLoopBoundaryToTick(LoopBoundaryType type, int tick)
|
||||||
{
|
{
|
||||||
if (boundary.isNull()) {
|
if (playback()) {
|
||||||
unsetLoop();
|
playback()->addLoopBoundary(type, tick);
|
||||||
|
showLoop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaybackController::setLoop(const LoopBoundaries& boundaries)
|
||||||
|
{
|
||||||
|
if (!boundaries.visible) {
|
||||||
|
hideLoop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t fromMilliseconds = secondsToMilliseconds(playback()->tickToSec(boundary.loopInTick));
|
uint64_t fromMilliseconds = secondsToMilliseconds(playback()->tickToSec(boundaries.loopInTick));
|
||||||
uint64_t toMilliseconds = secondsToMilliseconds(playback()->tickToSec(boundary.loopOutTick));
|
uint64_t toMilliseconds = secondsToMilliseconds(playback()->tickToSec(boundaries.loopOutTick));
|
||||||
|
|
||||||
sequencer()->setLoop(fromMilliseconds, toMilliseconds);
|
sequencer()->setLoop(fromMilliseconds, toMilliseconds);
|
||||||
|
showLoop();
|
||||||
|
|
||||||
m_isPlaybackLooped = true;
|
|
||||||
notifyActionEnabledChanged(LOOP_CODE);
|
notifyActionEnabledChanged(LOOP_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaybackController::unsetLoop()
|
void PlaybackController::showLoop()
|
||||||
{
|
{
|
||||||
if (playback() && m_isPlaybackLooped) {
|
if (playback()) {
|
||||||
m_isPlaybackLooped = false;
|
playback()->setLoopBoundariesVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaybackController::hideLoop()
|
||||||
|
{
|
||||||
|
if (playback()) {
|
||||||
sequencer()->unsetLoop();
|
sequencer()->unsetLoop();
|
||||||
playback()->removeLoopBoundaries();
|
playback()->setLoopBoundariesVisible(false);
|
||||||
notifyActionEnabledChanged(LOOP_CODE);
|
notifyActionEnabledChanged(LOOP_CODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,7 +380,7 @@ void PlaybackController::notifyActionEnabledChanged(const ActionCode& actionCode
|
||||||
bool PlaybackController::isActionEnabled(const ActionCode& actionCode) const
|
bool PlaybackController::isActionEnabled(const ActionCode& actionCode) const
|
||||||
{
|
{
|
||||||
QMap<std::string, bool> isEnabled {
|
QMap<std::string, bool> isEnabled {
|
||||||
{ LOOP_CODE, m_isPlaybackLooped },
|
{ LOOP_CODE, isLoopVisible() },
|
||||||
{ MIDI_ON_CODE, notationConfiguration()->isMidiInputEnabled() },
|
{ MIDI_ON_CODE, notationConfiguration()->isMidiInputEnabled() },
|
||||||
{ REPEAT_CODE, notationConfiguration()->isPlayRepeatsEnabled() },
|
{ REPEAT_CODE, notationConfiguration()->isPlayRepeatsEnabled() },
|
||||||
{ PAN_CODE, notationConfiguration()->isAutomaticallyPanEnabled() },
|
{ PAN_CODE, notationConfiguration()->isAutomaticallyPanEnabled() },
|
||||||
|
@ -374,12 +403,12 @@ QTime PlaybackController::totalPlayTime() const
|
||||||
|
|
||||||
Tempo PlaybackController::currentTempo() const
|
Tempo PlaybackController::currentTempo() const
|
||||||
{
|
{
|
||||||
return playback() ? playback()->tempo(m_tickPlayed.val) : Tempo();
|
return playback() ? playback()->tempo(currentTick()) : Tempo();
|
||||||
}
|
}
|
||||||
|
|
||||||
MeasureBeat PlaybackController::currentBeat() const
|
MeasureBeat PlaybackController::currentBeat() const
|
||||||
{
|
{
|
||||||
return playback() ? playback()->beat(m_tickPlayed.val) : MeasureBeat();
|
return playback() ? playback()->beat(currentTick()) : MeasureBeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t PlaybackController::beatToMilliseconds(int measureIndex, int beatIndex) const
|
uint64_t PlaybackController::beatToMilliseconds(int measureIndex, int beatIndex) const
|
||||||
|
|
|
@ -69,8 +69,12 @@ private:
|
||||||
notation::INotationPlaybackPtr playback() const;
|
notation::INotationPlaybackPtr playback() const;
|
||||||
notation::INotationSelectionPtr selection() const;
|
notation::INotationSelectionPtr selection() const;
|
||||||
|
|
||||||
|
int currentTick() const;
|
||||||
bool isPaused() const;
|
bool isPaused() const;
|
||||||
|
|
||||||
|
bool isLoopVisible() const;
|
||||||
|
bool isPlaybackLooped() const;
|
||||||
|
|
||||||
void onNotationChanged();
|
void onNotationChanged();
|
||||||
void togglePlay();
|
void togglePlay();
|
||||||
void rewind(const actions::ActionData& args);
|
void rewind(const actions::ActionData& args);
|
||||||
|
@ -87,8 +91,12 @@ private:
|
||||||
void toggleLoopPlayback();
|
void toggleLoopPlayback();
|
||||||
|
|
||||||
void addLoopBoundary(notation::LoopBoundaryType type);
|
void addLoopBoundary(notation::LoopBoundaryType type);
|
||||||
void setLoop(const notation::LoopBoundaries& boundary);
|
void addLoopBoundaryToTick(notation::LoopBoundaryType type, int tick);
|
||||||
void unsetLoop();
|
|
||||||
|
void setLoop(const notation::LoopBoundaries& boundaries);
|
||||||
|
|
||||||
|
void showLoop();
|
||||||
|
void hideLoop();
|
||||||
|
|
||||||
void notifyActionEnabledChanged(const actions::ActionCode& actionCode);
|
void notifyActionEnabledChanged(const actions::ActionCode& actionCode);
|
||||||
|
|
||||||
|
@ -96,11 +104,10 @@ private:
|
||||||
async::Notification m_isPlayAllowedChanged;
|
async::Notification m_isPlayAllowedChanged;
|
||||||
async::Notification m_isPlayingChanged;
|
async::Notification m_isPlayingChanged;
|
||||||
async::Notification m_playbackPositionChanged;
|
async::Notification m_playbackPositionChanged;
|
||||||
ValCh<uint32_t> m_tickPlayed;
|
async::Channel<uint32_t> m_tickPlayed;
|
||||||
async::Channel<actions::ActionCode> m_actionEnabledChanged;
|
async::Channel<actions::ActionCode> m_actionEnabledChanged;
|
||||||
|
|
||||||
bool m_needRewindBeforePlay = false;
|
bool m_needRewindBeforePlay = false;
|
||||||
bool m_isPlaybackLooped = false;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ Rectangle {
|
||||||
delegate: FlatButton {
|
delegate: FlatButton {
|
||||||
icon: model.icon
|
icon: model.icon
|
||||||
hint: model.hint
|
hint: model.hint
|
||||||
enabled: model.enabled
|
iconFont: ui.theme.toolbarIconsFont
|
||||||
|
|
||||||
normalStateColor: model.checked || playbackSettings.isOpened ? ui.theme.accentColor : "transparent"
|
normalStateColor: model.checked || playbackSettings.isOpened ? ui.theme.accentColor : "transparent"
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SeparatorLine { orientation: Qt.Vertical }
|
SeparatorLine { orientation: Qt.Vertical; visible: !root.floating }
|
||||||
|
|
||||||
TimeInputField {
|
TimeInputField {
|
||||||
id: timeField
|
id: timeField
|
||||||
|
@ -105,6 +105,9 @@ Rectangle {
|
||||||
|
|
||||||
minValue: 1
|
minValue: 1
|
||||||
maxValue: playbackModel.maxMeasureNumber
|
maxValue: playbackModel.maxMeasureNumber
|
||||||
|
|
||||||
|
addLeadingZeros: false
|
||||||
|
|
||||||
value: playbackModel.measureNumber
|
value: playbackModel.measureNumber
|
||||||
|
|
||||||
onValueEdited: {
|
onValueEdited: {
|
||||||
|
@ -124,6 +127,9 @@ Rectangle {
|
||||||
|
|
||||||
minValue: 1
|
minValue: 1
|
||||||
maxValue: playbackModel.maxBeatNumber
|
maxValue: playbackModel.maxBeatNumber
|
||||||
|
|
||||||
|
addLeadingZeros: false
|
||||||
|
|
||||||
value: playbackModel.beatNumber
|
value: playbackModel.beatNumber
|
||||||
|
|
||||||
onValueEdited: {
|
onValueEdited: {
|
||||||
|
@ -152,7 +158,7 @@ Rectangle {
|
||||||
font: timeField.font
|
font: timeField.font
|
||||||
}
|
}
|
||||||
|
|
||||||
SeparatorLine { orientation: Qt.Vertical }
|
SeparatorLine { orientation: Qt.Vertical; visible: !root.floating }
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledSlider {
|
StyledSlider {
|
||||||
|
|
|
@ -99,16 +99,31 @@ void PlaybackToolBarModel::load()
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
|
|
||||||
|
ActionList additionalActions;
|
||||||
|
|
||||||
for (const ActionItem& action : currentWorkspaceActions()) {
|
for (const ActionItem& action : currentWorkspaceActions()) {
|
||||||
|
if (isAdditionalAction(action.code)) {
|
||||||
|
additionalActions.push_back(action);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
m_items << action;
|
m_items << action;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_items << settingsItem();
|
m_items << settingsItem();
|
||||||
|
|
||||||
|
for (const ActionItem& action : additionalActions) {
|
||||||
|
m_items << action;
|
||||||
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
|
||||||
updateState();
|
updateState();
|
||||||
|
setupConnections();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaybackToolBarModel::setupConnections()
|
||||||
|
{
|
||||||
playbackController()->isPlayAllowedChanged().onNotify(this, [this]() {
|
playbackController()->isPlayAllowedChanged().onNotify(this, [this]() {
|
||||||
updateState();
|
updateState();
|
||||||
updatePlayTime();
|
updatePlayTime();
|
||||||
|
@ -309,11 +324,13 @@ void PlaybackToolBarModel::handleAction(const QString& actionCode)
|
||||||
|
|
||||||
void PlaybackToolBarModel::updateState()
|
void PlaybackToolBarModel::updateState()
|
||||||
{
|
{
|
||||||
|
bool playAllowed = isPlayAllowed();
|
||||||
|
|
||||||
for (MenuItem& item : m_items) {
|
for (MenuItem& item : m_items) {
|
||||||
item.checked = playbackController()->isActionEnabled(item.code);
|
item.checked = playAllowed && playbackController()->isActionEnabled(item.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPlayAllowed()) {
|
if (playAllowed) {
|
||||||
bool isPlaying = playbackController()->isPlaying();
|
bool isPlaying = playbackController()->isPlaying();
|
||||||
item("play").iconCode = isPlaying ? IconCode::Code::PAUSE : IconCode::Code::PLAY;
|
item("play").iconCode = isPlaying ? IconCode::Code::PAUSE : IconCode::Code::PLAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,8 @@ private:
|
||||||
IsPlaybackSettingsRole,
|
IsPlaybackSettingsRole,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void setupConnections();
|
||||||
|
|
||||||
QTime totalPlayTime() const;
|
QTime totalPlayTime() const;
|
||||||
uint64_t totalPlayTimeMilliseconds() const;
|
uint64_t totalPlayTimeMilliseconds() const;
|
||||||
notation::MeasureBeat measureBeat() const;
|
notation::MeasureBeat measureBeat() const;
|
||||||
|
|
|
@ -209,15 +209,19 @@ void WorkspaceManager::setupCurrentWorkspace()
|
||||||
saveCurrentWorkspace();
|
saveCurrentWorkspace();
|
||||||
|
|
||||||
std::string workspaceName = configuration()->currentWorkspaceName().val;
|
std::string workspaceName = configuration()->currentWorkspaceName().val;
|
||||||
|
|
||||||
WorkspacePtr workspace = findAndInit(workspaceName);
|
WorkspacePtr workspace = findAndInit(workspaceName);
|
||||||
|
|
||||||
if (!workspace) {
|
if (!workspace) {
|
||||||
std::string defaultWorkspaceName(DEFAULT_WORKSPACE_NAME);
|
std::string defaultWorkspaceName(DEFAULT_WORKSPACE_NAME);
|
||||||
LOGW() << "failed get workspace: " << workspaceName << ", will use " << defaultWorkspaceName;
|
LOGW() << "failed get workspace: " << workspaceName << ", will use " << defaultWorkspaceName;
|
||||||
workspace = findAndInit(defaultWorkspaceName);
|
workspace = findAndInit(defaultWorkspaceName);
|
||||||
|
|
||||||
|
if (workspace) {
|
||||||
|
configuration()->setCurrentWorkspaceName(defaultWorkspaceName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workspace) {
|
if (workspace && workspace != m_currentWorkspace) {
|
||||||
m_currentWorkspace = workspace;
|
m_currentWorkspace = workspace;
|
||||||
m_currentWorkspaceChanged.send(workspace);
|
m_currentWorkspaceChanged.send(workspace);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue