21 #ifndef REMOTECONTROL_H 22 #define REMOTECONTROL_H 24 #include "Components/PlayManager/PlayState.h" 25 #include "Utils/Playlist/PlaylistFwd.h" 29 #include "Utils/Pimpl.h" 96 bool is_connected()
const;
99 void new_connection();
100 void socket_disconnected();
103 void pos_changed_ms(MilliSeconds pos);
104 void track_changed(
const MetaData& md);
105 void volume_changed(
int vol);
106 void playstate_changed(
PlayState playstate);
107 void active_playlist_changed(
int index);
108 void active_playlist_content_changed(
int index);
110 void cover_found(
const QPixmap& pm);
112 void _sl_active_changed();
113 void _sl_port_changed();
114 void _sl_broadcast_changed();
120 void set_volume(
int vol);
121 void seek_rel(
int pos_percent);
122 void seek_rel_ms(
int pos_ms);
123 void change_track(
int idx);
126 void request_state();
128 int extract_parameter_int(
const QByteArray& arr,
int cmd_len);
130 void json_playstate(QJsonObject& o);
131 void write_playstate();
133 void json_broadcast_info(QJsonObject& o);
134 void write_broadcast_info();
136 void json_current_track(QJsonObject& o);
137 void write_current_track();
139 void json_volume(QJsonObject& o)
const;
142 void json_current_position(QJsonObject& o)
const;
143 void write_current_position();
145 void json_playlist(QJsonArray& o)
const;
146 void write_playlist();
149 void json_cover(QJsonObject& o,
const QPixmap& pm)
const;
151 void write(
const QByteArray& arr);
153 void active_changed();
158 #endif // REMOTECONTROL_H PlayState
The PlayState enum.
Definition: PlayState.h:28
Remote control allows to control Sayonara from an external application via network. Various commands are implemented. Sayonara also delivers information about state changes,The current implemented commands are: play start playing pause pause playing prev previous song next next song playpause toggle play/pause stop stop playing volup increase volume voldown decrease volume setvol <int> change volume pl fetch the active playlist curSong fetch the current song index seekrel <int> seek within song in percent seekrelms <int> seek within song in relative to current position in seconds chtrk <int> change track state request state: every answer except playlists are returned Answers are sent in JSON format. Each answer is terminated with 10 bytes long ENDMESSAGE. The list of attributes is: volume<int> current volume value between 0 and 100 Current track track-title<string> current track title track-artist<string> current track artist track-album<string> current track album track-total-time<int> current track total time in seconds track-current-position<int> current track position in seconds Broadcasting broadcast-active<bool> is broadcast active? broadcast-port<int> port where broadcasts can be received from Cover cover-data<string> Base64 encoded JPG file cover-width<int> width of cover pixmap cover-height<int> height of cover pixmap playstate<string> one of the values "playing", "paused" or "stopped" Playlist playlist-current-index<int> current playing track index playlist<array> array of tracks pl-track-title<int> title of track pl-track-album<string> album of track pl-track-artist<string> artist of track pl-track-total-time<int> length of track in seconds .
Definition: RemoteControl.h:86