#include <mpdcom.h>
Public Types | |||
enum | responcetype { CONNECTING, SIMPLE, PLAYLIST, PLAYLIST_INFO, STATUS, FILELIST } | ||
enum | mpdstate { PLAY, STOP, PAUSE } | ||
Public Slots | |||
void | previous (void) | ||
Plays the previous song. More... | |||
void | next (void) | ||
Plays the next song. More... | |||
void | stop (void) | ||
Stops playing. More... | |||
void | play (void) | ||
Starts playing. More... | |||
void | play (int) | ||
Starts playing a specific song. More... | |||
void | pause (void) | ||
Pauses the playback. More... | |||
void | seek (int songnr, int pos) | ||
Seeks a position in a specific song. More... | |||
void | volume (int perc) | ||
Sets the volume. More... | |||
void | repeat (bool) | ||
Toggles repeat. More... | |||
void | random (bool) | ||
Toggles random. More... | |||
void | update (void) | ||
Sends the update command. More... | |||
void | crossFade (int) | ||
Sets the crossfade amount. More... | |||
void | requestPlaylist (void) | ||
Retrieves the playlist. More... | |||
void | loadPlaylist (QString, bool=false) | ||
Loads a playlist. More... | |||
void | clearPlaylist (void) | ||
Clears the current playlist. More... | |||
void | deletePlaylist (QString) | ||
Deletes a playlist. More... | |||
void | requestSongInfo (unsigned) | ||
Requests songinformation about a specific song. More... | |||
void | requestStatusUpdate (void) | ||
Requests the current status. More... | |||
void | requestDirectoryContent (QString dir="") | ||
Requests the content of a directory. More... | |||
void | addFile (QString) | ||
Adds a song to the playlist. More... | |||
void | removeFile (QString) | ||
Removes a song from the playlist. More... | |||
void | swap (unsigned, unsigned) | ||
Swaps two songs in the playlist. More... | |||
Signals | |||
void | playlistUpdate (const Playlist &p) | ||
Sends a received playlist.
| |||
void | statusUpdate (const MpdCom::Status &s) | ||
Sends new status information.
| |||
void | error (const QString &e) | ||
Sends error information.
| |||
void | directoryContent (const MpdCom::Filelist &f) | ||
Sends received directorycontent.
| |||
Public Methods | |||
MpdCom (const char *hostname, int hostport, bool needsPlayList, QObject *) | |||
Constructs an instance of this class. More... | |||
void | reconnectCom (const char *hostname, int hostport) | ||
Reconnects to a diffrent server. More... | |||
void | disconnectCom (void) | ||
Disconnect from the server. More... | |||
void | connectCom (void) | ||
Connect to the server. More... | |||
bool | minVersion (QString) | ||
Returns true if the connected version of MPD is higher of equel to the given version. More... | |||
QString | getVersion (void) | ||
void | startCommandList (void) | ||
void | endCommandList (void) | ||
Protected Slots | |||
void | slotReadyRead (void) | ||
Reads from the socket. This function handles all incoming data from MPD. More... | |||
void | slotConnected (void) | ||
Logs connection establishments. More... | |||
void | slotError (int) | ||
Logs connection errors. More... | |||
void | slotReconnect (void) | ||
Reconnects with the server. More... | |||
void | slotConnectionClosed (void) | ||
Logs connection closes. More... |
The communication with MPD is asynchronic which makes it possible to comunicate without stalling of the application. This class tries to wrap around differences in MPD versions as much as posible.
|
|
|
|
|
Constructs an instance of this class.
|
|
Adds a song to the playlist. Directories are only supported from MPD 0.10+.
|
|
Clears the current playlist.
|
|
Connect to the server.
|
|
Sets the crossfade amount. Only works on MPD 0.10+
|
|
Deletes a playlist.
|
|
Sends received directorycontent.
|
|
Disconnect from the server.
|
|
End a command list and send the list to MPD |
|
Sends error information.
|
|
Returns the version of MPD |
|
Loads a playlist.
|
|
Returns true if the connected version of MPD is higher of equel to the given version.
|
|
Plays the next song.
|
|
Pauses the playback.
|
|
Starts playing a specific song.
|
|
Starts playing.
|
|
Sends a received playlist.
|
|
Plays the previous song.
|
|
Toggles random.
|
|
Reconnects to a diffrent server.
|
|
Removes a song from the playlist.
|
|
Toggles repeat.
|
|
Requests the content of a directory.
|
|
Retrieves the playlist.
|
|
Requests songinformation about a specific song.
|
|
Requests the current status.
|
|
Seeks a position in a specific song.
|
|
Logs connection establishments.
|
|
Logs connection closes.
|
|
Logs connection errors.
|
|
Reads from the socket. This function handles all incoming data from MPD.
|
|
Reconnects with the server.
|
|
Starts a command list, all simple commands are stored and transfered when the endCommandList function is executed. |
|
Sends new status information.
|
|
Stops playing.
|
|
Swaps two songs in the playlist.
|
|
Sends the update command.
|
|
Sets the volume. This function is version independant, MPD versions below 0.10 work with relative values. The absolute values of this function are translated for older versions.
|