LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
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 <QMetaType>
15
#include <QtPlugin>
16
#include <
util/threads/coro/channel.h
>
17
#include <
util/sll/either.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
40
bool
operator==
(
const
AlbumInfo
&)
const
=
default
;
41
};
42
45
inline
size_t
qHash
(
const
AlbumInfo
& info)
46
{
47
return
qHash
(std::pair { info.
Album_
, info.
Artist_
});
48
}
49
55
class
Q_DECL_EXPORT
IAlbumArtProvider
56
{
57
protected
:
58
virtual
~
IAlbumArtProvider
() =
default
;
59
public
:
60
struct
AlbumArtResponse
61
{
64
QString
ServiceName_
;
65
66
using
Result_t
=
LC::Util::Either<QString, QList<QUrl>
>;
67
73
Result_t
Result_
;
74
};
75
76
using
Channel_t
=
LC::Util::Channel_ptr<AlbumArtResponse>
;
77
87
[[nodiscard]]
88
virtual
Channel_t
RequestAlbumArt (
const
AlbumInfo
& album)
const
= 0;
89
};
90
}
91
92
Q_DECLARE_METATYPE
(
Media::AlbumInfo
)
93
Q_DECLARE_INTERFACE (
Media::IAlbumArtProvider
,
"org.LeechCraft.Media.IAlbumArtProvider/1.0"
)
Media::qHash
size_t qHash(const AlbumInfo &info)
A hash function for AlbumInfo to use it with QHash.
Definition:
ialbumartprovider.h:45
Media::IAlbumArtProvider::AlbumArtResponse::ServiceName_
QString ServiceName_
The human-readable name of the service, like "Last.FM".
Definition:
ialbumartprovider.h:64
Media::IAlbumArtProvider::AlbumArtResponse
Definition:
ialbumartprovider.h:60
either.h
Media::IAlbumArtProvider::AlbumArtResponse::Result_
Result_t Result_
The result of an album art search query.
Definition:
ialbumartprovider.h:73
LC::Util::Channel_ptr
std::shared_ptr< Channel< T > > Channel_ptr
Definition:
channelfwd.h:19
channel.h
Media::AlbumInfo
Information about an album used in IAlbumArtProvider.
Definition:
ialbumartprovider.h:28
Media::AlbumInfo::Album_
QString Album_
The album name.
Definition:
ialbumartprovider.h:36
Media::IAlbumArtProvider
Interface for plugins that can search for album art.
Definition:
ialbumartprovider.h:55
Media
Definition:
audiostructs.h:16
QFuture
Definition:
idownload.h:17
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QVariantList *)
LC::Util::Either< QString, QList< QUrl > >
Media::AlbumInfo::operator==
bool operator==(const AlbumInfo &) const =default
Compares two AlbumInfo structures.
Media::IAlbumArtProvider::Channel_t
LC::Util::Channel_ptr< AlbumArtResponse > Channel_t
Definition:
ialbumartprovider.h:76
Media::AlbumInfo::Artist_
QString Artist_
The artist name of this album.
Definition:
ialbumartprovider.h:32
src
interfaces
media
ialbumartprovider.h
Generated by
1.8.14