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>
17#include <util/sll/either.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
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:
75
77
87 [[nodiscard]]
88 virtual Channel_t RequestAlbumArt (const AlbumInfo& album) const = 0;
89 };
90}
91
93Q_DECLARE_INTERFACE (Media::IAlbumArtProvider, "org.LeechCraft.Media.IAlbumArtProvider/1.0")
Interface for plugins that can search for album art.
virtual Channel_t RequestAlbumArt(const AlbumInfo &album) const =0
Initiates search for album art of the given album.
virtual ~IAlbumArtProvider()=default
LC::Util::Channel_ptr< AlbumArtResponse > Channel_t
std::shared_ptr< Channel< T > > Channel_ptr
Definition channelfwd.h:19
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.
LC::Util::Either< QString, QList< QUrl > > Result_t
Result_t Result_
The result of an album art search query.
QString ServiceName_
The human-readable name of the service, like "Last.FM".
Q_DECLARE_METATYPE(QVariantList *)