Skip to content

Commit

Permalink
DBus cast fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
terencode authored and falkTX committed Nov 17, 2019
1 parent 12e3907 commit b69d157
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/cadence.py
Expand Up @@ -1310,7 +1310,7 @@ def DBusSignalReceiver(self, *args, **kwds):

def jackStarted(self):
self.m_last_dsp_load = gDBus.jack.GetLoad()
self.m_last_xruns = gDBus.jack.GetXruns()
self.m_last_xruns = int(gDBus.jack.GetXruns())
self.m_last_buffer_size = gDBus.jack.GetBufferSize()

self.b_jack_start.setEnabled(False)
Expand Down Expand Up @@ -2324,7 +2324,7 @@ def timerEvent(self, event):
if event.timerId() == self.m_timer500:
if gDBus.jack and self.m_last_dsp_load != None:
next_dsp_load = gDBus.jack.GetLoad()
next_xruns = gDBus.jack.GetXruns()
next_xruns = int(gDBus.jack.GetXruns())
needUpdateTip = False

if self.m_last_dsp_load != next_dsp_load:
Expand Down
34 changes: 20 additions & 14 deletions src/jacksettings.py
Expand Up @@ -404,28 +404,30 @@ def loadServerSettings(self, reset=False, forceReset=False):
elif attribute == "alias":
self.ui.obj_server_alias.setChecked(bool(value))
elif attribute == "client-timeout":
self.setComboBoxValue(self.ui.obj_server_client_timeout, str(value))
self.setComboBoxValue(self.ui.obj_server_client_timeout, str(int(value)))
elif attribute == "clock-source":
value = str(value)
if value == "c":
self.ui.obj_server_clock_source_cycle.setChecked(True)
elif value == "h":
self.ui.obj_server_clock_source_hpet.setChecked(True)
elif value == "s":
self.ui.obj_server_clock_source_system.setChecked(True)
if len(str(value)) == 1 :
value = str(value)
if value == "c":
self.ui.obj_server_clock_source_cycle.setChecked(True)
elif value == "h":
self.ui.obj_server_clock_source_hpet.setChecked(True)
elif value == "s":
self.ui.obj_server_clock_source_system.setChecked(True)
else:
value = int(value)
self.fBrokenServerClockSource = True
if value == str(JACK_TIMER_SYSTEM_CLOCK):
if value == JACK_TIMER_SYSTEM_CLOCK:
self.ui.obj_server_clock_source_system.setChecked(True)
elif value == str(JACK_TIMER_CYCLE_COUNTER):
elif value == JACK_TIMER_CYCLE_COUNTER:
self.ui.obj_server_clock_source_cycle.setChecked(True)
elif value == str(JACK_TIMER_HPET):
elif value == JACK_TIMER_HPET:
self.ui.obj_server_clock_source_hpet.setChecked(True)
else:
self.ui.obj_server_clock_source.setEnabled(False)
print("JackSettingsW::saveServerSettings() - Invalid clock-source value '%s'" % value)
elif attribute == "port-max":
self.setComboBoxValue(self.ui.obj_server_port_max, str(value))
self.setComboBoxValue(self.ui.obj_server_port_max, str(int(value)))
elif attribute == "replace-registry":
self.ui.obj_server_replace_registry.setChecked(bool(value))
elif attribute == "sync":
Expand Down Expand Up @@ -627,17 +629,21 @@ def loadDriverSettings(self, reset=False, forceReset=False):
elif attribute == "capture":
if self.fDriverName == "firewire":
self.ui.obj_driver_capture.setCurrentIndex(1 if bool(value) else 0)
elif self.fDriverName == "dummy":
self.setComboBoxValue(self.ui.obj_driver_capture, str(int(value)), True)
else:
self.setComboBoxValue(self.ui.obj_driver_capture, str(value), True)
elif attribute == "playback":
if self.fDriverName == "firewire":
self.ui.obj_driver_playback.setCurrentIndex(1 if bool(value) else 0)
elif self.fDriverName == "dummy":
self.setComboBoxValue(self.ui.obj_driver_playback, str(int(value)), True)
else:
self.setComboBoxValue(self.ui.obj_driver_playback, str(value), True)
elif attribute == "rate":
self.setComboBoxValue(self.ui.obj_driver_rate, str(value))
self.setComboBoxValue(self.ui.obj_driver_rate, str(int(value)))
elif attribute == "period":
self.setComboBoxValue(self.ui.obj_driver_period, str(value))
self.setComboBoxValue(self.ui.obj_driver_period, str(int(value)))
elif attribute == "nperiods":
self.ui.obj_driver_nperiods.setValue(int(value))
elif attribute == "hwmon":
Expand Down

0 comments on commit b69d157

Please sign in to comment.