libmpd 11.8.17
libmpd-status.h File Reference

Go to the source code of this file.

Functions

int mpd_status_check (MpdObj *mi)
 
int mpd_status_queue_update (MpdObj *mi)
 
int mpd_status_update (MpdObj *mi)
 
float mpd_status_set_volume_as_float (MpdObj *mi, float fvol)
 
int mpd_status_set_volume (MpdObj *mi, int volume)
 
int mpd_status_get_volume (MpdObj *mi)
 
int mpd_status_get_bitrate (MpdObj *mi)
 
unsigned int mpd_status_get_samplerate (MpdObj *mi)
 
int mpd_status_get_channels (MpdObj *mi)
 
int mpd_status_get_bits (MpdObj *mi)
 
int mpd_status_get_total_song_time (MpdObj *mi)
 
int mpd_status_get_elapsed_song_time (MpdObj *mi)
 
int mpd_status_get_crossfade (MpdObj *mi)
 
int mpd_status_set_crossfade (MpdObj *mi, int crossfade_time)
 
int mpd_status_db_is_updating (MpdObj *mi)
 
char * mpd_status_get_mpd_error (MpdObj *mi)
 
int mpd_stats_update (MpdObj *mi)
 
int mpd_stats_get_total_songs (MpdObj *mi)
 
int mpd_stats_get_total_artists (MpdObj *mi)
 
int mpd_stats_get_total_albums (MpdObj *mi)
 
int mpd_stats_get_uptime (MpdObj *mi)
 
int mpd_stats_get_db_playtime (MpdObj *mi)
 
int mpd_stats_get_playtime (MpdObj *mi)
 

Function Documentation

◆ mpd_stats_get_db_playtime()

int mpd_stats_get_db_playtime ( MpdObj * mi)
Parameters
mia MpdObj

Gets the total time of the database

Returns
the total time of the database

◆ mpd_stats_get_playtime()

int mpd_stats_get_playtime ( MpdObj * mi)
Parameters
mia MpdObj

Gets the time mpd is playing

Returns
time that mpd is playing in seconds

◆ mpd_stats_get_total_albums()

int mpd_stats_get_total_albums ( MpdObj * mi)
Parameters
mia MpdObj

Gets the total number of albums in the database

Returns
The number of albums in the database

◆ mpd_stats_get_total_artists()

int mpd_stats_get_total_artists ( MpdObj * mi)
Parameters
mia MpdObj

Gets the total number of artists in the database.

Returns
The number of artists in the database

◆ mpd_stats_get_total_songs()

int mpd_stats_get_total_songs ( MpdObj * mi)
Parameters
mia MpdObj

Gets the total number of songs in the database

Returns
The total number of songs

◆ mpd_stats_get_uptime()

int mpd_stats_get_uptime ( MpdObj * mi)
Parameters
mia MpdObj

Gets the time since mpd has been running

Returns
time since mpd has been running in seconds

◆ mpd_stats_update()

int mpd_stats_update ( MpdObj * mi)
Parameters
mia MpdObj

Shouldn't be used from the program.

◆ mpd_status_check()

int mpd_status_check ( MpdObj * mi)
Parameters
mia MpdObj

Checks if there is status information available. if not available, it tries to fetch it. This function is called from within libmpd, and shouldn't be called from the program.

Returns
0 when successful

◆ mpd_status_db_is_updating()

int mpd_status_db_is_updating ( MpdObj * mi)
Parameters
mia MpdObj

Checks if mpd is updating it's music db.

Returns
TRUE if mpd is still updating, FALSE if not.
Examples
testcase.c.

◆ mpd_status_get_bitrate()

int mpd_status_get_bitrate ( MpdObj * mi)
Parameters
mia MpdObj

get the bitrate of the currently playing song in kbs. This is a constantly updating value. (for vbr songs)

Returns
bitrate in kbs

◆ mpd_status_get_bits()

int mpd_status_get_bits ( MpdObj * mi)
Parameters
mia MpdObj

get the number of bits per sample of the currently playing song.

Returns
bits per sample

◆ mpd_status_get_channels()

int mpd_status_get_channels ( MpdObj * mi)
Parameters
mia MpdObj

get the number of channels in the currently playing song. This is usually only 1(mono) or 2(stereo), but this might change in the future.

Returns
number of channels

◆ mpd_status_get_crossfade()

int mpd_status_get_crossfade ( MpdObj * mi)
Parameters
mia MpdObj

Get the crossfade time. 0 is disabled.

Returns
The crossfade time in seconds
Examples
testcase.c.

◆ mpd_status_get_elapsed_song_time()

int mpd_status_get_elapsed_song_time ( MpdObj * mi)
Parameters
mia MpdObj

Gets the elapsed time of the currently playing song.

Returns
Time in seconds

◆ mpd_status_get_mpd_error()

char * mpd_status_get_mpd_error ( MpdObj * mi)
Parameters
mia MpdObj
Returns
the error message that mpd last reported, or NULL. Needs to be freed.

◆ mpd_status_get_samplerate()

unsigned int mpd_status_get_samplerate ( MpdObj * mi)
Parameters
mia MpdObj

get the samplerate of the currently playing song in bps.

Returns
samplerate in bps

◆ mpd_status_get_total_song_time()

int mpd_status_get_total_song_time ( MpdObj * mi)
Parameters
mia MpdObj

get the total length of the currently playing song.

Returns
time in seconds or <0 when failed.
Examples
testcase.c.

◆ mpd_status_get_volume()

int mpd_status_get_volume ( MpdObj * mi)
Parameters
mia MpdObj

Get the audio output volume.

Returns
the audio output volume between 0 and 100 or < 0 when failed
Examples
testcase.c.

◆ mpd_status_queue_update()

int mpd_status_queue_update ( MpdObj * mi)
Parameters
mia MpdObj

Marks the current status invalid, the next time status is needed it will be fetched from mpd.

Returns
0 when successful

◆ mpd_status_set_crossfade()

int mpd_status_set_crossfade ( MpdObj * mi,
int crossfade_time )
Parameters
mia MpdObj
crossfade_timethe time to crossfade in seconds

Sets the crossfade time. 0 to disable crossfade.

Returns
0 when successful

◆ mpd_status_set_volume()

int mpd_status_set_volume ( MpdObj * mi,
int volume )
Parameters
mia MpdObj
volumea value between 0 and 100.

Set the output volume

Returns
the new volume or < 0 when failed.
Examples
testcase.c.

◆ mpd_status_set_volume_as_float()

float mpd_status_set_volume_as_float ( MpdObj * mi,
float fvol )
Parameters
mia MpdObj
fvola float between 0.0 and 1.0

Set the output volume

Returns
the new volume or a value below 0 when failed.

◆ mpd_status_update()

int mpd_status_update ( MpdObj * mi)
Parameters
mia MpdObj

Updates the status field from mpd. Call this function every 0.x seconds from the program's main-loop to receive signals when mpd's status has changed.

Returns
0 when succesfull
Examples
testcase.c.

Copyright 2006 Qball Cow