Sayonara Player
Loading...
Searching...
No Matches
Station.h
1/* Station.h
2 *
3 * Copyright (C) 2011-2024 Michael Lugmair
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 ABSTRACTUTILSTREAM_H
22#define ABSTRACTUTILSTREAM_H
23
24#include "Utils/Pimpl.h"
25
26class QString;
27
28namespace Cover
29{
30 class Location;
31}
32
34{
35 public:
36 Station();
37 virtual ~Station();
38 Station(const Station& other);
39
40 Station& station(const Station& other);
41
42 [[nodiscard]] virtual QString url() const = 0;
43 [[nodiscard]] virtual QString name() const = 0;
44 [[nodiscard]] virtual QString userAgent() const = 0;
45};
46
47class Stream :
48 public Station
49{
50 PIMPL(Stream)
51
52 public:
53 Stream();
54 Stream(const QString& name, const QString& url, bool isUpdatable = true, const QString& userAgent = QString());
55 Stream(const Stream& other);
56 ~Stream() override;
57
58 Stream& operator=(const Stream& stream);
59
60 [[nodiscard]] QString name() const override;
61 void setName(const QString& name);
62
63 [[nodiscard]] QString url() const override;
64 void setUrl(const QString& url);
65
66 [[nodiscard]] bool isUpdatable() const;
67
68 [[nodiscard]] QString userAgent() const override;
69};
70
71class Podcast :
72 public Station
73{
74 PIMPL(Podcast)
75
76 public:
77 Podcast();
78 Podcast(const QString& name, const QString& url, bool reversed = false, const QString& userAgent = QString());
79 Podcast(const Podcast& other);
80
81 ~Podcast() override;
82
83 [[nodiscard]] QString name() const override;
84 void setName(const QString& name);
85
86 [[nodiscard]] QString url() const override;
87 void setUrl(const QString& url);
88
89 [[nodiscard]] bool reversed() const;
90 void setReversed(bool b);
91
92 [[nodiscard]] QString userAgent() const override;
93
94 Podcast& operator=(const Podcast& podcast);
95};
96
97using StationPtr = std::shared_ptr<Station>;
98
99#endif // ABSTRACTUTILSTREAM_H
Definition: Station.h:73
Definition: Station.h:34
Definition: Station.h:49