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 void sigServersChanged();
45
46 public:
47 Lyrics(const std::shared_ptr<Tagging::TagReader>& tagReader,
48 const std::shared_ptr<Tagging::TagWriter>& tagWriter,
49 const QString& lyricConfigurationFile,
50 QObject* parent = nullptr);
51 ~Lyrics() override;
52
53 [[nodiscard]] QStringList servers() const;
54 void setMetadata(const MetaData& track);
55 bool fetchLyrics(const QString& artist, const QString& title, int serverIndex);
56 bool saveLyrics(const QString& plainText);
57
58 [[nodiscard]] QString artist() const;
59 [[nodiscard]] QString title() const;
60 [[nodiscard]] QString lyricHeader() const;
61 [[nodiscard]] QString localLyricHeader() const;
62 [[nodiscard]] QString lyrics() const;
63 [[nodiscard]] QString localLyrics() const;
64
65 [[nodiscard]]bool isLyricTagAvailable() const;
66 [[nodiscard]]bool isLyricTagSupported() const;
67
68 private slots:
69 void lyricsFetched();
70 void refreshServerList();
71 };
72}
73
74#endif // LYRICS_H
Definition Lyrics.h:38
Definition MetaData.h:43
The GUI_TagEdit class.
Definition Engine.h:33