diff options
Diffstat (limited to 'app/Mixer.qml')
-rw-r--r-- | app/Mixer.qml | 161 |
1 files changed, 97 insertions, 64 deletions
diff --git a/app/Mixer.qml b/app/Mixer.qml index 96875e0..2b6d5cc 100644 --- a/app/Mixer.qml +++ b/app/Mixer.qml @@ -18,11 +18,21 @@ import QtQuick 2.6 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 import AGL.Demo.Controls 1.0 -import PaControlModel 1.0 +import Mixer 1.0 ApplicationWindow { id: root + Mixer { + id: mixer + Component.objectName: { + mixer.open(bindingAddress) + } + onMasterVolumeChanged: sliderMasterVolume.value = masterVolume + onPcmVolumeChanged: sliderPcmVolume.value = pcmVolume + onMicrophoneVolumeChanged: sliderMicrophoneVolume.value = microphoneVolume + } + Label { id: title font.pixelSize: 48 @@ -30,69 +40,92 @@ ApplicationWindow { anchors.horizontalCenter: parent.horizontalCenter } - Component { - id: ctldesc - Label { - font.pixelSize: 32 - width: listView.width - wrapMode: Text.WordWrap - property var typeString: {modelType ? "Output" : "Input"} - text: "[" + typeString + " #" + modelCIndex + "]: " + modelDesc - } - } + ColumnLayout { + anchors.margins: 80 + anchors.top: title.bottom + anchors.left: parent.left + anchors.right: parent.right - Component { - id: empty - Item { - } - } + ComboBox { + id: soundCardSelector + anchors.left: parent.left + anchors.right: parent.right + model: mixer.hals + onCurrentIndexChanged: mixer.ActiveHal = currentIndex + } - ListView { - id: listView - anchors.left: parent.left - anchors.top: title.bottom - anchors.margins: 80 - anchors.fill: parent - model: PaControlModel { objectName: "pacm" } - delegate: ColumnLayout { - width: parent.width - spacing: 40 - Connections { - target: listView.model - onDataChanged: slider.value = volume - } - Loader { - property int modelType: type - property int modelCIndex: cindex - property string modelDesc: name - sourceComponent: (channel == 0) ? ctldesc : empty - } - RowLayout { - Layout.minimumHeight: 75 - Label { - font.pixelSize: 24 - text: cdesc - Layout.minimumWidth: 150 - } - Label { - font.pixelSize: 24 - text: "0 %" - } - Slider { - id: slider - Layout.fillWidth: true - from: 0 - to: 65536 - stepSize: 256 - snapMode: Slider.SnapOnRelease - onValueChanged: volume = value - Component.onCompleted: value = volume - } - Label { - font.pixelSize: 24 - text: "100 %" - } - } - } - } + RowLayout { + Layout.minimumHeight: 75 + Label { + font.pixelSize: 24 + text: "Master" + Layout.minimumWidth: 150 + } + Label { + id: textMasterVolume + font.pixelSize: 24 + text: "0 %" + } + Slider { + id: sliderMasterVolume + Layout.fillWidth: true + from: 0 + to: 100 + stepSize: 1 + snapMode: Slider.SnapOnRelease + onValueChanged: { + textMasterVolume.text = value + " %" + mixer.masterVolume = value + } + } + } +/* + RowLayout { + Layout.minimumHeight: 75 + Label { + font.pixelSize: 24 + text: "PCM" + Layout.minimumWidth: 150 + } + Label { + font.pixelSize: 24 + text: "0 %" + } + Slider { + id: sliderPcmVolume + Layout.fillWidth: true + from: 0 + to: 100 + stepSize: 1 + snapMode: Slider.SnapOnRelease + onValueChanged: mixer.pcmVolume = value + } + } +*/ + RowLayout { + Layout.minimumHeight: 75 + Label { + font.pixelSize: 24 + text: "Microphone" + Layout.minimumWidth: 150 + } + Label { + id: textMicrophoneVolume + font.pixelSize: 24 + text: "0 %" + } + Slider { + id: sliderMicrophoneVolume + Layout.fillWidth: true + from: 0 + to: 100 + stepSize: 1 + snapMode: Slider.SnapOnRelease + onValueChanged: { + textMicrophoneVolume.text = value + " %" + mixer.microphoneVolume = value + } + } + } + } } |