rocky / pycdio

Python interface to the libcdio - the CD Input and Control library
GNU General Public License v3.0
15 stars 8 forks source link

Add output typemaps for cdtext_list_languages_v2() and cdtext_get() #4

Closed baszoetekouw closed 3 years ago

baszoetekouw commented 3 years ago

OK, I keep fixing things as I work on my project that uses pycdio. This PR fixes the interface of two cdtext functions. Rather than returning the raw C-structures, we ass a typemap so that the return values for can be used as normal python epxressions.

Specifically, this changes the return type of :

The return values for cdtext_list_languages_v2() are the be interpreted as one of the (existing) CDTEXT_LANGUAGE_* constants. The CDtext format unfortunately doesn't specify a character set, so we simply return a byte string here. Decoding is left as an exercise to the reader ;)