chbmuc / cec

cec.go - a golang binding for libcec
MIT License
39 stars 21 forks source link

Make cec package compatible with libCEC v3.1 #2

Open minorhacks opened 8 years ago

minorhacks commented 8 years ago

Discovered today that this package doesn't build when following the directions in the README. It looks like the API to libcec has changed - a number of functions have been renamed from cec* to libcec, also taking an additional libcec_connection_t parameter. The bulk of the important changes are: save off the libcec_connection_t value received from libcecinitialise() into a global, and use this value for subsequent libcec\ calls that require it.

I replaced the 'log' package with the 'glog' package, which allows for different logging levels (Info, Warning, Error) and different verbosities. CEC debug info that is logged in callbacks.go can be logged at a higher verbosity level so that it doesn't always have to be visible. I updated the README file with the additional step required (flag.Parse()) and flag information.

I ran gofmt on all the files, so there are a lot of whitespace changes.