jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
554 stars 69 forks source link

_get_property marked as private #37

Closed za4410 closed 7 years ago

za4410 commented 7 years ago

Is there any reason why "_get_property" function is marked as private (underscored)? I need to be able to request player's current playback time without "observing" it, and the only way I can do that now is by: player._get_property("playback-time")

where it really should be: player.get_property("playback-time")

jaseg commented 7 years ago

Try player.playback_time

jaseg commented 7 years ago

All mpv properties are mapped to attibutes on the MPV python object. Any dashes in the property name are replaced by underscores.

The accessor functions are autogenerated from a long list of all properties since they are all the same anyway and the exposed properties are constantly shifting.

The only instance where you'd need to use _get_property is if you'd want to access a libmpv property that didn't exist in the libmpv version this module was written against. There is a unit test checking congruency between what this module exposes and what libmpv exposes.

jaseg commented 7 years ago

Is this issue resolved for you? If it is not, please just re-open it.