-
Notifications
You must be signed in to change notification settings - Fork 0
/
SoundSimulate.qml
60 lines (51 loc) · 1.53 KB
/
SoundSimulate.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
import QtQuick 2.5
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
Item {
anchors.fill: parent
FileDialog {
id: openAudioFile
title: qsTr("select a *.wav file to use")
nameFilters: [ "Audio files (*.wav)" ]
onAccepted: {
config.soundFile = fileUrl
var path = fileUrl.toString()
path = path.replace(/^(file:\/{3})/,"/")
var cleanPath = decodeURIComponent(path)
textFieldAudioFileName.text = cleanPath
}
}
Column {
id: column1
GroupBox {
id: groupBox1
flat: true
Layout.fillWidth: true
Row {
id: row1
spacing: 5
anchors.fill: parent
Label {
id: textAudioFileName
text: qsTr("audiofile name ")
anchors.verticalCenter: parent.verticalCenter
}
TextField {
id: textFieldAudioFileName
width: 300
anchors.verticalCenter: parent.verticalCenter
readOnly: true
text: config.soundFile.toString()
placeholderText: qsTr("filename")
}
Button {
id: fileDialogButton
width: 33
text: qsTr("...")
onClicked: openAudioFile.open()
}
}
}
}
}