|
Freya
0.0.1
A Gtk3 MPD Client
|
The client implements concrete commands of the MPD Protocol. More...
#include <Client.hh>
Public Member Functions | |||
| Client () | |||
| Instance the client. | |||
| ~Client () | |||
| Disconnects also. | |||
| void | connect () | ||
| Connect to the MPD Server specified in the config. | |||
| void | disconnect () | ||
| Disconnects from the currently connected server. | |||
| bool | playback_next () | ||
| Go to next song. | |||
| bool | playback_prev () | ||
| Go the prev song. | |||
| bool | playback_stop () | ||
| Stop playback. | |||
| bool | playback_play () | ||
| Resume from stopmode. | |||
| bool | playback_pause () | ||
| Toggle pause-state. | |||
| void | playback_seek (unsigned song_id, unsigned abs_time) | ||
| Seek forward in song song_id, to abs_time from start. | |||
| void | playback_crossfade (unsigned seconds) | ||
| Set blending between songs in seconds. | |||
| void | toggle_random () | ||
| Toggle randome mode. | |||
| void | toggle_consume () | ||
| Toggle consume mode (song gets deleted from playlist after playing) | |||
| void | toggle_repeat () | ||
| Toggle repeat mode (repeat playlist) | |||
| void | toggle_single () | ||
| Toggle single mode (stops playing after one song) | |||
| void | play_song_at_id (unsigned song_id) | ||
| Play song at ID (not the Pos in the Queue!) | |||
Save the current queue as playlist of name
| |||
| void | playlist_save (const char *name) | ||
| void | queue_add (const char *url) | ||
| Add song from the database to the queue. | |||
| void | queue_clear () | ||
| Clears entire queue. | |||
| void | queue_delete (unsigned pos) | ||
| Deletes song in the queue. | |||
| unsigned | database_update (const char *path) | ||
| Update the database. | |||
| unsigned | database_rescan (const char *path) | ||
| Full rescan of the database. | |||
| void | set_volume (unsigned vol) | ||
| set the volume | |||
| void | fill_queue (AbstractItemlist &data_model) | ||
| Fetches the playlist from the mpd server. | |||
| void | fill_queue_changes (AbstractItemlist &data_model, unsigned last_version, unsigned &first_pos) | ||
| void | fill_playlists (AbstractItemlist &data_model) | ||
| Fetches all playlists from the server. | |||
| void | fill_outputs (AbstractItemlist &data_model) | ||
| Fetches all available outputs from the server. | |||
| void | fill_filelist (AbstractItemlist &data_model, const char *path) | ||
| Fetches a list of files in the database. | |||
| bool | send_command (const char *command) | ||
| Send a command to the server. | |||
| bool | ping () | ||
| Pings server. | |||
The client implements concrete commands of the MPD Protocol.
Instance the client.
If settings.connection.autoconnect is set to true This also connects already anc calls force_update() Use is_connected() to check if beign connected.
Disconnects also.
| void MPD::Client::connect | ( | ) |
Connect to the MPD Server specified in the config.
See also BaseClient
| unsigned MPD::Client::database_rescan | ( | const char * | path | ) |
Full rescan of the database.
This is a very expensive operation and might take some time.
| path | an optional path, "/" means everything. |
| unsigned MPD::Client::database_update | ( | const char * | path | ) |
Update the database.
Add new files to mpd's database
| path | a certain path, or "/" for everything |
| void MPD::Client::disconnect | ( | ) |
Disconnects from the currently connected server.
If already disconnected it does plain nothing. If connection was lost violently BaseClient will try to periodically reconnect.
| void MPD::Client::fill_filelist | ( | AbstractItemlist & | data_model, |
| const char * | path | ||
| ) | [virtual] |
Fetches a list of files in the database.
| data_model | A user defined class, that inherits from AbstractSonglist |
| path | A certain path, or NULL which will add / |
Implements MPD::AbstractItemGenerator.
| void MPD::Client::fill_outputs | ( | AbstractItemlist & | data_model | ) | [virtual] |
Fetches all available outputs from the server.
| data_model | A user defined class, that inherits from AbstractSonglist |
Implements MPD::AbstractItemGenerator.
| void MPD::Client::fill_playlists | ( | AbstractItemlist & | data_model | ) | [virtual] |
Fetches all playlists from the server.
| data_model | A user defined class, that inherits from AbstractSonglist |
Implements MPD::AbstractItemGenerator.
| void MPD::Client::fill_queue | ( | AbstractItemlist & | data_model | ) | [virtual] |
Fetches the playlist from the mpd server.
| data_model | A user defined class, that inherits from AbstractSonglist |
Implements MPD::AbstractItemGenerator.
| void MPD::Client::fill_queue_changes | ( | AbstractItemlist & | data_model, |
| unsigned | last_version, | ||
| unsigned & | first_pos | ||
| ) | [virtual] |
| data_model | A user defined class, that inherits from AbstractSonglist |
| last_version | The changes since this version |
| first_pos | The position of the song that changed first is stored here |
Implements MPD::AbstractItemGenerator.
| bool MPD::Client::ping | ( | ) |
Pings server.
| void MPD::Client::play_song_at_id | ( | unsigned | song_id | ) |
Play song at ID (not the Pos in the Queue!)
| song_id |
| void MPD::Client::playback_crossfade | ( | unsigned | seconds | ) |
Set blending between songs in seconds.
| seconds |
| bool MPD::Client::playback_next | ( | ) |
Go to next song.
| bool MPD::Client::playback_pause | ( | ) |
Toggle pause-state.
When playing it gets paused, when being paused it starts playing.
| bool MPD::Client::playback_play | ( | ) |
Resume from stopmode.
| bool MPD::Client::playback_prev | ( | ) |
Go the prev song.
| void MPD::Client::playback_seek | ( | unsigned | song_id, |
| unsigned | abs_time | ||
| ) |
Seek forward in song song_id, to abs_time from start.
| song_id | The song to seek in |
| abs_time | Time in seconds starting from 0 |
| bool MPD::Client::playback_stop | ( | ) |
Stop playback.
Will remember the current song. You have to call playback_play() to "unstop"
| void MPD::Client::playlist_save | ( | const char * | name | ) |
| void MPD::Client::queue_add | ( | const char * | url | ) |
Add song from the database to the queue.
| url | a path to the song, does not start with / |
| void MPD::Client::queue_clear | ( | ) |
Clears entire queue.
| void MPD::Client::queue_delete | ( | unsigned | pos | ) |
Deletes song in the queue.
| pos |
| bool MPD::Client::send_command | ( | const char * | command | ) |
Send a command to the server.
The output will be printed in the cmd, it is therefore just useful for debugging purpose
| command | See the protocol reference: http://www.musicpd.org/doc/protocol/index.html |
| void MPD::Client::set_volume | ( | unsigned | vol | ) |
set the volume
| vol | Must be in [0-100] |
| void MPD::Client::toggle_consume | ( | ) |
Toggle consume mode (song gets deleted from playlist after playing)
| void MPD::Client::toggle_random | ( | ) |
Toggle randome mode.
| void MPD::Client::toggle_repeat | ( | ) |
Toggle repeat mode (repeat playlist)
| void MPD::Client::toggle_single | ( | ) |
Toggle single mode (stops playing after one song)
1.8.0