2 // C++ Interface: medialib
4 // Author: Oliver Groß <z.o.gross@gmx.de>, (C) 2008
6 // Copyright: See COPYING file that comes with this distribution
8 #ifndef XMMSQT_MEDIALIB_H
9 #define XMMSQT_MEDIALIB_H
13 #include <xmmsclient/xmmsclient.h>
33 typedef QHash
<quint32
, MediaInfo
*> QMediaInfoHash
;
34 typedef QHash
<QString
, QPlaylist
*> QPlaylistHash
;
36 class QMedialib
: public QObject
{
39 xmmsc_connection_t
* m_Connection
;
40 QMediaInfoHash m_CachedMedia
;
41 QPlaylistHash m_Playlists
;
42 QPlaylist
* m_ActivePlaylist
;
44 static void recievedMediaInfoCallback(xmmsc_result_t
* result
, void * instance
);
45 static void updatedMediaInfoCallback(xmmsc_result_t
* result
, void * instance
);
47 static void playlistChangedCallback(xmmsc_result_t
* result
, void * instance
);
48 static void activePlaylistCallback(xmmsc_result_t
* result
, void * instance
);
49 static void currentPosCallback(xmmsc_result_t
* result
, void * instance
);
50 static void collectionChangedCallback(xmmsc_result_t
* result
, void * instance
);
51 static void fillPlaylists(xmmsc_result_t
*, void * instance
);
53 void setActivePlaylist(QString name
);
55 void setConnection(xmmsc_connection_t
* connection
);
56 //void setActivePlaylist(QPlaylist * playlist);
58 QMedialib(QClient
* parent
);
61 const QMediaInfoHash
& media() { return m_CachedMedia
; }
62 const QPlaylistHash
& playlists() { return m_Playlists
; }
63 QPlaylist
* activePlaylist() const { return m_ActivePlaylist
; };
65 void clearMediaInfo();
66 void removeMediaInfo(quint32 id
);
67 void requestMediaInfo(quint32 id
);
68 bool checkMediaInfo(quint32 id
);
69 //void resetPlaylists();
71 void mediaInfoReady(quint32 id
);
72 void activePlaylistChanged();
73 void collectionAdded(QString name
);
74 void collectionRemoved(QString name
);
75 void collectionUpdated(QString name
);
76 void collectionRenamed(QString oldName
, QString newName
);
77 void playlistsReseted();