Detailed Description
Functions to get and modify the status/state of mpd.
Function Documentation
- Parameters:
-
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
- Parameters:
-
Checks if mpd is updating it's music db.
- Returns:
- TRUE if mpd is still updating, FALSE if not.
- Examples:
- testcase.c.
- Parameters:
-
get the bitrate of the currently playing song in kbs. This is a constantly updating value. (for vbr songs)
- Returns:
- bitrate in kbs
- Parameters:
-
get the number of bits per sample of the currently playing song.
- Returns:
- bits per sample
- Parameters:
-
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
- Parameters:
-
Get the crossfade time. 0 is disabled.
- Returns:
- The crossfade time in seconds
- Examples:
- testcase.c.
- Parameters:
-
Gets the elapsed time of the currently playing song.
- Returns:
- Time in seconds
- Parameters:
-
- Returns:
- the error message that mpd last reported, or NULL. Needs to be freed.
- Parameters:
-
get the samplerate of the currently playing song in bps.
- Returns:
- samplerate in bps
- Parameters:
-
get the total length of the currently playing song.
- Returns:
- time in seconds or <0 when failed.
- Examples:
- testcase.c.
- Parameters:
-
Get the audio output volume.
- Returns:
- the audio output volume between 0 and 100 or < 0 when failed
- Examples:
- testcase.c.
- Parameters:
-
Marks the current status invalid, the next time status is needed it will be fetched from mpd.
- Returns:
- 0 when successful
- Parameters:
-
mi | a #MpdObj |
crossfade_time | the time to crossfade in seconds |
Sets the crossfade time. 0 to disable crossfade.
- Returns:
- 0 when successful
- Parameters:
-
mi | a #MpdObj |
volume | a value between 0 and 100. |
Set the output volume
- Returns:
- the new volume or < 0 when failed.
- Examples:
- testcase.c.
- Parameters:
-
mi | a #MpdObj |
fvol | a float between 0.0 and 1.0 |
Set the output volume
- Returns:
- the new volume or a value below 0 when failed.
- Parameters:
-
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.