Add const

This commit is contained in:
Jonas Kvinge 2024-08-02 23:35:52 +02:00
parent d3dd26c596
commit 17e88bb97d
5 changed files with 20 additions and 20 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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(); }

View File

@ -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;
}

View File

@ -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_;