summaryrefslogtreecommitdiff
path: root/mpv.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-04-22 23:18:48 +0200
committerjaseg <git@jaseg.de>2022-04-22 23:18:48 +0200
commit85ad2a6aa6ef526db7b47c9e062f3460610e163d (patch)
tree638e32327eb09e3a39bf3a62500fd145e2c42c81 /mpv.py
parentc90a5f692f255b9ee5bd51be65dc00a554ebf88e (diff)
downloadpython-mpv-85ad2a6aa6ef526db7b47c9e062f3460610e163d.tar.gz
python-mpv-85ad2a6aa6ef526db7b47c9e062f3460610e163d.tar.bz2
python-mpv-85ad2a6aa6ef526db7b47c9e062f3460610e163d.zip
Finish rewriting event infrastructure
Diffstat (limited to 'mpv.py')
-rw-r--r--mpv.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/mpv.py b/mpv.py
index 5811d70..714c293 100644
--- a/mpv.py
+++ b/mpv.py
@@ -415,7 +415,7 @@ class MpvEventProperty(Structure):
@property
def value(self):
- return MpvNode.node_cast_value(self.data, self.format.value)
+ return MpvNode.node_cast_value(self.data, self.format.value, decoder=lazy_decoder)
class MpvEventLogMessage(Structure):
_fields_ = [('_prefix', c_char_p),
@@ -432,7 +432,7 @@ class MpvEventLogMessage(Structure):
@property
def text(self):
- return self._text
+ return lazy_decoder(self._text)
class MpvEventEndFile(Structure):
_fields_ = [('reason', c_int),
@@ -459,9 +459,14 @@ class MpvEventClientMessage(Structure):
class MpvEventCommand(Structure):
_fields_ = [('_result', MpvNode)]
- def result(self):
+ @property
+ def result_raw(self):
return self._result.node_value()
+ @property
+ def result(self):
+ return self._result.node_value(decoder=lazy_decoder)
+
class MpvEventHook(Structure):
_fields_ = [('_name', c_char_p),
('id', c_ulonglong),]