diff --git a/src/core/backgroundstreams.cpp b/src/core/backgroundstreams.cpp index f5ea3b1c5..c65c6ab36 100644 --- a/src/core/backgroundstreams.cpp +++ b/src/core/backgroundstreams.cpp @@ -10,6 +10,7 @@ const char* BackgroundStreams::kSettingsGroup = "BackgroundStreams"; const char* BackgroundStreams::kHypnotoadUrl = "hypnotoad:///"; const char* BackgroundStreams::kRainUrl = "http://data.clementine-player.org/rainymood"; +const char* BackgroundStreams::kEnterpriseUrl = "enterprise:///"; BackgroundStreams::BackgroundStreams(EngineBase* engine, QObject* parent) : QObject(parent), @@ -25,12 +26,14 @@ void BackgroundStreams::LoadStreams() { s.beginGroup(kSettingsGroup); int version = s.value("version", 0).toInt(); - if (version < kVersion) { - s.setValue("version", kVersion); + if (version < 1) { AddStream(QT_TR_NOOP("Hypnotoad"), QUrl(kHypnotoadUrl)); AddStream(QT_TR_NOOP("Rain"), QUrl(kRainUrl)); - SaveStreams(); - return; + } + + if (version < kVersion) { + s.setValue("version", kVersion); + AddStream(QT_TR_NOOP("Make it so!"), QUrl(kEnterpriseUrl)); } int size = s.beginReadArray("streams"); @@ -41,6 +44,8 @@ void BackgroundStreams::LoadStreams() { s.value("volume").toInt(), s.value("enabled").toBool()); } + + SaveStreams(); } void BackgroundStreams::SaveStreams() { diff --git a/src/core/backgroundstreams.h b/src/core/backgroundstreams.h index 8b96dceec..ed581f714 100644 --- a/src/core/backgroundstreams.h +++ b/src/core/backgroundstreams.h @@ -59,10 +59,11 @@ class BackgroundStreams : public QObject { QMap streams_; static const char* kSettingsGroup; - static const int kVersion = 1; + static const int kVersion = 2; static const char* kHypnotoadUrl; static const char* kRainUrl; + static const char* kEnterpriseUrl; }; #endif diff --git a/src/engines/gstengine.cpp b/src/engines/gstengine.cpp index 406d1b0c4..9d5eb8a7d 100644 --- a/src/engines/gstengine.cpp +++ b/src/engines/gstengine.cpp @@ -56,13 +56,16 @@ using boost::shared_ptr; const char* GstEngine::kSettingsGroup = "GstEngine"; const char* GstEngine::kAutoSink = "autoaudiosink"; -const char* GstEngine::kHypnotoadPipeline = +const char* GstEngine::kHypnotoadPipeline = "audiotestsrc wave=6 ! " "audioecho intensity=1 delay=50000000 ! " "audioecho intensity=1 delay=25000000 ! " "equalizer-10bands " "band0=-24 band1=-3 band2=7.5 band3=12 band4=8 " "band5=6 band6=5 band7=6 band8=0 band9=-24"; +const char* GstEngine::kEnterprisePipeline = + "audiotestsrc wave=5 ! " + "audiocheblimit mode=0 cutoff=120"; GstEngine::GstEngine() : Engine::Base(), @@ -700,6 +703,11 @@ shared_ptr GstEngine::CreatePipeline(const QUrl& url, return ret; } + if (url.scheme() == "enterprise") { + ret->InitFromString(kEnterprisePipeline); + return ret; + } + if (!ret->InitFromUrl(url, end_nanosec)) ret.reset(); diff --git a/src/engines/gstengine.h b/src/engines/gstengine.h index dd96c2590..69b0dd229 100644 --- a/src/engines/gstengine.h +++ b/src/engines/gstengine.h @@ -153,6 +153,7 @@ class GstEngine : public Engine::Base, public BufferConsumer { static const int kSeekDelayNanosec = 100 * kNsecPerMsec; // 100msec static const char* kHypnotoadPipeline; + static const char* kEnterprisePipeline; QFuture initialising_; diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 7adaa5e38..5b0e9b186 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -371,6 +371,7 @@ MainWindow::MainWindow( background_streams_->AddAction("Rain", ui_->action_rain); background_streams_->AddAction("Hypnotoad", ui_->action_hypnotoad); + background_streams_->AddAction("Make it so!", ui_->action_enterprise); // Playlist view actions ui_->action_next_playlist->setShortcuts(QList() diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 76e2e7514..5ddc606e0 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -474,6 +474,7 @@ + @@ -687,6 +688,14 @@ All Glory to the Hypnotoad! + + + true + + + Make it so! + + true