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
19
class
QUrl;
20
21
template
<
typename
>
22
class
QFuture
;
23
24
namespace
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
72
using
Result_t
=
LC::Util::Either<QString, QList<QUrl>
>;
73
78
virtual
QString
GetAlbumArtProviderName
()
const
= 0;
79
89
virtual
QFuture<Result_t>
RequestAlbumArt
(
const
AlbumInfo
& album)
const
= 0;
90
};
91
}
92
93
Q_DECLARE_METATYPE
(
Media::AlbumInfo
)
94
Q_DECLARE_INTERFACE (
Media::IAlbumArtProvider
,
"org.LeechCraft.Media.IAlbumArtProvider/1.0"
)
LC::Util::Either
Definition:
either.h:22
Media::IAlbumArtProvider
Interface for plugins that can search for album art.
Definition:
ialbumartprovider.h:63
Media::IAlbumArtProvider::~IAlbumArtProvider
virtual ~IAlbumArtProvider()
Definition:
ialbumartprovider.h:65
Media::IAlbumArtProvider::RequestAlbumArt
virtual QFuture< Result_t > RequestAlbumArt(const AlbumInfo &album) const =0
Initiates search for album art of the given album.
Media::IAlbumArtProvider::GetAlbumArtProviderName
virtual QString GetAlbumArtProviderName() const =0
Returns the human-readable name of this provider.
QFuture
Definition:
idownload.h:17
eitherfwd.h
Media
Definition:
audiostructs.h:17
Media::qHash
size_t qHash(const AlbumInfo &info)
A hash function for AlbumInfo to use it with QHash.
Definition:
ialbumartprovider.h:49
Media::operator==
bool operator==(const AlbumInfo &a1, const AlbumInfo &a2)
Compares two AlbumInfo structures.
Definition:
ialbumartprovider.h:41
Media::AlbumInfo
Information about an album used in IAlbumArtProvider.
Definition:
ialbumartprovider.h:29
Media::AlbumInfo::Artist_
QString Artist_
The artist name of this album.
Definition:
ialbumartprovider.h:32
Media::AlbumInfo::Album_
QString Album_
The album name.
Definition:
ialbumartprovider.h:36
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QVariantList *)
src
interfaces
media
ialbumartprovider.h
Generated by
1.9.6