From cf6281a5a758e4b93d67f7fd5804a8cff60ddbf9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Feb 2014 00:26:34 +0100 Subject: Instance: add Database attribute Move from db/DatabaseGlue.cxx, eliminating global variable. --- src/Instance.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Instance.hxx') diff --git a/src/Instance.hxx b/src/Instance.hxx index ea60072cb..9e3f92458 100644 --- a/src/Instance.hxx +++ b/src/Instance.hxx @@ -30,9 +30,11 @@ class NeighborGlue; #ifdef ENABLE_DATABASE #include "db/DatabaseListener.hxx" +class Database; class UpdateService; #endif +class Error; class ClientList; struct Partition; @@ -55,6 +57,8 @@ struct Instance final #endif #ifdef ENABLE_DATABASE + Database *database; + UpdateService *update; #endif @@ -69,6 +73,12 @@ struct Instance final } #ifdef ENABLE_DATABASE + /** + * Returns the global #Database instance. May return nullptr + * if this MPD configuration has no database (no + * music_directory was configured). + */ + Database *GetDatabase(Error &error); void DeleteSong(const char *uri); -- cgit v1.2.3