2018-07-08 05:15:02 +00:00
|
|
|
import QtQuick 2.9
|
2018-07-08 17:19:08 +00:00
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
|
2018-07-09 05:56:38 +00:00
|
|
|
import StreamingPreferences 1.0
|
|
|
|
|
2018-07-08 18:20:56 +00:00
|
|
|
ScrollView {
|
2018-07-08 05:15:02 +00:00
|
|
|
id: settingsPage
|
|
|
|
objectName: "Settings"
|
|
|
|
|
2018-07-09 05:56:38 +00:00
|
|
|
StreamingPreferences {
|
|
|
|
id: prefs
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onDestruction: {
|
|
|
|
prefs.save()
|
|
|
|
}
|
|
|
|
|
2018-07-08 17:19:08 +00:00
|
|
|
Column {
|
|
|
|
x: 10
|
|
|
|
y: 10
|
|
|
|
width: settingsPage.width
|
|
|
|
height: 400
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
// TODO save the settings
|
2018-07-08 18:12:22 +00:00
|
|
|
id: basicSettingsGroupBox
|
2018-07-08 17:19:08 +00:00
|
|
|
width: (parent.width - 20)
|
|
|
|
padding: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
title: "<font color=\"skyblue\">Basic Settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
2018-07-08 17:19:08 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
Label {
|
|
|
|
width: parent.width
|
|
|
|
id: resFPStitle
|
|
|
|
text: qsTr("Resolution and FPS target")
|
|
|
|
font.pointSize: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
wrapMode: Text.Wrap
|
|
|
|
color: "white"
|
2018-07-08 17:19:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
width: parent.width
|
|
|
|
id: resFPSdesc
|
2018-07-09 05:56:38 +00:00
|
|
|
text: qsTr("Setting values too high for your device may cause lag or crashes")
|
2018-07-08 17:19:08 +00:00
|
|
|
font.pointSize: 9
|
|
|
|
wrapMode: Text.Wrap
|
2018-07-08 18:20:56 +00:00
|
|
|
color: "white"
|
2018-07-08 17:19:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: resolutionComboBox
|
2018-07-09 05:56:38 +00:00
|
|
|
currentIndex : 1
|
2018-07-08 18:12:22 +00:00
|
|
|
width: Math.min(bitrateDesc.implicitWidth, parent.width)
|
|
|
|
font.pointSize: 9
|
2018-07-08 17:19:08 +00:00
|
|
|
model: ListModel {
|
|
|
|
id: resolutionListModel
|
|
|
|
// TODO have values associated with the text.
|
|
|
|
ListElement { text: "720p 30 FPS" }
|
|
|
|
ListElement { text: "720p 60 FPS" }
|
|
|
|
ListElement { text: "1080p 30 FPS" }
|
|
|
|
ListElement { text: "1080p 60 FPS" }
|
|
|
|
ListElement { text: "4K 30 FPS" }
|
|
|
|
ListElement { text: "4K 60 FPS" }
|
|
|
|
}
|
|
|
|
onCurrentIndexChanged: console.debug(resolutionListModel.get(currentIndex).text + " selected resolution")
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
width: parent.width
|
|
|
|
id: bitrateTitle
|
2018-07-09 05:56:38 +00:00
|
|
|
text: qsTr("Video bitrate: ")
|
2018-07-08 17:19:08 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
wrapMode: Text.Wrap
|
2018-07-08 18:20:56 +00:00
|
|
|
color: "white"
|
2018-07-08 17:19:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
width: parent.width
|
|
|
|
id: bitrateDesc
|
2018-07-09 05:56:38 +00:00
|
|
|
text: qsTr("Lower bitrate to reduce lag and stuttering. Raise bitrate to increase image quality.")
|
2018-07-08 17:19:08 +00:00
|
|
|
font.pointSize: 9
|
|
|
|
wrapMode: Text.Wrap
|
2018-07-08 18:20:56 +00:00
|
|
|
color: "white"
|
2018-07-08 17:19:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Slider {
|
|
|
|
id: slider
|
|
|
|
wheelEnabled: true
|
|
|
|
|
|
|
|
// TODO value should be loaded as the current value.
|
2018-07-09 05:56:38 +00:00
|
|
|
value: prefs.bitrateKbps
|
2018-07-08 17:19:08 +00:00
|
|
|
stepSize: 500
|
|
|
|
from : 500
|
2018-07-09 05:56:38 +00:00
|
|
|
to: 100000
|
2018-07-08 17:19:08 +00:00
|
|
|
snapMode: "SnapOnRelease"
|
|
|
|
width: Math.min(bitrateDesc.implicitWidth, parent.width)
|
|
|
|
|
2018-07-09 05:56:38 +00:00
|
|
|
onValueChanged: {
|
|
|
|
bitrateTitle.text = "Video bitrate: " + (value / 1000.0) + " Mbps"
|
|
|
|
prefs.bitrateKbps = value
|
2018-07-08 17:19:08 +00:00
|
|
|
}
|
|
|
|
}
|
2018-07-08 18:12:22 +00:00
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: fullScreenCheck
|
2018-07-09 05:56:38 +00:00
|
|
|
text: "<font color=\"white\">Full-screen</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
2018-07-09 05:56:38 +00:00
|
|
|
checked: prefs.fullScreen
|
|
|
|
onCheckedChanged: {
|
|
|
|
prefs.fullScreen = checked
|
|
|
|
}
|
2018-07-08 18:12:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
id: audioSettingsGroupBox
|
|
|
|
width: (parent.width - 20)
|
|
|
|
padding: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
title: "<font color=\"skyblue\">Audio Settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: surroundSoundCheck
|
2018-07-08 18:20:56 +00:00
|
|
|
text: "<font color=\"white\">Enable 5.1 surround sound</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
id: gamepadSettingsGroupBox
|
|
|
|
width: (parent.width - 20)
|
|
|
|
padding: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
title: "<font color=\"skyblue\">Gamepad Settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: multiControllerCheck
|
2018-07-08 18:20:56 +00:00
|
|
|
text: "<font color=\"white\">Multiple controller support</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
2018-07-09 05:56:38 +00:00
|
|
|
checked: prefs.multiController
|
|
|
|
onCheckedChanged: {
|
|
|
|
prefs.multiController = checked
|
|
|
|
}
|
2018-07-08 18:12:22 +00:00
|
|
|
}
|
|
|
|
CheckBox {
|
|
|
|
id: mouseEmulationCheck
|
2018-07-08 18:20:56 +00:00
|
|
|
text: "<font color=\"white\">Mouse emulation via gamepad</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
id: onScreenControlsGroupBox
|
|
|
|
width: (parent.width - 20)
|
|
|
|
padding: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
title: "<font color=\"skyblue\">On-screen Controls Settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: onScreenControlsCheck
|
2018-07-08 18:20:56 +00:00
|
|
|
text: "<font color=\"white\">Show on-screen controls</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
id: hostSettingsGroupBox
|
|
|
|
width: (parent.width - 20)
|
|
|
|
padding: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
title: "<font color=\"skyblue\">Host Settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: optimizeGameSettingsCheck
|
2018-07-08 18:20:56 +00:00
|
|
|
text: "<font color=\"white\">Optimize game settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
2018-07-09 05:56:38 +00:00
|
|
|
checked: prefs.gameOptimizations
|
|
|
|
onCheckedChanged: {
|
|
|
|
prefs.gameOptimizations = checked
|
|
|
|
}
|
2018-07-08 18:12:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: audioPcCheck
|
2018-07-09 05:56:38 +00:00
|
|
|
text: "<font color=\"white\">Play audio on host PC</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
2018-07-09 05:56:38 +00:00
|
|
|
checked: prefs.playAudioOnHost
|
|
|
|
onCheckedChanged: {
|
|
|
|
prefs.playAudioOnHost = checked
|
|
|
|
}
|
2018-07-08 18:12:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
id: advancedSettingsGroupBox
|
|
|
|
width: (parent.width - 20)
|
|
|
|
padding: 12
|
2018-07-08 18:20:56 +00:00
|
|
|
title: "<font color=\"skyblue\">Advanced Settings</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: neverDropFramesCheck
|
2018-07-08 18:20:56 +00:00
|
|
|
text: "<font color=\"white\">Never drop frames</font>"
|
2018-07-08 18:12:22 +00:00
|
|
|
font.pointSize: 12
|
|
|
|
}
|
2018-07-08 17:19:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-07-08 05:15:02 +00:00
|
|
|
}
|