diff --git a/picts/flat/mic.png b/picts/flat/mic.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba39b97ee4567630085e416beffeb8284624ec8 Binary files /dev/null and b/picts/flat/mic.png differ diff --git a/spare_parts/scalable/glyphs/mic.svg b/spare_parts/scalable/glyphs/mic.svg index ef5208d1d000b6b89bbda0046d10bd747b605171..7a731f7fcbef5ba78e1e18d9aa47a73064c27e00 100644 --- a/spare_parts/scalable/glyphs/mic.svg +++ b/spare_parts/scalable/glyphs/mic.svg @@ -11,9 +11,12 @@ version="1.1" id="svg6" sodipodi:docname="mic.svg" - inkscape:version="0.92.0 r" + inkscape:version="0.92.4 5da689c313, 2019-01-14" width="8.3094015" - height="12"> + height="12" + inkscape:export-filename="../../../picts/mic.png" + inkscape:export-xdpi="2044.9126" + inkscape:export-ydpi="2044.9126"> <metadata id="metadata10"> <rdf:RDF> @@ -22,7 +25,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -36,12 +39,12 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1920" - inkscape:window-height="1039" + inkscape:window-height="1043" id="namedview8" showgrid="false" inkscape:zoom="14.75" - inkscape:cx="-7.4801419" - inkscape:cy="3.4888733" + inkscape:cx="3.6385022" + inkscape:cy="3.7600597" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" diff --git a/src/libs/core/Android/tmobilemenu.cpp b/src/libs/core/Android/tmobilemenu.cpp index e7b5374e38726af457b20640ce268f20fe833ed6..92742527528c1e1209fad7baa3986aa75353d546 100644 --- a/src/libs/core/Android/tmobilemenu.cpp +++ b/src/libs/core/Android/tmobilemenu.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2017 by Tomasz Bojczuk * + * Copyright (C) 2017-2020 by Tomasz Bojczuk * * seelook@gmail.com * * * * This program is free software; you can redistribute it and/or modify * @@ -21,6 +21,7 @@ #include "tmtr.h" #include "taction.h" +#include <QtGui/qguiapplication.h> #include <QtCore/qmath.h> #include <QtCore/qdebug.h> @@ -30,6 +31,10 @@ TmobileMenu::TmobileMenu(QQuickItem* parent) : { setAntialiasing(true); setAcceptedMouseButtons(Qt::LeftButton); + + m_pitchDetectAct = new Taction(QGuiApplication::translate("MainMenuMobile", "Pitch recognition", + "Android menu entry, could be 'Note recognition' or 'detection' as well"), + QStringLiteral("mic"), this); } @@ -37,7 +42,7 @@ TmobileMenu::~TmobileMenu() {} void TmobileMenu::addAction(Taction* a) { - m_flyActions.append(QVariant::fromValue(a)); + m_flyActions.append(a); emit flyActionsChanged(); } diff --git a/src/libs/core/Android/tmobilemenu.h b/src/libs/core/Android/tmobilemenu.h index deb93af2a7dd030290e5c31247c941c4befed071..ec2417cb91b8b3df4d8d573690f49675a5e5ee3f 100644 --- a/src/libs/core/Android/tmobilemenu.h +++ b/src/libs/core/Android/tmobilemenu.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2017 by Tomasz Bojczuk * + * Copyright (C) 2017-2020 by Tomasz Bojczuk * * seelook@gmail.com * * * * This program is free software; you can redistribute it and/or modify * @@ -36,7 +36,8 @@ class TmobileMenu : public QQuickItem Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) Q_PROPERTY(bool extra READ extra NOTIFY extraChanged) Q_PROPERTY(QQuickItem* currentFly READ currentFly NOTIFY currentFlyChanged) - Q_PROPERTY(QVariantList flyActions READ flyActions NOTIFY flyActionsChanged) + Q_PROPERTY(QList<QObject*> flyActions READ flyActions NOTIFY flyActionsChanged) + Q_PROPERTY(Taction* pitchDetectAct READ pitchDetectAct NOTIFY flyActionsChanged) public: @@ -49,7 +50,9 @@ public: QQuickItem* currentFly() { return m_currentFlyItem; } - QVariantList flyActions() { return m_flyActions; } + QList<QObject*> flyActions() { return m_flyActions; } + + Taction* pitchDetectAct() { return m_pitchDetectAct; } Q_INVOKABLE void addAction(Taction* a); @@ -75,7 +78,8 @@ private: bool m_pressed = false; bool m_extra = false; QQuickItem *m_currentFlyItem = nullptr; - QVariantList m_flyActions; + Taction *m_pitchDetectAct; + QList<QObject*> m_flyActions; }; #endif // TMOBILEMENU_H diff --git a/src/libs/core/core.qrc b/src/libs/core/core.qrc index 029f73625457ba42d6169156678ad1ca1fac9ec7..79c8c30b3bd29fb5f09f4f49577ff5a6248eae3e 100644 --- a/src/libs/core/core.qrc +++ b/src/libs/core/core.qrc @@ -97,5 +97,7 @@ <file>picts/wizard-left.png</file> <file>picts/zoom-in.png</file> <file>picts/zoom-out.png</file> + + <file alias="picts/mic.png">picts/flat/mic.png</file> </qresource> </RCC> diff --git a/src/main/tmainscoreobject.cpp b/src/main/tmainscoreobject.cpp index 14400f08eb399503e258ae243d25bb447122c746..d8e465e71b6735d238b87073728dccaac8e055db 100644 --- a/src/main/tmainscoreobject.cpp +++ b/src/main/tmainscoreobject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2017-2019 by Tomasz Bojczuk * + * Copyright (C) 2017-2020 by Tomasz Bojczuk * * seelook@gmail.com * * * * This program is free software; you can redistribute it and/or modify * @@ -72,7 +72,7 @@ TmainScoreObject::TmainScoreObject(QObject* parent) : m_zoomInAct = new Taction(tr("Zoom score in"), QStringLiteral("zoom-in"), this); m_playAct = new Taction(qTR("TtoolBar", "Play"), QStringLiteral("playMelody"), this); - m_recModeAct = new Taction(qApp->translate("MainScore", "Note by note"), QString(), this); + m_recModeAct = new Taction(qApp->translate("MainScore", "Note by note"), QStringLiteral("record"), this); m_recModeAct->setCheckable(true); m_recModeAct->setTip(tr("Notes are written on the score one by one. Either playing, selecting fret or note name adds a new note to the staff automatically.")); m_openXmlAct = new Taction(qTR("QShortcut", "Open"), QStringLiteral("open"), this); diff --git a/src/qml/+android/FlyItem.qml b/src/qml/+android/FlyItem.qml index 8932c8350ceeb6c465eb0016277f754390184c04..53c37c4e1b449b6cab45e4b6b144b06f4fa65077 100644 --- a/src/qml/+android/FlyItem.qml +++ b/src/qml/+android/FlyItem.qml @@ -1,5 +1,5 @@ /** This file is part of Nootka (http://nootka.sf.net) * - * Copyright (C) 2017 by Tomasz Bojczuk (seelook@gmail.com) * + * Copyright (C) 2017-2020 by Tomasz Bojczuk (seelook@gmail.com) * * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ import QtQuick 2.9 @@ -10,11 +10,16 @@ import Nootka 1.0 TcuteButton { property Taction taction: null + width: Noo.fingerPixels() * 1.5; height: Noo.fingerPixels() * 1.5 radius: width / 2 + Behavior on scale { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }} + Behavior on x { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }} + Behavior on y { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }} + Image { source: taction ? taction.icon : "" - sourceSize.width: parent.width * 0.6 - x: (parent.width - width) / 2; y: (parent.height - height) / 2 + height: parent.width * 0.8; width: height * (sourceSize.width / sourceSize.height) + anchors.centerIn: parent } -} +} diff --git a/src/qml/+android/MainMenuMobile.qml b/src/qml/+android/MainMenuMobile.qml index de3e7355508b9b4ba37252f195487cfbcb639f1c..b04246efc98ee31140502495e8bfbbc637ba3476 100644 --- a/src/qml/+android/MainMenuMobile.qml +++ b/src/qml/+android/MainMenuMobile.qml @@ -49,10 +49,8 @@ TmobileMenu { } } - Taction { - id: pitchDetectAct - text: qsTr("Pitch recognition", "Android menu entry, could be 'Note recognition' or 'detection' as well") - icon: "delete" + Connections { + target: pitchDetectAct onTriggered: { SOUND.stoppedByUser = !SOUND.stoppedByUser if (SOUND.listening) @@ -155,7 +153,6 @@ TmobileMenu { } } - onClicked: mainDrawer.open() onFlyClicked: { @@ -171,16 +168,21 @@ TmobileMenu { Repeater { model: flyActions FlyItem { - visible: extra - x: flyX(index); y: flyY(index); width: fingerPixels() * 1.5; height: fingerPixels() * 1.5 taction: modelData + x: extra ? flyX(index) : -width; y: extra ? flyY(index) : -height + scale: (extra ? 0.99 : 0.01) color: currentFly === this ? activPal.highlight : activPal.button } } - Component.onCompleted: { - addAction(score.playAct) - addAction(score.recModeAct) - addAction(pitchDetectAct) - addAction(score.clearScoreAct) + + Connections { + target: SOUND + onInitialized: { + addAction(score.playAct) + addAction(score.recModeAct) + addAction(score.clearScoreAct) + addAction(score.randMelodyAct) + addAction(pitchDetectAct) + } } } diff --git a/src/qml/MainScore.qml b/src/qml/MainScore.qml index 64be50af56e679cafe125d150223fe3636ffffdf..3d2422fab2d73250cea7b50aae7f79d19b831c7a 100644 --- a/src/qml/MainScore.qml +++ b/src/qml/MainScore.qml @@ -1,5 +1,5 @@ /** This file is part of Nootka (http://nootka.sf.net) * - * Copyright (C) 2017-2019 by Tomasz Bojczuk (seelook@gmail.com) * + * Copyright (C) 2017-2020 by Tomasz Bojczuk (seelook@gmail.com) * * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ import QtQuick 2.9 @@ -28,6 +28,7 @@ Score { property alias melodyActions: mainObj.melodyActions property alias noteActions: mainObj.noteActions property alias notesMenuAct: mainObj.notesMenuAct + property alias randMelodyAct: mainObj.randMelodyAct property alias keyName: keyName scoreObj.meter: GLOB.rhythmsEnabled && !GLOB.singleNoteMode ? Tmeter.Meter_4_4 : Tmeter.NoMeter