Commit 53a2b31d authored by SeeLook's avatar SeeLook 🎸
Browse files

Added QML component visualizing difference between notes

parent f5de698e
......@@ -62,6 +62,7 @@
<file alias="sound/IntonationBar.qml">qml/sound/IntonationBar.qml</file>
<file alias="sound/TunerDialog.qml">qml/sound/TunerDialog.qml</file>
<file alias="sound/CountdownItem.qml">qml/sound/CountdownItem.qml</file>
<file alias="sound/NotesDiffBar.qml">qml/sound/NotesDiffBar.qml</file>
<file alias="score/Score.qml">qml/score/Score.qml</file>
<file alias="score/Staff.qml">qml/score/Staff.qml</file>
......
/** This file is part of Nootka (http://nootka.sf.net) *
* Copyright (C) 2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12
import QtQuick.Controls 2.12
import Nootka 1.0
import "../"
TnotesBarItem {
id: nBar
expectedNote: score.note
z: score.z
y: score.y + score.height
width: score.width; height: nootkaWindow.height / 20
Rectangle { // background
anchors.fill: parent
color: NOO.alpha(activPal.window, 250)
}
GlowRect {
color: Qt.tint(activPal.base, NOO.alpha((notesDiff === 0 ? GLOB.correctColor: GLOB.wrongColor), 50))
x: expectedX; y: (parent.height - height) / 2
width: nBar.height - NOO.factor() / 2; height: width
Text {
y: -height * 0.2; anchors.horizontalCenter: parent.horizontalCenter
font { family: "Scorek"; pixelSize: nBar.height / 2 }
color: activPal.text
text: expectedName
}
}
GlowRect {
visible: detectedX > 0
color: activPal.base //Qt.tint(activPal.base, NOO.alpha(GLOB.selectedColor, 50))
x: detectedX; y: (parent.height - height) / 2
width: nBar.height - NOO.factor() / 2; height: width
Text {
y: -height * 0.2; anchors.horizontalCenter: parent.horizontalCenter
font { family: "Scorek"; pixelSize: nBar.height / 2 }
color: activPal.text
text: detectedName
}
scale: isPlaying ? 1.5 : 1
Behavior on scale { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }}
Behavior on x { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }}
}
Component.onCompleted: setAmbitus(GLOB.loNote(), GLOB.hiNote())
Connections {
target: GLOB
onTuningChanged: setAmbitus(GLOB.loNote(), GLOB.hiNote())
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment