OTHER: Update promoe to the latest api change (currentPos)

At the moment the api change has not yet reached the c++ bindings in
xmms2-devel.
get patch for bug #1973 if necessary
This commit is contained in:
Thomas Frauendorfer 2008-05-19 16:44:50 +02:00
parent 18bcad6f99
commit 1fa72bd3f0
3 changed files with 13 additions and 10 deletions

1
README
View file

@ -5,6 +5,7 @@ Required dependencys:
- promoe should compile with DrK - promoe should compile with DrK
- if you compile against xmms2-devel - if you compile against xmms2-devel
make sure it isn't not older than 2008-05-15 make sure it isn't not older than 2008-05-15
(and get the patch for bug 1973 if necessary)
Optional dependencys: Optional dependencys:
* Avahi http://www.avahi.org/ * Avahi http://www.avahi.org/

View file

@ -96,11 +96,7 @@ PlaylistModel::got_connection (XClient *client)
client->playlist ()->currentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this)); client->playlist ()->currentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this));
client->playlist ()->broadcastChanged () (Xmms::bind (&PlaylistModel::handle_change, 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)); client->playlist ()->broadcastCurrentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this));
#endif
client->playlist ()->broadcastLoaded () (Xmms::bind (&PlaylistModel::handle_pls_loaded, this)); client->playlist ()->broadcastLoaded () (Xmms::bind (&PlaylistModel::handle_pls_loaded, this));
@ -119,17 +115,19 @@ PlaylistModel::handle_pls_loaded (const std::string &name)
return true; return true;
} }
#if (XMMS_IPC_PROTOCOL_VERSION > 10)
bool bool
PlaylistModel::handle_update_positions (const Xmms::Dict &pos) PlaylistModel::handle_update_pos (const Xmms::Dict &posdict)
{ {
QString changed_pl = XClient::stdToQ (pos.get<std::string> ("name")); QString changed_pl = XClient::stdToQ (posdict.get<std::string> ("name"));
if (changed_pl == m_name) { if (changed_pl == m_name) {
uint32_t newpos = pos.get<uint32_t> ("position"); uint32_t pos = posdict.get<uint32_t> ("position");
return handle_update_pos (newpos); m_current_pos = pos;
emit dataChanged(index (pos, 0), index (pos, m_columns.size ()));
} }
return true; return true;
} }
#else
bool bool
PlaylistModel::handle_update_pos (const uint32_t &pos) PlaylistModel::handle_update_pos (const uint32_t &pos)
{ {
@ -137,6 +135,7 @@ PlaylistModel::handle_update_pos (const uint32_t &pos)
emit dataChanged(index (pos, 0), index (pos, m_columns.size ())); emit dataChanged(index (pos, 0), index (pos, m_columns.size ()));
return true; return true;
} }
#endif
QList<QString> QList<QString>
PlaylistModel::columns () const PlaylistModel::columns () const

View file

@ -130,8 +130,11 @@ class PlaylistModel : public QAbstractItemModel
private: private:
bool handle_list (const Xmms::List< unsigned int > &list); bool handle_list (const Xmms::List< unsigned int > &list);
bool handle_change (const Xmms::Dict &chg); bool handle_change (const Xmms::Dict &chg);
bool handle_update_positions (const Xmms::Dict &pos); #if (XMMS_IPC_PROTOCOL_VERSION > 10)
bool handle_update_pos (const Xmms::Dict &pos);
#else
bool handle_update_pos (const unsigned int &pos); bool handle_update_pos (const unsigned int &pos);
#endif
bool handle_pls_loaded (const std::string &); bool handle_pls_loaded (const std::string &);
bool handle_current_pls (const std::string &); bool handle_current_pls (const std::string &);