Detailed Description
MPD related general actions such as connection issues, status changes etc.
Function Documentation
MpdData* mpd_data_get_next_keep |
( |
MpdData * |
data | ) |
|
Convenience function if a MpdData list is used more than once
- Parameters:
-
data | a pointer to a MpdData list |
- Returns:
- a pointer to the next element in the list (keeping the current element intact)
int mpd_get_current_album_string |
( |
char * |
album, |
|
|
int |
strlen |
|
) |
| |
Get the album name from which current song comes or "n/a" if no song is playing
- Parameters:
-
*album | a pointer to a char array of length strlen |
strlen | the length of the array to which album points |
- Returns:
- 0
int mpd_get_current_artist_string |
( |
char * |
artist, |
|
|
int |
strlen |
|
) |
| |
Get the artist name from which current song comes or "n/a" if no artist tag for the current song.
- Parameters:
-
*artist | a pointer to a char array of length strlen |
strlen | the length of the array to which `artist` points |
- Returns:
- 0
int mpd_get_current_play_time |
( |
| ) |
|
Get the current play time of the song which is playing
- Returns:
- the current play time (the time of the song that has been played)
mpd_Song* mpd_get_current_song |
( |
MpdObj * |
obj | ) |
|
Gets the currently playing song. Clients don't need to free the result but must check the connection to the daemon
- Parameters:
-
obj | a pointer to a connected MpdObj |
- Returns:
- a pointer to the current song
int mpd_get_current_song_pos |
( |
| ) |
|
Get the current playlist from mpd
- Returns:
- a pointer to a MpdPlContainer which contains the current playlist
int mpd_get_current_song_string |
( |
char * |
song, |
|
|
int |
strlen |
|
) |
| |
Get a string describing the current song in the following format:
if playing||paused:
-
if {artist_name} != NULL: "{artist name} - {song name}"
-
else: "{song name}"
else: "mpd not playing"
- Parameters:
-
*song | a pointer to an char array of length strlen |
strlen | the length of the array to which song points |
- Returns:
- 0
int mpd_get_current_song_time |
( |
| ) |
|
Get the total time of the current song
- Returns:
- the total time of the current song
int mpd_get_current_title_string |
( |
char * |
title, |
|
|
int |
strlen |
|
) |
| |
Get the title of the current song or "n/a" if no song is playing
- Parameters:
-
*title | a pointer to a char array of length strlen |
strlen | the length of the array to which title points |
- Returns:
- 0
int mpd_get_current_track_string |
( |
char * |
track, |
|
|
int |
strlen |
|
) |
| |
Gets the track tag of the current song.
- Parameters:
-
*track | a pointer to a char array of length strlen |
strlen | the length of the array to which track points |
- Returns:
- 0
int mpd_get_db_length |
( |
| ) |
|
Gets the number of entries in the MPD database
- Returns:
- number of entries in the MPD database
int mpd_get_pl_length |
( |
| ) |
|
Gets the number of songs in the current playlist
- Returns:
- number of songs in the current playlist
gboolean mpd_has_current_song_changed |
( |
| ) |
|
Returns TRUE if the current song has changed
- Returns:
- TRUE if changed, FALSE if not
gboolean mpd_has_play_state_changed |
( |
| ) |
|
Returns TRUE if the play state has changed
- Returns:
- TRUE if changed, FALSE if not
gboolean mpd_has_playlist_changed |
( |
| ) |
|
Returns TRUE if the playlist has changed
- Returns:
- TRUE if changed, FALSE if not
gboolean mpd_is_connected |
( |
MpdObj * |
obj | ) |
|
Checks if there is a connection to mpd
- Parameters:
-
- Returns:
- TRUE if connected, FALSE if not
mpd_Connection* mpd_object_get_connection |
( |
MpdObj * |
obj | ) |
|
Gets the mpd_Connection from the supplied MpdObj
- Parameters:
-
obj | the MpdObj you want the connection from |
- Returns:
- the mpd_Connection associated with `obj`
Returns the play state of MPD:
-
0 == stopped, whatever
-
1 == playing
-
2 == paused
- Returns:
- the play state as indicated above
void mpd_play_state_update |
( |
MpdObj * |
obj | ) |
|
Updates the MpdPlayState fields in mpd_info, does not check if connection to mpd is ok, the caller has to ensure that.
- Parameters:
-
obj | a pointer to the MpdObj from which the state info should be fetched |
void mpd_status_changed_cb |
( |
MpdObj * |
obj, |
|
|
ChangedStatusType |
what, |
|
|
gpointer |
data |
|
) |
| |
A callback function which is registered with libmpd using the mpd_signal_connect_status_changed() function and gets called every time the status of the daemon changes
- Parameters:
-
obj | pointer to the calling MpdObj |
what | a code of the changed property |
data | additional data |
clears the mi.msi field
- Parameters:
-
fills the mi.msi field (MpdStateInfo) with information obtained from the MpdObj mi.obj
- Parameters:
-