1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

Use url instead of filename.

This commit is contained in:
John Maguire 2012-05-28 15:33:37 -07:00
parent 823b59e3a7
commit 38f1b71761
3 changed files with 10 additions and 10 deletions

View File

@ -108,7 +108,7 @@ MoodbarLoader::Result MoodbarLoader::Load(
thread_->start();
// There was no existing file, analyze the audio file and create one.
MoodbarPipeline* pipeline = new MoodbarPipeline(filename);
MoodbarPipeline* pipeline = new MoodbarPipeline(url);
pipeline->moveToThread(thread_);
NewClosure(pipeline, SIGNAL(Finished(bool)),
this, SLOT(RequestFinished(MoodbarPipeline*,QUrl)),

View File

@ -24,7 +24,7 @@
bool MoodbarPipeline::sIsAvailable = false;
MoodbarPipeline::MoodbarPipeline(const QString& local_filename)
MoodbarPipeline::MoodbarPipeline(const QUrl& local_filename)
: QObject(NULL),
local_filename_(local_filename),
pipeline_(NULL),
@ -93,9 +93,8 @@ void MoodbarPipeline::Start() {
// Join them together
gst_element_link_many(convert_element_, fftwspectrum, moodbar, appsink, NULL);
QUrl local_url = QUrl::fromLocalFile(local_filename_);
// Set properties
g_object_set(decodebin, "uri", local_url.toEncoded().constData(), NULL);
g_object_set(decodebin, "uri", local_filename_.toEncoded().constData(), NULL);
g_object_set(fftwspectrum, "def-size", 2048,
"def-step", 1024,
"hiquality", true, NULL);

View File

@ -19,6 +19,7 @@
#define MOODBARPIPELINE_H
#include <QObject>
#include <QUrl>
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
@ -28,7 +29,7 @@ class MoodbarPipeline : public QObject {
Q_OBJECT
public:
MoodbarPipeline(const QString& local_filename);
MoodbarPipeline(const QUrl& local_filename);
~MoodbarPipeline();
static bool IsAvailable();
@ -57,7 +58,7 @@ private:
private:
static bool sIsAvailable;
QString local_filename_;
QUrl local_filename_;
GstElement* pipeline_;
GstElement* convert_element_;