mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-17 20:09:50 +01:00
Never start playing a background stream on startup, even if it was enabled last time.
This commit is contained in:
parent
73517ea475
commit
fe964b9457
@ -41,8 +41,7 @@ void BackgroundStreams::LoadStreams() {
|
||||
s.setArrayIndex(i);
|
||||
AddStream(s.value("name").toString(),
|
||||
s.value("url").toUrl(),
|
||||
s.value("volume").toInt(),
|
||||
s.value("enabled").toBool());
|
||||
s.value("volume").toInt());
|
||||
}
|
||||
|
||||
SaveStreams();
|
||||
@ -60,24 +59,23 @@ void BackgroundStreams::SaveStreams() {
|
||||
s.setValue("name", stream->name);
|
||||
s.setValue("url", stream->url);
|
||||
s.setValue("volume", stream->volume);
|
||||
s.setValue("enabled", stream->id != -1);
|
||||
}
|
||||
s.endArray();
|
||||
}
|
||||
|
||||
void BackgroundStreams::AddStream(const QString& name,
|
||||
const QUrl& url,
|
||||
int volume,
|
||||
bool enabled) {
|
||||
int volume) {
|
||||
if (streams_.contains(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Stream* s = new Stream;
|
||||
s->name = name;
|
||||
s->url = url;
|
||||
s->volume = volume;
|
||||
s->id = -1;
|
||||
streams_[name] = s;
|
||||
if (enabled) {
|
||||
PlayStream(s);
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundStreams::EnableStream(const QString& name, bool enable) {
|
||||
|
@ -49,8 +49,7 @@ class BackgroundStreams : public QObject {
|
||||
QAction* action;
|
||||
};
|
||||
|
||||
void AddStream(
|
||||
const QString& name, const QUrl& url, int volume = 50, bool enabled = false);
|
||||
void AddStream(const QString& name, const QUrl& url, int volume = 50);
|
||||
void PlayStream(Stream* stream);
|
||||
void StopStream(Stream* stream);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user