BUG(1963): update promoe to playlist position broadcast
Promoe should still compile with DrK. If you compile against -devel, you need the fix for Bug 1965 from xmms2-eclipser.git
This commit is contained in:
parent
38431358ae
commit
ca0582e1cc
3 changed files with 24 additions and 0 deletions
4
README
4
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'
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include "xclient.h"
|
||||
#include "xclientcache.h"
|
||||
|
||||
// Used to check for Protocolversion at compiletime
|
||||
#include <xmmsc/xmmsc_idnumbers.h>
|
||||
|
||||
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<std::string> ("name"));
|
||||
if (changed_pl == m_name) {
|
||||
uint32_t newpos = pos.get<uint32_t> ("position");
|
||||
return handle_update_pos (newpos);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
PlaylistModel::handle_update_pos (const uint32_t &pos)
|
||||
{
|
||||
|
|
|
@ -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 &);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue