remove some now unused code from XMMSHandler and clean up headers
This commit is contained in:
parent
ced09fc049
commit
f10cd0465a
41 changed files with 407 additions and 242 deletions
3
lib/README
Normal file
3
lib/README
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Contains a copy of some of Esperanzas src/lib/ directory
|
||||||
|
|
||||||
|
Will perhaps someday become a seperate lib
|
4
lib/TODO
4
lib/TODO
|
@ -1,4 +0,0 @@
|
||||||
Contains a copy of some of Esperanzas src/lib/ directory
|
|
||||||
Will have to be removed as soon as those files become a seperate lib
|
|
||||||
|
|
||||||
Redo XSettings with something better
|
|
|
@ -8,6 +8,7 @@ OBJECTS_DIR = .obj
|
||||||
SOURCES += xclient.cpp \
|
SOURCES += xclient.cpp \
|
||||||
xclientcache.cpp \
|
xclientcache.cpp \
|
||||||
xconfig.cpp \
|
xconfig.cpp \
|
||||||
|
xplayback.cpp \
|
||||||
xcollection.cpp \
|
xcollection.cpp \
|
||||||
playlistmodel.cpp \
|
playlistmodel.cpp \
|
||||||
xmmsqt4.cpp
|
xmmsqt4.cpp
|
||||||
|
@ -16,7 +17,9 @@ SOURCES += xclient.cpp \
|
||||||
HEADERS += xclient.h \
|
HEADERS += xclient.h \
|
||||||
xclientcache.h \
|
xclientcache.h \
|
||||||
xconfig.h \
|
xconfig.h \
|
||||||
|
xplayback.h \
|
||||||
xcollection.h \
|
xcollection.h \
|
||||||
|
xcollection_p.h \
|
||||||
playlistmodel.h \
|
playlistmodel.h \
|
||||||
xmmsqt4.h \
|
xmmsqt4.h \
|
||||||
debug.h
|
debug.h
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#include "playlistmodel.h"
|
#include "playlistmodel.h"
|
||||||
|
#include "xclient.h"
|
||||||
|
#include "xclientcache.h"
|
||||||
|
|
||||||
PlaylistModel::PlaylistModel (QObject *parent, XClient *client, const QString &name) : QAbstractItemModel (parent)
|
PlaylistModel::PlaylistModel (QObject *parent, XClient *client, const QString &name) : QAbstractItemModel (parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
|
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
|
|
||||||
|
class XClient;
|
||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include "xclient.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class PlaylistModel playlistmodel.h
|
* @class PlaylistModel playlistmodel.h
|
||||||
* @brief A model that represents a playlist on the server
|
* @brief A model that represents a playlist on the server
|
||||||
|
|
|
@ -24,7 +24,10 @@
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
#include "xclient.h"
|
#include "xclient.h"
|
||||||
|
#include "xclientcache.h"
|
||||||
|
#include "xplayback.h"
|
||||||
#include "xcollection.h"
|
#include "xcollection.h"
|
||||||
|
#include "xconfig.h"
|
||||||
#include "xmmsqt4.h"
|
#include "xmmsqt4.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
@ -53,6 +56,7 @@ XClient::qToStd (const QString &str)
|
||||||
return std::string (str.toUtf8 ().data ());
|
return std::string (str.toUtf8 ().data ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
QDir
|
QDir
|
||||||
XClient::esperanza_dir ()
|
XClient::esperanza_dir ()
|
||||||
{
|
{
|
||||||
|
@ -68,13 +72,15 @@ XClient::esperanza_dir ()
|
||||||
}
|
}
|
||||||
return QDir ();
|
return QDir ();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
XClient::XClient (QObject *parent, const std::string &name) : QObject (parent), m_sync (name + "-sync")
|
XClient::XClient (QObject *parent, const std::string &name) : QObject (parent), m_sync (name + "-sync")
|
||||||
{
|
{
|
||||||
m_client = NULL;
|
m_client = NULL;
|
||||||
m_isconnected = false;
|
m_isconnected = false;
|
||||||
m_cache = new XClientCache (this, this);
|
m_cache = new XClientCache (this);
|
||||||
m_config = new XConfig (this);
|
m_config = new XConfig (this);
|
||||||
|
m_playback = new XPlayback (this);
|
||||||
m_collection = new XCollection (this);
|
m_collection = new XCollection (this);
|
||||||
m_name = name;
|
m_name = name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,32 +20,16 @@
|
||||||
|
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
|
|
||||||
class XClient;
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QDir>
|
class QWidget;
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include "xclientcache.h"
|
|
||||||
#include "xconfig.h"
|
|
||||||
|
|
||||||
|
class XClientCache;
|
||||||
class XConfig;
|
class XConfig;
|
||||||
|
class XPlayback;
|
||||||
class XCollection;
|
class XCollection;
|
||||||
|
|
||||||
/*
|
|
||||||
class XSettings : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
XSettings (QObject *);
|
|
||||||
void change_settings ();
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void settingsChanged ();
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
class XClient : public QObject {
|
class XClient : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -53,7 +37,8 @@ class XClient : public QObject {
|
||||||
XClient (QObject *, const std::string &);
|
XClient (QObject *, const std::string &);
|
||||||
|
|
||||||
void disconnect ();
|
void disconnect ();
|
||||||
bool connect (const char *path = NULL, const bool &sync = false, QWidget* parent = NULL);
|
bool connect (const char *path = NULL, const bool &sync = false,
|
||||||
|
QWidget* parent = NULL);
|
||||||
static void propDictToQHash (const std::string &key,
|
static void propDictToQHash (const std::string &key,
|
||||||
const Xmms::Dict::Variant &value,
|
const Xmms::Dict::Variant &value,
|
||||||
const std::string &source,
|
const std::string &source,
|
||||||
|
@ -74,6 +59,10 @@ class XClient : public QObject {
|
||||||
return m_config;
|
return m_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
XPlayback *xplayback () const {
|
||||||
|
return m_playback;
|
||||||
|
}
|
||||||
|
|
||||||
XCollection *xcollection () const {
|
XCollection *xcollection () const {
|
||||||
return m_collection;
|
return m_collection;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +78,7 @@ class XClient : public QObject {
|
||||||
return m_isconnected;
|
return m_isconnected;
|
||||||
};
|
};
|
||||||
|
|
||||||
static QDir esperanza_dir ();
|
// static QDir esperanza_dir ();
|
||||||
void setDisconnectCallback (const Xmms::DisconnectCallback::slot_type &slot) { m_client->setDisconnectCallback (slot); }
|
void setDisconnectCallback (const Xmms::DisconnectCallback::slot_type &slot) { m_client->setDisconnectCallback (slot); }
|
||||||
const Xmms::Collection* collection () { if (m_client && m_client->isConnected ()) return &m_client->collection; else return NULL; }
|
const Xmms::Collection* collection () { if (m_client && m_client->isConnected ()) return &m_client->collection; else return NULL; }
|
||||||
const Xmms::Playlist* playlist () { if (m_client && m_client->isConnected ()) return &m_client->playlist; else return NULL; }
|
const Xmms::Playlist* playlist () { if (m_client && m_client->isConnected ()) return &m_client->playlist; else return NULL; }
|
||||||
|
@ -111,6 +100,7 @@ class XClient : public QObject {
|
||||||
// Xmms::Client *m_client;
|
// Xmms::Client *m_client;
|
||||||
XClientCache *m_cache;
|
XClientCache *m_cache;
|
||||||
XConfig *m_config;
|
XConfig *m_config;
|
||||||
|
XPlayback *m_playback;
|
||||||
XCollection *m_collection;
|
XCollection *m_collection;
|
||||||
bool m_isconnected;
|
bool m_isconnected;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "xclientcache.h"
|
#include "xclientcache.h"
|
||||||
|
#include "xclient.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
@ -26,10 +27,11 @@
|
||||||
#include <QPixmapCache>
|
#include <QPixmapCache>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
XClientCache::XClientCache (QObject *parent, XClient *client) : QObject (parent)
|
XClientCache::XClientCache (XClient *client) : QObject (client)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
connect (client, SIGNAL (gotConnection (XClient *)), this, SLOT (got_connection (XClient *)));
|
connect (client, SIGNAL (gotConnection (XClient *)),
|
||||||
|
this, SLOT (got_connection (XClient *)));
|
||||||
QPixmapCache::setCacheLimit (s.value ("core/pixmapcache").toInt ());
|
QPixmapCache::setCacheLimit (s.value ("core/pixmapcache").toInt ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,10 +39,13 @@ void
|
||||||
XClientCache::got_connection (XClient *client)
|
XClientCache::got_connection (XClient *client)
|
||||||
{
|
{
|
||||||
m_client = client;
|
m_client = client;
|
||||||
client->playback ()->signalPlaytime () (Xmms::bind (&XClientCache::handle_playtime, this));
|
client->playback ()->signalPlaytime () (
|
||||||
client->playback ()->getPlaytime () (Xmms::bind (&XClientCache::handle_playtime, this));
|
Xmms::bind (&XClientCache::handle_playtime, this));
|
||||||
|
client->playback ()->getPlaytime () (
|
||||||
|
Xmms::bind (&XClientCache::handle_playtime, this));
|
||||||
|
|
||||||
client->medialib ()->broadcastEntryChanged () (Xmms::bind (&XClientCache::handle_mlib_entry_changed, this));
|
client->medialib ()->broadcastEntryChanged () (
|
||||||
|
Xmms::bind (&XClientCache::handle_mlib_entry_changed, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -143,8 +148,10 @@ QHash<QString, QVariant>
|
||||||
XClientCache::get_info (uint32_t id)
|
XClientCache::get_info (uint32_t id)
|
||||||
{
|
{
|
||||||
if (!m_info.contains (id)) {
|
if (!m_info.contains (id)) {
|
||||||
m_client->medialib ()->getInfo (id) (Xmms::bind (&XClientCache::handle_medialib_info, this),
|
m_client->medialib ()->getInfo (id) (
|
||||||
boost::bind (&XClientCache::handle_medialib_info_error, this, _1, id));
|
Xmms::bind (&XClientCache::handle_medialib_info, this),
|
||||||
|
boost::bind (&XClientCache::handle_medialib_info_error,
|
||||||
|
this, _1, id));
|
||||||
m_info[id] = QHash<QString, QVariant> ();
|
m_info[id] = QHash<QString, QVariant> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,23 +18,31 @@
|
||||||
#ifndef __XCLIENTCACHE_H__
|
#ifndef __XCLIENTCACHE_H__
|
||||||
#define __XCLIENTCACHE_H__
|
#define __XCLIENTCACHE_H__
|
||||||
|
|
||||||
class XClientCache;
|
// for Xmms::bin definition
|
||||||
|
#include "xmmsclient/xmmsclient++/result.h"
|
||||||
|
|
||||||
#include "xclient.h"
|
class XClient;
|
||||||
|
namespace Xmms {
|
||||||
|
class Dict;
|
||||||
|
class PropDict;
|
||||||
|
}
|
||||||
|
// class XClientCache;
|
||||||
|
|
||||||
|
// #include "xclient.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QIcon>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QPixmapCache>
|
class QIcon;
|
||||||
|
class QPixmap;
|
||||||
|
//#include <QPixmapCache>
|
||||||
|
|
||||||
class XClientCache : public QObject
|
class XClientCache : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
XClientCache (QObject *, XClient *);
|
XClientCache (XClient *);
|
||||||
|
|
||||||
QHash<QString, QVariant> get_info (uint32_t id);
|
QHash<QString, QVariant> get_info (uint32_t id);
|
||||||
QIcon get_icon (uint32_t id);
|
QIcon get_icon (uint32_t id);
|
||||||
|
|
|
@ -13,43 +13,28 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
|
|
||||||
#include "xcollection.h"
|
#include "xcollection.h"
|
||||||
|
#include "xcollection_p.h"
|
||||||
|
#include "xclient.h"
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
XCollection::XCollection (XClient * client) : QObject ( client)
|
/*
|
||||||
|
* Private implemention to hide <xmmsclient/xmmsclient++> from collection.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
XCollection::Private::Private (XCollection *collection) : QObject (collection)
|
||||||
{
|
{
|
||||||
m_client = client;
|
|
||||||
|
|
||||||
connect (client, SIGNAL (gotConnection (XClient *)),
|
|
||||||
this, SLOT (on_connect (XClient *)));
|
|
||||||
|
|
||||||
if (client->isConnected ()) {
|
|
||||||
on_connect (client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
XCollection::on_connect (XClient *client)
|
|
||||||
{
|
|
||||||
client->collection ()->broadcastCollectionChanged ()
|
|
||||||
(Xmms::bind (&XCollection::on_collection_modified, this));
|
|
||||||
|
|
||||||
client->collection ()->list ("Playlists")
|
|
||||||
(Xmms::bind (&XCollection::handle_playlists_list, this));
|
|
||||||
|
|
||||||
client->playlist ()->currentActive ()
|
|
||||||
(Xmms::bind (&XCollection::handle_active_pls_changed, this));
|
|
||||||
client->playlist ()->broadcastLoaded ()
|
|
||||||
(Xmms::bind (&XCollection::handle_active_pls_changed, this));
|
|
||||||
|
|
||||||
m_client = client;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
XCollection::on_collection_modified (const Xmms::Dict &value)
|
XCollection::Private::on_collection_modified (const Xmms::Dict &value)
|
||||||
{
|
{
|
||||||
QString newname = QString ();
|
QString newname = QString ();
|
||||||
QHash<QString, QVariant> tmp = XClient::convert_dict (value);
|
QHash<QString, QVariant> tmp = XClient::convert_dict (value);
|
||||||
|
@ -99,6 +84,48 @@ XCollection::on_collection_modified (const Xmms::Dict &value)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The XCollection class
|
||||||
|
*/
|
||||||
|
XCollection::XCollection (XClient * client) : QObject ( client)
|
||||||
|
{
|
||||||
|
m_client = client;
|
||||||
|
d = new XCollection::Private (this);
|
||||||
|
|
||||||
|
connect (client, SIGNAL (gotConnection (XClient *)),
|
||||||
|
this, SLOT (on_connect (XClient *)));
|
||||||
|
|
||||||
|
// emit signals from private implementation as our own
|
||||||
|
connect (d, SIGNAL (collectionModified(QString, QString, int, QString)),
|
||||||
|
this, SIGNAL (collectionModified(QString, QString, int, QString)));
|
||||||
|
connect (d, SIGNAL (activePlaylistChanged (QString, QString)),
|
||||||
|
this, SIGNAL (activePlaylistChanged (QString, QString)));
|
||||||
|
|
||||||
|
|
||||||
|
if (client->isConnected ()) {
|
||||||
|
on_connect (client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XCollection::on_connect (XClient *client)
|
||||||
|
{
|
||||||
|
client->collection ()->broadcastCollectionChanged ()
|
||||||
|
(Xmms::bind (&XCollection::Private::on_collection_modified, d));
|
||||||
|
|
||||||
|
client->collection ()->list ("Playlists")
|
||||||
|
(Xmms::bind (&XCollection::Private::handle_playlists_list, d));
|
||||||
|
|
||||||
|
client->playlist ()->currentActive ()
|
||||||
|
(Xmms::bind (&XCollection::Private::handle_active_pls_changed, d));
|
||||||
|
client->playlist ()->broadcastLoaded ()
|
||||||
|
(Xmms::bind (&XCollection::Private::handle_active_pls_changed, d));
|
||||||
|
|
||||||
|
m_client = client;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
XCollection::remove (QString name, QString ns) {
|
XCollection::remove (QString name, QString ns) {
|
||||||
if (!m_client->isConnected ()) return false;
|
if (!m_client->isConnected ()) return false;
|
||||||
|
@ -111,9 +138,15 @@ XCollection::remove (QString name, QString ns) {
|
||||||
/*
|
/*
|
||||||
* idList (Playlist) stuff
|
* idList (Playlist) stuff
|
||||||
*/
|
*/
|
||||||
|
QString
|
||||||
|
XCollection::activePlaylist ()
|
||||||
|
{
|
||||||
|
return d->m_activePlaylist;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
XCollection::handle_playlists_list (const Xmms::List< std::string > &list)
|
XCollection::Private::handle_playlists_list (const Xmms::List< std::string > &list)
|
||||||
{
|
{
|
||||||
m_playlists.clear ();
|
m_playlists.clear ();
|
||||||
|
|
||||||
|
@ -130,7 +163,7 @@ QStringList
|
||||||
XCollection::list (QString ns) {
|
XCollection::list (QString ns) {
|
||||||
// FIXME: use the ns parameter.
|
// FIXME: use the ns parameter.
|
||||||
// We will need to handle querying the serverside playlists bettter...
|
// We will need to handle querying the serverside playlists bettter...
|
||||||
return m_playlists;
|
return d->m_playlists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,7 +178,7 @@ XCollection::setActivePlaylist (QString name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
XCollection::handle_active_pls_changed (const std::string &name) {
|
XCollection::Private::handle_active_pls_changed (const std::string &name) {
|
||||||
QString tmp = m_activePlaylist;
|
QString tmp = m_activePlaylist;
|
||||||
m_activePlaylist = XClient::stdToQ (name);
|
m_activePlaylist = XClient::stdToQ (name);
|
||||||
|
|
||||||
|
@ -173,7 +206,7 @@ XCollection::playlistAddUrl (QUrl url, QString plsname)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plsname == "") {
|
if (plsname == "") {
|
||||||
plsname = m_activePlaylist;
|
plsname = d->m_activePlaylist;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_client->playlist ()->addUrl (url.toString ().toStdString (),
|
m_client->playlist ()->addUrl (url.toString ().toStdString (),
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __XCollection_H__
|
#ifndef __XCOLLECTION_H__
|
||||||
#define __XCollection_H__
|
#define __XCOLLECTION_H__
|
||||||
|
|
||||||
#include "xclient.h"
|
class XClient;
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
class QString;
|
|
||||||
class QStringList;
|
class QStringList;
|
||||||
|
class QString;
|
||||||
class QUrl;
|
class QUrl;
|
||||||
|
|
||||||
class XCollection : public QObject
|
class XCollection : public QObject
|
||||||
|
@ -32,9 +32,10 @@ class XCollection : public QObject
|
||||||
QStringList list (QString ns = "Playlists");
|
QStringList list (QString ns = "Playlists");
|
||||||
|
|
||||||
bool remove (QString name, QString ns);
|
bool remove (QString name, QString ns);
|
||||||
|
|
||||||
// idlist specific
|
// idlist specific
|
||||||
bool setActivePlaylist (QString name);
|
bool setActivePlaylist (QString name);
|
||||||
QString activePlaylist () {return m_activePlaylist;}
|
QString activePlaylist ();
|
||||||
bool addIdlist (QString name);
|
bool addIdlist (QString name);
|
||||||
bool playlistAddUrl (QUrl url, QString plsname = "");
|
bool playlistAddUrl (QUrl url, QString plsname = "");
|
||||||
|
|
||||||
|
@ -48,14 +49,10 @@ class XCollection : public QObject
|
||||||
void on_connect (XClient *);
|
void on_connect (XClient *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_collection_modified (const Xmms::Dict &value);
|
class Private;
|
||||||
bool handle_playlists_list (const Xmms::List< std::string > &list);
|
Private* d;
|
||||||
bool handle_active_pls_changed (const std::string &name);
|
|
||||||
|
|
||||||
XClient *m_client;
|
XClient *m_client;
|
||||||
QStringList m_playlists;
|
|
||||||
|
|
||||||
QString m_activePlaylist;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
51
lib/xcollection_p.h
Normal file
51
lib/xcollection_p.h
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/**
|
||||||
|
* This file is a part of Promoe
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Thomas Frauendorfer
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// these headers are placed in here, so that the moc files are created and
|
||||||
|
// that these Objects can emit signals
|
||||||
|
|
||||||
|
#ifndef __XCOLLECTION_P_H__
|
||||||
|
#define __XCOLLECTION_P_H__
|
||||||
|
|
||||||
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
|
|
||||||
|
#include "xcollection.h"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class XCollection::Private : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
Private (XCollection *collection);
|
||||||
|
|
||||||
|
bool on_collection_modified (const Xmms::Dict &value);
|
||||||
|
bool handle_playlists_list (const Xmms::List< std::string > &list);
|
||||||
|
bool handle_active_pls_changed (const std::string &name);
|
||||||
|
|
||||||
|
QStringList m_playlists;
|
||||||
|
QString m_activePlaylist;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void collectionModified (QString collection, QString ns, int type,
|
||||||
|
QString newname);
|
||||||
|
|
||||||
|
void activePlaylistChanged (QString newActive, QString oldActive);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -17,8 +17,10 @@
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
|
|
||||||
#include "xconfig.h"
|
#include "xconfig.h"
|
||||||
|
#include "xclient.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
XConfig::XConfig (XClient *parent) : QObject (parent)
|
XConfig::XConfig (XClient *parent) : QObject (parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,10 +14,13 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __XConfig__
|
#ifndef __XConfig_H__
|
||||||
#define __XConfig__
|
#define __XConfig_H__
|
||||||
|
|
||||||
#include "xclient.h"
|
class XClient;
|
||||||
|
namespace Xmms {
|
||||||
|
class Dict;
|
||||||
|
}
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
88
lib/xplayback.cpp
Normal file
88
lib/xplayback.cpp
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
/**
|
||||||
|
* This file is a part of Promoe, an XMMS2 Client.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Thomas Frauendorfer
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
|
|
||||||
|
#include "xplayback.h"
|
||||||
|
#include "xclient.h"
|
||||||
|
|
||||||
|
#include <xmmsclient/xmmsclient++/playback.h>
|
||||||
|
#include <xmmsclient/xmmsclient++/playlist.h>
|
||||||
|
|
||||||
|
XPlayback::XPlayback (XClient *client)
|
||||||
|
{
|
||||||
|
m_client = client;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::play ()
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playback ()->start ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::pause ()
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playback ()->pause ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::stop ()
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playback ()->stop ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::prev ()
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playlist ()->setNextRel (-1);
|
||||||
|
m_client->playback ()->tickle ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::next ()
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playlist ()->setNextRel (1);
|
||||||
|
m_client->playback ()->tickle ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::seekMs (uint milliseconds)
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playback ()->seekMs (milliseconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XPlayback::seekMsRel (int milliseconds)
|
||||||
|
{
|
||||||
|
if (!m_client->isConnected ()) return;
|
||||||
|
|
||||||
|
m_client->playback ()->seekMsRel (milliseconds);
|
||||||
|
}
|
||||||
|
|
49
lib/xplayback.h
Normal file
49
lib/xplayback.h
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/**
|
||||||
|
* This file is a part of Promoe, an XMMS2 Client.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Thomas Frauendorfer
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __XPLAYBACK_H__
|
||||||
|
#define __XPLAYBACK_H__
|
||||||
|
|
||||||
|
class XClient;
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class XPlayback
|
||||||
|
* @brief Thin wrapper around Xmms::Playback providing QT Signals and Slots
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class XPlayback : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
XPlayback (XClient *);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void play ();
|
||||||
|
void pause ();
|
||||||
|
void stop ();
|
||||||
|
void prev ();
|
||||||
|
void next ();
|
||||||
|
|
||||||
|
void seekMs (uint milliseconds);
|
||||||
|
void seekMsRel (int milliseconds);
|
||||||
|
|
||||||
|
private:
|
||||||
|
XClient *m_client;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -16,17 +16,15 @@
|
||||||
#ifndef __BROWSEDIALOG_H__
|
#ifndef __BROWSEDIALOG_H__
|
||||||
#define __BROWSEDIALOG_H__
|
#define __BROWSEDIALOG_H__
|
||||||
|
|
||||||
#include "BrowseModel.h"
|
class BrowseModel;
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QTreeView>
|
class QTreeView;
|
||||||
#include <QListView>
|
class QComboBox;
|
||||||
#include <QGridLayout>
|
class QLineEdit;
|
||||||
#include <QPushButton>
|
class QItemSelectionModel;
|
||||||
#include <QLabel>
|
class QModelIndex;
|
||||||
#include <QComboBox>
|
class QString;
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QItemSelectionModel>
|
|
||||||
|
|
||||||
class BrowseDialog : public QDialog
|
class BrowseDialog : public QDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QStyle>
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BrowseModelItem::itemCompare (BrowseModelItem *s1, BrowseModelItem *s2)
|
BrowseModelItem::itemCompare (BrowseModelItem *s1, BrowseModelItem *s2)
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStyle>
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
class QStyle;
|
||||||
|
|
||||||
class BrowseModelItem
|
class BrowseModelItem
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,11 +17,14 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
|
||||||
#include "TitleBar.h"
|
#include "TitleBar.h"
|
||||||
|
|
||||||
#include "FileDialog.h"
|
#include "FileDialog.h"
|
||||||
|
|
||||||
|
#include <QMouseEvent>
|
||||||
|
|
||||||
SkinDisplay::SkinDisplay (QWidget *parent) : QWidget(parent)
|
SkinDisplay::SkinDisplay (QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
Skin *skin = Skin::getInstance ();
|
Skin *skin = Skin::getInstance ();
|
||||||
|
|
|
@ -16,16 +16,12 @@
|
||||||
#ifndef __SKINDISPLAY_H__
|
#ifndef __SKINDISPLAY_H__
|
||||||
#define __SKINDISPLAY_H__
|
#define __SKINDISPLAY_H__
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QHash>
|
class QEvent;
|
||||||
#include <QMouseEvent>
|
class QMouseEvent;
|
||||||
#include <QPaintEvent>
|
class QPaintEvent;
|
||||||
|
|
||||||
#include "Skin.h"
|
class Skin;
|
||||||
|
|
||||||
class SkinDisplay : public QWidget
|
class SkinDisplay : public QWidget
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
#include "Skin.h"
|
#include "Skin.h"
|
||||||
#include "PixWidget.h"
|
#include "PixWidget.h"
|
||||||
|
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPixmap>
|
||||||
|
|
||||||
PixWidget::PixWidget (QWidget *parent) : QWidget (parent)
|
PixWidget::PixWidget (QWidget *parent) : QWidget (parent)
|
||||||
{
|
{
|
||||||
Skin *skin = Skin::getInstance();
|
Skin *skin = Skin::getInstance();
|
||||||
|
|
|
@ -16,11 +16,8 @@
|
||||||
#ifndef __PIXWIDGET_H__
|
#ifndef __PIXWIDGET_H__
|
||||||
#define __PIXWIDGET_H__
|
#define __PIXWIDGET_H__
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
class QPixmap;
|
||||||
|
|
||||||
class Skin;
|
class Skin;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "XMMSHandler.h"
|
#include "XMMSHandler.h"
|
||||||
|
#include "xplayback.h"
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
@ -173,7 +174,7 @@ PosBar::setPos (uint p)
|
||||||
void
|
void
|
||||||
PosBar::requestPos (float value)
|
PosBar::requestPos (float value)
|
||||||
{
|
{
|
||||||
XMMSHandler::getInstance ().setPlaytime (m_max * value);
|
XMMSHandler::getInstance ().xplayback ()->seekMs (m_max * value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -48,7 +48,7 @@ TextScroller::TextScroller (QWidget *parent, uint w,
|
||||||
m_x2_off = 0;
|
m_x2_off = 0;
|
||||||
m_fontsize = s.value ("fontsize").toInt ();
|
m_fontsize = s.value ("fontsize").toInt ();
|
||||||
m_ttf = s.value ("ttf").toBool ();
|
m_ttf = s.value ("ttf").toBool ();
|
||||||
m_text = "Promoe 0.1";
|
m_text = "Promoe " PROMOE_VERSION;
|
||||||
m_scroll = s.value ("scroll").toBool ();
|
m_scroll = s.value ("scroll").toBool ();
|
||||||
|
|
||||||
s.endGroup ();
|
s.endGroup ();
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "maindisplay.h"
|
#include "maindisplay.h"
|
||||||
#include "TimeDisplay.h"
|
#include "TimeDisplay.h"
|
||||||
#include "NumberDisplay.h"
|
#include "NumberDisplay.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
#include "BrowseDialog.h"
|
#include "BrowseDialog.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ class TitleBar;
|
||||||
#include "PixWidget.h"
|
#include "PixWidget.h"
|
||||||
|
|
||||||
class Button;
|
class Button;
|
||||||
|
class Skin;
|
||||||
|
|
||||||
class TitleBar : public PixWidget
|
class TitleBar : public PixWidget
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Button;
|
||||||
|
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
#include "PixWidget.h"
|
#include "PixWidget.h"
|
||||||
#include "Skin.h"
|
class Skin;
|
||||||
|
|
||||||
class SliderButton : public Button
|
class SliderButton : public Button
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
|
|
||||||
#include <QErrorMessage>
|
#include <QErrorMessage>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QFile>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
XMMSHandler &XMMSHandler::getInstance ()
|
XMMSHandler &XMMSHandler::getInstance ()
|
||||||
{
|
{
|
||||||
|
@ -64,15 +61,22 @@ XMMSHandler::connect_handler (const char *ipcpath, const bool &sync, QWidget *pa
|
||||||
connect(ipcpath, sync, parent);
|
connect(ipcpath, sync, parent);
|
||||||
|
|
||||||
using Xmms::bind;
|
using Xmms::bind;
|
||||||
m_client->medialib.broadcastEntryChanged () (bind (&XMMSHandler::medialib_entry_changed, this));
|
m_client->medialib.broadcastEntryChanged () (
|
||||||
|
bind (&XMMSHandler::medialib_entry_changed, this));
|
||||||
|
|
||||||
m_client->playback.currentID () (bind (&XMMSHandler::playback_current_id, this));
|
m_client->playback.currentID () (
|
||||||
m_client->playback.broadcastCurrentID () (bind (&XMMSHandler::playback_current_id, this));
|
bind (&XMMSHandler::playback_current_id, this));
|
||||||
|
m_client->playback.broadcastCurrentID () (
|
||||||
|
bind (&XMMSHandler::playback_current_id, this));
|
||||||
|
|
||||||
m_client->playback.getStatus () (bind (&XMMSHandler::playback_status, this));
|
|
||||||
m_client->playback.broadcastStatus () (bind (&XMMSHandler::playback_status, this));
|
|
||||||
|
|
||||||
m_client->playback.broadcastVolumeChanged () (bind (&XMMSHandler::volume_changed, this));
|
m_client->playback.getStatus () (
|
||||||
|
bind (&XMMSHandler::playback_status, this));
|
||||||
|
m_client->playback.broadcastStatus () (
|
||||||
|
bind (&XMMSHandler::playback_status, this));
|
||||||
|
|
||||||
|
m_client->playback.broadcastVolumeChanged () (
|
||||||
|
bind (&XMMSHandler::volume_changed, this));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -98,30 +102,14 @@ XMMSHandler::playlistAddURL (const QString &s)
|
||||||
{
|
{
|
||||||
m_client->playlist.addUrl (s.toAscii ().constData ()) ();
|
m_client->playlist.addUrl (s.toAscii ().constData ()) ();
|
||||||
}
|
}
|
||||||
void
|
|
||||||
XMMSHandler::playlistRemove (uint pos)
|
|
||||||
{
|
|
||||||
m_client->playlist.removeEntry (pos) ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
XMMSHandler::playlistMove (uint pos, uint newpos)
|
|
||||||
{
|
|
||||||
m_client->playlist.moveEntry (pos, newpos) ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XMMSHandler::requestMediainfo (uint id)
|
XMMSHandler::requestMediainfo (uint id)
|
||||||
{
|
{
|
||||||
m_client->medialib.getInfo (id) (Xmms::bind (&XMMSHandler::medialib_info, this));
|
m_client->medialib.getInfo (id) (
|
||||||
|
Xmms::bind (&XMMSHandler::medialib_info, this));
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
void
|
|
||||||
XMMSHandler::requestPlaylistList ()
|
|
||||||
{
|
|
||||||
// m_client->playlist.listEntries () (Xmms::bind (&XMMSHandler::playlist_list, this));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
XMMSHandler::requestTrackChange (int pos)
|
XMMSHandler::requestTrackChange (int pos)
|
||||||
{
|
{
|
||||||
|
@ -129,13 +117,6 @@ XMMSHandler::requestTrackChange (int pos)
|
||||||
m_client->playback.tickle () ();
|
m_client->playback.tickle () ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
XMMSHandler::playlist_list (const Xmms::List< unsigned int > &playlist)
|
|
||||||
{
|
|
||||||
emit playlistList (playlist);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
XMMSHandler::playback_status (const Xmms::Playback::Status &status)
|
XMMSHandler::playback_status (const Xmms::Playback::Status &status)
|
||||||
{
|
{
|
||||||
|
@ -152,15 +133,9 @@ XMMSHandler::playback_current_id (const unsigned int &id)
|
||||||
requestMediainfo (id);
|
requestMediainfo (id);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit currentID(id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
XMMSHandler::setPlaytime (uint pos)
|
|
||||||
{
|
|
||||||
m_client->playback.seekMs (pos) ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XMMSHandler::DictToQHash (const std::string &key,
|
XMMSHandler::DictToQHash (const std::string &key,
|
||||||
|
@ -221,13 +196,6 @@ XMMSHandler::medialib_select (XMMSResultDictList *res)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool
|
|
||||||
XMMSHandler::playlist_changed (const Xmms::Dict &list)
|
|
||||||
{
|
|
||||||
emit playlistChanged (list);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
XMMSHandler::medialib_info (const Xmms::PropDict &propdict)
|
XMMSHandler::medialib_info (const Xmms::PropDict &propdict)
|
||||||
{
|
{
|
||||||
|
@ -310,31 +278,3 @@ void XMMSHandler::playlistClear ()
|
||||||
{
|
{
|
||||||
m_client->playlist.clear () ();
|
m_client->playlist.clear () ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMMSHandler::play ()
|
|
||||||
{
|
|
||||||
m_client->playback.start () ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMMSHandler::stop ()
|
|
||||||
{
|
|
||||||
m_client->playback.stop () ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMMSHandler::pause ()
|
|
||||||
{
|
|
||||||
m_client->playback.pause () ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMMSHandler::next ()
|
|
||||||
{
|
|
||||||
m_client->playlist.setNextRel (1) ();
|
|
||||||
m_client->playback.tickle () ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMMSHandler::prev ()
|
|
||||||
{
|
|
||||||
m_client->playlist.setNextRel (-1) ();
|
|
||||||
m_client->playback.tickle () ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
class PlaylistModel;
|
class PlaylistModel;
|
||||||
|
|
||||||
|
@ -37,20 +36,15 @@ class XMMSHandler : public XClient {
|
||||||
|
|
||||||
bool connect_handler (const char *ipcpath = NULL, const bool &sync = false, QWidget *parent = NULL);
|
bool connect_handler (const char *ipcpath = NULL, const bool &sync = false, QWidget *parent = NULL);
|
||||||
|
|
||||||
bool playlist_list (const Xmms::List< unsigned int > &playlist);
|
|
||||||
bool playback_current_id (const unsigned int &id);
|
bool playback_current_id (const unsigned int &id);
|
||||||
bool medialib_info (const Xmms::PropDict &propdict);
|
bool medialib_info (const Xmms::PropDict &propdict);
|
||||||
bool medialib_entry_changed (const unsigned int &id);
|
bool medialib_entry_changed (const unsigned int &id);
|
||||||
bool playback_status (const Xmms::Playback::Status &status);
|
bool playback_status (const Xmms::Playback::Status &status);
|
||||||
bool volume_changed (const Xmms::Dict &levels);
|
bool volume_changed (const Xmms::Dict &levels);
|
||||||
bool playlist_changed (const Xmms::Dict &list);
|
|
||||||
|
|
||||||
void requestMediainfo (uint id);
|
void requestMediainfo (uint id);
|
||||||
// void requestPlaylistList ();
|
|
||||||
void requestTrackChange (int pos);
|
void requestTrackChange (int pos);
|
||||||
void playlistAddURL (const QString& url);
|
void playlistAddURL (const QString& url);
|
||||||
void playlistRemove (uint pos);
|
|
||||||
void playlistMove (uint pos, uint newpos);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void medialib_select (XMMSResultDictList *res);
|
void medialib_select (XMMSResultDictList *res);
|
||||||
|
@ -73,24 +67,14 @@ class XMMSHandler : public XClient {
|
||||||
PlaylistModel *getPlaylistModel () {return m_playlist_model; }
|
PlaylistModel *getPlaylistModel () {return m_playlist_model; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setPlaytime (uint pos);
|
|
||||||
|
|
||||||
void playlistClear ();
|
void playlistClear ();
|
||||||
void play ();
|
|
||||||
void stop ();
|
|
||||||
void pause ();
|
|
||||||
void next ();
|
|
||||||
void prev ();
|
|
||||||
void volumeSet (uint volume);
|
void volumeSet (uint volume);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsSaved ();
|
void settingsSaved ();
|
||||||
void playbackStatusChanged (Xmms::Playback::Status status);
|
void playbackStatusChanged (Xmms::Playback::Status status);
|
||||||
void playtimeChanged (uint time);
|
|
||||||
void mediainfoChanged (uint, const Xmms::PropDict &);
|
void mediainfoChanged (uint, const Xmms::PropDict &);
|
||||||
void currentSong (const Xmms::PropDict &);
|
void currentSong (const Xmms::PropDict &);
|
||||||
void playlistList (const Xmms::List< unsigned int > &);
|
|
||||||
void currentID (uint);
|
|
||||||
void playlistChanged (const Xmms::Dict &);
|
void playlistChanged (const Xmms::Dict &);
|
||||||
/*
|
/*
|
||||||
void medialibResponse (uint, const QList<QHash<QString, QString> > &);
|
void medialibResponse (uint, const QList<QHash<QString, QString> > &);
|
||||||
|
@ -98,8 +82,6 @@ class XMMSHandler : public XClient {
|
||||||
void getVolume (uint);
|
void getVolume (uint);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTimer m_playtime_timer;
|
|
||||||
|
|
||||||
void DictToQHash (const std::string &key,
|
void DictToQHash (const std::string &key,
|
||||||
const Xmms::Dict::Variant &value,
|
const Xmms::Dict::Variant &value,
|
||||||
QHash<QString, QString> &hash);
|
QHash<QString, QString> &hash);
|
||||||
|
|
|
@ -14,10 +14,6 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// FIXME: because somewhere something with the includes is wrons, this line
|
|
||||||
// is needed
|
|
||||||
#include "XMMSHandler.h"
|
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "urlopen.h"
|
#include "urlopen.h"
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
|
#include "Skin.h"
|
||||||
#include "VolumeSlider.h"
|
#include "VolumeSlider.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
#include "XMMSHandler.h"
|
#include "XMMSHandler.h"
|
||||||
|
#include "xclientcache.h"
|
||||||
|
#include "xplayback.h"
|
||||||
|
|
||||||
#include "maindisplay.h"
|
#include "maindisplay.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
@ -259,28 +262,28 @@ MainDisplay::toggleTime (void)
|
||||||
void
|
void
|
||||||
MainDisplay::SetupPushButtons (void)
|
MainDisplay::SetupPushButtons (void)
|
||||||
{
|
{
|
||||||
XMMSHandler &xmmsh = XMMSHandler::getInstance ();
|
XMMSHandler &client = XMMSHandler::getInstance ();
|
||||||
|
|
||||||
/* Normal buttons */
|
/* Normal buttons */
|
||||||
m_prev = new Button (this, Skin::BTN_PREV_0, Skin::BTN_PREV_1);
|
m_prev = new Button (this, Skin::BTN_PREV_0, Skin::BTN_PREV_1);
|
||||||
m_prev->move(16, 88);
|
m_prev->move(16, 88);
|
||||||
connect (m_prev, SIGNAL(clicked()), &xmmsh, SLOT(prev()));
|
connect (m_prev, SIGNAL(clicked()), client.xplayback (), SLOT(prev ()));
|
||||||
|
|
||||||
m_play = new Button (this, Skin::BTN_PLAY_0, Skin::BTN_PLAY_1);
|
m_play = new Button (this, Skin::BTN_PLAY_0, Skin::BTN_PLAY_1);
|
||||||
m_play->move(39, 88);
|
m_play->move(39, 88);
|
||||||
connect (m_play, SIGNAL(clicked()), &xmmsh, SLOT(play()));
|
connect (m_play, SIGNAL(clicked()), client.xplayback (), SLOT(play ()));
|
||||||
|
|
||||||
m_pause = new Button (this, Skin::BTN_PAUSE_0, Skin::BTN_PAUSE_1);
|
m_pause = new Button (this, Skin::BTN_PAUSE_0, Skin::BTN_PAUSE_1);
|
||||||
m_pause->move(62, 88);
|
m_pause->move(62, 88);
|
||||||
connect (m_pause, SIGNAL(clicked()), &xmmsh, SLOT(pause()));
|
connect (m_pause, SIGNAL(clicked()), client.xplayback (), SLOT(pause ()));
|
||||||
|
|
||||||
m_stop = new Button (this, Skin::BTN_STOP_0, Skin::BTN_STOP_1);
|
m_stop = new Button (this, Skin::BTN_STOP_0, Skin::BTN_STOP_1);
|
||||||
m_stop->move(85, 88);
|
m_stop->move(85, 88);
|
||||||
connect (m_stop, SIGNAL(clicked()), &xmmsh, SLOT(stop()));
|
connect (m_stop, SIGNAL(clicked()), client.xplayback (), SLOT(stop ()));
|
||||||
|
|
||||||
m_next = new Button (this, Skin::BTN_NEXT_0, Skin::BTN_NEXT_1);
|
m_next = new Button (this, Skin::BTN_NEXT_0, Skin::BTN_NEXT_1);
|
||||||
m_next->move(108, 88);
|
m_next->move(108, 88);
|
||||||
connect (m_next, SIGNAL(clicked()), &xmmsh, SLOT(next()));
|
connect (m_next, SIGNAL(clicked()), client.xplayback (), SLOT(next ()));
|
||||||
|
|
||||||
m_eject = new Button (this, Skin::BTN_EJECT_0, Skin::BTN_EJECT_1);
|
m_eject = new Button (this, Skin::BTN_EJECT_0, Skin::BTN_EJECT_1);
|
||||||
m_eject->move(136, 89);
|
m_eject->move(136, 89);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "shadeddisplay.h"
|
#include "shadeddisplay.h"
|
||||||
#include "equalizerwindow.h"
|
#include "equalizerwindow.h"
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
#include "XMMSHandler.h"
|
#include "XMMSHandler.h"
|
||||||
|
#include "xclientcache.h"
|
||||||
|
#include "xplayback.h"
|
||||||
|
|
||||||
#include "shadeddisplay.h"
|
#include "shadeddisplay.h"
|
||||||
#include "TitleBar.h"
|
#include "TitleBar.h"
|
||||||
|
@ -25,7 +27,7 @@
|
||||||
|
|
||||||
ShadedDisplay::ShadedDisplay (QWidget *parent) : SkinDisplay (parent)
|
ShadedDisplay::ShadedDisplay (QWidget *parent) : SkinDisplay (parent)
|
||||||
{
|
{
|
||||||
XMMSHandler &xmmsh = XMMSHandler::getInstance ();
|
XMMSHandler &client = XMMSHandler::getInstance ();
|
||||||
|
|
||||||
setMinimumSize (275, 14);
|
setMinimumSize (275, 14);
|
||||||
setMaximumSize (275, 14);
|
setMaximumSize (275, 14);
|
||||||
|
@ -47,38 +49,38 @@ ShadedDisplay::ShadedDisplay (QWidget *parent) : SkinDisplay (parent)
|
||||||
m_prev = new Button (this);
|
m_prev = new Button (this);
|
||||||
m_prev->move(169, 4);
|
m_prev->move(169, 4);
|
||||||
m_prev->resize (8, 7);
|
m_prev->resize (8, 7);
|
||||||
connect (m_prev, SIGNAL(clicked()), &xmmsh, SLOT(prev()));
|
connect (m_prev, SIGNAL(clicked()), client.xplayback (), SLOT(prev ()));
|
||||||
|
|
||||||
m_play = new Button (this);
|
m_play = new Button (this);
|
||||||
m_play->move(177, 4);
|
m_play->move(177, 4);
|
||||||
m_play->resize (10, 7);
|
m_play->resize (10, 7);
|
||||||
connect (m_play, SIGNAL(clicked()), &xmmsh, SLOT(play()));
|
connect (m_play, SIGNAL(clicked()), client.xplayback (), SLOT(play ()));
|
||||||
|
|
||||||
m_pause = new Button (this);
|
m_pause = new Button (this);
|
||||||
m_pause->move(187, 4);
|
m_pause->move(187, 4);
|
||||||
m_pause->resize (10, 7);
|
m_pause->resize (10, 7);
|
||||||
connect (m_pause, SIGNAL(clicked()), &xmmsh, SLOT(pause()));
|
connect (m_pause, SIGNAL(clicked()), client.xplayback (), SLOT(pause ()));
|
||||||
|
|
||||||
m_stop = new Button (this);
|
m_stop = new Button (this);
|
||||||
m_stop->move(197, 4);
|
m_stop->move(197, 4);
|
||||||
m_stop->resize (9, 7);
|
m_stop->resize (9, 7);
|
||||||
connect (m_stop, SIGNAL(clicked()), &xmmsh, SLOT(stop()));
|
connect (m_stop, SIGNAL(clicked()), client.xplayback (), SLOT(stop ()));
|
||||||
|
|
||||||
m_next = new Button (this);
|
m_next = new Button (this);
|
||||||
m_next->move(206, 4);
|
m_next->move(206, 4);
|
||||||
m_next->resize (8, 7);
|
m_next->resize (8, 7);
|
||||||
connect (m_next, SIGNAL(clicked()), &xmmsh, SLOT(next()));
|
connect (m_next, SIGNAL(clicked()), client.xplayback (), SLOT(next ()));
|
||||||
|
|
||||||
m_eject = new Button (this);
|
m_eject = new Button (this);
|
||||||
m_eject->move(216, 4);
|
m_eject->move(216, 4);
|
||||||
m_eject->resize (9, 7);
|
m_eject->resize (9, 7);
|
||||||
connect (m_eject, SIGNAL(clicked()), this, SLOT(fileOpen()));
|
connect (m_eject, SIGNAL(clicked()), this, SLOT(fileOpen()));
|
||||||
|
|
||||||
connect (&xmmsh, SIGNAL(playbackStatusChanged(Xmms::Playback::Status)),
|
connect (&client, SIGNAL(playbackStatusChanged(Xmms::Playback::Status)),
|
||||||
this, SLOT(setStatus(Xmms::Playback::Status)));
|
this, SLOT(setStatus(Xmms::Playback::Status)));
|
||||||
connect (xmmsh.cache (), SIGNAL (playtime (uint32_t)),
|
connect (client.cache (), SIGNAL (playtime (uint32_t)),
|
||||||
this, SLOT ( setPlaytime(uint32_t)));
|
this, SLOT ( setPlaytime(uint32_t)));
|
||||||
connect (&xmmsh, SIGNAL(currentSong (const Xmms::PropDict &)),
|
connect (&client, SIGNAL(currentSong (const Xmms::PropDict &)),
|
||||||
this, SLOT(setMediainfo (const Xmms::PropDict &)));
|
this, SLOT(setMediainfo (const Xmms::PropDict &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "playlistmenu.h"
|
#include "playlistmenu.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
|
@ -19,16 +19,13 @@
|
||||||
class PlaylistMenu;
|
class PlaylistMenu;
|
||||||
|
|
||||||
#include "XMMSHandler.h"
|
#include "XMMSHandler.h"
|
||||||
#include "Skin.h"
|
|
||||||
#include "PixWidget.h"
|
#include "PixWidget.h"
|
||||||
|
#include "Skin.h"
|
||||||
/*
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QPixmap>
|
|
||||||
*/
|
|
||||||
|
|
||||||
class PlaylistMenu;
|
class PlaylistMenu;
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
class QWidget;
|
||||||
|
|
||||||
class PlaylistMenuBar : public PixWidget {
|
class PlaylistMenuBar : public PixWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -40,7 +40,7 @@ PlaylistShade::PlaylistShade (QWidget *parent) : QWidget (parent)
|
||||||
connect (&xmmsh, SIGNAL(settingsSaved ()),
|
connect (&xmmsh, SIGNAL(settingsSaved ()),
|
||||||
this, SLOT(settingsSaved ()));
|
this, SLOT(settingsSaved ()));
|
||||||
|
|
||||||
m_text = "Promoe 0.1 - A very neat XMMS2 client";
|
m_text = "Promoe " PROMOE_VERSION " - A very neat XMMS2 client";
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -17,10 +17,12 @@
|
||||||
// FIXME should not need those two
|
// FIXME should not need those two
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
#include "XMMSHandler.h"
|
#include "XMMSHandler.h"
|
||||||
|
#include "xplayback.h"
|
||||||
|
|
||||||
#include "playlistview.h"
|
#include "playlistview.h"
|
||||||
#include "playlistmodel.h"
|
#include "playlistmodel.h"
|
||||||
#include "playlistwidget.h"
|
#include "playlistwidget.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
@ -272,6 +274,6 @@ PlaylistView::mouseDoubleClickEvent (QMouseEvent *event)
|
||||||
xmmsh.requestTrackChange (index.row());
|
xmmsh.requestTrackChange (index.row());
|
||||||
if (m_status == XMMS_PLAYBACK_STATUS_STOP ||
|
if (m_status == XMMS_PLAYBACK_STATUS_STOP ||
|
||||||
m_status == XMMS_PLAYBACK_STATUS_PAUSE) {
|
m_status == XMMS_PLAYBACK_STATUS_PAUSE) {
|
||||||
xmmsh.play ();
|
xmmsh.xplayback ()->play ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,12 @@
|
||||||
|
|
||||||
//include "Playlist.h"
|
//include "Playlist.h"
|
||||||
#include <xmmsclient/xmmsclient++.h>
|
#include <xmmsclient/xmmsclient++.h>
|
||||||
#include "Skin.h"
|
class Skin;
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QAbstractItemDelegate>
|
#include <QAbstractItemDelegate>
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QWidget>
|
class QWidget;
|
||||||
|
|
||||||
class PlaylistDelegate : public QAbstractItemDelegate {
|
class PlaylistDelegate : public QAbstractItemDelegate {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue