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:
parent
18bcad6f99
commit
1fa72bd3f0
3 changed files with 13 additions and 10 deletions
1
README
1
README
|
@ -5,6 +5,7 @@ Required dependencys:
|
|||
- promoe should compile with DrK
|
||||
- if you compile against xmms2-devel
|
||||
make sure it isn't not older than 2008-05-15
|
||||
(and get the patch for bug 1973 if necessary)
|
||||
|
||||
Optional dependencys:
|
||||
* Avahi http://www.avahi.org/
|
||||
|
|
|
@ -96,11 +96,7 @@ 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));
|
||||
|
||||
|
@ -119,17 +115,19 @@ PlaylistModel::handle_pls_loaded (const std::string &name)
|
|||
return true;
|
||||
}
|
||||
|
||||
#if (XMMS_IPC_PROTOCOL_VERSION > 10)
|
||||
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) {
|
||||
uint32_t newpos = pos.get<uint32_t> ("position");
|
||||
return handle_update_pos (newpos);
|
||||
uint32_t pos = posdict.get<uint32_t> ("position");
|
||||
m_current_pos = pos;
|
||||
emit dataChanged(index (pos, 0), index (pos, m_columns.size ()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#else
|
||||
bool
|
||||
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 ()));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
QList<QString>
|
||||
PlaylistModel::columns () const
|
||||
|
|
|
@ -130,8 +130,11 @@ 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);
|
||||
#if (XMMS_IPC_PROTOCOL_VERSION > 10)
|
||||
bool handle_update_pos (const Xmms::Dict &pos);
|
||||
#else
|
||||
bool handle_update_pos (const unsigned int &pos);
|
||||
#endif
|
||||
bool handle_pls_loaded (const std::string &);
|
||||
bool handle_current_pls (const std::string &);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue