Browse Source

rm unused

master
Robin Thoni 9 years ago
parent
commit
6de692f7fa
2 changed files with 3 additions and 17 deletions
  1. 3
    15
      radio.cpp
  2. 0
    2
      radio.h

+ 3
- 15
radio.cpp View File

14
     songTimer->setSingleShot(true);
14
     songTimer->setSingleShot(true);
15
     connect(songTimer, SIGNAL(timeout()), this, SLOT(songEnded()));
15
     connect(songTimer, SIGNAL(timeout()), this, SLOT(songEnded()));
16
     player = new QMediaPlayer(this);
16
     player = new QMediaPlayer(this);
17
-    player->setVolume(50);
17
+    player->setVolume(100);
18
 }
18
 }
19
 
19
 
20
 QString Radio::getName()
20
 QString Radio::getName()
121
 {
121
 {
122
     songsTries = 0;
122
     songsTries = 0;
123
     QUrl url = apiBase;
123
     QUrl url = apiBase;
124
-    QUrlQuery query;
124
+    QUrlQuery query(url.query());
125
     query.addQueryItem("act", "get_plist");
125
     query.addQueryItem("act", "get_plist");
126
     query.addQueryItem("id_wr", QString::number(id));
126
     query.addQueryItem("id_wr", QString::number(id));
127
     url.setQuery(query);
127
     url.setQuery(query);
175
 
175
 
176
 void Radio::songsFinished()
176
 void Radio::songsFinished()
177
 {
177
 {
178
+    qDeleteAll(nextSongs);
178
     QNetworkReply* reply = (QNetworkReply*)sender();
179
     QNetworkReply* reply = (QNetworkReply*)sender();
179
     YAML::Node itms = YAML::Load(reply->readAll().constData())["itms"];
180
     YAML::Node itms = YAML::Load(reply->readAll().constData())["itms"];
180
-    qDeleteAll(nextSongs);
181
     for(unsigned i = 1;i < itms.size(); ++i)
181
     for(unsigned i = 1;i < itms.size(); ++i)
182
     {
182
     {
183
         YAML::Node itm = itms[i];
183
         YAML::Node itm = itms[i];
203
     }
203
     }
204
 }
204
 }
205
 
205
 
206
-/*void Radio::streamRead()
207
-{
208
-    if(stream->header(QNetworkRequest::LocationHeader).toUrl().isEmpty())
209
-        emit streamData(stream->readAll());
210
-    else
211
-    {
212
-        streamUrl = stream->header(QNetworkRequest::LocationHeader).toUrl();
213
-        stopStream();
214
-        startStream();
215
-    }
216
-}*/
217
-
218
 void Radio::streamError()
206
 void Radio::streamError()
219
 {
207
 {
220
     if(streamTries < 3)
208
     if(streamTries < 3)

+ 0
- 2
radio.h View File

50
     void startStream();
50
     void startStream();
51
     void stopStream();
51
     void stopStream();
52
 
52
 
53
-public slots:
54
     void setNetworkManager(QNetworkAccessManager* m);
53
     void setNetworkManager(QNetworkAccessManager* m);
55
 
54
 
56
 private slots:
55
 private slots:
60
     void songsFinished();
59
     void songsFinished();
61
     void songsError(QNetworkReply::NetworkError);
60
     void songsError(QNetworkReply::NetworkError);
62
 
61
 
63
-    //void streamRead();
64
     void streamError();
62
     void streamError();
65
 
63
 
66
     void songEnded();
64
     void songEnded();

Loading…
Cancel
Save