@@ -35,8 +35,8 @@ MoodbarController::MoodbarController(Application *app, QObject *parent)
|
||||
app_(app),
|
||||
enabled_(false) {
|
||||
|
||||
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, this, &MoodbarController::CurrentSongChanged);
|
||||
QObject::connect(app_->player(), &Player::Stopped, this, &MoodbarController::PlaybackStopped);
|
||||
QObject::connect(&*app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, this, &MoodbarController::CurrentSongChanged);
|
||||
QObject::connect(&*app_->player(), &Player::Stopped, this, &MoodbarController::PlaybackStopped);
|
||||
|
||||
ReloadSettings();
|
||||
|
||||
|
||||
@@ -37,8 +37,9 @@
|
||||
#include <QUrl>
|
||||
#include <QSettings>
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/scoped_ptr.h"
|
||||
#include "core/application.h"
|
||||
|
||||
#include "moodbarpipeline.h"
|
||||
|
||||
@@ -131,7 +132,7 @@ MoodbarLoader::Result MoodbarLoader::Load(const QUrl &url, const bool has_cue, Q
|
||||
|
||||
QNetworkCacheMetaData disk_cache_metadata = cache_->metaData(CacheUrlEntry(filename));
|
||||
if (disk_cache_metadata.isValid()) {
|
||||
std::unique_ptr<QIODevice> device_cache_file(cache_->data(disk_cache_metadata.url()));
|
||||
ScopedPtr<QIODevice> device_cache_file(cache_->data(disk_cache_metadata.url()));
|
||||
if (device_cache_file) {
|
||||
qLog(Info) << "Loading cached moodbar data for" << filename;
|
||||
*data = device_cache_file->readAll();
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include "ext/gstmoodbar/gstfastspectrum.h"
|
||||
|
||||
using std::make_unique;
|
||||
|
||||
const int MoodbarPipeline::kBands = 128;
|
||||
|
||||
MoodbarPipeline::MoodbarPipeline(const QUrl &url, QObject *parent)
|
||||
@@ -109,7 +111,7 @@ void MoodbarPipeline::Start() {
|
||||
return;
|
||||
}
|
||||
|
||||
builder_ = std::make_unique<MoodbarBuilder>();
|
||||
builder_ = make_unique<MoodbarBuilder>();
|
||||
|
||||
// Set properties
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <gst/gst.h>
|
||||
#include <gst/app/gstappsink.h>
|
||||
|
||||
#include "core/scoped_ptr.h"
|
||||
|
||||
class MoodbarBuilder;
|
||||
|
||||
// Creates moodbar data for a single local music file.
|
||||
@@ -69,7 +69,7 @@ class MoodbarPipeline : public QObject {
|
||||
GstElement *pipeline_;
|
||||
GstElement *convert_element_;
|
||||
|
||||
std::unique_ptr<MoodbarBuilder> builder_;
|
||||
ScopedPtr<MoodbarBuilder> builder_;
|
||||
|
||||
bool success_;
|
||||
bool running_;
|
||||
|
||||
Reference in New Issue
Block a user