diff options
Diffstat (limited to 'src/DatabasePlugin.hxx')
-rw-r--r-- | src/DatabasePlugin.hxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/DatabasePlugin.hxx b/src/DatabasePlugin.hxx index a6168b628..37df7f654 100644 --- a/src/DatabasePlugin.hxx +++ b/src/DatabasePlugin.hxx @@ -37,6 +37,34 @@ struct config_param; struct DatabaseSelection; struct db_visitor; +struct DatabaseStats { + /** + * Number of songs. + */ + unsigned song_count; + + /** + * Total duration of all songs (in seconds). + */ + unsigned long total_duration; + + /** + * Number of distinct artist names. + */ + unsigned artist_count; + + /** + * Number of distinct album names. + */ + unsigned album_count; + + void Clear() { + song_count = 0; + total_duration = 0; + artist_count = album_count = 0; + } +}; + class Database { public: /** @@ -94,6 +122,10 @@ public: enum tag_type tag_type, VisitString visit_string, GError **error_r) const = 0; + + virtual bool GetStats(const DatabaseSelection &selection, + DatabaseStats &stats, + GError **error_r) const = 0; }; struct DatabasePlugin { |