Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

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

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

Definition at line 69 of file stats.c.

References mpd_stats::db_play_time, mpd_stats::db_update_time, mpd_stats_feed(), mpd_pair::name, mpd_stats::number_of_albums, mpd_stats::number_of_artists, mpd_stats::number_of_songs, mpd_stats::play_time, mpd_stats::uptime, and mpd_pair::value.

Referenced by mpd_recv_stats(), and mpd_stats_feed().

{
      if (strcmp(pair->name, "artists") == 0)
            stats->number_of_artists = atoi(pair->value);
      else if (strcmp(pair->name, "albums") == 0)
            stats->number_of_albums = atoi(pair->value);
      else if (strcmp(pair->name, "songs") == 0)
            stats->number_of_songs = atoi(pair->value);
      else if (strcmp(pair->name, "uptime") == 0)
            stats->uptime = strtol(pair->value,NULL,10);
      else if (strcmp(pair->name, "db_update") == 0)
            stats->db_update_time = strtol(pair->value,NULL,10);
      else if (strcmp(pair->name, "playtime") == 0)
            stats->play_time = strtol(pair->value,NULL,10);
      else if (strcmp(pair->name, "db_playtime") == 0)
            stats->db_play_time = strtol(pair->value,NULL,10);
}


Generated by  Doxygen 1.6.0   Back to index