20 #ifndef MPD_SIMPLE_DATABASE_PLUGIN_HXX 21 #define MPD_SIMPLE_DATABASE_PLUGIN_HXX 40 std::string path_utf8;
67 mutable unsigned borrowed_song_count;
105 void Mount(
const char *local_uri,
const char *storage_uri);
111 void Open()
override;
112 void Close()
override;
void Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist) const override
Visit the selected entities.
gcc_nonnull_all void Mount(const char *uri, Database *db)
An event loop that polls for events on file/socket descriptors.
A path name in the native file system character set.
bool FileExists() const
Returns true if there is a valid database file on the disk.
std::function< void(const LightDirectory &)> VisitDirectory
DatabaseStats GetStats(const DatabaseSelection &selection) const override
An object that listens to events from the Database.
std::function< void(const PlaylistInfo &, const LightDirectory &)> VisitPlaylist
time_t GetUpdateStamp() const noexcept override
Returns the time stamp of the last database update.
const DatabasePlugin simple_db_plugin
const LightSong * GetSong(const char *uri_utf8) const override
Look up a song (including tag data) in the database.
TagType
Codes for the type of a tag item.
gcc_nonnull_all bool Unmount(const char *uri)
uint_least32_t tag_mask_t
std::function< void(const LightSong &)> VisitSong
std::function< void(const Tag &)> VisitTag
void Open() override
Open the database.
gcc_pure Directory & GetRoot() noexcept
void Close() override
Close the database, free allocated memory.
static Database * Create(EventLoop &loop, DatabaseListener &listener, const ConfigBlock &block)
void VisitUniqueTags(const DatabaseSelection &selection, TagType tag_type, tag_mask_t group_mask, VisitTag visit_tag) const override
Visit all unique tag values.
void ReturnSong(const LightSong *song) const override
Mark the song object as "unused".
const Storage const char * uri
A reference to a song file.