RemoteTagCache: new glue class for integrating RemoteTagScanner

This commit also puts an instance of RemoteTagScanner into the
Instance class, and hooks it into the "add" and "addid" commands.
This commit is contained in:
Max Kellermann
2018-01-29 12:02:14 +01:00
parent 7d16d8c887
commit ce2b6dc84d
11 changed files with 417 additions and 0 deletions

View File

@@ -43,6 +43,24 @@ playlist::TagModified(DetachedSong &&song)
OnModified();
}
void
playlist::TagModified(const char *uri, const Tag &tag) noexcept
{
bool modified = false;
for (unsigned i = 0; i < queue.length; ++i) {
auto &song = *queue.items[i].song;
if (song.IsURI(uri)) {
song.SetTag(tag);
queue.ModifyAtPosition(i);
modified = true;
}
}
if (modified)
OnModified();
}
inline void
playlist::QueueSongOrder(PlayerControl &pc, unsigned order)

View File

@@ -23,6 +23,7 @@
#include "queue/Queue.hxx"
enum TagType : uint8_t;
struct Tag;
struct PlayerControl;
class DetachedSong;
class Database;
@@ -192,6 +193,7 @@ public:
* the song matches.
*/
void TagModified(DetachedSong &&song);
void TagModified(const char *uri, const Tag &tag) noexcept;
#ifdef ENABLE_DATABASE
/**