View Single Post
Posts: 564 | Thanked: 693 times | Joined on Apr 2010
#502
Originally Posted by mece View Post
It does require some hacking it seems. libopenspotify is made after APIv4 specs and libspotify uses v7, and it doesn't support 96kbps. With some hacking I managed to compile qspot against libspotify but I didn't get it to actually work. If run as root it jammed at "connected to AP:" and if run as user it segfaulted. It was most likely my ugly hacks that caused the issues though. I had some warnings.

Aside from changeing #include <spotify/api.h> to #include <libspotify/api.h> and the .pro file, the main problems were the session bits that mostly return void in v7 where they kindly returned sp_error in v4. I just put whatever_error = SP_ERROR_OK;
sp_session_something()
instead of whatever_error = sp_session_something()

Also, turns out sp_session_init is now sp_session_create.
Code:
#if SPOTIFY_API_VERSION > 4
        sp_session_create(&m_config, &m_session);
#else
        sp_session_init(&m_config, &m_session);
#endif
worked for that.

But as I said, it didn't actually work. But it compiled. Now zzz.
It is indeed possible to compile QSpot against the official libspotify library, I have myself made successful tests using it.. So I have a QSpot ready version that can be used with the official lib in case the terms of usage will allow it at some point (hopefully).. Quite a lot of changes were required as you stated due to libopenspotify using api version 4, while libspotify is already at version 7. In case the official library can be used, then we can add support directly for e.g., playlist management (creation / editing), starring tracks, playlist folders, caching of tracks etc.
 

The Following 4 Users Say Thank You to aenbacka For This Useful Post: