LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
ialbumartprovider.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QString>
12#include <QList>
13#include <QImage>
14#include <QHash>
15#include <QMetaType>
16#include <util/sll/eitherfwd.h>
17
18class QUrl;
19
20template<typename>
21class QFuture;
22
23namespace Media
24{
27 struct AlbumInfo
28 {
31 QString Artist_;
32
35 QString Album_;
36
39 bool operator== (const AlbumInfo&) const = default;
40 };
41
44 inline size_t qHash (const AlbumInfo& info)
45 {
46 const std::initializer_list<QString> elems { info.Album_, info.Artist_ };
47 return qHashRange (elems.begin (), elems.end ());
48 }
49
55 class Q_DECL_EXPORT IAlbumArtProvider
56 {
57 protected:
58 virtual ~IAlbumArtProvider () = default;
59 public:
66
71 virtual QString GetAlbumArtProviderName () const = 0;
72
82 virtual QFuture<Result_t> RequestAlbumArt (const AlbumInfo& album) const = 0;
83 };
84}
85
87Q_DECLARE_INTERFACE (Media::IAlbumArtProvider, "org.LeechCraft.Media.IAlbumArtProvider/1.0")
Interface for plugins that can search for album art.
virtual QFuture< Result_t > RequestAlbumArt(const AlbumInfo &album) const =0
Initiates search for album art of the given album.
virtual QString GetAlbumArtProviderName() const =0
Returns the human-readable name of this provider.
virtual ~IAlbumArtProvider()=default
size_t qHash(const AlbumInfo &info)
A hash function for AlbumInfo to use it with QHash.
Information about an album used in IAlbumArtProvider.
QString Artist_
The artist name of this album.
bool operator==(const AlbumInfo &) const =default
Compares two AlbumInfo structures.
QString Album_
The album name.
Q_DECLARE_METATYPE(QVariantList *)