Socialify

Folder ..

Viewing Inputs.qml
50 lines (42 loc) • 1.6 KB

 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
import QtQuick 2.5
import QtQuick.Layouts 1.1

import org.kde.plasma.components 2.0 as PlasmaComponents

import "../../code/soundicon.js" as Icon

ColumnLayout {
    id: content
    spacing: 4

    RowLayout {
        id: controller
        Layout.fillWidth: true

        VolumeController {
            id: globalController
            Layout.fillWidth: true
            Layout.alignment: Qt.AlignVCenter
            pulseObject: sourceModelProxy.defaultSource
            iconName: sourceModelProxy.defaultSource ? Icon.inputName(
                                                           sourceModelProxy.defaultSource.volume,
                                                           sourceModelProxy.defaultSource.muted) : "undefined"
        }
    }

    PlasmaComponents.Label {
        Layout.leftMargin: 6
        text: i18n("Inputs")
    }

    PlasmaComponents.ComboBox {
        id: inputsComboBox
        Layout.fillWidth: true
        textRole: "text"
        model: sourceModelProxy
        currentIndex: sourceModelProxy.defaultSourceIndex
        onCurrentIndexChanged: sourceModelProxy.defaultSourceIndex = currentIndex
    }

    PlasmaComponents.ComboBox {
        id: inputsPortsComboBox
        Layout.fillWidth: true
        model: sourceModel.defaultSource.ports
        onModelChanged: currentIndex = sourceModel.defaultSource.activePortIndex
        textRole: "description"
        currentIndex: sourceModel.defaultSource.activePortIndex
        onActivated: sourceModel.defaultSource.activePortIndex = index
    }
}