| 1 |
import QtQuick 2.7 |
| 2 |
import QtQuick.Layouts 1.3 |
| 3 |
import QtQuick.Controls 2.0 |
| 4 |
|
| 5 |
import sfxr 1.0 |
| 6 |
|
| 7 |
RowLayout { |
| 8 |
property SoundPlayer soundPlayer |
| 9 |
Button { |
| 10 |
id: playButton |
| 11 |
Layout.minimumWidth: implicitWidth * 1.5 |
| 12 |
Layout.minimumHeight: implicitHeight * 1.5 |
| 13 |
text: qsTr("Play (Return)") |
| 14 |
onClicked: { |
| 15 |
soundPlayer.play(); |
| 16 |
} |
| 17 |
} |
| 18 |
CheckBox { |
| 19 |
text: qsTr("Loop (L)") |
| 20 |
checked: soundPlayer.loop |
| 21 |
onCheckedChanged: { |
| 22 |
soundPlayer.loop = checked; |
| 23 |
} |
| 24 |
} |
| 25 |
Shortcut { |
| 26 |
sequence: "Return" |
| 27 |
onActivated: soundPlayer.play(); |
| 28 |
} |
| 29 |
Shortcut { |
| 30 |
sequence: "L" |
| 31 |
onActivated: { |
| 32 |
soundPlayer.loop = !soundPlayer.loop; |
| 33 |
} |
| 34 |
} |
| 35 |
} |