Sayonara Player
StreamDataSender.h
1 /* StreamDataSender.h */
2 
3 /* Copyright (C) 2011-2016 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 
22 #ifndef STREAMDATASENDER_H
23 #define STREAMDATASENDER_H
24 
25 #include <QTcpSocket>
26 
32 {
33 
34 private:
35  QTcpSocket* _socket=nullptr;
36  quint64 _sent_data_bytes;
37 
38  QByteArray _header;
39  QByteArray _icy_header;
40  QByteArray _reject_header;
41 
42  bool send_icy_metadata(const QString& stream_title);
43 
44 public:
45  StreamDataSender(QTcpSocket* socket);
47 
48  bool send_trash();
49  bool send_data(const uchar* data, quint64 size);
50  bool send_icy_data(const uchar* data, quint64 size, const QString& stream_title);
51  bool send_header(bool reject, bool icy);
52  bool send_html5(const QString& stream_title);
53  bool send_bg();
54  bool send_metadata(const QString& stream_title);
55  bool send_playlist(const QString& host, int port);
56  bool send_favicon();
57 
58 };
59 
60 #endif // STREAMDATASENDER_H
The StreamDataSender class. This class is used for sending the raw bytes.
Definition: StreamDataSender.h:31