LeechCraft
0.6.70-18450-gabe19ee3b0
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 <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"
)
channel.h
LC::Util::Either
Definition
either.h:33
Media::IAlbumArtProvider
Interface for plugins that can search for album art.
Definition
ialbumartprovider.h:56
Media::IAlbumArtProvider::RequestAlbumArt
virtual Channel_t RequestAlbumArt(const AlbumInfo &album) const =0
Initiates search for album art of the given album.
Media::IAlbumArtProvider::~IAlbumArtProvider
virtual ~IAlbumArtProvider()=default
Media::IAlbumArtProvider::Channel_t
LC::Util::Channel_ptr< AlbumArtResponse > Channel_t
Definition
ialbumartprovider.h:76
QFuture
Definition
idownload.h:17
LC::Util::Channel_ptr
std::shared_ptr< Channel< T > > Channel_ptr
Definition
channelfwd.h:19
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:45
either.h
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::operator==
bool operator==(const AlbumInfo &) const =default
Compares two AlbumInfo structures.
Media::AlbumInfo::Album_
QString Album_
The album name.
Definition
ialbumartprovider.h:36
Media::IAlbumArtProvider::AlbumArtResponse
Definition
ialbumartprovider.h:61
Media::IAlbumArtProvider::AlbumArtResponse::Result_t
LC::Util::Either< QString, QList< QUrl > > Result_t
Definition
ialbumartprovider.h:66
Media::IAlbumArtProvider::AlbumArtResponse::Result_
Result_t Result_
The result of an album art search query.
Definition
ialbumartprovider.h:73
Media::IAlbumArtProvider::AlbumArtResponse::ServiceName_
QString ServiceName_
The human-readable name of the service, like "Last.FM".
Definition
ialbumartprovider.h:64
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QVariantList *)
src
interfaces
media
ialbumartprovider.h
Generated by
1.16.1