Skip to content

Commit 1747c11

Browse files
Rick164brindosch
authored andcommitted
Misc improvements to delays and priority clearing (#31)
* Added global or per FPS delays. Removed framerate option as it didn't make sense to keep with the new delay setup. Added Hyperion clear on disconnect / no image, this prevents stale images when forwarding to other Hyperion instances. * Simplified delay setting bool check * Changed indenting from 2 to 4 spaces. * Moved clear priority to separate function. * Removed old API calls and checks to improve performance and reduce overall code, only compatible with Kodi 17 and up.
1 parent a60c6a0 commit 1747c11

File tree

6 files changed

+256
-174
lines changed

6 files changed

+256
-174
lines changed

addon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
from settings import Settings
3636
from state import DisconnectedState
37+
from hyperion.Hyperion import Hyperion
3738

3839
if __name__ == "__main__":
3940
# read settings

resources/language/English/strings.po

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,42 @@ msgctxt "#32010"
5454
msgid "Frame rate (fps)"
5555
msgstr ""
5656

57+
msgctxt "#33001"
58+
msgid "Delays"
59+
msgstr ""
60+
61+
msgctxt "#33002"
62+
msgid "Delay default (ms)"
63+
msgstr ""
64+
65+
msgctxt "#33003"
66+
msgid "Delay 23/24FPS (ms)"
67+
msgstr ""
68+
69+
msgctxt "#33004"
70+
msgid "Delay 25FPS (ms)"
71+
msgstr ""
72+
73+
msgctxt "#33005"
74+
msgid "Delay 50FPS (ms)"
75+
msgstr ""
76+
77+
msgctxt "#33006"
78+
msgid "Delay 59FPS (ms)"
79+
msgstr ""
80+
81+
msgctxt "#33007"
82+
msgid "Delay 60FPS (ms)"
83+
msgstr ""
84+
85+
msgctxt "#33100"
86+
msgid "Default delay is only used if below FPS isn't matched"
87+
msgstr ""
88+
89+
msgctxt "#33200"
90+
msgid "Always use default delay"
91+
msgstr ""
92+
5793
msgctxt "#32100"
5894
msgid "Error: Unable to connect to Hyperion. Wrong IP-address?"
5995
msgstr ""

resources/language/German/strings.po

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,42 @@ msgctxt "#32010"
5454
msgid "Frame rate (fps)"
5555
msgstr "Bildfrequenz (fps)"
5656

57+
msgctxt "#33001"
58+
msgid "Verzögerungen"
59+
msgstr ""
60+
61+
msgctxt "#33002"
62+
msgid "Verzögerung Standard (ms)"
63+
msgstr "Wird nur verwendet wenn FPS kein Match ist"
64+
65+
msgctxt "#33003"
66+
msgid "Verzögerung für 23/24FPS (ms)"
67+
msgstr ""
68+
69+
msgctxt "#33004"
70+
msgid "Verzögerung für 25FPS (ms)"
71+
msgstr ""
72+
73+
msgctxt "#33005"
74+
msgid "Verzögerung für 50FPS (ms)"
75+
msgstr ""
76+
77+
msgctxt "#33006"
78+
msgid "Verzögerung für 59FPS (ms)"
79+
msgstr ""
80+
81+
msgctxt "#33007"
82+
msgid "Verzögerung für 60FPS (ms)"
83+
msgstr ""
84+
85+
msgctxt "#33100"
86+
msgid "Die Standardverzögerung wird nur verwendet, wenn unter FPS nicht übereinstimmt"
87+
msgstr ""
88+
89+
msgctxt "#33200"
90+
msgid "Verwenden Sie immer die Standardverzögerung"
91+
msgstr ""
92+
5793
msgctxt "#32100"
5894
msgid "Error: Unable to connect to Hyperion. Wrong IP-address?"
5995
msgstr "Fehler: Kann keine Verbindung zu Hyperion aufbauen. Falsche IP-Adresse?"

resources/lib/settings.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,16 @@ def readSettings(self):
8080
self.timeout = int(addon.getSetting("reconnect_timeout"))
8181
self.capture_width = int(addon.getSetting("capture_width"))
8282
self.capture_height = int(addon.getSetting("capture_height"))
83-
self.framerate = int(addon.getSetting("framerate"))
83+
84+
# Hack around Kodi's settings readout limitations
85+
self.useDefaultDelay = addon.getSetting('use_default_delay').lower() == 'true'
86+
87+
self.delay = int(addon.getSetting("delay"))
88+
self.delay24 = int(addon.getSetting("delay24"))
89+
self.delay25 = int(addon.getSetting("delay25"))
90+
self.delay50 = int(addon.getSetting("delay50"))
91+
self.delay59 = int(addon.getSetting("delay59"))
92+
self.delay60 = int(addon.getSetting("delay60"))
8493

8594
self.showErrorMessage = True
8695
self.rev += 1

0 commit comments

Comments
 (0)