Fix minor code issues
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef ENGINE_FWD_H
|
||||
#define ENGINE_FWD_H
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
/// Used by eg engineobserver.h, and thus we reduce header dependencies on enginebase.h
|
||||
|
||||
namespace Engine {
|
||||
@@ -31,7 +33,7 @@ enum TrackChangeType {
|
||||
SameAlbum = 0x10,
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(TrackChangeFlags, TrackChangeType);
|
||||
Q_DECLARE_FLAGS(TrackChangeFlags, TrackChangeType)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -138,6 +138,8 @@ void Engine::Base::EmitAboutToEnd() {
|
||||
|
||||
bool Engine::Base::ValidOutput(const QString &output) {
|
||||
|
||||
Q_UNUSED(output);
|
||||
|
||||
return (true);
|
||||
|
||||
}
|
||||
|
||||
@@ -69,23 +69,23 @@ public:
|
||||
|
||||
virtual bool Init() = 0;
|
||||
virtual State state() const = 0;
|
||||
virtual void StartPreloading(const QUrl &stream_url, const QUrl &original_url, bool, qint64, qint64) {}
|
||||
virtual bool Load(const QUrl &stream_url, const QUrl &original_url, TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
virtual bool Play(quint64 offset_nanosec) = 0;
|
||||
virtual void Stop(bool stop_after = false) = 0;
|
||||
virtual void StartPreloading(const QUrl&, const QUrl&, const bool, const qint64, const qint64) {}
|
||||
virtual bool Load(const QUrl &stream_url, const QUrl &original_url, const TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec);
|
||||
virtual bool Play(const quint64 offset_nanosec) = 0;
|
||||
virtual void Stop(const bool stop_after = false) = 0;
|
||||
virtual void Pause() = 0;
|
||||
virtual void Unpause() = 0;
|
||||
virtual void Seek(quint64 offset_nanosec) = 0;
|
||||
virtual void SetVolumeSW(uint percent) = 0;
|
||||
virtual void Seek(const quint64 offset_nanosec) = 0;
|
||||
virtual void SetVolumeSW(const uint percent) = 0;
|
||||
|
||||
virtual qint64 position_nanosec() const = 0;
|
||||
virtual qint64 length_nanosec() const = 0;
|
||||
|
||||
virtual const Scope &scope(int chunk_length) { return scope_; }
|
||||
virtual const Scope &scope(const int chunk_length) { Q_UNUSED(chunk_length); return scope_; }
|
||||
|
||||
// Sets new values for the beginning and end markers of the currently playing song.
|
||||
// This doesn't change the state of engine or the stream's current position.
|
||||
virtual void RefreshMarkers(quint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
virtual void RefreshMarkers(const quint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
beginning_nanosec_ = beginning_nanosec;
|
||||
end_nanosec_ = end_nanosec;
|
||||
}
|
||||
@@ -98,9 +98,9 @@ public:
|
||||
|
||||
// Plays a media stream represented with the URL 'u' from the given 'beginning' to the given 'end' (usually from 0 to a song's length).
|
||||
// Both markers should be passed in nanoseconds. 'end' can be negative, indicating that the real length of 'u' stream is unknown.
|
||||
bool Play(const QUrl &stream_url, const QUrl &original_url, TrackChangeFlags c, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
void SetVolume(uint value);
|
||||
static uint MakeVolumeLogarithmic(uint volume);
|
||||
bool Play(const QUrl &stream_url, const QUrl &original_url, const TrackChangeFlags c, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec);
|
||||
void SetVolume(const uint value);
|
||||
static uint MakeVolumeLogarithmic(const uint volume);
|
||||
|
||||
public slots:
|
||||
virtual void ReloadSettings();
|
||||
@@ -125,12 +125,12 @@ public:
|
||||
|
||||
QVariant device() { return device_; }
|
||||
|
||||
public slots:
|
||||
virtual void SetEqualizerEnabled(bool) {}
|
||||
virtual void SetEqualizerParameters(int preamp, const QList<int> &bandGains) {}
|
||||
virtual void SetStereoBalance(float value) {}
|
||||
public slots:
|
||||
virtual void SetEqualizerEnabled(const bool) {}
|
||||
virtual void SetEqualizerParameters(const int preamp, const QList<int> &bandGains) { Q_UNUSED(preamp); Q_UNUSED(bandGains); }
|
||||
virtual void SetStereoBalance(float value) { Q_UNUSED(value); }
|
||||
|
||||
signals:
|
||||
signals:
|
||||
// Emitted when crossfading is enabled and the track is crossfade_duration_ away from finishing
|
||||
void TrackAboutToEnd();
|
||||
|
||||
@@ -201,7 +201,7 @@ signals:
|
||||
|
||||
private:
|
||||
bool about_to_end_emitted_;
|
||||
Q_DISABLE_COPY(Base);
|
||||
Q_DISABLE_COPY(Base)
|
||||
|
||||
};
|
||||
|
||||
@@ -226,6 +226,6 @@ struct SimpleMetaBundle {
|
||||
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(EngineBase::OutputDetails);
|
||||
Q_DECLARE_METATYPE(EngineBase::OutputDetails)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,6 +40,6 @@ QString EngineName(Engine::EngineType enginetype);
|
||||
QString EngineDescription(Engine::EngineType enginetype);
|
||||
|
||||
}
|
||||
Q_DECLARE_METATYPE(Engine::EngineType);
|
||||
Q_DECLARE_METATYPE(Engine::EngineType)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -131,7 +131,7 @@ Engine::State GstEngine::state() const {
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::StartPreloading(const QUrl &stream_url, const QUrl &original_url, bool force_stop_at_end, qint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
void GstEngine::StartPreloading(const QUrl &stream_url, const QUrl &original_url, const bool force_stop_at_end, const qint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
|
||||
EnsureInitialised();
|
||||
|
||||
@@ -143,7 +143,7 @@ void GstEngine::StartPreloading(const QUrl &stream_url, const QUrl &original_url
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
bool GstEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
|
||||
EnsureInitialised();
|
||||
|
||||
@@ -181,7 +181,7 @@ bool GstEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::T
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::Play(quint64 offset_nanosec) {
|
||||
bool GstEngine::Play(const quint64 offset_nanosec) {
|
||||
|
||||
EnsureInitialised();
|
||||
|
||||
@@ -198,7 +198,7 @@ bool GstEngine::Play(quint64 offset_nanosec) {
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::Stop(bool stop_after) {
|
||||
void GstEngine::Stop(const bool stop_after) {
|
||||
|
||||
StopTimers();
|
||||
|
||||
@@ -272,7 +272,7 @@ void GstEngine::Unpause() {
|
||||
}
|
||||
}
|
||||
|
||||
void GstEngine::Seek(quint64 offset_nanosec) {
|
||||
void GstEngine::Seek(const quint64 offset_nanosec) {
|
||||
|
||||
if (!current_pipeline_) return;
|
||||
|
||||
@@ -285,7 +285,7 @@ void GstEngine::Seek(quint64 offset_nanosec) {
|
||||
}
|
||||
}
|
||||
|
||||
void GstEngine::SetVolumeSW(uint percent) {
|
||||
void GstEngine::SetVolumeSW(const uint percent) {
|
||||
if (current_pipeline_) current_pipeline_->SetVolume(percent);
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ qint64 GstEngine::length_nanosec() const {
|
||||
|
||||
}
|
||||
|
||||
const Engine::Scope &GstEngine::scope(int chunk_length) {
|
||||
const Engine::Scope &GstEngine::scope(const int chunk_length) {
|
||||
|
||||
// The new buffer could have a different size
|
||||
if (have_new_buffer_) {
|
||||
@@ -392,7 +392,7 @@ void GstEngine::ReloadSettings() {
|
||||
|
||||
}
|
||||
|
||||
GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin, bool showerror) {
|
||||
GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin, const bool showerror) {
|
||||
|
||||
// Make a unique name
|
||||
QString name = factoryName + "-" + QString::number(next_element_id_++);
|
||||
@@ -411,7 +411,7 @@ GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin
|
||||
return element;
|
||||
}
|
||||
|
||||
void GstEngine::ConsumeBuffer(GstBuffer *buffer, int pipeline_id) {
|
||||
void GstEngine::ConsumeBuffer(GstBuffer *buffer, const int pipeline_id) {
|
||||
|
||||
// Schedule this to run in the GUI thread. The buffer gets added to the queue and unreffed by UpdateScope.
|
||||
if (!QMetaObject::invokeMethod(this, "AddBufferToScope", Q_ARG(GstBuffer*, buffer), Q_ARG(int, pipeline_id))) {
|
||||
@@ -420,14 +420,14 @@ void GstEngine::ConsumeBuffer(GstBuffer *buffer, int pipeline_id) {
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::SetEqualizerEnabled(bool enabled) {
|
||||
void GstEngine::SetEqualizerEnabled(const bool enabled) {
|
||||
|
||||
equalizer_enabled_ = enabled;
|
||||
|
||||
if (current_pipeline_) current_pipeline_->SetEqualizerEnabled(enabled);
|
||||
}
|
||||
|
||||
void GstEngine::SetEqualizerParameters(int preamp, const QList<int> &band_gains) {
|
||||
void GstEngine::SetEqualizerParameters(const int preamp, const QList<int> &band_gains) {
|
||||
|
||||
equalizer_preamp_ = preamp;
|
||||
equalizer_gains_ = band_gains;
|
||||
@@ -437,7 +437,7 @@ void GstEngine::SetEqualizerParameters(int preamp, const QList<int> &band_gains)
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::SetStereoBalance(float value) {
|
||||
void GstEngine::SetStereoBalance(const float value) {
|
||||
|
||||
stereo_balance_ = value;
|
||||
|
||||
@@ -479,7 +479,7 @@ void GstEngine::timerEvent(QTimerEvent *e) {
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::EndOfStreamReached(int pipeline_id, bool has_next_track) {
|
||||
void GstEngine::EndOfStreamReached(const int pipeline_id, const bool has_next_track) {
|
||||
|
||||
if (!current_pipeline_.get() || current_pipeline_->id() != pipeline_id)
|
||||
return;
|
||||
@@ -513,14 +513,14 @@ void GstEngine::HandlePipelineError(int pipeline_id, const QString &message, int
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::NewMetaData(int pipeline_id, const Engine::SimpleMetaBundle &bundle) {
|
||||
void GstEngine::NewMetaData(const int pipeline_id, const Engine::SimpleMetaBundle &bundle) {
|
||||
|
||||
if (!current_pipeline_.get() || current_pipeline_->id() != pipeline_id) return;
|
||||
emit MetaData(bundle);
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::AddBufferToScope(GstBuffer *buf, int pipeline_id) {
|
||||
void GstEngine::AddBufferToScope(GstBuffer *buf, const int pipeline_id) {
|
||||
|
||||
if (!current_pipeline_ || current_pipeline_->id() != pipeline_id) {
|
||||
gst_buffer_unref(buf);
|
||||
@@ -618,7 +618,7 @@ void GstEngine::BufferingStarted() {
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::BufferingProgress(int percent) {
|
||||
void GstEngine::BufferingProgress(const int percent) {
|
||||
task_manager_->SetTaskProgress(buffering_task_id_, percent, 100);
|
||||
}
|
||||
|
||||
@@ -761,7 +761,7 @@ shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline() {
|
||||
|
||||
}
|
||||
|
||||
shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QByteArray &gst_url, const QUrl &original_url, qint64 end_nanosec) {
|
||||
shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QByteArray &gst_url, const QUrl &original_url, const qint64 end_nanosec) {
|
||||
|
||||
shared_ptr<GstEnginePipeline> ret = CreatePipeline();
|
||||
if (!ret->InitFromUrl(gst_url, original_url, end_nanosec)) ret.reset();
|
||||
@@ -769,7 +769,7 @@ shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QByteArray &gst_ur
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::UpdateScope(int chunk_length) {
|
||||
void GstEngine::UpdateScope(const int chunk_length) {
|
||||
|
||||
typedef Engine::Scope::value_type sample_type;
|
||||
|
||||
|
||||
@@ -69,21 +69,21 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
|
||||
bool Init();
|
||||
Engine::State state() const;
|
||||
void StartPreloading(const QUrl &stream_url, const QUrl &original_url, bool force_stop_at_end, qint64 beginning_nanosec, qint64 end_nanosec);
|
||||
bool Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
bool Play(quint64 offset_nanosec);
|
||||
void Stop(bool stop_after = false);
|
||||
void StartPreloading(const QUrl &stream_url, const QUrl &original_url, const bool force_stop_at_end, const qint64 beginning_nanosec, const qint64 end_nanosec);
|
||||
bool Load(const QUrl &stream_url, const QUrl &original_url, const Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec);
|
||||
bool Play(const quint64 offset_nanosec);
|
||||
void Stop(const bool stop_after = false);
|
||||
void Pause();
|
||||
void Unpause();
|
||||
void Seek(quint64 offset_nanosec);
|
||||
void Seek(const quint64 offset_nanosec);
|
||||
|
||||
protected:
|
||||
void SetVolumeSW(uint percent);
|
||||
void SetVolumeSW(const uint percent);
|
||||
|
||||
public:
|
||||
qint64 position_nanosec() const;
|
||||
qint64 length_nanosec() const;
|
||||
const Engine::Scope &scope(int chunk_length);
|
||||
const Engine::Scope &scope(const int chunk_length);
|
||||
|
||||
OutputDetailsList GetOutputsList() const;
|
||||
bool ValidOutput(const QString &output);
|
||||
@@ -94,7 +94,7 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
void SetStartup(GstStartup *gst_startup) { gst_startup_ = gst_startup; }
|
||||
void EnsureInitialised() { gst_startup_->EnsureInitialised(); }
|
||||
|
||||
GstElement *CreateElement(const QString &factoryName, GstElement *bin = nullptr, bool showerror = true);
|
||||
GstElement *CreateElement(const QString &factoryName, GstElement *bin = nullptr, const bool showerror = true);
|
||||
void ConsumeBuffer(GstBuffer *buffer, int pipeline_id);
|
||||
|
||||
public slots:
|
||||
@@ -102,13 +102,13 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
void ReloadSettings();
|
||||
|
||||
/** Set whether equalizer is enabled */
|
||||
void SetEqualizerEnabled(bool);
|
||||
void SetEqualizerEnabled(const bool);
|
||||
|
||||
/** Set equalizer preamp and gains, range -100..100. Gains are 10 values. */
|
||||
void SetEqualizerParameters(int preamp, const QList<int> &bandGains);
|
||||
void SetEqualizerParameters(const int preamp, const QList<int> &bandGains);
|
||||
|
||||
/** Set Stereo balance, range -1.0f..1.0f */
|
||||
void SetStereoBalance(float value);
|
||||
void SetStereoBalance(const float value);
|
||||
|
||||
void AddBufferConsumer(GstBufferConsumer *consumer);
|
||||
void RemoveBufferConsumer(GstBufferConsumer *consumer);
|
||||
@@ -121,10 +121,10 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
void timerEvent(QTimerEvent*);
|
||||
|
||||
private slots:
|
||||
void EndOfStreamReached(int pipeline_id, bool has_next_track);
|
||||
void HandlePipelineError(int pipeline_id, const QString &message, int domain, int error_code);
|
||||
void NewMetaData(int pipeline_id, const Engine::SimpleMetaBundle &bundle);
|
||||
void AddBufferToScope(GstBuffer *buf, int pipeline_id);
|
||||
void EndOfStreamReached(const int pipeline_id, const bool has_next_track);
|
||||
void HandlePipelineError(const int pipeline_id, const QString &message, const int domain, const int error_code);
|
||||
void NewMetaData(const int pipeline_id, const Engine::SimpleMetaBundle &bundle);
|
||||
void AddBufferToScope(GstBuffer *buf, const int pipeline_id);
|
||||
void FadeoutFinished();
|
||||
void FadeoutPauseFinished();
|
||||
void SeekNow();
|
||||
@@ -158,7 +158,7 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
void StopTimers();
|
||||
|
||||
std::shared_ptr<GstEnginePipeline> CreatePipeline();
|
||||
std::shared_ptr<GstEnginePipeline> CreatePipeline(const QByteArray &gst_url, const QUrl &original_url, qint64 end_nanosec);
|
||||
std::shared_ptr<GstEnginePipeline> CreatePipeline(const QByteArray &gst_url, const QUrl &original_url, const qint64 end_nanosec);
|
||||
|
||||
void UpdateScope(int chunk_length);
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ void GstEnginePipeline::set_replaygain(bool enabled, int mode, float preamp, boo
|
||||
|
||||
}
|
||||
|
||||
void GstEnginePipeline::set_buffer_duration_nanosec(qint64 buffer_duration_nanosec) {
|
||||
void GstEnginePipeline::set_buffer_duration_nanosec(const qint64 buffer_duration_nanosec) {
|
||||
buffer_duration_nanosec_ = buffer_duration_nanosec;
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ bool GstEnginePipeline::InitFromString(const QString &pipeline) {
|
||||
|
||||
}
|
||||
|
||||
bool GstEnginePipeline::InitFromUrl(const QByteArray &stream_url, const QUrl original_url, qint64 end_nanosec) {
|
||||
bool GstEnginePipeline::InitFromUrl(const QByteArray &stream_url, const QUrl original_url, const qint64 end_nanosec) {
|
||||
|
||||
stream_url_ = stream_url;
|
||||
original_url_ = original_url;
|
||||
@@ -758,6 +758,8 @@ void GstEnginePipeline::BufferingMessageReceived(GstMessage *msg) {
|
||||
void GstEnginePipeline::NewPadCallback(GstElement*, GstPad *pad, gpointer self) {
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
if (!instance) return;
|
||||
|
||||
GstPad *const audiopad = gst_element_get_static_pad(instance->audiobin_, "sink");
|
||||
|
||||
// Link decodebin's sink pad to audiobin's src pad.
|
||||
@@ -787,6 +789,8 @@ void GstEnginePipeline::NewPadCallback(GstElement*, GstPad *pad, gpointer self)
|
||||
GstPadProbeReturn GstEnginePipeline::DecodebinProbe(GstPad *pad, GstPadProbeInfo *info, gpointer data) {
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(data);
|
||||
if (!instance) return GST_PAD_PROBE_OK;
|
||||
|
||||
const GstPadProbeType info_type = GST_PAD_PROBE_INFO_TYPE(info);
|
||||
|
||||
if (info_type & GST_PAD_PROBE_TYPE_BUFFER) {
|
||||
@@ -826,6 +830,8 @@ GstPadProbeReturn GstEnginePipeline::DecodebinProbe(GstPad *pad, GstPadProbeInfo
|
||||
GstPadProbeReturn GstEnginePipeline::HandoffCallback(GstPad*, GstPadProbeInfo *info, gpointer self) {
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
if (!instance) return GST_PAD_PROBE_OK;
|
||||
|
||||
GstBuffer *buf = gst_pad_probe_info_get_buffer(info);
|
||||
|
||||
QList<GstBufferConsumer*> consumers;
|
||||
@@ -872,6 +878,8 @@ GstPadProbeReturn GstEnginePipeline::HandoffCallback(GstPad*, GstPadProbeInfo *i
|
||||
GstPadProbeReturn GstEnginePipeline::EventHandoffCallback(GstPad*, GstPadProbeInfo *info, gpointer self) {
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
if (!instance) return GST_PAD_PROBE_OK;
|
||||
|
||||
GstEvent *e = gst_pad_probe_info_get_event(info);
|
||||
|
||||
qLog(Debug) << instance->id() << "event" << GST_EVENT_TYPE_NAME(e);
|
||||
@@ -897,7 +905,10 @@ GstPadProbeReturn GstEnginePipeline::EventHandoffCallback(GstPad*, GstPadProbeIn
|
||||
|
||||
void GstEnginePipeline::AboutToFinishCallback(GstPlayBin *bin, gpointer self) {
|
||||
|
||||
Q_UNUSED(bin);
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
if (!instance) return;
|
||||
|
||||
if (instance->has_next_valid_url() && !instance->next_uri_set_) {
|
||||
// Set the next uri. When the current song ends it will be played automatically and a STREAM_START message is send to the bus.
|
||||
@@ -910,7 +921,11 @@ void GstEnginePipeline::AboutToFinishCallback(GstPlayBin *bin, gpointer self) {
|
||||
|
||||
void GstEnginePipeline::SourceSetupCallback(GstPlayBin *bin, GParamSpec *pspec, gpointer self) {
|
||||
|
||||
Q_UNUSED(pspec);
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
if (!instance) return;
|
||||
|
||||
GstElement *element;
|
||||
g_object_get(bin, "source", &element, nullptr);
|
||||
if (!element) {
|
||||
@@ -927,12 +942,6 @@ void GstEnginePipeline::SourceSetupCallback(GstPlayBin *bin, GParamSpec *pspec,
|
||||
QString user_agent = QString("%1 %2").arg(QCoreApplication::applicationName(), QCoreApplication::applicationVersion());
|
||||
g_object_set(element, "user-agent", user_agent.toUtf8().constData(), nullptr);
|
||||
g_object_set(element, "ssl-strict", FALSE, nullptr);
|
||||
|
||||
//#ifdef Q_OS_MACOS
|
||||
//g_object_set(element, "tls-database", instance->engine_->tls_database(), nullptr);
|
||||
//g_object_set(element, "ssl-use-system-ca-file", false, nullptr);
|
||||
//g_object_set(element, "ssl-strict", TRUE, nullptr);
|
||||
//#endif
|
||||
}
|
||||
|
||||
// If the pipeline was buffering we stop that now.
|
||||
@@ -978,7 +987,7 @@ QFuture<GstStateChangeReturn> GstEnginePipeline::SetState(GstState state) {
|
||||
|
||||
}
|
||||
|
||||
bool GstEnginePipeline::Seek(qint64 nanosec) {
|
||||
bool GstEnginePipeline::Seek(const qint64 nanosec) {
|
||||
|
||||
if (ignore_next_seek_) {
|
||||
ignore_next_seek_ = false;
|
||||
@@ -1011,7 +1020,7 @@ void GstEnginePipeline::SetEqualizerEnabled(bool enabled) {
|
||||
|
||||
}
|
||||
|
||||
void GstEnginePipeline::SetEqualizerParams(int preamp, const QList<int>& band_gains) {
|
||||
void GstEnginePipeline::SetEqualizerParams(const int preamp, const QList<int>& band_gains) {
|
||||
|
||||
eq_preamp_ = preamp;
|
||||
eq_band_gains_ = band_gains;
|
||||
@@ -1019,7 +1028,7 @@ void GstEnginePipeline::SetEqualizerParams(int preamp, const QList<int>& band_ga
|
||||
|
||||
}
|
||||
|
||||
void GstEnginePipeline::SetStereoBalance(float value) {
|
||||
void GstEnginePipeline::SetStereoBalance(const float value) {
|
||||
|
||||
stereo_balance_ = value;
|
||||
UpdateStereoBalance();
|
||||
@@ -1059,13 +1068,13 @@ void GstEnginePipeline::UpdateStereoBalance() {
|
||||
}
|
||||
}
|
||||
|
||||
void GstEnginePipeline::SetVolume(int percent) {
|
||||
void GstEnginePipeline::SetVolume(const int percent) {
|
||||
if (!volume_) return;
|
||||
volume_percent_ = percent;
|
||||
UpdateVolume();
|
||||
}
|
||||
|
||||
void GstEnginePipeline::SetVolumeModifier(qreal mod) {
|
||||
void GstEnginePipeline::SetVolumeModifier(const qreal mod) {
|
||||
if (!volume_) return;
|
||||
volume_modifier_ = mod;
|
||||
UpdateVolume();
|
||||
@@ -1077,7 +1086,7 @@ void GstEnginePipeline::UpdateVolume() {
|
||||
g_object_set(G_OBJECT(volume_), "volume", vol, nullptr);
|
||||
}
|
||||
|
||||
void GstEnginePipeline::StartFader(qint64 duration_nanosec, QTimeLine::Direction direction, QTimeLine::CurveShape shape, bool use_fudge_timer) {
|
||||
void GstEnginePipeline::StartFader(const qint64 duration_nanosec, const QTimeLine::Direction direction, const QTimeLine::CurveShape shape, const bool use_fudge_timer) {
|
||||
|
||||
const int duration_msec = duration_nanosec / kNsecPerMsec;
|
||||
|
||||
@@ -1153,7 +1162,7 @@ void GstEnginePipeline::RemoveAllBufferConsumers() {
|
||||
buffer_consumers_.clear();
|
||||
}
|
||||
|
||||
void GstEnginePipeline::SetNextUrl(const QByteArray &stream_url, const QUrl &original_url, qint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
void GstEnginePipeline::SetNextUrl(const QByteArray &stream_url, const QUrl &original_url, const qint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
|
||||
next_stream_url_ = stream_url;
|
||||
next_original_url_ = original_url;
|
||||
@@ -1164,6 +1173,9 @@ void GstEnginePipeline::SetNextUrl(const QByteArray &stream_url, const QUrl &ori
|
||||
|
||||
void GstEnginePipeline::StreamDiscovered(GstDiscoverer *discoverer, GstDiscovererInfo *info, GError *err, gpointer self) {
|
||||
|
||||
Q_UNUSED(discoverer);
|
||||
Q_UNUSED(err);
|
||||
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
if (!instance) return;
|
||||
|
||||
@@ -1218,6 +1230,8 @@ void GstEnginePipeline::StreamDiscovered(GstDiscoverer *discoverer, GstDiscovere
|
||||
}
|
||||
|
||||
void GstEnginePipeline::StreamDiscoveryFinished(GstDiscoverer *discoverer, gpointer self) {
|
||||
Q_UNUSED(discoverer);
|
||||
Q_UNUSED(self);
|
||||
//GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,13 +69,13 @@ class GstEnginePipeline : public QObject {
|
||||
|
||||
// Call these setters before Init
|
||||
void set_output_device(const QString &sink, const QVariant &device);
|
||||
void set_volume_control(bool volume_control);
|
||||
void set_replaygain(bool enabled, int mode, float preamp, bool compression);
|
||||
void set_volume_control(const bool volume_control);
|
||||
void set_replaygain(const bool enabled, const int mode, const float preamp, const bool compression);
|
||||
void set_buffer_duration_nanosec(qint64 duration_nanosec);
|
||||
void set_buffer_min_fill(int percent);
|
||||
|
||||
// Creates the pipeline, returns false on error
|
||||
bool InitFromUrl(const QByteArray &stream_url, const QUrl original_url, qint64 end_nanosec);
|
||||
bool InitFromUrl(const QByteArray &stream_url, const QUrl original_url, const qint64 end_nanosec);
|
||||
bool InitFromString(const QString &pipeline);
|
||||
|
||||
// GstBufferConsumers get fed audio data. Thread-safe.
|
||||
@@ -84,13 +84,13 @@ class GstEnginePipeline : public QObject {
|
||||
void RemoveAllBufferConsumers();
|
||||
|
||||
// Control the music playback
|
||||
QFuture<GstStateChangeReturn> SetState(GstState state);
|
||||
Q_INVOKABLE bool Seek(qint64 nanosec);
|
||||
void SetEqualizerEnabled(bool enabled);
|
||||
void SetEqualizerParams(int preamp, const QList<int> &band_gains);
|
||||
void SetVolume(int percent);
|
||||
void SetStereoBalance(float value);
|
||||
void StartFader(qint64 duration_nanosec, QTimeLine::Direction direction = QTimeLine::Forward, QTimeLine::CurveShape shape = QTimeLine::LinearCurve, bool use_fudge_timer = true);
|
||||
QFuture<GstStateChangeReturn> SetState(const GstState state);
|
||||
Q_INVOKABLE bool Seek(const qint64 nanosec);
|
||||
void SetEqualizerEnabled(const bool enabled);
|
||||
void SetEqualizerParams(const int preamp, const QList<int> &band_gains);
|
||||
void SetVolume(const int percent);
|
||||
void SetStereoBalance(const float value);
|
||||
void StartFader(const qint64 duration_nanosec, const QTimeLine::Direction direction = QTimeLine::Forward, const QTimeLine::CurveShape shape = QTimeLine::LinearCurve, const bool use_fudge_timer = true);
|
||||
|
||||
// If this is set then it will be loaded automatically when playback finishes for gapless playback
|
||||
void SetNextUrl(const QByteArray &stream_url, const QUrl &original_url, qint64 beginning_nanosec, qint64 end_nanosec);
|
||||
@@ -121,11 +121,11 @@ class GstEnginePipeline : public QObject {
|
||||
void SetVolumeModifier(qreal mod);
|
||||
|
||||
signals:
|
||||
void EndOfStreamReached(int pipeline_id, bool has_next_track);
|
||||
void MetadataFound(int pipeline_id, const Engine::SimpleMetaBundle &bundle);
|
||||
void EndOfStreamReached(const int pipeline_id, const bool has_next_track);
|
||||
void MetadataFound(const int pipeline_id, const Engine::SimpleMetaBundle &bundle);
|
||||
// This indicates an error, delegated from GStreamer, in the pipeline.
|
||||
// The message, domain and error_code are related to GStreamer's GError.
|
||||
void Error(int pipeline_id, const QString &message, int domain, int error_code);
|
||||
void Error(const int pipeline_id, const QString &message, const int domain, const int error_code);
|
||||
void FaderFinished();
|
||||
|
||||
void BufferingStarted();
|
||||
|
||||
@@ -39,6 +39,8 @@ PhononEngine::PhononEngine(TaskManager *task_manager)
|
||||
state_timer_(new QTimer(this)),
|
||||
seek_offset_(-1) {
|
||||
|
||||
Q_UNUSED(task_manager);
|
||||
|
||||
type_ = Engine::Phonon;
|
||||
|
||||
Phonon::createPath(media_object_, audio_output_);
|
||||
@@ -61,16 +63,24 @@ bool PhononEngine::Init() {
|
||||
}
|
||||
|
||||
bool PhononEngine::CanDecode(const QUrl &url) {
|
||||
Q_UNUSED(url);
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PhononEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
bool PhononEngine::Load(const QUrl &stream_url, const QUrl &original_url, const Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
|
||||
Q_UNUSED(original_url);
|
||||
Q_UNUSED(change);
|
||||
Q_UNUSED(force_stop_at_end);
|
||||
Q_UNUSED(beginning_nanosec);
|
||||
Q_UNUSED(end_nanosec);
|
||||
|
||||
media_object_->setCurrentSource(Phonon::MediaSource(stream_url));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PhononEngine::Play(quint64 offset_nanosec) {
|
||||
bool PhononEngine::Play(const quint64 offset_nanosec) {
|
||||
|
||||
// The seek happens in PhononStateChanged - phonon doesn't seem to change currentTime() if we seek before we start playing :S
|
||||
seek_offset_ = (offset_nanosec / kNsecPerMsec);
|
||||
@@ -80,7 +90,8 @@ bool PhononEngine::Play(quint64 offset_nanosec) {
|
||||
|
||||
}
|
||||
|
||||
void PhononEngine::Stop(bool stop_after) {
|
||||
void PhononEngine::Stop(const bool stop_after) {
|
||||
Q_UNUSED(stop_after);
|
||||
media_object_->stop();
|
||||
}
|
||||
|
||||
@@ -119,12 +130,12 @@ uint PhononEngine::length() const {
|
||||
return media_object_->totalTime();
|
||||
}
|
||||
|
||||
void PhononEngine::Seek(quint64 offset_nanosec) {
|
||||
void PhononEngine::Seek(const quint64 offset_nanosec) {
|
||||
int offset = (offset_nanosec / kNsecPerMsec);
|
||||
media_object_->seek(offset);
|
||||
}
|
||||
|
||||
void PhononEngine::SetVolumeSW(uint volume) {
|
||||
void PhononEngine::SetVolumeSW(const uint volume) {
|
||||
audio_output_->setVolume(volume);
|
||||
}
|
||||
|
||||
@@ -132,7 +143,7 @@ void PhononEngine::PhononFinished() {
|
||||
emit TrackEnded();
|
||||
}
|
||||
|
||||
void PhononEngine::PhononStateChanged(Phonon::State new_state) {
|
||||
void PhononEngine::PhononStateChanged(const Phonon::State new_state) {
|
||||
|
||||
if (new_state == Phonon::ErrorState) {
|
||||
emit Error(media_object_->errorString());
|
||||
@@ -159,6 +170,7 @@ qint64 PhononEngine::position_nanosec() const {
|
||||
}
|
||||
|
||||
qint64 PhononEngine::length_nanosec() const {
|
||||
|
||||
if (state() == Engine::Empty) return 0;
|
||||
const qint64 result = end_nanosec_ - beginning_nanosec_;
|
||||
if (result > 0) {
|
||||
@@ -168,9 +180,11 @@ qint64 PhononEngine::length_nanosec() const {
|
||||
// Get the length from the pipeline if we don't know.
|
||||
return (length() * kNsecPerMsec);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EngineBase::OutputDetailsList PhononEngine::GetOutputsList() const {
|
||||
|
||||
OutputDetailsList ret;
|
||||
OutputDetails output;
|
||||
output.name = "none";
|
||||
@@ -178,6 +192,7 @@ EngineBase::OutputDetailsList PhononEngine::GetOutputsList() const {
|
||||
output.iconname = "soundcard";
|
||||
ret << output;
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
bool PhononEngine::ValidOutput(const QString &output) {
|
||||
@@ -187,9 +202,11 @@ bool PhononEngine::ValidOutput(const QString &output) {
|
||||
}
|
||||
|
||||
bool PhononEngine::CustomDeviceSupport(const QString &output) {
|
||||
Q_UNUSED(output);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PhononEngine::ALSADeviceSupport(const QString &output) {
|
||||
Q_UNUSED(output);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ class PhononEngine : public Engine::Base {
|
||||
|
||||
bool CanDecode(const QUrl &url);
|
||||
|
||||
bool Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
bool Play(quint64 offset_nanosec);
|
||||
void Stop(bool stop_after = false);
|
||||
bool Load(const QUrl &stream_url, const QUrl &original_url, const Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec);
|
||||
bool Play(const quint64 offset_nanosec);
|
||||
void Stop(const bool stop_after = false);
|
||||
void Pause();
|
||||
void Unpause();
|
||||
|
||||
@@ -59,22 +59,22 @@ class PhononEngine : public Engine::Base {
|
||||
uint position() const;
|
||||
uint length() const;
|
||||
|
||||
void Seek(quint64 offset_nanosec);
|
||||
void Seek(const quint64 offset_nanosec);
|
||||
|
||||
qint64 position_nanosec() const;
|
||||
qint64 length_nanosec() const;
|
||||
|
||||
QString DefaultOutput() { return ""; }
|
||||
QString DefaultOutput() { return QString(""); }
|
||||
bool ValidOutput(const QString &output);
|
||||
bool CustomDeviceSupport(const QString &output);
|
||||
bool ALSADeviceSupport(const QString &output);
|
||||
|
||||
protected:
|
||||
void SetVolumeSW( uint percent );
|
||||
void SetVolumeSW(const uint percent );
|
||||
|
||||
private slots:
|
||||
void PhononFinished();
|
||||
void PhononStateChanged(Phonon::State new_state);
|
||||
void PhononStateChanged(const Phonon::State new_state);
|
||||
void StateTimeoutExpired();
|
||||
|
||||
private:
|
||||
|
||||
@@ -117,7 +117,10 @@ retry:
|
||||
|
||||
void PulseDeviceFinder::GetSinkInfoCallback(pa_context *c, const pa_sink_info *info, int eol, void *state_voidptr) {
|
||||
|
||||
Q_UNUSED(c);
|
||||
|
||||
ListDevicesState *state = reinterpret_cast<ListDevicesState*>(state_voidptr);
|
||||
if (!state) return;
|
||||
|
||||
if (info) {
|
||||
Device dev;
|
||||
|
||||
@@ -43,6 +43,8 @@ VLCEngine::VLCEngine(TaskManager *task_manager)
|
||||
player_(nullptr),
|
||||
state_(Engine::Empty) {
|
||||
|
||||
Q_UNUSED(task_manager);
|
||||
|
||||
type_ = Engine::VLC;
|
||||
ReloadSettings();
|
||||
|
||||
@@ -98,7 +100,13 @@ bool VLCEngine::Init() {
|
||||
|
||||
}
|
||||
|
||||
bool VLCEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
bool VLCEngine::Load(const QUrl &stream_url, const QUrl &original_url, const Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
|
||||
Q_UNUSED(original_url);
|
||||
Q_UNUSED(change);
|
||||
Q_UNUSED(force_stop_at_end);
|
||||
Q_UNUSED(beginning_nanosec);
|
||||
Q_UNUSED(end_nanosec);
|
||||
|
||||
if (!Initialised()) return false;
|
||||
|
||||
@@ -111,7 +119,7 @@ bool VLCEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::T
|
||||
|
||||
}
|
||||
|
||||
bool VLCEngine::Play(quint64 offset_nanosec) {
|
||||
bool VLCEngine::Play(const quint64 offset_nanosec) {
|
||||
|
||||
if (!Initialised()) return false;
|
||||
|
||||
@@ -135,7 +143,9 @@ bool VLCEngine::Play(quint64 offset_nanosec) {
|
||||
|
||||
}
|
||||
|
||||
void VLCEngine::Stop(bool stop_after) {
|
||||
void VLCEngine::Stop(const bool stop_after) {
|
||||
|
||||
Q_UNUSED(stop_after);
|
||||
|
||||
if (!Initialised()) return;
|
||||
libvlc_media_player_stop(player_);
|
||||
@@ -156,7 +166,7 @@ void VLCEngine::Unpause() {
|
||||
|
||||
}
|
||||
|
||||
void VLCEngine::Seek(quint64 offset_nanosec) {
|
||||
void VLCEngine::Seek(const quint64 offset_nanosec) {
|
||||
|
||||
if (!Initialised()) return;
|
||||
|
||||
@@ -171,7 +181,7 @@ void VLCEngine::Seek(quint64 offset_nanosec) {
|
||||
|
||||
}
|
||||
|
||||
void VLCEngine::SetVolumeSW(uint percent) {
|
||||
void VLCEngine::SetVolumeSW(const uint percent) {
|
||||
if (!Initialised()) return;
|
||||
if (!volume_control_ && percent != 100) return;
|
||||
libvlc_audio_set_volume(player_, percent);
|
||||
@@ -261,7 +271,7 @@ uint VLCEngine::length() const {
|
||||
|
||||
}
|
||||
|
||||
bool VLCEngine::CanDecode(const QUrl &url) { return true; }
|
||||
bool VLCEngine::CanDecode(const QUrl &url) { Q_UNUSED(url); return true; }
|
||||
|
||||
void VLCEngine::AttachCallback(libvlc_event_manager_t *em, libvlc_event_type_t type, libvlc_callback_t callback) {
|
||||
|
||||
@@ -336,7 +346,9 @@ EngineBase::PluginDetailsList VLCEngine::GetPluginList() const {
|
||||
|
||||
}
|
||||
|
||||
void VLCEngine::GetDevicesList(QString output) const {
|
||||
void VLCEngine::GetDevicesList(const QString &output) const {
|
||||
|
||||
Q_UNUSED(output);
|
||||
|
||||
libvlc_audio_output_device_t *audio_output_device_list = libvlc_audio_output_device_list_get(instance_, output_.toUtf8().constData());
|
||||
for (libvlc_audio_output_device_t *audio_device = audio_output_device_list ; audio_device ; audio_device = audio_device->p_next) {
|
||||
|
||||
@@ -48,14 +48,14 @@ class VLCEngine : public Engine::Base {
|
||||
|
||||
bool Init();
|
||||
Engine::State state() const { return state_; }
|
||||
bool Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
bool Play(quint64 offset_nanosec);
|
||||
void Stop(bool stop_after = false);
|
||||
bool Load(const QUrl &stream_url, const QUrl &original_url, const Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec);
|
||||
bool Play(const quint64 offset_nanosec);
|
||||
void Stop(const bool stop_after = false);
|
||||
void Pause();
|
||||
void Unpause();
|
||||
void Seek(quint64 offset_nanosec);
|
||||
void Seek(const quint64 offset_nanosec);
|
||||
protected:
|
||||
void SetVolumeSW(uint percent);
|
||||
void SetVolumeSW(const uint percent);
|
||||
public:
|
||||
virtual qint64 position_nanosec() const;
|
||||
virtual qint64 length_nanosec() const;
|
||||
@@ -79,7 +79,7 @@ class VLCEngine : public Engine::Base {
|
||||
static void StateChangedCallback(const libvlc_event_t* e, void* data);
|
||||
|
||||
PluginDetailsList GetPluginList() const;
|
||||
void GetDevicesList(QString output) const;
|
||||
void GetDevicesList(const QString &output) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ class VlcScopedRef {
|
||||
template <typename T>
|
||||
void VlcScopedRef_Release(T* ptr);
|
||||
|
||||
VLCSCOPEDREF_DEFINE2(instance, libvlc_release);
|
||||
VLCSCOPEDREF_DEFINE(media_player);
|
||||
VLCSCOPEDREF_DEFINE(media);
|
||||
VLCSCOPEDREF_DEFINE2(instance, libvlc_release)
|
||||
VLCSCOPEDREF_DEFINE(media_player)
|
||||
VLCSCOPEDREF_DEFINE(media)
|
||||
|
||||
template <> void VlcScopedRef_Release<char>(char* ptr) { free(ptr); }
|
||||
|
||||
|
||||
@@ -95,6 +95,8 @@ XineEngine::XineEngine(TaskManager *task_manager)
|
||||
preamp_(1.0),
|
||||
have_metadata_(false) {
|
||||
|
||||
Q_UNUSED(task_manager);
|
||||
|
||||
type_ = Engine::Xine;
|
||||
ReloadSettings();
|
||||
|
||||
@@ -306,7 +308,7 @@ Engine::State XineEngine::state() const {
|
||||
|
||||
}
|
||||
|
||||
bool XineEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec) {
|
||||
bool XineEngine::Load(const QUrl &stream_url, const QUrl &original_url, const Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec) {
|
||||
|
||||
if (!EnsureStream()) return false;
|
||||
|
||||
@@ -333,7 +335,7 @@ bool XineEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::
|
||||
|
||||
}
|
||||
|
||||
bool XineEngine::Play(quint64 offset_nanosec) {
|
||||
bool XineEngine::Play(const quint64 offset_nanosec) {
|
||||
|
||||
if (!EnsureStream()) return false;
|
||||
|
||||
@@ -354,7 +356,9 @@ bool XineEngine::Play(quint64 offset_nanosec) {
|
||||
|
||||
}
|
||||
|
||||
void XineEngine::Stop(bool stop_after) {
|
||||
void XineEngine::Stop(const bool stop_after) {
|
||||
|
||||
Q_UNUSED(stop_after);
|
||||
|
||||
if (!stream_) return;
|
||||
|
||||
@@ -394,7 +398,7 @@ void XineEngine::Unpause() {
|
||||
|
||||
}
|
||||
|
||||
void XineEngine::Seek(quint64 offset_nanosec) {
|
||||
void XineEngine::Seek(const quint64 offset_nanosec) {
|
||||
|
||||
if (!EnsureStream()) return;
|
||||
|
||||
@@ -409,7 +413,7 @@ void XineEngine::Seek(quint64 offset_nanosec) {
|
||||
|
||||
}
|
||||
|
||||
void XineEngine::SetVolumeSW(uint vol) {
|
||||
void XineEngine::SetVolumeSW(const uint vol) {
|
||||
|
||||
if (!stream_) return;
|
||||
if (!volume_control_ && vol != 100) return;
|
||||
@@ -582,7 +586,7 @@ bool XineEngine::CanDecode(const QUrl &url) {
|
||||
|
||||
}
|
||||
|
||||
void XineEngine::SetEqualizerEnabled(bool enabled) {
|
||||
void XineEngine::SetEqualizerEnabled(const bool enabled) {
|
||||
|
||||
if (!stream_) return;
|
||||
|
||||
@@ -609,7 +613,7 @@ void XineEngine::SetEqualizerEnabled(bool enabled) {
|
||||
pre: (-100..100)
|
||||
post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off)
|
||||
*/
|
||||
void XineEngine::SetEqualizerParameters(int preamp, const QList<int> &gains) {
|
||||
void XineEngine::SetEqualizerParameters(const int preamp, const QList<int> &gains) {
|
||||
|
||||
if (!stream_) return;
|
||||
|
||||
@@ -902,7 +906,9 @@ void XineEngine::DetermineAndShowErrorMessage() {
|
||||
|
||||
#ifdef XINE_ANALYZER
|
||||
|
||||
const Engine::Scope &XineEngine::scope(int chunk_length) {
|
||||
const Engine::Scope &XineEngine::scope(const int chunk_length) {
|
||||
|
||||
Q_UNUSED(chunk_length);
|
||||
|
||||
if (!post_ || !stream_ || xine_get_status(stream_) != XINE_STATUS_PLAY)
|
||||
return scope_;
|
||||
|
||||
Reference in New Issue
Block a user