From a4cb137b2476f52f60b3b25d671a87cc42b30126 Mon Sep 17 00:00:00 2001 From: Headshotnoby Date: Tue, 22 Jun 2021 12:14:20 -0400 Subject: [PATCH] add reload audio system button --- options.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/options.py b/options.py index 6f1db3f..a59202d 100644 --- a/options.py +++ b/options.py @@ -143,6 +143,10 @@ class Settings(QtGui.QDialog): audio_layout.setWidget(4, QtGui.QFormLayout.LabelRole, bliplabel) audio_layout.setWidget(4, QtGui.QFormLayout.FieldRole, self.blipslider) + self.reloadaudio = QtGui.QPushButton(text="Reload audio system") + self.reloadaudio.clicked.connect(self.onReloadAudio) + audio_layout.setWidget(5, QtGui.QFormLayout.FieldRole, self.reloadaudio) + for device in audio.getdevices(): self.device_list.addItem(device) @@ -258,4 +262,9 @@ class Settings(QtGui.QDialog): code = updater.checkForUpdates() if code == 0: subprocess.Popen(["./AO2XPupdat"]) - _exit(0) \ No newline at end of file + _exit(0) + + def onReloadAudio(self): + audio.free() + audio.init() + print "reloaded audio" \ No newline at end of file