This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChannelStrip.qml
137 lines (100 loc) · 2.97 KB
/
ChannelStrip.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import QtQuick 2.7
import QtQuick.Controls 2.0
import "controls" as Controls
Item {
id: control
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 82
property QtObject c_ChannelStrip
Rectangle {
anchors.fill: parent
color: "#eee"
}
Button {
id: btn_From
anchors.top: parent.top
anchors.topMargin: 1
height: 20
width: 80
x: 1
onPressed: { if (!cmb_From.visible) cmb_From.open() }
Component { id: portsModel; ListModel { } }
PortsSelector {
id: cmb_From
y: 1
x: 1
onS_ConnectPort: {
if (connect)
c_ChannelStrip.connectFrom(port, side)
else
c_ChannelStrip.disconnectFrom(port, side)
}
Component.onCompleted: {
var mdl_Source = c_ChannelStrip.getJackOutputPorts()
var mdl_Sorted = portsModel.createObject(this);
for (var i = 0; i < mdl_Source.length; i++)
mdl_Sorted.append( {"portName": mdl_Source[i]} )
this.model = mdl_Sorted
}
}
}
Text {
anchors.top: btn_From.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: "+"
}
Controls.Knob {
id: dial_Volume
anchors.bottom: sld_Fader.top
onPositionChanged: c_ChannelStrip.setPan(dial_Volume.position)
}
Controls.Fader {
id: sld_Fader
anchors.bottom: rowLayout1.top
onPositionChanged: c_ChannelStrip.setVolume(sld_Fader.position)
}
Row {
id: rowLayout1
anchors.bottom: btn_To.top
anchors.bottomMargin: 4
anchors.horizontalCenter: parent.horizontalCenter
spacing: 2
Controls.MuteButton {
text: "M"
onClicked: c_ChannelStrip.isMuted(this.checked);
}
Controls.SoloButton {
text: "S"
}
}
Button {
id: btn_To
anchors.bottom: parent.bottom
anchors.bottomMargin: 1
height: 20
width: 80
x: 1
onPressed: { if (!cmb_To.visible) cmb_To.open() }
Component { id: portsModel2; ListModel { } }
PortsSelector {
id: cmb_To
// y: 1
y: -this.height + 20
x: 1
onS_ConnectPort: {
if (connect)
c_ChannelStrip.connectTo(port, side)
else
c_ChannelStrip.disconnectTo(port, side)
}
Component.onCompleted: {
var mdl_Source = c_ChannelStrip.getJackInputPorts()
var mdl_Sorted = portsModel2.createObject(this);
for (var i = 0; i < mdl_Source.length; i++)
mdl_Sorted.append( {"portName": mdl_Source[i]} )
this.model = mdl_Sorted
}
}
}
}