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>
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:
61  {
64  QString ServiceName_;
65 
67 
74  };
75 
77 
87  [[nodiscard]]
88  virtual Channel_t RequestAlbumArt (const AlbumInfo& album) const = 0;
89  };
90 }
91 
93 Q_DECLARE_INTERFACE (Media::IAlbumArtProvider, "org.LeechCraft.Media.IAlbumArtProvider/1.0")
size_t qHash(const AlbumInfo &info)
A hash function for AlbumInfo to use it with QHash.
QString ServiceName_
The human-readable name of the service, like "Last.FM".
Result_t Result_
The result of an album art search query.
std::shared_ptr< Channel< T > > Channel_ptr
Definition: channelfwd.h:19
Information about an album used in IAlbumArtProvider.
QString Album_
The album name.
Interface for plugins that can search for album art.
Q_DECLARE_METATYPE(QVariantList *)
bool operator==(const AlbumInfo &) const =default
Compares two AlbumInfo structures.
LC::Util::Channel_ptr< AlbumArtResponse > Channel_t
QString Artist_
The artist name of this album.