From 7f3293609b5c7738b2740cd3a49eecdf002504cf Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 10 Nov 2024 01:11:43 +0100 Subject: [PATCH] Player: Always use GStreamer --- src/core/player.cpp | 59 +-------------------------------------------- src/core/player.h | 1 - 2 files changed, 1 insertion(+), 59 deletions(-) diff --git a/src/core/player.cpp b/src/core/player.cpp index b419b2aa1..a7c3cfebe 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -38,7 +38,6 @@ #include #include "constants/behavioursettings.h" -#include "constants/backendsettings.h" #include "constants/playlistsettings.h" #include "constants/timeconstants.h" @@ -79,7 +78,7 @@ Player::Player(const SharedPtr task_manager, const SharedPtr(task_manager_)), analyzer_(nullptr), equalizer_(nullptr), timer_save_volume_(new QTimer(this)), @@ -102,13 +101,6 @@ Player::Player(const SharedPtr task_manager, const SharedPtrclassName())); - Settings s; - s.beginGroup(BackendSettings::kSettingsGroup); - EngineBase::Type enginetype = EngineBase::TypeFromName(s.value(BackendSettings::kEngine, EngineBase::Name(EngineBase::Type::GStreamer)).toString().toLower()); - s.endGroup(); - - CreateEngine(enginetype); - timer_save_volume_->setSingleShot(true); timer_save_volume_->setInterval(5s); QObject::connect(timer_save_volume_, &QTimer::timeout, this, &Player::SaveVolume); @@ -117,57 +109,8 @@ Player::Player(const SharedPtr task_manager, const SharedPtr(task_manager_); - break; - } - default: - if (i > 0) { - qFatal("No engine available!"); - } - enginetype = EngineBase::Type::None; - break; - } - } - - if (use_enginetype != enginetype) { // Engine was set to something else. Reset output and device. - Settings s; - s.beginGroup(BackendSettings::kSettingsGroup); - s.setValue(BackendSettings::kEngine, EngineBase::Name(use_enginetype)); - s.setValue(BackendSettings::kOutput, engine_->DefaultOutput()); - s.setValue(BackendSettings::kDevice, QVariant()); - s.endGroup(); - } - - if (!engine_) { - qFatal("Failed to create engine!"); - } - - Q_EMIT EngineChanged(use_enginetype); - - return use_enginetype; - -} - void Player::Init() { - Settings s; - - if (!engine_) { - s.beginGroup(BackendSettings::kSettingsGroup); - EngineBase::Type enginetype = EngineBase::TypeFromName(s.value("engine", EngineBase::Name(EngineBase::Type::GStreamer)).toString().toLower()); - s.endGroup(); - CreateEngine(enginetype); - } - if (!engine_->Init()) { qFatal("Error initializing audio engine"); } diff --git a/src/core/player.h b/src/core/player.h index db0dbc747..dc0c6d12a 100644 --- a/src/core/player.h +++ b/src/core/player.h @@ -54,7 +54,6 @@ class Player : public PlayerInterface { public: explicit Player(const SharedPtr task_manager, const SharedPtr url_handlers, const SharedPtr playlist_manager, QObject *parent = nullptr); - EngineBase::Type CreateEngine(EngineBase::Type Type); void Init(); SharedPtr engine() const override { return engine_; }