libmpdclient 2.22
Functions
stats.h File Reference

MPD client library. More...

#include "compiler.h"
#include <stdbool.h>
Include dependency graph for stats.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool mpd_send_stats (struct mpd_connection *connection)
 
struct mpd_statsmpd_stats_begin (void)
 
void mpd_stats_feed (struct mpd_stats *stats, const struct mpd_pair *pair)
 
struct mpd_statsmpd_recv_stats (struct mpd_connection *connection)
 
struct mpd_statsmpd_run_stats (struct mpd_connection *connection)
 
void mpd_stats_free (struct mpd_stats *stats)
 
unsigned mpd_stats_get_number_of_artists (const struct mpd_stats *stats)
 
unsigned mpd_stats_get_number_of_albums (const struct mpd_stats *stats)
 
unsigned mpd_stats_get_number_of_songs (const struct mpd_stats *stats)
 
unsigned long mpd_stats_get_uptime (const struct mpd_stats *stats)
 
unsigned long mpd_stats_get_db_update_time (const struct mpd_stats *stats)
 
unsigned long mpd_stats_get_play_time (const struct mpd_stats *stats)
 
unsigned long mpd_stats_get_db_play_time (const struct mpd_stats *stats)
 

Detailed Description

MPD client library.

Do not include this header directly. Use mpd/client.h instead.

Definition in file stats.h.

Function Documentation

◆ mpd_send_stats()

bool mpd_send_stats ( struct mpd_connection connection)

Send the "stats" command to MPD. Call mpd_recv_stats() to read the response.

Returns
true on success

◆ mpd_stats_begin()

struct mpd_stats * mpd_stats_begin ( void  )

Begins parsing server stats: creates a new empty mpd_stats object. Free it with mpd_stats_free().

Returns
the newly allocated mpd_stats object, or NULL if out of memory

◆ mpd_stats_feed()

void mpd_stats_feed ( struct mpd_stats stats,
const struct mpd_pair pair 
)

Parses the pair, adding its information to the specified mpd_stats object.

◆ mpd_recv_stats()

struct mpd_stats * mpd_recv_stats ( struct mpd_connection connection)

Reads the "stats" response from MPD.

Returns
a mpd_stats object, or NULL on error

◆ mpd_run_stats()

struct mpd_stats * mpd_run_stats ( struct mpd_connection connection)

◆ mpd_stats_free()

void mpd_stats_free ( struct mpd_stats stats)

Frees a mpd_stats object.

◆ mpd_stats_get_number_of_artists()

unsigned mpd_stats_get_number_of_artists ( const struct mpd_stats stats)
Returns
the number of distinct artists in MPD's database, or 0 if unknown

◆ mpd_stats_get_number_of_albums()

unsigned mpd_stats_get_number_of_albums ( const struct mpd_stats stats)
Returns
the number of distinct album names in MPD's database, or 0 if unknown

◆ mpd_stats_get_number_of_songs()

unsigned mpd_stats_get_number_of_songs ( const struct mpd_stats stats)
Returns
the total number of song files in MPD's database, or 0 if unknown

◆ mpd_stats_get_uptime()

unsigned long mpd_stats_get_uptime ( const struct mpd_stats stats)
Returns
the uptime of MPD in seconds, or 0 if unknown

◆ mpd_stats_get_db_update_time()

unsigned long mpd_stats_get_db_update_time ( const struct mpd_stats stats)
Returns
the UNIX time stamp of the last database update, or 0 if unknown

◆ mpd_stats_get_play_time()

unsigned long mpd_stats_get_play_time ( const struct mpd_stats stats)
Returns
the accumulated time MPD was playing music since the process was started, or 0 if unknown

◆ mpd_stats_get_db_play_time()

unsigned long mpd_stats_get_db_play_time ( const struct mpd_stats stats)
Returns
the accumulated duration of all songs in the database, or 0 if unknown