From 17e88bb97d38ab35dee760e8c185649d3a7adbce Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 2 Aug 2024 23:35:52 +0200 Subject: [PATCH] Add const --- src/engine/enginebase.h | 8 ++++---- src/engine/gstengine.cpp | 6 +++--- src/engine/gstengine.h | 8 ++++---- src/engine/vlcengine.cpp | 10 +++++----- src/engine/vlcengine.h | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/engine/enginebase.h b/src/engine/enginebase.h index 00be606ea..e7eb5768a 100644 --- a/src/engine/enginebase.h +++ b/src/engine/enginebase.h @@ -126,10 +126,10 @@ class EngineBase : public QObject { virtual OutputDetailsList GetOutputsList() const = 0; virtual bool ValidOutput(const QString &output) = 0; - virtual QString DefaultOutput() = 0; - virtual bool CustomDeviceSupport(const QString &output) = 0; - virtual bool ALSADeviceSupport(const QString &output) = 0; - virtual bool ExclusiveModeSupport(const QString &output) = 0; + virtual QString DefaultOutput() const = 0; + virtual bool CustomDeviceSupport(const QString &output) const = 0; + virtual bool ALSADeviceSupport(const QString &output) const = 0; + virtual bool ExclusiveModeSupport(const QString &output) const = 0; // 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. diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index dea4076d8..7ce63d792 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -454,15 +454,15 @@ bool GstEngine::ValidOutput(const QString &output) { } -bool GstEngine::CustomDeviceSupport(const QString &output) { +bool GstEngine::CustomDeviceSupport(const QString &output) const { return output == QLatin1String(kALSASink) || output == QLatin1String(kOpenALSASink) || output == QLatin1String(kOSSSink) || output == QLatin1String(kOSS4Sink) || output == QLatin1String(kPulseSink) || output == QLatin1String(kA2DPSink) || output == QLatin1String(kAVDTPSink) || output == QLatin1String(kJackAudioSink); } -bool GstEngine::ALSADeviceSupport(const QString &output) { +bool GstEngine::ALSADeviceSupport(const QString &output) const { return output == QLatin1String(kALSASink); } -bool GstEngine::ExclusiveModeSupport(const QString &output) { +bool GstEngine::ExclusiveModeSupport(const QString &output) const { return output == QLatin1String(kWASAPISink); } diff --git a/src/engine/gstengine.h b/src/engine/gstengine.h index cd8659783..c23930ce1 100644 --- a/src/engine/gstengine.h +++ b/src/engine/gstengine.h @@ -78,10 +78,10 @@ class GstEngine : public EngineBase, public GstBufferConsumer { OutputDetailsList GetOutputsList() const override; bool ValidOutput(const QString &output) override; - QString DefaultOutput() override { return QLatin1String(kAutoSink); } - bool CustomDeviceSupport(const QString &output) override; - bool ALSADeviceSupport(const QString &output) override; - bool ExclusiveModeSupport(const QString &output) override; + QString DefaultOutput() const override { return QLatin1String(kAutoSink); } + bool CustomDeviceSupport(const QString &output) const override; + bool ALSADeviceSupport(const QString &output) const override; + bool ExclusiveModeSupport(const QString &output) const override; void SetStartup(GstStartup *gst_startup) { gst_startup_ = gst_startup; } void EnsureInitialized() { gst_startup_->EnsureInitialized(); } diff --git a/src/engine/vlcengine.cpp b/src/engine/vlcengine.cpp index 332d1b48f..b652e70ae 100644 --- a/src/engine/vlcengine.cpp +++ b/src/engine/vlcengine.cpp @@ -255,15 +255,15 @@ bool VLCEngine::ValidOutput(const QString &output) { } -bool VLCEngine::CustomDeviceSupport(const QString &output) { - return (output != QLatin1String("auto")); +bool VLCEngine::CustomDeviceSupport(const QString &output) const { + return output != QLatin1String("auto"); } -bool VLCEngine::ALSADeviceSupport(const QString &output) { - return (output == QLatin1String("alsa")); +bool VLCEngine::ALSADeviceSupport(const QString &output) const { + return output == QLatin1String("alsa"); } -bool VLCEngine::ExclusiveModeSupport(const QString &output) { +bool VLCEngine::ExclusiveModeSupport(const QString &output) const { Q_UNUSED(output); return false; } diff --git a/src/engine/vlcengine.h b/src/engine/vlcengine.h index 50e991a07..04e3712fb 100644 --- a/src/engine/vlcengine.h +++ b/src/engine/vlcengine.h @@ -67,10 +67,10 @@ class VLCEngine : public EngineBase { OutputDetailsList GetOutputsList() const override; bool ValidOutput(const QString &output) override; - QString DefaultOutput() override { return QLatin1String(""); } - bool CustomDeviceSupport(const QString &output) override; - bool ALSADeviceSupport(const QString &output) override; - bool ExclusiveModeSupport(const QString &output) override; + QString DefaultOutput() const override { return QLatin1String(""); } + bool CustomDeviceSupport(const QString &output) const override; + bool ALSADeviceSupport(const QString &output) const override; + bool ExclusiveModeSupport(const QString &output) const override; private: libvlc_instance_t *instance_;