2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2014-01-11 01:01:54 +01:00
|
|
|
|
|
|
|
#ifndef MPD_DATABASE_CLIENT_HXX
|
|
|
|
#define MPD_DATABASE_CLIENT_HXX
|
|
|
|
|
2014-02-04 19:16:30 +01:00
|
|
|
struct LightSong;
|
|
|
|
|
2014-01-11 01:01:54 +01:00
|
|
|
/**
|
|
|
|
* An object that listens to events from the #Database.
|
|
|
|
*
|
|
|
|
* @see #Instance
|
|
|
|
*/
|
|
|
|
class DatabaseListener {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The database has been modified. This must be called in the
|
|
|
|
* thread that has created the #Database instance and that
|
|
|
|
* runs the #EventLoop.
|
|
|
|
*/
|
2019-04-24 14:57:30 +02:00
|
|
|
virtual void OnDatabaseModified() noexcept = 0;
|
2014-02-04 19:16:30 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* During database update, a song is about to be removed from
|
|
|
|
* the database because the file has disappeared.
|
|
|
|
*/
|
2019-04-24 14:57:30 +02:00
|
|
|
virtual void OnDatabaseSongRemoved(const char *uri) noexcept = 0;
|
2014-01-11 01:01:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|