1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00

moc doesn't know about config.h, so these slots need to always be declared.

This commit is contained in:
David Sansome 2010-06-26 15:09:32 +00:00
parent 751f2bbd43
commit 8d3ca44d14
2 changed files with 33 additions and 33 deletions

View File

@ -160,6 +160,39 @@ void SongLoader::AddAsRawStream() {
songs_ << song;
}
void SongLoader::Timeout() {
state_ = Finished;
success_ = false;
StopTypefind();
}
void SongLoader::StopTypefind() {
#ifdef HAVE_GSTREAMER
// Destroy the pipeline
if (pipeline_) {
gst_element_set_state(pipeline_.get(), GST_STATE_NULL);
pipeline_.reset();
}
timeout_timer_->stop();
if (success_ && parser_) {
qDebug() << "Parsing" << url_ << "with" << parser_->name();
// Parse the playlist
QBuffer buf(&buffer_);
buf.open(QIODevice::ReadOnly);
songs_ = parser_->Load(&buf);
} else if (success_) {
qDebug() << "Loading" << url_ << "as raw stream";
// It wasn't a playlist - just put the URL in as a stream
AddAsRawStream();
}
#endif // HAVE_GSTREAMER
emit LoadFinished(success_);
}
#ifdef HAVE_GSTREAMER
SongLoader::Result SongLoader::LoadRemote() {
qDebug() << "Loading remote file" << url_;
@ -248,12 +281,6 @@ void SongLoader::DataReady(GstPad *, GstBuffer *buf, void *self) {
}
}
void SongLoader::Timeout() {
state_ = Finished;
success_ = false;
StopTypefind();
}
gboolean SongLoader::BusCallback(GstBus*, GstMessage* msg, gpointer self) {
SongLoader* instance = reinterpret_cast<SongLoader*>(self);
@ -349,29 +376,4 @@ void SongLoader::StopTypefindAsync(bool success) {
metaObject()->invokeMethod(this, "StopTypefind", Qt::QueuedConnection);
}
void SongLoader::StopTypefind() {
// Destroy the pipeline
if (pipeline_) {
gst_element_set_state(pipeline_.get(), GST_STATE_NULL);
pipeline_.reset();
}
timeout_timer_->stop();
if (success_ && parser_) {
qDebug() << "Parsing" << url_ << "with" << parser_->name();
// Parse the playlist
QBuffer buf(&buffer_);
buf.open(QIODevice::ReadOnly);
songs_ = parser_->Load(&buf);
} else if (success_) {
qDebug() << "Loading" << url_ << "as raw stream";
// It wasn't a playlist - just put the URL in as a stream
AddAsRawStream();
}
emit LoadFinished(success_);
}
#endif // HAVE_GSTREAMER

View File

@ -58,10 +58,8 @@ signals:
void LoadFinished(bool success);
private slots:
#ifdef HAVE_GSTREAMER
void Timeout();
void StopTypefind();
#endif // HAVE_GSTREAMER
private:
enum State {