Refactor background streams.
Add volume control for background streams and infrastructure for custom streams.
This commit is contained in:
parent
880909104e
commit
c625acfd87
|
@ -40,6 +40,7 @@ set(SOURCES
|
|||
|
||||
core/albumcoverfetcher.cpp
|
||||
core/albumcoverloader.cpp
|
||||
core/backgroundstreams.cpp
|
||||
core/backgroundthread.cpp
|
||||
core/commandlineoptions.cpp
|
||||
core/database.cpp
|
||||
|
@ -231,6 +232,7 @@ set(HEADERS
|
|||
|
||||
core/albumcoverfetcher.h
|
||||
core/albumcoverloader.h
|
||||
core/backgroundstreams.h
|
||||
core/backgroundthread.h
|
||||
core/database.h
|
||||
core/deletefiles.h
|
||||
|
|
|
@ -0,0 +1,130 @@
|
|||
#include "backgroundstreams.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "engines/enginebase.h"
|
||||
|
||||
const char* BackgroundStreams::kSettingsGroup = "BackgroundStreams";
|
||||
const char* BackgroundStreams::kHypnotoadUrl = "hypnotoad:///";
|
||||
const char* BackgroundStreams::kRainUrl = "http://data.clementine-player.org/rainymood";
|
||||
|
||||
BackgroundStreams::BackgroundStreams(EngineBase* engine, QObject* parent)
|
||||
: QObject(parent),
|
||||
engine_(engine) {
|
||||
}
|
||||
|
||||
BackgroundStreams::~BackgroundStreams() {
|
||||
SaveStreams();
|
||||
}
|
||||
|
||||
void BackgroundStreams::LoadStreams() {
|
||||
QSettings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
|
||||
int version = s.value("version", 0).toInt();
|
||||
if (version < kVersion) {
|
||||
s.setValue("version", kVersion);
|
||||
// TODO: Make these robust against translations.
|
||||
AddStream(tr("Hypnotoad"), QUrl(kHypnotoadUrl));
|
||||
AddStream(tr("Rain"), QUrl(kRainUrl));
|
||||
SaveStreams();
|
||||
return;
|
||||
}
|
||||
|
||||
int size = s.beginReadArray("streams");
|
||||
for (int i = 0; i < size; ++i) {
|
||||
s.setArrayIndex(i);
|
||||
AddStream(s.value("name").toString(),
|
||||
s.value("url").toUrl(),
|
||||
s.value("volume").toInt(),
|
||||
s.value("enabled").toBool());
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundStreams::SaveStreams() {
|
||||
QSettings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
|
||||
QList<Stream*> values = streams_.values();
|
||||
s.beginWriteArray("streams");
|
||||
for (int i = 0; i < values.size(); ++i) {
|
||||
s.setArrayIndex(i);
|
||||
Stream* stream = values[i];
|
||||
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) {
|
||||
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) {
|
||||
Stream* stream = streams_[name];
|
||||
if (enable == (stream->id != -1)) {
|
||||
return;
|
||||
}
|
||||
if (enable) {
|
||||
PlayStream(stream);
|
||||
} else {
|
||||
StopStream(stream);
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundStreams::SetStreamVolume(const QString& name, int volume) {
|
||||
Stream* stream = streams_[name];
|
||||
stream->volume = volume;
|
||||
if (stream->id != -1) {
|
||||
engine_->SetBackgroundStreamVolume(stream->id, stream->volume);
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundStreams::PlayStream(Stream* stream) {
|
||||
stream->id = engine_->AddBackgroundStream(stream->url);
|
||||
engine_->SetBackgroundStreamVolume(stream->id, stream->volume);
|
||||
emit StreamStarted(stream->name);
|
||||
}
|
||||
|
||||
void BackgroundStreams::StopStream(Stream* stream) {
|
||||
engine_->StopBackgroundStream(stream->id);
|
||||
stream->id = -1;
|
||||
emit StreamStopped(stream->name);
|
||||
}
|
||||
|
||||
int BackgroundStreams::GetStreamVolume(const QString& name) {
|
||||
return streams_[name]->volume;
|
||||
}
|
||||
|
||||
bool BackgroundStreams::IsPlaying(const QString& name) {
|
||||
return streams_[name]->id != -1;
|
||||
}
|
||||
|
||||
void BackgroundStreams::MakeItRain(bool enable) {
|
||||
if (!streams_.contains(tr("Rain"))) {
|
||||
AddStream(tr("Rain"), QUrl(kRainUrl));
|
||||
}
|
||||
EnableStream(tr("Rain"), enable);
|
||||
}
|
||||
|
||||
void BackgroundStreams::AllGloryToTheHypnotoad(bool enable) {
|
||||
if (!streams_.contains(tr("Hypnotoad"))) {
|
||||
AddStream(tr("Hypnotoad"), QUrl(kHypnotoadUrl));
|
||||
}
|
||||
EnableStream(tr("Hypnotoad"), enable);
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
#ifndef BACKGROUNDSTREAMS_H
|
||||
#define BACKGROUNDSTREAMS_H
|
||||
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
|
||||
#include "engines/engine_fwd.h"
|
||||
|
||||
class BackgroundStreams : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BackgroundStreams(EngineBase* engine, QObject* parent = 0);
|
||||
~BackgroundStreams();
|
||||
|
||||
void LoadStreams();
|
||||
void SaveStreams();
|
||||
|
||||
QList<QString> streams() const { return streams_.keys(); }
|
||||
|
||||
void EnableStream(const QString& name, bool enable);
|
||||
void SetStreamVolume(const QString& name, int volume);
|
||||
|
||||
int GetStreamVolume(const QString& name);
|
||||
bool IsPlaying(const QString& name);
|
||||
|
||||
public slots:
|
||||
void MakeItRain(bool enable);
|
||||
void AllGloryToTheHypnotoad(bool enable);
|
||||
|
||||
signals:
|
||||
void StreamStarted(const QString& name);
|
||||
void StreamStopped(const QString& name);
|
||||
|
||||
private:
|
||||
struct Stream {
|
||||
QString name;
|
||||
QUrl url;
|
||||
int volume;
|
||||
int id;
|
||||
};
|
||||
|
||||
void AddStream(
|
||||
const QString& name, const QUrl& url, int volume = 50, bool enabled = false);
|
||||
void PlayStream(Stream* stream);
|
||||
void StopStream(Stream* stream);
|
||||
|
||||
EngineBase* engine_;
|
||||
|
||||
QMap<QString, Stream*> streams_;
|
||||
|
||||
static const char* kSettingsGroup;
|
||||
static const int kVersion = 1;
|
||||
|
||||
static const char* kHypnotoadUrl;
|
||||
static const char* kRainUrl;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -50,8 +50,6 @@
|
|||
|
||||
using boost::shared_ptr;
|
||||
|
||||
const char* Player::kRainUrl = "http://data.clementine-player.org/rainymood";
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
QDBusArgument& operator<< (QDBusArgument& arg, const DBusStatus& status) {
|
||||
arg.beginStructure();
|
||||
|
@ -83,8 +81,6 @@ Player::Player(MainWindow* main_window, PlaylistManager* playlists,
|
|||
lastfm_(lastfm),
|
||||
engine_(CreateEngine(engine)),
|
||||
stream_change_type_(Engine::First),
|
||||
rain_stream_(-1),
|
||||
toad_stream_(-1),
|
||||
volume_before_mute_(50)
|
||||
{
|
||||
#ifdef Q_WS_X11
|
||||
|
@ -560,25 +556,3 @@ void Player::TrackAboutToEnd() {
|
|||
engine_->StartPreloading(url);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::MakeItRain(bool rain) {
|
||||
const bool is_raining = rain_stream_ != -1;
|
||||
if (rain && !is_raining) {
|
||||
rain_stream_ = engine_->AddBackgroundStream(QUrl(kRainUrl));
|
||||
}
|
||||
if (!rain && is_raining) {
|
||||
engine_->StopBackgroundStream(rain_stream_);
|
||||
rain_stream_ = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void Player::AllHail(bool hypnotoad) {
|
||||
const bool is_hailing = toad_stream_ != -1;
|
||||
if (hypnotoad && !is_hailing) {
|
||||
toad_stream_ = engine_->AllGloryToTheHypnotoad();
|
||||
}
|
||||
if (!hypnotoad && is_hailing) {
|
||||
engine_->StopBackgroundStream(toad_stream_);
|
||||
toad_stream_ = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,9 +85,6 @@ class Player : public QObject {
|
|||
|
||||
void PlaylistChanged();
|
||||
|
||||
void MakeItRain(bool rain);
|
||||
void AllHail(bool hypnotoad);
|
||||
|
||||
// MPRIS /Player
|
||||
void Mute();
|
||||
void Pause();
|
||||
|
@ -148,12 +145,7 @@ class Player : public QObject {
|
|||
|
||||
QUrl loading_async_;
|
||||
|
||||
int rain_stream_;
|
||||
int toad_stream_;
|
||||
|
||||
int volume_before_mute_;
|
||||
|
||||
static const char* kRainUrl;
|
||||
};
|
||||
|
||||
#endif // PLAYER_H
|
||||
|
|
|
@ -54,7 +54,7 @@ class Base : public QObject, boost::noncopyable {
|
|||
|
||||
virtual int AddBackgroundStream(const QUrl& url);
|
||||
virtual void StopBackgroundStream(int id) {}
|
||||
virtual int AllGloryToTheHypnotoad() { return -1; }
|
||||
virtual void SetBackgroundStreamVolume(int id, int volume) {}
|
||||
|
||||
virtual State state() const = 0;
|
||||
virtual uint position() const = 0;
|
||||
|
|
|
@ -762,6 +762,12 @@ shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline() {
|
|||
|
||||
shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QUrl& url) {
|
||||
shared_ptr<GstEnginePipeline> ret = CreatePipeline();
|
||||
|
||||
if (url.scheme() == "hypnotoad") {
|
||||
ret->InitFromString(kHypnotoadPipeline);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!ret->InitFromUrl(url))
|
||||
ret.reset();
|
||||
|
||||
|
@ -877,12 +883,8 @@ void GstEngine::BackgroundStreamFinished() {
|
|||
pipeline->SetNextUrl(pipeline->url());
|
||||
}
|
||||
|
||||
int GstEngine::AllGloryToTheHypnotoad() {
|
||||
shared_ptr<GstEnginePipeline> pipeline = CreatePipeline();
|
||||
pipeline->InitFromString(kHypnotoadPipeline);
|
||||
if (!pipeline) {
|
||||
return -1;
|
||||
}
|
||||
pipeline->SetVolume(5); // Hypnotoad is *loud*.
|
||||
return AddBackgroundStream(pipeline);
|
||||
void GstEngine::SetBackgroundStreamVolume(int id, int volume) {
|
||||
shared_ptr<GstEnginePipeline> pipeline = background_streams_[id];
|
||||
Q_ASSERT(pipeline);
|
||||
pipeline->SetVolume(volume);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
|||
|
||||
int AddBackgroundStream(const QUrl& url);
|
||||
void StopBackgroundStream(int id);
|
||||
int AllGloryToTheHypnotoad();
|
||||
void SetBackgroundStreamVolume(int id, int volume);
|
||||
|
||||
uint position() const;
|
||||
uint length() const;
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Цвят на фона"
|
||||
|
||||
|
@ -1029,6 +1032,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Нямам регистрация в Magnatune"
|
||||
|
||||
|
|
|
@ -360,6 +360,9 @@ msgstr "Disponible"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Color de fons"
|
||||
|
||||
|
@ -1051,6 +1054,9 @@ msgstr "Alta (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Alta (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "No tinc cap compte a Magnatune"
|
||||
|
||||
|
|
|
@ -352,6 +352,9 @@ msgstr "K dispozici"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Barva pozadí"
|
||||
|
||||
|
@ -1030,6 +1033,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Nemám u Magnatune účet"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -352,6 +352,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Baggrundsfarve"
|
||||
|
||||
|
@ -1030,6 +1033,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -358,6 +358,9 @@ msgstr "Verfügbar"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Hintergrundfarbe"
|
||||
|
||||
|
@ -1052,6 +1055,9 @@ msgstr "Hoch (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Hoch (35fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Ich habe kein Magnatune-Konto"
|
||||
|
||||
|
|
|
@ -363,6 +363,9 @@ msgstr "Διαθέσιμα"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Χρώμα φόντου"
|
||||
|
||||
|
@ -1063,6 +1066,9 @@ msgstr "Υψηλή (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Υψηλά (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Δεν έχω λογαριασμό Magnatune"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Background colour"
|
||||
|
||||
|
@ -1030,6 +1033,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Background colour"
|
||||
|
||||
|
@ -1028,6 +1031,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -364,6 +364,9 @@ msgstr "Disponible"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Color de fondo"
|
||||
|
||||
|
@ -1060,6 +1063,9 @@ msgstr "Alta (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Alta (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "No tengo una cuenta en Magnatune"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr "Saadaolevad"
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Taustavärv"
|
||||
|
||||
|
@ -1028,6 +1031,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Mul pole Magnatune kontot"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Taustaväri"
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr "Korkea (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Korkea (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Minulla ei ole Magnatune-tunnusta"
|
||||
|
||||
|
|
|
@ -363,6 +363,9 @@ msgstr "Disponible"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Couleur de l'arrière-plan"
|
||||
|
||||
|
@ -1058,6 +1061,9 @@ msgstr "Élevé (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Élevé (35fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Je ne possède pas de compte Magnatune"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr "Dispoñíbel"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Cor de fondo"
|
||||
|
||||
|
@ -1031,6 +1034,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -359,6 +359,9 @@ msgstr "Elérhető"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Háttérszín"
|
||||
|
||||
|
@ -1055,6 +1058,9 @@ msgstr "Magas (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Gyors (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Nincs Magnatune fiókom"
|
||||
|
||||
|
|
|
@ -366,6 +366,9 @@ msgstr "Disponibile"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Colore di sfondo"
|
||||
|
||||
|
@ -1061,6 +1064,9 @@ msgstr "Alta (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Alta (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Non ho un account Magnatune"
|
||||
|
||||
|
|
|
@ -357,6 +357,9 @@ msgstr "空き"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "背景色"
|
||||
|
||||
|
@ -1048,6 +1051,9 @@ msgstr "高 (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "高 (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Magnatune アカウントがありません"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -354,6 +354,9 @@ msgstr "Tilgjengelig"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Bakgrunnsfarge"
|
||||
|
||||
|
@ -1039,6 +1042,9 @@ msgstr "Høy (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -359,6 +359,9 @@ msgstr "Beschikbaar"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Achtergrondkleur"
|
||||
|
||||
|
@ -1051,6 +1054,9 @@ msgstr "Hoog (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Hoog (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Ik heb geen Magnatune-account"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Color del rèire plan"
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -359,6 +359,9 @@ msgstr "Dostępny"
|
|||
msgid "BPM"
|
||||
msgstr "Uderzenia na minutę"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Kolor tła"
|
||||
|
||||
|
@ -1049,6 +1052,9 @@ msgstr "Wysoki (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Wysoki (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Nie posiadam konta w Magnatune"
|
||||
|
||||
|
|
|
@ -362,6 +362,9 @@ msgstr "Disponível"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Cor do fundo"
|
||||
|
||||
|
@ -1058,6 +1061,9 @@ msgstr "Alta (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Alta (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Não tenho uma conta Magnatune"
|
||||
|
||||
|
|
|
@ -356,6 +356,9 @@ msgstr "Disponível"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Cor de fundo"
|
||||
|
||||
|
@ -1040,6 +1043,9 @@ msgstr "Alta (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Alto (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Eu não tenho uma conta no Magnatune"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Culoare fundal"
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -354,6 +354,9 @@ msgstr "Доступно"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Цвет фона"
|
||||
|
||||
|
@ -1044,6 +1047,9 @@ msgstr "Высокое (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Высокая (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "У меня нет учётной записи Magnatune"
|
||||
|
||||
|
|
|
@ -359,6 +359,9 @@ msgstr "K dispozícii"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Farba pozadia"
|
||||
|
||||
|
@ -1049,6 +1052,9 @@ msgstr "Vysoká (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Vysoký (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Nemám Magnatune účet"
|
||||
|
||||
|
|
|
@ -358,6 +358,9 @@ msgstr "Na voljo"
|
|||
msgid "BPM"
|
||||
msgstr "udarcev/min"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Barva ozadja"
|
||||
|
||||
|
@ -1051,6 +1054,9 @@ msgstr "Visoka (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Visoko (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Nimam računa Magnatune"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "ОПМ"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Боја позадине"
|
||||
|
||||
|
@ -1030,6 +1033,9 @@ msgstr "Висока (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Немам налог на Мегатјуну"
|
||||
|
||||
|
|
|
@ -356,6 +356,9 @@ msgstr "Tillgängliga"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Bakgrundsfärg"
|
||||
|
||||
|
@ -1050,6 +1053,9 @@ msgstr "Hög (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Hög (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Jag har inte ett Magnatune-konto"
|
||||
|
||||
|
|
|
@ -355,6 +355,9 @@ msgstr "Mevcut"
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Arkaplan rengi"
|
||||
|
||||
|
@ -1045,6 +1048,9 @@ msgstr "Yüksek (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Yüksek (35 fps)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "Magnatune hesabım yok"
|
||||
|
||||
|
|
|
@ -341,6 +341,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1017,6 +1020,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -358,6 +358,9 @@ msgstr "Доступне"
|
|||
msgid "BPM"
|
||||
msgstr "Бітів за хвилину"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "Колір фону"
|
||||
|
||||
|
@ -1049,6 +1052,9 @@ msgstr "Висока (1024x1024)"
|
|||
msgid "High (35 fps)"
|
||||
msgstr "Висока (35 к/с)"
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "У мене немає облікового запису на Magnatune"
|
||||
|
||||
|
|
|
@ -351,6 +351,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr "BPM"
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "背景颜色"
|
||||
|
||||
|
@ -1027,6 +1030,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "我没有 Magnatune 帐号"
|
||||
|
||||
|
|
|
@ -355,6 +355,9 @@ msgstr ""
|
|||
msgid "BPM"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background Streams"
|
||||
msgstr ""
|
||||
|
||||
msgid "Background color"
|
||||
msgstr "背景顏色"
|
||||
|
||||
|
@ -1031,6 +1034,9 @@ msgstr ""
|
|||
msgid "High (35 fps)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Hypnotoad"
|
||||
msgstr ""
|
||||
|
||||
msgid "I don't have a Magnatune account"
|
||||
msgstr "我沒有 Magnatune 帳號"
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "core/backgroundstreams.h"
|
||||
#include "core/commandlineoptions.h"
|
||||
#include "core/database.h"
|
||||
#include "core/globalshortcuts.h"
|
||||
|
@ -202,6 +203,9 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent)
|
|||
|
||||
// Start initialising the player
|
||||
player_->Init();
|
||||
background_streams_ = new BackgroundStreams(player_->GetEngine(), this);
|
||||
background_streams_->LoadStreams();
|
||||
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
if (qobject_cast<GstEngine*>(player_->GetEngine()) == NULL) {
|
||||
|
@ -300,8 +304,10 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent)
|
|||
connect(ui_->action_transcode, SIGNAL(triggered()), SLOT(ShowTranscodeDialog()));
|
||||
connect(ui_->action_jump, SIGNAL(triggered()), ui_->playlist->view(), SLOT(JumpToCurrentlyPlayingTrack()));
|
||||
connect(ui_->action_update_library, SIGNAL(triggered()), library_, SLOT(IncrementalScan()));
|
||||
connect(ui_->action_rain, SIGNAL(toggled(bool)), player_, SLOT(MakeItRain(bool)));
|
||||
connect(ui_->action_hypnotoad, SIGNAL(toggled(bool)), player_, SLOT(AllHail(bool)));
|
||||
connect(ui_->action_rain, SIGNAL(toggled(bool)),
|
||||
background_streams_, SLOT(MakeItRain(bool)));
|
||||
connect(ui_->action_hypnotoad, SIGNAL(toggled(bool)),
|
||||
background_streams_, SLOT(AllGloryToTheHypnotoad(bool)));
|
||||
connect(ui_->action_queue_manager, SIGNAL(triggered()), SLOT(ShowQueueManager()));
|
||||
|
||||
// Give actions to buttons
|
||||
|
@ -471,7 +477,7 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent)
|
|||
connect(tray_icon_, SIGNAL(PlayPause()), player_, SLOT(PlayPause()));
|
||||
connect(tray_icon_, SIGNAL(ShowHide()), SLOT(ToggleShowHide()));
|
||||
connect(tray_icon_, SIGNAL(ChangeVolume(int)), SLOT(VolumeWheelEvent(int)));
|
||||
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
// Add check for updates item to application menu.
|
||||
QAction* check_updates = ui_->menuTools->addAction(tr("Check for updates..."));
|
||||
|
@ -1557,7 +1563,7 @@ void MainWindow::EnsureSettingsDialogCreated() {
|
|||
if (settings_dialog_)
|
||||
return;
|
||||
|
||||
settings_dialog_.reset(new SettingsDialog);
|
||||
settings_dialog_.reset(new SettingsDialog(background_streams_));
|
||||
settings_dialog_->SetLibraryDirectoryModel(library_->model()->directory_model());
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
|
|
|
@ -35,6 +35,7 @@ class About;
|
|||
class AddStreamDialog;
|
||||
class AlbumCoverManager;
|
||||
class ArtistInfoView;
|
||||
class BackgroundStreams;
|
||||
class CommandlineOptions;
|
||||
class Database;
|
||||
class DeviceManager;
|
||||
|
@ -272,6 +273,8 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||
|
||||
bool was_maximized_;
|
||||
bool autoclear_playlist_;
|
||||
|
||||
BackgroundStreams* background_streams_;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
@ -16,16 +16,18 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "core/backgroundstreams.h"
|
||||
#include "iconloader.h"
|
||||
#include "mainwindow.h"
|
||||
#include "settingsdialog.h"
|
||||
#include "ui_settingsdialog.h"
|
||||
#include "engines/enginebase.h"
|
||||
#include "playlist/playlistview.h"
|
||||
#include "songinfo/songinfotextview.h"
|
||||
#include "widgets/osd.h"
|
||||
#include "widgets/osdpretty.h"
|
||||
|
||||
#include "ui_settingsdialog.h"
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
#include "ui/wiimotedevshortcutsconfig.h"
|
||||
#include "ui_wiimotedevshortcutsconfig.h"
|
||||
|
@ -43,12 +45,57 @@
|
|||
|
||||
#include <QtDebug>
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget* parent)
|
||||
void SettingsDialog::AddStream(const QString& name) {
|
||||
QGroupBox* box = new QGroupBox(name, streams_page_);
|
||||
QSlider* slider = new QSlider(Qt::Horizontal, box);
|
||||
QCheckBox* check = new QCheckBox(box);
|
||||
QHBoxLayout* layout = new QHBoxLayout(box);
|
||||
layout->addWidget(slider);
|
||||
layout->addWidget(check);
|
||||
|
||||
streams_layout_->addWidget(box);
|
||||
|
||||
sliders_[slider] = name;
|
||||
checkboxes_[check] = name;
|
||||
|
||||
connect(slider, SIGNAL(valueChanged(int)), SLOT(StreamVolumeChanged(int)));
|
||||
connect(check, SIGNAL(stateChanged(int)), SLOT(EnableStream(int)));
|
||||
|
||||
slider->setValue(streams_->GetStreamVolume(name));
|
||||
check->setCheckState(streams_->IsPlaying(name) ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
void SettingsDialog::EnableStream(int state) {
|
||||
QCheckBox* check = qobject_cast<QCheckBox*>(sender());
|
||||
Q_ASSERT(check);
|
||||
const QString& name = checkboxes_[check];
|
||||
streams_->EnableStream(name, state == Qt::Checked ? true : false);
|
||||
}
|
||||
|
||||
void SettingsDialog::StreamVolumeChanged(int value) {
|
||||
QSlider* slider = qobject_cast<QSlider*>(sender());
|
||||
Q_ASSERT(slider);
|
||||
|
||||
const QString& name = sliders_[slider];
|
||||
streams_->SetStreamVolume(name, value);
|
||||
}
|
||||
|
||||
void SettingsDialog::AddStreams() {
|
||||
const QList<QString>& streams = streams_->streams();
|
||||
foreach (const QString& name, streams) {
|
||||
AddStream(name);
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent)
|
||||
: QDialog(parent),
|
||||
gst_engine_(NULL),
|
||||
ui_(new Ui_SettingsDialog),
|
||||
streams_page_(new QWidget(this)),
|
||||
streams_layout_(new QVBoxLayout(streams_page_)),
|
||||
loading_settings_(false),
|
||||
pretty_popup_(new OSDPretty(OSDPretty::Mode_Draggable))
|
||||
pretty_popup_(new OSDPretty(OSDPretty::Mode_Draggable)),
|
||||
streams_(streams)
|
||||
{
|
||||
ui_->setupUi(this);
|
||||
pretty_popup_->SetMessage(tr("OSD Preview"), tr("Drag to reposition"),
|
||||
|
@ -60,6 +107,14 @@ SettingsDialog::SettingsDialog(QWidget* parent)
|
|||
ui_->list->item(Page_GlobalShortcuts)->setIcon(IconLoader::Load("input-keyboard"));
|
||||
ui_->list->item(Page_Notifications)->setIcon(IconLoader::Load("help-hint"));
|
||||
ui_->list->item(Page_Library)->setIcon(IconLoader::Load("folder-sound"));
|
||||
ui_->list->item(Page_BackgroundStreams)->setIcon(IconLoader::Load("folder-sound"));
|
||||
|
||||
streams_page_->setObjectName(QString::fromUtf8("streams_page"));
|
||||
streams_layout_->setObjectName(QString::fromUtf8("streams_layout"));
|
||||
|
||||
AddStreams();
|
||||
streams_layout_->addStretch(1);
|
||||
ui_->stacked_widget->addWidget(streams_page_);
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
// Wiimotedev page
|
||||
|
@ -295,6 +350,8 @@ void SettingsDialog::accept() {
|
|||
ui_->magnatune->Save();
|
||||
ui_->global_shortcuts->Save();
|
||||
|
||||
streams_->SaveStreams();
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
|
||||
#include <QDialog>
|
||||
#include <QMap>
|
||||
#include <QUrl>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
class QBoxLayout;
|
||||
class QCheckBox;
|
||||
class QSlider;
|
||||
|
||||
class BackgroundStreams;
|
||||
class GlobalShortcuts;
|
||||
class LibraryDirectoryModel;
|
||||
class OSDPretty;
|
||||
|
@ -39,7 +45,7 @@ class SettingsDialog : public QDialog {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsDialog(QWidget* parent = 0);
|
||||
SettingsDialog(BackgroundStreams* streams, QWidget* parent = 0);
|
||||
~SettingsDialog();
|
||||
|
||||
enum Page {
|
||||
|
@ -51,6 +57,7 @@ class SettingsDialog : public QDialog {
|
|||
Page_Library,
|
||||
Page_Lastfm,
|
||||
Page_Magnatune,
|
||||
Page_BackgroundStreams,
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
Page_Wiimotedev,
|
||||
#endif
|
||||
|
@ -70,6 +77,11 @@ class SettingsDialog : public QDialog {
|
|||
void showEvent(QShowEvent* e);
|
||||
void hideEvent(QHideEvent *);
|
||||
|
||||
private:
|
||||
void AddStream(const QString& name);
|
||||
void AddStreams();
|
||||
void LoadStreams();
|
||||
|
||||
private slots:
|
||||
void CurrentTextChanged(const QString& text);
|
||||
void NotificationTypeChanged();
|
||||
|
@ -88,6 +100,10 @@ class SettingsDialog : public QDialog {
|
|||
|
||||
void SongInfoFontSizeChanged(double value);
|
||||
|
||||
// Background streams.
|
||||
void EnableStream(int state);
|
||||
void StreamVolumeChanged(int value);
|
||||
|
||||
private:
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
WiimotedevShortcutsConfig* wiimotedev_config_;
|
||||
|
@ -95,6 +111,8 @@ class SettingsDialog : public QDialog {
|
|||
const GstEngine* gst_engine_;
|
||||
|
||||
Ui_SettingsDialog* ui_;
|
||||
QWidget* streams_page_;
|
||||
QBoxLayout* streams_layout_;
|
||||
|
||||
bool loading_settings_;
|
||||
|
||||
|
@ -102,8 +120,14 @@ class SettingsDialog : public QDialog {
|
|||
|
||||
QMap<QString, QString> language_map_;
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
QMap<QSlider*, QString> sliders_;
|
||||
QMap<QCheckBox*, QString> checkboxes_;
|
||||
|
||||
BackgroundStreams* streams_;
|
||||
|
||||
signals:
|
||||
void StreamVolumeChanged(const QUrl& url, int value);
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
void SetWiimotedevInterfaceActived(bool);
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>708</width>
|
||||
<width>750</width>
|
||||
<height>604</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -102,6 +102,11 @@
|
|||
<normaloff>:/providers/magnatune.png</normaloff>:/providers/magnatune.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Background Streams</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Loading…
Reference in New Issue