|
@@ -14,7 +14,7 @@ Radio::Radio(QObject *parent) : QObject(parent), logo(0, 0)
|
14
|
14
|
songTimer->setSingleShot(true);
|
15
|
15
|
connect(songTimer, SIGNAL(timeout()), this, SLOT(songEnded()));
|
16
|
16
|
player = new QMediaPlayer(this);
|
17
|
|
- player->setVolume(50);
|
|
17
|
+ player->setVolume(100);
|
18
|
18
|
}
|
19
|
19
|
|
20
|
20
|
QString Radio::getName()
|
|
@@ -121,7 +121,7 @@ void Radio::updateNextSongs()
|
121
|
121
|
{
|
122
|
122
|
songsTries = 0;
|
123
|
123
|
QUrl url = apiBase;
|
124
|
|
- QUrlQuery query;
|
|
124
|
+ QUrlQuery query(url.query());
|
125
|
125
|
query.addQueryItem("act", "get_plist");
|
126
|
126
|
query.addQueryItem("id_wr", QString::number(id));
|
127
|
127
|
url.setQuery(query);
|
|
@@ -175,9 +175,9 @@ void Radio::logoError(QNetworkReply::NetworkError)
|
175
|
175
|
|
176
|
176
|
void Radio::songsFinished()
|
177
|
177
|
{
|
|
178
|
+ qDeleteAll(nextSongs);
|
178
|
179
|
QNetworkReply* reply = (QNetworkReply*)sender();
|
179
|
180
|
YAML::Node itms = YAML::Load(reply->readAll().constData())["itms"];
|
180
|
|
- qDeleteAll(nextSongs);
|
181
|
181
|
for(unsigned i = 1;i < itms.size(); ++i)
|
182
|
182
|
{
|
183
|
183
|
YAML::Node itm = itms[i];
|
|
@@ -203,18 +203,6 @@ void Radio::songsError(QNetworkReply::NetworkError)
|
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
|
206
|
void Radio::streamError()
|
219
|
207
|
{
|
220
|
208
|
if(streamTries < 3)
|