This file is indexed.

/usr/share/webcamoid/qml/AudioConfig.qml is in webcamoid-data 8.1.0+dfsg-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
/* Webcamoid, webcam capture application.
 * Copyright (C) 2011-2017  Gonzalo Exequiel Pedone
 *
 * Webcamoid is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Webcamoid is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
 *
 * Web-Site: http://webcamoid.github.io/
 */

import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1

Rectangle {
    id: recAudioConfig
    color: Qt.rgba(0, 0, 0, 0)
    clip: true
    width: 200
    height: 400

    function updateInputs(inputs)
    {
        lsvInputs.model.clear();

        for (var input in inputs) {
            if (inputs[input] === ":dummyin:")
                continue;

            lsvInputs.model.append({
                input: inputs[input],
                description: AudioLayer.description(inputs[input])
            })
        }

        if (AudioLayer.audioInput.indexOf(":dummyin:") >= 0) {
            lsvInputs.currentIndex = -1
            noInput.selected = true
        } else
            lsvInputs.currentIndex = inputs.indexOf(AudioLayer.audioInput[0]) - 1
    }

    function updateOutputs(outputs)
    {
        lsvOutputs.model.clear();

        for (var output in outputs) {
            if (outputs[output] === ":dummyout:")
                continue;

            lsvOutputs.model.append({
                output: outputs[output],
                description: AudioLayer.description(outputs[output])})
        }

        if (AudioLayer.audioOutput === ":dummyout:") {
            lsvOutputs.currentIndex = -1
            noOutput.selected = true
        } else
            lsvOutputs.currentIndex = outputs.indexOf(AudioLayer.audioOutput)
    }

    Component.onCompleted: {
        updateInputs(AudioLayer.inputs)
        updateOutputs(AudioLayer.outputs)
    }

    Connections {
        target: AudioLayer

        onInputsChanged: updateInputs(inputs)
        onOutputsChanged: updateOutputs(outputs)
        onAudioInputChanged: {
            lsvInputs.lock = true

            if (audioInput.length > 0)
                lsvInputs.currentIndex = AudioLayer.inputs.indexOf(audioInput[0]) - 1

            lsvInputs.lock = false
        }
        onAudioOutputChanged: {
            lsvOutputs.lock = true

            if (AudioLayer.audioOutput === ":dummyout:") {
                lsvOutputs.currentIndex = -1
                noOutput.selected = true
            } else
                lsvOutputs.currentIndex = AudioLayer.outputs.indexOf(audioOutput)

            lsvOutputs.lock = false
        }

        onInputDescriptionChanged: {
            lsvInputs.lock = true
            updateInputs(AudioLayer.inputs)
            lsvInputs.lock = false
        }
    }

    RowLayout {
        id: rlyDevices
        anchors.left: parent.left
        anchors.right: parent.right

        ToolButton {
            id: btnOutputs
            text: qsTr("Outputs")
            checked: true
            Layout.fillWidth: true
            tooltip: qsTr("Select the output device for audio playing")
            checkable: true
            iconSource: "image://icons/webcamoid-headphones"
            iconName: "webcamoid-headphones"

            onCheckedChanged: {
                if (checked) {
                    btnInputs.checked = false
                    recAudioConfig.state = ""
                }
            }
        }
        ToolButton {
            id: btnInputs
            text: qsTr("Inputs")
            Layout.fillWidth: true
            tooltip: qsTr("Select the device for audio capturing")
            checkable: true
            iconSource: "image://icons/webcamoid-mic"
            iconName: "webcamoid-mic"

            onCheckedChanged: {
                if (checked) {
                    btnOutputs.checked = false
                    recAudioConfig.state = "showInputs"
                }
            }
        }
    }

    // Output devices

    Rectangle {
        id: noOutput
        height: 32
        anchors.top: rlyDevices.bottom
        anchors.right: parent.right
        anchors.left: parent.left

        property bool selected: false

        property color gradUp: selected?
                                   Qt.rgba(0.75, 0, 0, 1):
                                   Qt.rgba(0.25, 0, 0, 1)
        property color gradLow: selected?
                                    Qt.rgba(1, 0, 0, 1):
                                    Qt.rgba(0.5, 0, 0, 1)

        onSelectedChanged: {
            gradUp = selected?
                        Qt.rgba(0.75, 0, 0, 1):
                        Qt.rgba(0.25, 0, 0, 1)
            gradLow = selected?
                        Qt.rgba(1, 0, 0, 1):
                        Qt.rgba(0.5, 0, 0, 1)
        }

        gradient: Gradient {
            GradientStop {
                position: 0
                color: noOutput.gradUp
            }

            GradientStop {
                position: 1
                color: noOutput.gradLow
            }
        }

        Label {
            id: txtNoOutputButton
            anchors.verticalCenter: parent.verticalCenter
            anchors.horizontalCenter: parent.horizontalCenter
            text: qsTr("Silence")
            color: noOutput.selected? Qt.rgba(1, 1, 1, 1): Qt.rgba(0.75, 0.75, 0.75, 1)
        }

        MouseArea {
            id: msaNoOutputButton
            hoverEnabled: true
            cursorShape: Qt.PointingHandCursor
            anchors.fill: parent

            onEntered: {
                txtNoOutputButton.font.bold = true
                noOutput.gradUp = noOutput.selected?
                                            Qt.rgba(1, 0.25, 0.25, 1):
                                            Qt.rgba(0.5, 0.25, 0.25, 1)
                noOutput.gradLow = noOutput.selected?
                                            Qt.rgba(1, 0.25, 0.25, 1):
                                            Qt.rgba(0.75, 0.25, 0.25, 1)
            }
            onExited: {
                txtNoOutputButton.font.bold = false
                txtNoOutputButton.scale = 1
                noOutput.gradUp = noOutput.selected?
                                            Qt.rgba(0.75, 0, 0, 1):
                                            Qt.rgba(0.25, 0, 0, 1)
                noOutput.gradLow = noOutput.selected?
                                            Qt.rgba(1, 0, 0, 1):
                                            Qt.rgba(0.5, 0, 0, 1)
            }
            onPressed: txtNoOutputButton.scale = 0.75
            onReleased: txtNoOutputButton.scale = 1
            onClicked: {
                AudioLayer.audioOutput = ":dummyout:"
                lsvOutputs.currentIndex = -1
                noOutput.selected = true
            }
        }
    }
    OptionList {
        id: lsvOutputs
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top: noOutput.bottom
        anchors.bottom: parent.bottom
        textRole: "description"

        property bool lock: false

        onCurrentIndexChanged: {
            if (lock)
                return;

            var option = model.get(currentIndex)
            AudioLayer.audioOutput = option? option.output: ":dummyout:"
            noOutput.selected = false
        }
    }

    // Input devices

    Rectangle {
        id: noInput
        height: 0
        anchors.top: rlyDevices.bottom
        anchors.right: parent.right
        anchors.left: parent.left
        visible: false

        property bool selected: false

        property color gradUp: selected?
                                   Qt.rgba(0.75, 0, 0, 1):
                                   Qt.rgba(0.25, 0, 0, 1)
        property color gradLow: selected?
                                    Qt.rgba(1, 0, 0, 1):
                                    Qt.rgba(0.5, 0, 0, 1)

        onSelectedChanged: {
            gradUp = selected?
                        Qt.rgba(0.75, 0, 0, 1):
                        Qt.rgba(0.25, 0, 0, 1)
            gradLow = selected?
                        Qt.rgba(1, 0, 0, 1):
                        Qt.rgba(0.5, 0, 0, 1)
        }

        gradient: Gradient {
            GradientStop {
                position: 0
                color: noInput.gradUp
            }

            GradientStop {
                position: 1
                color: noInput.gradLow
            }
        }

        Label {
            id: txtNoInputButton
            anchors.verticalCenter: parent.verticalCenter
            anchors.horizontalCenter: parent.horizontalCenter
            text: qsTr("Silence")
            color: noInput.selected? Qt.rgba(1, 1, 1, 1): Qt.rgba(0.75, 0.75, 0.75, 1)
        }

        MouseArea {
            id: msaNoInputButton
            hoverEnabled: true
            cursorShape: Qt.PointingHandCursor
            anchors.fill: parent

            onEntered: {
                txtNoInputButton.font.bold = true
                noInput.gradUp = noInput.selected?
                                            Qt.rgba(1, 0.25, 0.25, 1):
                                            Qt.rgba(0.5, 0.25, 0.25, 1)
                noInput.gradLow = noInput.selected?
                                            Qt.rgba(1, 0.25, 0.25, 1):
                                            Qt.rgba(0.75, 0.25, 0.25, 1)
            }
            onExited: {
                txtNoInputButton.font.bold = false
                txtNoInputButton.scale = 1
                noInput.gradUp = noInput.selected?
                                            Qt.rgba(0.75, 0, 0, 1):
                                            Qt.rgba(0.25, 0, 0, 1)
                noInput.gradLow = noInput.selected?
                                            Qt.rgba(1, 0, 0, 1):
                                            Qt.rgba(0.5, 0, 0, 1)
            }
            onPressed: txtNoInputButton.scale = 0.75
            onReleased: txtNoInputButton.scale = 1
            onClicked: {
                AudioLayer.audioInput = [":dummyin:"]
                lsvInputs.currentIndex = -1
                noInput.selected = true
            }
        }
    }
    OptionList {
        id: lsvInputs
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top: noInput.bottom
        anchors.bottom: parent.bottom
        textRole: "description"
        visible: false

        property bool lock: false

        onCurrentIndexChanged: {
            if (lock)
                return;

            var option = model.get(currentIndex)
            AudioLayer.audioInput = option? [option.input]: [":dummyin:"]
            noInput.selected = false
        }
    }

    states: [
        State {
            name: "showInputs"

            PropertyChanges {
                target: noOutput
                height: 0
                visible: false
            }
            PropertyChanges {
                target: lsvOutputs
                visible: false
            }
            PropertyChanges {
                target: noInput
                height: 32
                visible: true
            }
            PropertyChanges {
                target: lsvInputs
                visible: true
            }
        }
    ]
}