Commit Graph

87 Commits

Author SHA1 Message Date
jaseg 230f0078fe Fix filesystem encoding on windows 2016-08-09 23:38:21 +02:00
jaseg 1feab17c18 💥 breaking: Call observe_property handler with correct type arg 2016-08-07 19:49:55 +02:00
jaseg 1bde43a4d8 Update README with more instructions 2016-08-07 19:49:37 +02:00
jaseg 1acc39885f Keep wait_for_playback in waiting state during PAUSE
...to allow proper playback of network resources even in case of
buffering
2016-08-07 19:40:28 +02:00
jaseg dc1c4d89a5 💥 breaking: Pass individual arguments to log_handler 2016-08-07 19:14:26 +02:00
jaseg 14bb2c3223 Use utf-8 facing the API
In libmpv's client.h it is said that the API uses utf-8 for everything
except for filenames, for which it uses the system's default filename
encoding. We now try to honor this.
2016-08-07 19:02:29 +02:00
jaseg 2bff338c83 Add filesystem encoding handling 2016-08-07 18:56:07 +02:00
jaseg 7c1343f03d Remove trailing whitespace in mpv.py 2016-08-05 02:35:07 +02:00
jaseg a960a2ed4e Add GL API stuff 2016-08-05 02:35:00 +02:00
jaseg dfdc201ac7 Fix video_params list access 2016-08-05 02:17:39 +02:00
jaseg 24c70a5ac8 Some more lowercase for readability 2016-08-05 02:17:10 +02:00
jaseg 47919b0ca8 Fix event callback foo 2016-08-04 17:06:34 +02:00
jaseg 0c5530aa27 Fix log handling 2016-08-04 16:38:25 +02:00
jaseg 588d74938c Make video-pan-x and video-pan-y floats as they should be 2016-08-04 16:23:44 +02:00
jaseg 73f2e87f66 Fix property observe handler hash handling 2016-08-04 16:19:36 +02:00
jaseg ae8770df30 Make ynbool python2-compatible 2016-08-02 13:45:58 +02:00
jaseg 35de5ecc93 Make this python2 compatible 2016-07-31 21:29:03 +02:00
jaseg 8d8b061fcc Use ctypes.util.find_library to find libmpv. Thanks to @mozbugbox 2016-07-01 13:12:02 +02:00
jaseg f3cab6cdf1 Add tests 2016-02-19 15:34:34 +01:00
jaseg 51869a9184 Properly release resources after use
Namely, let the event handler thread terminate itself cleanly and remove
reference leak so __del__ can do its job.
2016-02-19 14:06:59 +01:00
Frechdachs 1dd8329a42 Fix DEFAULT_ERROR_HANDLER 2016-02-19 08:33:48 +01:00
Frechdachs ac30a66ed4 Implement '==' and '!=' for ynbool
'ynbool(True) == "yes"', 'ynbool(True) == True' and 'ynbool(True) == ynbool(True)' were not working.
2016-02-19 08:30:53 +01:00
Frechdachs c42fe539ab Improve Windows support
Windows users don't have to edit the source code anymore.
2016-02-12 14:09:21 +01:00
Frechdachs bcd8166829 Fix property getter for non-available properties
Properties which are not currently available weren't handled properly: The getter for a property that is not available with proptype 'str' would return "None" (as a string) instead of None. Trying to retrieve a non-available property with proptype 'int' would raise a TypeError, because the getter tries to call 'int(None)'. An alternative would be to raise some kind of exception for non-available properties, but I would prefer the getter to return None. For example None should be a valid value for the property 'path' if no video is loaded yet.
2016-02-12 14:09:21 +01:00
Frechdachs ee8316a282 Fix percent-pos property
The 'percent-pos' property has to be float. Trying to retrieve this property was raising an exception, because e.g. 'int("0.0000")' raises a ValueError.
2016-02-12 14:09:21 +01:00
jaseg 5605380fcb Improved log handling 2016-02-12 14:07:12 +01:00
Frechdachs ec91bf3e57 Fix unobserve_property
There were three problems:

1. MPV.unobserve_property called _mpv_observe_property instead of _mpv_unobserve_property.
2. _mpv_unobserve_property returns the number of properties that were assigned to the handler that is being removed. Because the return value is not 0 in such a case, ErrorCode.raise_for_ec tries to raise an error. To fix that, I changed the ErrorCode.raise_for_ec functon not to raise an error if ec is larger than 0. (If there is a positive return value, there should not have been an error anyway, if I'm not mistaken.)
3. Calling MPV.unobserve_property for a handle that is not currently been used, should not result in a KeyError being raised.

An alternative to 2. would be to add a restype to the _handle_func of 'mpv_unobserve_property' and returning that value in MPV.unobserve_property. (That way, raise_for_ec is never called.)  But I don't think this value is useful in any way. Even the built in lua interface does not return that value.
2016-02-09 22:53:52 +01:00
jaseg 694a2c2c62 Add observe_property support 2016-02-08 23:50:45 +01:00
jaseg a1c170d6ff Remove asyncio for windows support 2016-01-04 13:20:42 +01:00
jaseg fb1704c4dc Fixed accidental python2-ism in ynbool. Fixes #1
Thanks to u8sand from github for this.
2015-11-01 18:22:54 +01:00
jaseg 28b761627f Small beautifications 2015-05-10 17:55:06 +02:00
jaseg df80c10799 Added vim swap files to the .gitignore 2014-08-14 00:34:12 +02:00
jaseg b19b37708b Fixed encoding handling to use the system's default encoding 2014-08-14 00:15:17 +02:00
jaseg f74f0a3191 Removed a bunch of asserts and added some doc
Now leaving command parameter value checking to libmpv.
2014-08-14 00:01:21 +02:00
jaseg baee4f4e22 Added support for yet-unknown error codes 2014-08-13 23:51:07 +02:00
jaseg 2e6516aa32 Added optional loading of liblua 2014-08-13 23:28:28 +02:00
jaseg 9b68b0866e Initial commit 2014-08-10 23:27:26 +02:00