diff --git a/README b/README index c3305e6..4ac48ff 100644 --- a/README +++ b/README @@ -27,6 +27,10 @@ Compilation problems: After installing the headerfiles run 'make distclean' and start again from 'Compiling 1)' + - If promoe doesn't compile because of some wrong reference in + lib/playlist.cpp you need to apply the fix for the c++ bindings from + xmms2-eclipser.git (Bug 1965) + Reporting Bugs: preferred way to report bugs is through xmms2's bugtracker at 'http://bugs.xmms2.xmms.se/' at project 'Client - Promoe' diff --git a/lib/playlistmodel.cpp b/lib/playlistmodel.cpp index 3df76bf..fbd53a5 100644 --- a/lib/playlistmodel.cpp +++ b/lib/playlistmodel.cpp @@ -29,6 +29,9 @@ #include "xclient.h" #include "xclientcache.h" +// Used to check for Protocolversion at compiletime +#include + PlaylistModel::PlaylistModel (QObject *parent, XClient *client, const QString &name) : QAbstractItemModel (parent) { // m_columns.append ("#"); @@ -93,7 +96,11 @@ PlaylistModel::got_connection (XClient *client) client->playlist ()->currentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this)); client->playlist ()->broadcastChanged () (Xmms::bind (&PlaylistModel::handle_change, this)); +#if (XMMS_IPC_PROTOCOL_VERSION > 10) + client->playlist ()->broadcastCurrentPos () (Xmms::bind (&PlaylistModel::handle_update_positions, this)); +#else client->playlist ()->broadcastCurrentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this)); +#endif client->playlist ()->broadcastLoaded () (Xmms::bind (&PlaylistModel::handle_pls_loaded, this)); @@ -112,6 +119,18 @@ PlaylistModel::handle_pls_loaded (const std::string &name) return true; } +bool +PlaylistModel::handle_update_positions (const Xmms::Dict &pos) +{ + + QString changed_pl = XClient::stdToQ (pos.get ("name")); + if (changed_pl == m_name) { + uint32_t newpos = pos.get ("position"); + return handle_update_pos (newpos); + } + return false; +} + bool PlaylistModel::handle_update_pos (const uint32_t &pos) { diff --git a/lib/playlistmodel.h b/lib/playlistmodel.h index 6f3b1cc..5a79379 100644 --- a/lib/playlistmodel.h +++ b/lib/playlistmodel.h @@ -130,6 +130,7 @@ class PlaylistModel : public QAbstractItemModel private: bool handle_list (const Xmms::List< unsigned int > &list); bool handle_change (const Xmms::Dict &chg); + bool handle_update_positions (const Xmms::Dict &pos); bool handle_update_pos (const unsigned int &pos); bool handle_pls_loaded (const std::string &); bool handle_current_pls (const std::string &);