Sayonara Player
Loading...
Searching...
No Matches
src
Utils
Parser
StreamParser.h
1
/* StreamParser.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 STREAMPARSER_H
22
#define STREAMPARSER_H
23
24
#include "Utils/Pimpl.h"
25
#include <QObject>
26
27
class
WebClientFactory
;
28
class
IcyWebAccess
;
29
class
StreamParser
:
30
public
QObject
31
{
32
Q_OBJECT
33
34
signals:
35
void
sigFinished(
bool
success);
36
void
sigStopped();
37
void
sigUrlCountExceeded(
int
urlCount,
int
maxUrlCount);
38
39
public
:
40
explicit
StreamParser
(QObject* parent);
41
~StreamParser
()
override
;
42
43
void
parse(
const
QString& name,
const
QStringList& urls);
44
void
parse(
const
QString& name,
const
QStringList& urls,
const
QString& userAgent);
45
virtual
void
parse(
const
QString& name,
const
QStringList& urls,
const
QString& userAgent,
int
timeout) = 0;
46
virtual
void
stopParsing() = 0;
47
[[nodiscard]]
virtual
MetaDataList
tracks()
const
= 0;
48
[[nodiscard]]
virtual
bool
isStopped()
const
= 0;
49
virtual
void
setCoverUrl(
const
QString& coverUrl) = 0;
50
};
51
52
class
StationParserFactory
53
{
54
public
:
55
virtual
~StationParserFactory
() =
default
;
56
[[nodiscard]]
virtual
StreamParser
* createParser()
const
= 0;
57
58
static
std::shared_ptr<StationParserFactory>
59
createStationParserFactory(
const
std::shared_ptr<WebClientFactory>& webClientFactory, QObject* parent);
60
};
61
62
using
StationParserFactoryPtr = std::shared_ptr<StationParserFactory>;
63
64
#endif
IcyWebAccess
Definition
IcyWebAccess.h:32
MetaDataList
Definition
MetaDataList.h:34
StationParserFactory
Definition
StreamParser.h:53
StreamParser
Definition
StreamParser.h:31
WebClientFactory
Definition
WebClientFactory.h:29
Generated on Fri Apr 25 2025 00:00:00 for Sayonara Player by
1.10.0