mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
added an internal setting to control the main refresh interval
This commit is contained in:
parent
393d4516b8
commit
6a47781511
@ -673,6 +673,7 @@ class Client(MPDClient):
|
|||||||
self._settings=settings
|
self._settings=settings
|
||||||
self.emitter=MpdEventEmitter()
|
self.emitter=MpdEventEmitter()
|
||||||
self._last_status={}
|
self._last_status={}
|
||||||
|
self._refresh_interval=self._settings.get_int("refresh-interval")
|
||||||
|
|
||||||
#connect
|
#connect
|
||||||
self._settings.connect("changed::active-profile", self._on_settings_changed)
|
self._settings.connect("changed::active-profile", self._on_settings_changed)
|
||||||
@ -806,7 +807,7 @@ class Client(MPDClient):
|
|||||||
print("connect failed")
|
print("connect failed")
|
||||||
return True
|
return True
|
||||||
# connect successful
|
# connect successful
|
||||||
self._main_timeout_id=GLib.timeout_add(100, self._main_loop)
|
self._main_timeout_id=GLib.timeout_add(self._refresh_interval, self._main_loop)
|
||||||
self.emitter.emit("reconnected")
|
self.emitter.emit("reconnected")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -156,5 +156,17 @@
|
|||||||
<summary>List of cover regex</summary>
|
<summary>List of cover regex</summary>
|
||||||
<description></description>
|
<description></description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="i" name="refresh-interval">
|
||||||
|
<default>100</default>
|
||||||
|
<summary>Main refresh interval</summary>
|
||||||
|
<description>
|
||||||
|
This setting should only be used if you know what you are doing!
|
||||||
|
It controls the time in msec. between two status requests to MPD.
|
||||||
|
To high values (long time) will make mpdevil very slow in terms
|
||||||
|
of showing the latest status of MPD (e.g. current song).
|
||||||
|
To low values (short time) can cause gui blocks making mpdevil
|
||||||
|
unresponsive and cpu intensive.
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
</schemalist>
|
</schemalist>
|
||||||
|
Loading…
Reference in New Issue
Block a user