Connection syntax migration (#637)

This commit is contained in:
Jonas Kvinge
2021-01-26 16:48:04 +01:00
committed by GitHub
parent d57f6303f4
commit bf7c8df353
362 changed files with 2452 additions and 2434 deletions

View File

@@ -64,4 +64,3 @@ class DeviceFinder {
};
#endif // DEVICEFINDER_H

View File

@@ -46,4 +46,3 @@ class DirectSoundDeviceFinder : public DeviceFinder {
};
#endif // DIRECTSOUNDDEVICEFINDER_H

View File

@@ -138,17 +138,17 @@ public:
void FadeoutFinishedSignal();
void StatusText(const QString &text);
void Error(const QString &text);
void StatusText(QString text);
void Error(QString text);
// Emitted when there was a fatal error
void FatalError();
// Emitted when Engine was unable to play a song with the given QUrl.
void InvalidSongRequested(const QUrl &url);
void InvalidSongRequested(QUrl url);
// Emitted when Engine successfully started playing a song with the given QUrl.
void ValidSongRequested(const QUrl &url);
void ValidSongRequested(QUrl url);
void MetaData(const Engine::SimpleMetaBundle&);
void MetaData(Engine::SimpleMetaBundle);
// Signals that the engine's state has changed (a stream was stopped for example).
// Always use the state from event, because it's not guaranteed that immediate subsequent call to state() won't return a stale value.
@@ -235,4 +235,4 @@ struct SimpleMetaBundle {
Q_DECLARE_METATYPE(EngineBase::OutputDetails)
#endif
#endif // ENGINEBASE_H

View File

@@ -41,4 +41,4 @@ QString EngineDescription(Engine::EngineType enginetype);
}
Q_DECLARE_METATYPE(Engine::EngineType)
#endif
#endif // ENGINETYPE_H

View File

@@ -99,7 +99,7 @@ GstEngine::GstEngine(TaskManager *task_manager)
type_ = Engine::GStreamer;
seek_timer_->setSingleShot(true);
seek_timer_->setInterval(kSeekDelayNanosec / kNsecPerMsec);
connect(seek_timer_, SIGNAL(timeout()), SLOT(SeekNow()));
QObject::connect(seek_timer_, &QTimer::timeout, this, &GstEngine::SeekNow);
ReloadSettings();
@@ -262,7 +262,7 @@ void GstEngine::Stop(const bool stop_after) {
// Check if we started a fade out. If it isn't finished yet and the user pressed stop, we cancel the fader and just stop the playback.
if (is_fading_out_to_pause_) {
disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr);
QObject::disconnect(current_pipeline_.get(), &GstEnginePipeline::FaderFinished, nullptr, nullptr);
is_fading_out_to_pause_ = false;
has_faded_out_ = true;
@@ -284,7 +284,7 @@ void GstEngine::Pause() {
// Check if we started a fade out. If it isn't finished yet and the user pressed play, we inverse the fader and resume the playback.
if (is_fading_out_to_pause_) {
disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr);
QObject::disconnect(current_pipeline_.get(), &GstEnginePipeline::FaderFinished, nullptr, nullptr);
current_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Forward, QEasingCurve::InOutQuad, false);
is_fading_out_to_pause_ = false;
has_faded_out_ = false;
@@ -315,7 +315,7 @@ void GstEngine::Unpause() {
// Check if we faded out last time. If yes, fade in no matter what the settings say.
// If we pause with fadeout, deactivate fadeout and resume playback, the player would be muted if not faded in.
if (has_faded_out_) {
disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr);
QObject::disconnect(current_pipeline_.get(), &GstEnginePipeline::FaderFinished, nullptr, nullptr);
current_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Forward, QEasingCurve::InOutQuad, false);
has_faded_out_ = false;
}
@@ -764,24 +764,24 @@ void GstEngine::StartFadeout() {
if (is_fading_out_to_pause_) return;
fadeout_pipeline_ = current_pipeline_;
disconnect(fadeout_pipeline_.get(), nullptr, nullptr, nullptr);
QObject::disconnect(fadeout_pipeline_.get(), nullptr, nullptr, nullptr);
fadeout_pipeline_->RemoveAllBufferConsumers();
fadeout_pipeline_->StartFader(fadeout_duration_nanosec_, QTimeLine::Backward);
connect(fadeout_pipeline_.get(), SIGNAL(FaderFinished()), SLOT(FadeoutFinished()));
QObject::connect(fadeout_pipeline_.get(), &GstEnginePipeline::FaderFinished, this, &GstEngine::FadeoutFinished);
}
void GstEngine::StartFadeoutPause() {
fadeout_pause_pipeline_ = current_pipeline_;
disconnect(fadeout_pause_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr);
QObject::disconnect(fadeout_pause_pipeline_.get(), &GstEnginePipeline::FaderFinished, nullptr, nullptr);
fadeout_pause_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Backward, QEasingCurve::InOutQuad, false);
if (fadeout_pipeline_ && fadeout_pipeline_->state() == GST_STATE_PLAYING) {
fadeout_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Backward, QEasingCurve::Linear, false);
}
connect(fadeout_pause_pipeline_.get(), SIGNAL(FaderFinished()), SLOT(FadeoutPauseFinished()));
QObject::connect(fadeout_pause_pipeline_.get(), &GstEnginePipeline::FaderFinished, this, &GstEngine::FadeoutPauseFinished);
is_fading_out_to_pause_ = true;
}
@@ -818,12 +818,12 @@ std::shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline() {
ret->AddBufferConsumer(consumer);
}
connect(ret.get(), SIGNAL(EndOfStreamReached(int, bool)), SLOT(EndOfStreamReached(int, bool)));
connect(ret.get(), SIGNAL(Error(int, QString, int, int)), SLOT(HandlePipelineError(int, QString, int, int)));
connect(ret.get(), SIGNAL(MetadataFound(int, Engine::SimpleMetaBundle)), SLOT(NewMetaData(int, Engine::SimpleMetaBundle)));
connect(ret.get(), SIGNAL(BufferingStarted()), SLOT(BufferingStarted()));
connect(ret.get(), SIGNAL(BufferingProgress(int)), SLOT(BufferingProgress(int)));
connect(ret.get(), SIGNAL(BufferingFinished()), SLOT(BufferingFinished()));
QObject::connect(ret.get(), &GstEnginePipeline::EndOfStreamReached, this, &GstEngine::EndOfStreamReached);
QObject::connect(ret.get(), &GstEnginePipeline::Error, this, &GstEngine::HandlePipelineError);
QObject::connect(ret.get(), &GstEnginePipeline::MetadataFound, this, &GstEngine::NewMetaData);
QObject::connect(ret.get(), &GstEnginePipeline::BufferingStarted, this, &GstEngine::BufferingStarted);
QObject::connect(ret.get(), &GstEnginePipeline::BufferingProgress, this, &GstEngine::BufferingProgress);
QObject::connect(ret.get(), &GstEnginePipeline::BufferingFinished, this, &GstEngine::BufferingFinished);
return ret;

