Sayonara Player
Loading...
Searching...
No Matches
Lyrics.h
1/* Lyrics.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 LYRICS_H
22#define LYRICS_H
23
24#include "Utils/Pimpl.h"
25
26#include <QObject>
27
28namespace Tagging
29{
30 class TagReader;
31 class TagWriter;
32}
33
34namespace Lyrics
35{
36 class Lyrics :
37 public QObject
38 {
39 Q_OBJECT
40 PIMPL(Lyrics)
41
42 signals:
43 void sigLyricsFetched();
44
45 public:
46 Lyrics(const std::shared_ptr<Tagging::TagReader>& tagReader,
47 const std::shared_ptr<Tagging::TagWriter>& tagWriter,
48 QObject* parent = nullptr);
49 ~Lyrics() override;
50
51 [[nodiscard]] QStringList servers() const;
52 void setMetadata(const MetaData& track);
53 bool fetchLyrics(const QString& artist, const QString& title, int serverIndex);
54 bool saveLyrics(const QString& plainText);
55
56 [[nodiscard]] QString artist() const;
57 [[nodiscard]] QString title() const;
58 [[nodiscard]] QString lyricHeader() const;
59 [[nodiscard]] QString localLyricHeader() const;
60 [[nodiscard]] QString lyrics() const;
61 [[nodiscard]] QString localLyrics() const;
62
63 [[nodiscard]]bool isLyricTagAvailable() const;
64 [[nodiscard]]bool isLyricTagSupported() const;
65
66 private slots:
67 void lyricsFetched();
68 };
69}
70
71#endif // LYRICS_H
Definition Lyrics.h:38
The MetaData class.
Definition MetaData.h:47
The GUI_TagEdit class.
Definition Engine.h:33