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 final;
44 [[nodiscard]] virtual QString actualName() const = 0;
45 [[nodiscard]] virtual QString userAgent() const = 0;
46 [[nodiscard]] virtual bool isAnonymous() const;
47};
48
49class Stream :
50 public Station
51{
52 PIMPL(Stream)
53
54 public:
55 Stream();
56 Stream(const QString& name, const QString& url, bool isUpdatable = true, const QString& userAgent = QString());
57 Stream(const Stream& other);
58 ~Stream() override;
59
60 Stream& operator=(const Stream& stream);
61
62 [[nodiscard]] QString actualName() const override;
63 void setName(const QString& name);
64
65 [[nodiscard]] QString url() const override;
66 void setUrl(const QString& url);
67
68 [[nodiscard]] bool isUpdatable() const;
69
70 [[nodiscard]] QString userAgent() const override;
71};
72
73class Podcast :
74 public Station
75{
76 PIMPL(Podcast)
77
78 public:
79 Podcast();
80 Podcast(const QString& name, const QString& url, bool reversed = false, const QString& userAgent = QString());
81 Podcast(const Podcast& other);
82
83 ~Podcast() override;
84
85 [[nodiscard]] QString actualName() const override;
86 void setName(const QString& name);
87
88 [[nodiscard]] QString url() const override;
89 void setUrl(const QString& url);
90
91 [[nodiscard]] bool reversed() const;
92 void setReversed(bool b);
93
94 [[nodiscard]] QString userAgent() const override;
95
96 Podcast& operator=(const Podcast& podcast);
97};
98
99using StationPtr = std::shared_ptr<Station>;
100
101#endif // ABSTRACTUTILSTREAM_H
Definition Station.h:75
Definition Station.h:34
Definition Station.h:51