Sayonara Player
StreamParser.h
1 /* StreamParser.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 STREAMPARSER_H
23 #define STREAMPARSER_H
24 
25 #include <QObject>
26 #include <QString>
27 #include <QStringList>
28 #include "Helper/MetaData/MetaDataList.h"
29 
30 class StreamParser : public QObject
31 {
32  Q_OBJECT
33 
34  signals:
35  void sig_finished(bool);
36 
37  public:
38  StreamParser(const QString& station_name=QString(), QObject* parent=nullptr);
39 
40  void parse_stream(const QString& url);
41  MetaDataList get_metadata() const;
42 
43  private slots:
44  void awa_finished(bool success);
45 
46 
47  private:
48  QString _url;
49  QStringList _stream_buffer;
50  QString _station_name;
51  MetaDataList _v_md;
52 
53  private:
59  QStringList search_for_playlist_files(const QByteArray& data) const;
60 
66  QString write_playlist_file(const QByteArray& data) const;
67 
68 
79  MetaDataList parse_content(const QByteArray& data);
80 
86  void tag_metadata(MetaData& md, const QString& stream_url) const;
87 
88 };
89 
90 #endif
Definition: StreamParser.h:30
Definition: MetaData.h:49
Definition: MetaDataList.h:46