mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-04 00:36:36 +00:00
changed audio configuration to a dropdown, allowing auto/stereo/surround
This commit is contained in:
parent
d12fed3e7f
commit
f951a01a68
@ -186,18 +186,53 @@ ScrollView {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
|
||||||
CheckBox {
|
Label {
|
||||||
id: surroundSoundCheck
|
width: parent.width
|
||||||
text: "<font color=\"white\">Enable 5.1 surround sound</font>"
|
id: resAudioTitle
|
||||||
font.pointSize: 12
|
text: qsTr("Audio configuration")
|
||||||
|
font.pointSize: 12
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
color: "white"
|
||||||
|
}
|
||||||
|
|
||||||
// the backend actually supports auto/stereo/5.1. We'll expose stereo/5.1
|
ComboBox {
|
||||||
checked: prefs.audioConfig === StreamingPreferences.AC_FORCE_SURROUND
|
// ignore setting the index at first, and actually set it when the component is loaded
|
||||||
|
Component.onCompleted: {
|
||||||
|
var saved_audio = prefs.audioConfig
|
||||||
|
currentIndex = 0
|
||||||
|
for(var i = 0; i < audioListModel.count; i++) {
|
||||||
|
var el_audio= audioListModel.get(i).val;
|
||||||
|
if(saved_audio === el_audio) {
|
||||||
|
currentIndex = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onCheckedChanged: {
|
id: audioComboBox
|
||||||
prefs.audioConfig = checked ? StreamingPreferences.AC_FORCE_SURROUND : StreamingPreferences.AC_FORCE_STEREO
|
width: Math.min(bitrateDesc.implicitWidth, parent.width)
|
||||||
|
font.pointSize: 9
|
||||||
|
textRole: "text"
|
||||||
|
model: ListModel {
|
||||||
|
id: audioListModel
|
||||||
|
ListElement {
|
||||||
|
text: "Auto"
|
||||||
|
val: StreamingPreferences.AC_AUTO
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
text: "Force stereo"
|
||||||
|
val: StreamingPreferences.AC_FORCE_STEREO
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
text: "Force surround"
|
||||||
|
val: StreamingPreferences.AC_FORCE_SURROUND
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ::onActivated must be used, as it only listens for when the index is changed by a human
|
||||||
|
onActivated : {
|
||||||
|
prefs.audioConfig = audioListModel.get(currentIndex).val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,8 +315,6 @@ ScrollView {
|
|||||||
ComboBox {
|
ComboBox {
|
||||||
// ignore setting the index at first, and actually set it when the component is loaded
|
// ignore setting the index at first, and actually set it when the component is loaded
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// load the saved width/height/fps, and iterate through the ComboBox until a match is found
|
|
||||||
// set it to that index.
|
|
||||||
var saved_vds = prefs.videoDecoderSelection
|
var saved_vds = prefs.videoDecoderSelection
|
||||||
currentIndex = 0
|
currentIndex = 0
|
||||||
for(var i = 0; i < decoderListModel.count; i++) {
|
for(var i = 0; i < decoderListModel.count; i++) {
|
||||||
@ -317,8 +350,6 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
id: resVCCTitle
|
id: resVCCTitle
|
||||||
@ -331,8 +362,6 @@ ScrollView {
|
|||||||
ComboBox {
|
ComboBox {
|
||||||
// ignore setting the index at first, and actually set it when the component is loaded
|
// ignore setting the index at first, and actually set it when the component is loaded
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// load the saved width/height/fps, and iterate through the ComboBox until a match is found
|
|
||||||
// set it to that index.
|
|
||||||
var saved_vcc = prefs.videoCodecConfig
|
var saved_vcc = prefs.videoCodecConfig
|
||||||
currentIndex = 0
|
currentIndex = 0
|
||||||
for(var i = 0; i < codecListModel.count; i++) {
|
for(var i = 0; i < codecListModel.count; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user