Sayonara Player
Loading...
Searching...
No Matches
ArtistMatch.h
1/* ArtistMatch.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef ARTISTMATCH_H
22#define ARTISTMATCH_H
23
24#include "Utils/Pimpl.h"
25
26#include <QList>
27#include <QString>
28
29namespace DynamicPlayback
30{
31 class ArtistMatch
32 {
33 PIMPL(ArtistMatch)
34
35 public:
36 struct Entry
37 {
38 QString artist;
39 QString mbid;
40 double similarity {-1.0};
41
42 Entry() = default;
43 Entry(QString artist, QString mbid, double similarity);
44
45 [[nodiscard]] bool isValid() const;
46
47 [[nodiscard]] bool operator==(const Entry& other) const;
48 };
49
50 enum class Quality :
51 uint8_t
52 {
53 Poor = 0,
54 Good,
55 VeryGood,
56 Excellent
57 };
58
60 explicit ArtistMatch(const QString& artistName);
61 ArtistMatch(const ArtistMatch& other);
62
63 virtual ~ArtistMatch();
64
65 [[nodiscard]] bool isValid() const;
66
67 [[nodiscard]] bool operator==(const ArtistMatch& artistMatch) const;
68 ArtistMatch& operator=(const ArtistMatch& other);
69
70 void add(const Entry& entry);
71
72 [[nodiscard]] QList<Entry> get(Quality q) const;
73
74 [[nodiscard]] QString artistName() const;
75
76 [[nodiscard]] QString toString() const;
77
78 static ArtistMatch fromString(const QString& data);
79 };
80}
81
82#endif // ARTISTMATCH_H
Definition ArtistMatch.h:32
Definition EngineUtils.h:33