From 84e09aa8dd3a7ac1e6fd8945a3e22b2011e91704 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 6 Aug 2015 12:45:22 +0200 Subject: Partition: add method GetDatabase() --- src/Partition.cxx | 7 +++++++ src/Partition.hxx | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/Partition.cxx b/src/Partition.cxx index 31a64a355..1d48fefdb 100644 --- a/src/Partition.cxx +++ b/src/Partition.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "Partition.hxx" +#include "Instance.hxx" #include "DetachedSong.hxx" #include "output/MultipleOutputs.hxx" #include "mixer/Volume.hxx" @@ -27,6 +28,12 @@ #ifdef ENABLE_DATABASE +const Database * +Partition::GetDatabase(Error &error) const +{ + return instance.GetDatabase(error); +} + void Partition::DatabaseModified(const Database &db) { diff --git a/src/Partition.hxx b/src/Partition.hxx index 6f340d0d9..dfc4ac19a 100644 --- a/src/Partition.hxx +++ b/src/Partition.hxx @@ -176,6 +176,13 @@ struct Partition final : private PlayerListener, private MixerListener { } #ifdef ENABLE_DATABASE + /** + * Returns the global #Database instance. May return nullptr + * if this MPD configuration has no database (no + * music_directory was configured). + */ + const Database *GetDatabase(Error &error) const; + /** * The database has been modified. Propagate the change to * all subsystems. -- cgit v1.2.3