Sayonara Player
StreamParser.h
1/* StreamParser.h */
2
3/* Copyright (C) 2011-2020 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 STREAMPARSER_H
22#define STREAMPARSER_H
23
24#include "Utils/Pimpl.h"
25#include <QObject>
26
28class IcyWebAccess;
30 public QObject
31{
32 Q_OBJECT
33 PIMPL(StreamParser)
34
35 signals:
36 void sigFinished(bool success);
37 void sigStopped();
38 void sigUrlCountExceeded(int urlCount, int maxUrlCount);
39
40 public:
41 explicit StreamParser(const std::shared_ptr<WebClientFactory>& webClientFactory, QObject* parent = nullptr);
42 ~StreamParser() override;
43
44 // NOLINTNEXTLINE(readability-magic-numbers)
45 void parse(const QString& stationName, const QString& stationUrl, int timeout = 5000);
46 void parse(const QStringList& urls, int timeout = 5000); // NOLINT(readability-magic-numbers)
47
48 void setCoverUrl(const QString& coverUrl);
49
50 void stop();
51 [[nodiscard]] bool isStopped() const;
52
53 [[nodiscard]] MetaDataList tracks() const;
54
55 private slots:
56 void webClientFinished();
57
58 private: // NOLINT(readability-redundant-access-specifiers)
59 bool parseNextUrl();
60 void icyFinished(const QString& url, IcyWebAccess* icyWebAccess);
61
62};
63
64#endif
Definition: IcyWebAccess.h:32
The MetaDataList class.
Definition: MetaDataList.h:39
Definition: StreamParser.h:31
Definition: WebClientFactory.h:28
QString coverUrl(const QMimeData *data)
cover_url