LeechCraft 0.6.70-14794-g33744ae6ce
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 <boost/functional/hash.hpp>
12#include <QString>
13#include <QList>
14#include <QImage>
15#include <QHash>
16#include <QMetaType>
17#include <util/sll/eitherfwd.h>
18
19class QUrl;
20
21template<typename>
22class QFuture;
23
24namespace Media
25{
28 struct AlbumInfo
29 {
32 QString Artist_;
33
36 QString Album_;
37 };
38
41 inline bool operator== (const AlbumInfo& a1, const AlbumInfo& a2)
42 {
43 return a1.Artist_ == a2.Artist_ &&
44 a1.Album_ == a2.Album_;
45 }
46
49 inline size_t qHash (const AlbumInfo& info)
50 {
51 size_t seed = 0;
52 boost::hash_combine (seed, qHash (info.Album_));
53 boost::hash_combine (seed, qHash (info.Artist_));
54 return seed;
55 }
56
62 class Q_DECL_EXPORT IAlbumArtProvider
63 {
64 public:
65 virtual ~IAlbumArtProvider () {}
66
73
78 virtual QString GetAlbumArtProviderName () const = 0;
79
89 virtual QFuture<Result_t> RequestAlbumArt (const AlbumInfo& album) const = 0;
90 };
91}
92
94Q_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.
size_t qHash(const AlbumInfo &info)
A hash function for AlbumInfo to use it with QHash.
bool operator==(const AlbumInfo &a1, const AlbumInfo &a2)
Compares two AlbumInfo structures.
Information about an album used in IAlbumArtProvider.
QString Artist_
The artist name of this album.
QString Album_
The album name.
Q_DECLARE_METATYPE(QVariantList *)