2013-01-03 21:40:47 +01:00
|
|
|
#ifndef INCOMINGDATAPARSER_H
|
|
|
|
#define INCOMINGDATAPARSER_H
|
2012-12-31 23:37:39 +01:00
|
|
|
|
|
|
|
#include "core/player.h"
|
|
|
|
#include "core/application.h"
|
2013-01-03 21:40:47 +01:00
|
|
|
#include "remotecontrolmessages.pb.h"
|
2013-07-12 12:31:27 +02:00
|
|
|
#include "remoteclient.h"
|
2012-12-31 23:37:39 +01:00
|
|
|
|
2013-01-03 21:40:47 +01:00
|
|
|
class IncomingDataParser : public QObject {
|
2012-12-31 23:37:39 +01:00
|
|
|
Q_OBJECT
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2013-01-03 21:40:47 +01:00
|
|
|
IncomingDataParser(Application* app);
|
|
|
|
~IncomingDataParser();
|
2012-12-31 23:37:39 +01:00
|
|
|
|
|
|
|
bool close_connection();
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public slots:
|
2013-01-23 20:02:12 +01:00
|
|
|
void Parse(const pb::remote::Message& msg);
|
2013-01-10 21:21:55 +01:00
|
|
|
|
2012-12-31 23:37:39 +01:00
|
|
|
signals:
|
2013-01-15 13:05:43 +01:00
|
|
|
void SendClementineInfo();
|
2013-03-27 16:54:02 +01:00
|
|
|
void SendFirstData(bool send_playlist_songs);
|
2012-12-31 23:37:39 +01:00
|
|
|
void SendAllPlaylists();
|
2013-04-16 13:57:04 +02:00
|
|
|
void SendAllActivePlaylists();
|
2012-12-31 23:37:39 +01:00
|
|
|
void SendPlaylistSongs(int id);
|
2013-04-20 16:11:57 +02:00
|
|
|
void Open(int id);
|
|
|
|
void Close(int id);
|
2013-07-10 13:24:23 +02:00
|
|
|
void GetLyrics();
|
2013-05-07 17:57:53 +02:00
|
|
|
void Love();
|
|
|
|
void Ban();
|
2012-12-31 23:37:39 +01:00
|
|
|
|
|
|
|
void Play();
|
|
|
|
void PlayPause();
|
|
|
|
void Pause();
|
|
|
|
void Stop();
|
2013-07-20 19:38:37 +02:00
|
|
|
void StopAfterCurrent();
|
2012-12-31 23:37:39 +01:00
|
|
|
void Next();
|
|
|
|
void Previous();
|
|
|
|
void SetVolume(int volume);
|
|
|
|
void PlayAt(int i, Engine::TrackChangeFlags change, bool reshuffle);
|
|
|
|
void SetActivePlaylist(int id);
|
2013-01-09 20:07:28 +01:00
|
|
|
void ShuffleCurrent();
|
2013-01-15 14:43:02 +01:00
|
|
|
void SetRepeatMode(PlaylistSequence::RepeatMode mode);
|
|
|
|
void SetShuffleMode(PlaylistSequence::ShuffleMode mode);
|
2014-02-07 16:34:20 +01:00
|
|
|
void InsertUrls(int id, const QList<QUrl>& urls, int pos, bool play_now,
|
|
|
|
bool enqueue);
|
2015-06-13 16:00:15 +02:00
|
|
|
void InsertSongs(int id, const SongList& songs, int pos, bool play_now,
|
|
|
|
bool enqueue);
|
2013-07-31 19:06:29 +02:00
|
|
|
void RemoveSongs(int id, const QList<int>& indices);
|
2013-01-23 20:02:12 +01:00
|
|
|
void SeekTo(int seconds);
|
2013-08-01 18:13:14 +02:00
|
|
|
void SendLibrary(RemoteClient* client);
|
2013-09-22 12:06:19 +02:00
|
|
|
void RateCurrentSong(double);
|
2012-12-31 23:37:39 +01:00
|
|
|
|
2014-10-21 17:59:02 +02:00
|
|
|
void DoGlobalSearch(QString, RemoteClient*);
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2012-12-31 23:37:39 +01:00
|
|
|
Application* app_;
|
|
|
|
bool close_connection_;
|
|
|
|
|
2013-01-15 13:05:43 +01:00
|
|
|
void GetPlaylistSongs(const pb::remote::Message& msg);
|
|
|
|
void ChangeSong(const pb::remote::Message& msg);
|
2013-01-15 14:43:02 +01:00
|
|
|
void SetRepeatMode(const pb::remote::Repeat& repeat);
|
|
|
|
void SetShuffleMode(const pb::remote::Shuffle& shuffle);
|
2013-04-13 11:57:05 +02:00
|
|
|
void InsertUrls(const pb::remote::Message& msg);
|
|
|
|
void RemoveSongs(const pb::remote::Message& msg);
|
2015-04-24 17:30:21 +02:00
|
|
|
void ClientConnect(const pb::remote::Message& msg, RemoteClient* client);
|
2013-04-16 13:57:04 +02:00
|
|
|
void SendPlaylists(const pb::remote::Message& msg);
|
2013-04-20 16:11:57 +02:00
|
|
|
void OpenPlaylist(const pb::remote::Message& msg);
|
|
|
|
void ClosePlaylist(const pb::remote::Message& msg);
|
2013-08-15 20:52:12 +02:00
|
|
|
void RateSong(const pb::remote::Message& msg);
|
2014-10-21 17:59:02 +02:00
|
|
|
void GlobalSearch(RemoteClient* client, const pb::remote::Message& msg);
|
2015-06-13 16:00:15 +02:00
|
|
|
|
|
|
|
Song CreateSongFromProtobuf(const pb::remote::SongMetadata& pb);
|
2012-12-31 23:37:39 +01:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // INCOMINGDATAPARSER_H
|