View File

@@ -209,4 +209,4 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
};
#endif /* GSTENGINE_H */
#endif // GSTENGINE_H

View File

@@ -1201,8 +1201,8 @@ void GstEnginePipeline::StartFader(const qint64 duration_nanosec, const QTimeLin
}
fader_.reset(new QTimeLine(duration_msec, this));
connect(fader_.get(), SIGNAL(valueChanged(qreal)), SLOT(SetVolumeModifier(qreal)));
connect(fader_.get(), SIGNAL(finished()), SLOT(FaderTimelineFinished()));
QObject::connect(fader_.get(), &QTimeLine::valueChanged, this, &GstEnginePipeline::SetVolumeModifier);
QObject::connect(fader_.get(), &QTimeLine::finished, this, &GstEnginePipeline::FaderTimelineFinished);
fader_->setDirection(direction);
fader_->setEasingCurve(shape);
fader_->setCurrentTime(start_time);

View File

@@ -43,4 +43,4 @@ class GstStartup : public QObject {
};
#endif /* GSTSTARTUP_H */
#endif // GSTSTARTUP_H

View File

@@ -35,4 +35,4 @@ class MacOsDeviceFinder : public DeviceFinder {
virtual QList<Device> ListDevices();
};
#endif // MACOSDEVICEFINDER_H
#endif // MACOSDEVICEFINDER_H

View File

@@ -56,4 +56,4 @@ class PulseDeviceFinder : public DeviceFinder {
};
#endif // PULSEDEVICEFINDER_H
#endif // PULSEDEVICEFINDER_H

View File

@@ -84,4 +84,4 @@ class VLCEngine : public Engine::Base {
};
#endif // VLCENGINE_H
#endif // VLCENGINE_H