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{
32 {
33 PIMPL(ArtistMatch)
34
35 public:
36
37 struct Entry
38 {
39 QString artist;
40 QString mbid;
41 double similarity {-1.0};
42
43 Entry() = default;
44 Entry(const QString& artist, const QString& mbid, double similarity);
45
46 bool isValid() const;
47
48 bool operator==(const Entry& other) const;
49 };
50
54 enum class Quality :
55 uint8_t
56 {
57 Poor = 0,
58 Good,
59 VeryGood,
60 Excellent
61 };
62
64 explicit ArtistMatch(const QString& artist_name);
65 ArtistMatch(const ArtistMatch& other);
66
67 virtual ~ArtistMatch();
68
73 bool isValid() const;
74
80 bool operator==(const ArtistMatch& am) const;
81 ArtistMatch& operator=(const ArtistMatch& other);
82
88 void add(const Entry& entry);
89
96
101 QString artistName() const;
102
107 QString toString() const;
108
109 static ArtistMatch fromString(const QString& data);
110 };
111}
112
113#endif // ARTISTMATCH_H
Definition ArtistMatch.h:32
Quality
The Quality enum used to access the bin of interest. See ArtistMatch::get(Quality q)
Definition ArtistMatch.h:56
QString toString() const
converts the artist match to string
bool isValid() const
checks, if structure is valid.
QList< Entry > get(Quality q) const
get bin by quality
void add(const Entry &entry)
adds an artist string to the corresponding bin
bool operator==(const ArtistMatch &am) const
Compares two ArtistMatch structures.
QString artistName() const
get the corresponding artist name of the ArtistMatch structure
Definition EngineUtils.h:33
Definition ArtistMatch.h:38