Audio profile Save implemented no logic

This commit is contained in:
ykeara
2018-12-20 14:35:55 -06:00
parent 4b5c931592
commit 78f411e9df
7 changed files with 305 additions and 9 deletions
+18 -6
View File
@@ -38,9 +38,8 @@ MyStackViewPage {
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this audio profile?"
onClosed: {
//TODO audio delete profile
if (okClicked) {
//AudioTabController.deletePttProfile(profileIndex)
AudioTabController.deleteAudioProfile(profileIndex)
}
}
}
@@ -121,8 +120,7 @@ MyStackViewPage {
onClosed: {
if (okClicked) {
if (audioNewProfileName.text != "") {
//TODO call AUDIO add profile
//AudioTabController.addPttProfile(pttNewProfileName.text)
AudioTabController.addAudioProfile(audioNewProfileName.text)
} else {
audioMessageDialog.showMessage("Create New Profile", "ERROR: No name given.")
}
@@ -415,8 +413,7 @@ MyStackViewPage {
text: "Apply"
onClicked: {
if (audioProfileComboBox.currentIndex > 0) {
//TODO
// AudioTabController.applyPttProfile(pttProfileComboBox.currentIndex - 1)
AudioTabController.applyAudioProfile(audioProfileComboBox.currentIndex - 1)
audioProfileComboBox.currentIndex = 0
}
}
@@ -555,6 +552,7 @@ MyStackViewPage {
audioMicNameCombo.currentIndex = AudioTabController.micDeviceIndex
}
reloadPttProfiles()
reloadAudioProfiles()
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
audioPttLeftControllerToggle.checked = AudioTabController.pttLeftControllerEnabled
audioPttRightControllerToggle.checked = AudioTabController.pttRightControllerEnabled
@@ -634,6 +632,10 @@ MyStackViewPage {
onPttProfilesUpdated: {
reloadPttProfiles()
}
onAudioProfilesUpdated:{
reloadAudioProfiles()
}
onPlaybackDeviceListChanged: {
var devs1 = []
var devs2 = ["<None>"]
@@ -698,4 +700,14 @@ MyStackViewPage {
pttProfileComboBox.currentIndex = 0
pttProfileComboBox.model = profiles
}
function reloadAudioProfiles(){
var profiles = [""]
var profileCount = AudioTabController.getAudioProfileCount()
for (var i = 0; i < profileCount; i++) {
profiles.push(AudioTabController.getAudioProfileName(i))
}
audioProfileComboBox.currentIndex = 0
audioProfileComboBox.model = profiles
}
}