Debian Codegraph @

src/QML/VirtualKeyboard.qml

raw
1 import QtQuick 2.0
2 import QtQuick.Layouts 1.1
3
4 ColumnLayout {
5 id: layout
6 width: 600
7 height: 180
8 spacing: 6
9 property int octave: controls.octave
10 property int channel: controls.channel
11 property int velocity: controls.velocity
12
13 signal genNote(variant on, variant note, variant channel, variant velocity);
14 signal newCCvalue(int channel, int cc, int value)
15
16 Row {
17 spacing: 5
18 Repeater {
19 model: 3
20
21 ControlSlider {
22 width: layout.width/3 //model-2*spacing
23 ccNumber: index+1
24 onCcValueChanged: {
25 //console.log("CC:", channel, ccNumber, value)
26 newCCvalue(channel, ccNumber, value )
27 }
28 Keys.forwardTo: keyboard
29 }
30 }
31 }
32
33 Controls {
34 id: controls
35 Layout.fillWidth: true
36 anchors.topMargin: 10
37 Keys.forwardTo: keyboard;
38 }
39
40 Keyboard {
41 Layout.fillWidth: true
42 Layout.fillHeight: true
43 numOctaves: controls.numOctaves
44 id: keyboard
45 onGenNote: {
46 layout.genNote(on, note + (12*layout.octave), layout.channel, layout.velocity)
47 }
48 }
49 }