defuze.me  Client
remotecontrol.hpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 namespace Remote {
00012     class RemoteControl;
00013 }
00014 
00015 #ifndef REMOTECONTROL_HPP
00016 #define REMOTECONTROL_HPP
00017 
00018 #include <QObject>
00019 #include <QSet>
00020 #include "staticplugin.hpp"
00021 #include "networkcore.hpp"
00022 #include "playqueue.hpp"
00023 #include "mainplayer.hpp"
00024 
00025 using namespace Network;
00026 
00027 namespace Remote
00028 {
00033     class RemoteControl : public QObject, public StaticPlugin
00034     {
00035         Q_OBJECT
00036     public:
00037         explicit RemoteControl();
00038         virtual ~RemoteControl();
00039         void                init();                             
00040         void                sendToAll(const QString& event, const QVariantMap& data = QVariantMap());
00041 
00042     signals:
00043 
00044     public slots:
00045         void                newRemoteClient(RemoteSock*);       
00046         void                removeRemoteClient();               
00047         void                receiveEvent(const RemoteEvent&);   
00048 
00049         void                popQueue();
00050         void                removeQueueElem(Queue::Queueable* elem);
00051         void                addQueueElem(Queue::Queueable* elem);
00052         void                removeQueueElem(const RemoteEvent &packet);
00053         void                addQueueElem(const RemoteEvent &packet);
00054         void                moveQueueElem(const RemoteEvent &packet);
00055         void                play(const RemoteEvent &packet);
00056         void                pause(const RemoteEvent &packet);
00057         void                stop(const RemoteEvent &packet);
00058         void                next(const RemoteEvent &packet);
00059         void                playStatusChanged();
00060 
00061     private:
00062         void                sendPlayQueue(RemoteSock* client);  
00063         void                sendPlayState(RemoteSock* client);  
00064 
00065         QSet<RemoteSock*>   clients;
00066         Queue::PlayQueue*   play_queue;
00067         Player::MainPlayer* player;
00068     };
00069 }
00070 
00071 #endif // REMOTECONTROL_HPP