Remove phonon

This commit is contained in:
Jonas Kvinge 2020-04-25 01:42:29 +02:00
parent ac55b22839
commit 6e061764ee
12 changed files with 5 additions and 346 deletions

View File

@ -121,7 +121,6 @@ pkg_check_modules(GSTREAMER_TAG gstreamer-tag-1.0)
pkg_check_modules(GSTREAMER_PBUTILS gstreamer-pbutils-1.0)
pkg_check_modules(LIBXINE libxine)
pkg_check_modules(LIBVLC libvlc)
pkg_check_modules(PHONON phonon4qt5)
pkg_check_modules(SQLITE REQUIRED sqlite3>=3.9)
pkg_check_modules(LIBPULSE libpulse)
pkg_check_modules(CHROMAPRINT libchromaprint)
@ -297,10 +296,6 @@ optional_component(VLC ON "Engine: VLC backend"
DEPENDS "libvlc" LIBVLC_FOUND
)
optional_component(PHONON OFF "Engine: Phonon backend (UNSTABLE)"
DEPENDS "phonon4qt5" PHONON_FOUND
)
optional_component(CHROMAPRINT ON "Chromaprint (Tag fetching from Musicbrainz)"
DEPENDS "chromaprint" CHROMAPRINT_FOUND
)
@ -441,8 +436,8 @@ add_custom_target(uninstall
# Show a summary of what we have enabled
summary_show()
if(NOT HAVE_GSTREAMER AND NOT HAVE_XINE AND NOT HAVE_VLC AND NOT HAVE_PHONON)
message(FATAL_ERROR "You need to have either GStreamer, Xine, VLC or Phonon to compile!")
if(NOT HAVE_GSTREAMER AND NOT HAVE_XINE AND NOT HAVE_VLC)
message(FATAL_ERROR "You need to have either GStreamer, Xine or VLC to compile!")
elseif(NOT HAVE_GSTREAMER)
message(WARNING "GStreamer is the only engine that is fully implemented. Using other engines is possible but not recommended.")
endif()

View File

@ -63,7 +63,7 @@ To build Strawberry from source you need the following installed on your system
* [ALSA library (linux)](https://www.alsa-project.org/)
* [DBus (linux)](https://www.freedesktop.org/wiki/Software/dbus/)
* [PulseAudio (linux optional)](https://www.freedesktop.org/wiki/Software/PulseAudio/?)
* [GStreamer](https://gstreamer.freedesktop.org/), [Xine](https://www.xine-project.org), [VLC](https://www.videolan.org) or [Phonon](https://techbase.kde.org/Phonon)
* [GStreamer](https://gstreamer.freedesktop.org/), [Xine](https://www.xine-project.org) or [VLC](https://www.videolan.org)
* [GnuTLS](https://www.gnutls.org/)
Optional dependencies:
@ -74,7 +74,7 @@ Optional dependencies:
* iPhone, iPod Touch, iPad and Apple TV devices: [libimobiledevice, libplist and libusbmuxd](https://www.libimobiledevice.org/)
* Moodbar: [fftw3](http://www.fftw.org/)
Either GStreamer, Xine, VLC or Phonon engine is required, but only GStreamer is fully implemented so far.
Either GStreamer, Xine or VLC engine is required, but only GStreamer is fully implemented so far.
You should also install the gstreamer plugins base and good, and optionally bad and ugly.
### :wrench: Compiling from source

2
debian/copyright vendored
View File

@ -34,8 +34,6 @@ Files: src/core/main.h
src/engine/devicefinder.h
src/engine/enginedevice.cpp
src/engine/enginedevice.h
src/engine/phononengine.cpp
src/engine/phononengine.h
src/internet/internetservice.cpp
src/internet/internetservice.h
src/internet/internettabsview.cpp

View File

@ -32,7 +32,6 @@ depends=(
libusbmuxd
libplist
libimobiledevice
phonon-qt5
fftw
)
optdepends=(
@ -54,7 +53,6 @@ build() {
cmake ../${pkgname}-@STRAWBERRY_VERSION_PACKAGE@ \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_SYSTEM_TAGLIB=ON \
-DENABLE_PHONON=ON \
-DENABLE_TRANSLATIONS=ON
make -j$(nproc)
}

View File

@ -36,10 +36,6 @@ if(HAVE_GSTREAMER)
include_directories(${GSTREAMER_PBUTILS_INCLUDE_DIRS})
endif(HAVE_GSTREAMER)
if(HAVE_PHONON)
include_directories(${PHONON_INCLUDE_DIRS})
endif(HAVE_PHONON)
if(HAVE_CHROMAPRINT)
link_directories(${CHROMAPRINT_LIBRARY_DIRS})
include_directories(${CHROMAPRINT_INCLUDE_DIRS})
@ -588,12 +584,6 @@ optional_source(HAVE_VLC
HEADERS engine/vlcengine.h
)
# Phonon
optional_source(HAVE_PHONON
SOURCES engine/phononengine.cpp
HEADERS engine/phononengine.h
)
# DBUS and MPRIS - Unix specific
if(UNIX AND HAVE_DBUS)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus)
@ -1023,10 +1013,6 @@ if(HAVE_VLC)
target_link_libraries(strawberry_lib ${LIBVLC_LIBRARIES})
endif()
if(HAVE_PHONON)
target_link_libraries(strawberry_lib ${PHONON_LIBRARIES})
endif()
if(HAVE_LIBGPOD)
target_link_libraries(strawberry_lib ${LIBGPOD_LIBRARIES})
endif(HAVE_LIBGPOD)

View File

@ -45,7 +45,6 @@
#cmakedefine HAVE_GSTREAMER
#cmakedefine HAVE_VLC
#cmakedefine HAVE_XINE
#cmakedefine HAVE_PHONON
#cmakedefine XINE_ANALYZER
#cmakedefine HAVE_SUBSONIC

View File

@ -54,9 +54,6 @@
#ifdef HAVE_XINE
# include "engine/xineengine.h"
#endif
#ifdef HAVE_PHONON
# include "engine/phononengine.h"
#endif
#ifdef HAVE_VLC
# include "engine/vlcengine.h"
#endif
@ -139,12 +136,6 @@ Engine::EngineType Player::CreateEngine(Engine::EngineType enginetype) {
use_enginetype=Engine::VLC;
engine_.reset(new VLCEngine(app_->task_manager()));
break;
#endif
#ifdef HAVE_PHONON
case Engine::Phonon:
use_enginetype=Engine::Phonon;
engine_.reset(new PhononEngine(app_->task_manager()));
break;
#endif
default:
if (i > 0) { qFatal("No engine available!"); }

View File

@ -30,7 +30,6 @@ Engine::EngineType EngineTypeFromName(QString enginename) {
if (lower == "gstreamer") return Engine::GStreamer;
else if (lower == "xine") return Engine::Xine;
else if (lower == "vlc") return Engine::VLC;
else if (lower == "phonon") return Engine::Phonon;
else return Engine::None;
}
@ -39,7 +38,6 @@ QString EngineName(Engine::EngineType enginetype) {
case Engine::GStreamer: return QString("gstreamer");
case Engine::Xine: return QString("xine");
case Engine::VLC: return QString("vlc");
case Engine::Phonon: return QString("phonon");
case Engine::None:
default: return QString("None");
}
@ -50,7 +48,6 @@ QString EngineDescription(Engine::EngineType enginetype) {
case Engine::GStreamer: return QString("GStreamer");
case Engine::Xine: return QString("Xine");
case Engine::VLC: return QString("VLC");
case Engine::Phonon: return QString("Phonon");
case Engine::None:
default: return QString("None");

View File

@ -31,8 +31,7 @@ enum EngineType {
None,
GStreamer,
VLC,
Xine,
Phonon
Xine
};
Engine::EngineType EngineTypeFromName(QString enginename);

View File

@ -1,212 +0,0 @@
/*
* Strawberry Music Player
* This file was part of Clementine
* Copyright 2010, David Sansome <me@davidsansome.com>
* Copyright 2017-2018, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include <QtGlobal>
#include <QString>
#include <QUrl>
#include <QTimer>
#include "phononengine.h"
#include "core/timeconstants.h"
#include "core/taskmanager.h"
#include "core/logging.h"
PhononEngine::PhononEngine(TaskManager *task_manager)
: EngineBase(),
media_object_(new Phonon::MediaObject(this)),
audio_output_(new Phonon::AudioOutput(Phonon::MusicCategory, this)),
state_timer_(new QTimer(this)),
seek_offset_(-1) {
Q_UNUSED(task_manager);
type_ = Engine::Phonon;
Phonon::createPath(media_object_, audio_output_);
connect(media_object_, SIGNAL(finished()), SLOT(PhononFinished()));
connect(media_object_, SIGNAL(stateChanged(Phonon::State,Phonon::State)), SLOT(PhononStateChanged(Phonon::State)));
state_timer_->setSingleShot(true);
connect(state_timer_, SIGNAL(timeout()), SLOT(StateTimeoutExpired()));
}
PhononEngine::~PhononEngine() {
delete media_object_;
delete audio_output_;
}
bool PhononEngine::Init() {
return true;
}
bool PhononEngine::CanDecode(const QUrl &url) {
Q_UNUSED(url);
// TODO
return true;
}
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(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);
media_object_->play();
return true;
}
void PhononEngine::Stop(const bool stop_after) {
Q_UNUSED(stop_after);
media_object_->stop();
}
void PhononEngine::Pause() {
media_object_->pause();
}
void PhononEngine::Unpause() {
media_object_->play();
}
Engine::State PhononEngine::state() const {
switch (media_object_->state()) {
case Phonon::LoadingState:
case Phonon::PlayingState:
case Phonon::BufferingState:
return Engine::Playing;
case Phonon::PausedState:
return Engine::Paused;
case Phonon::StoppedState:
case Phonon::ErrorState:
default:
return Engine::Empty;
}
}
uint PhononEngine::position() const {
return media_object_->currentTime();
}
uint PhononEngine::length() const {
return media_object_->totalTime();
}
void PhononEngine::Seek(const quint64 offset_nanosec) {
int offset = (offset_nanosec / kNsecPerMsec);
media_object_->seek(offset);
}
void PhononEngine::SetVolumeSW(const uint volume) {
audio_output_->setVolume(volume);
}
void PhononEngine::PhononFinished() {
emit TrackEnded();
}
void PhononEngine::PhononStateChanged(const Phonon::State new_state) {
if (new_state == Phonon::ErrorState) {
emit Error(media_object_->errorString());
}
if (new_state == Phonon::PlayingState && seek_offset_ != -1) {
media_object_->seek(seek_offset_);
seek_offset_ = -1;
}
// Don't emit the state change straight away
state_timer_->start(100);
}
void PhononEngine::StateTimeoutExpired() {
emit StateChanged(state());
}
qint64 PhononEngine::position_nanosec() const {
if (state() == Engine::Empty) return 0;
const qint64 result = (position() * kNsecPerMsec);
return qint64(qMax(0ll, result));
}
qint64 PhononEngine::length_nanosec() const {
if (state() == Engine::Empty) return 0;
const qint64 result = end_nanosec_ - beginning_nanosec_;
if (result > 0) {
return result;
}
else {
// 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";
output.description = "Configured by the system";
output.iconname = "soundcard";
ret << output;
return ret;
}
bool PhononEngine::ValidOutput(const QString &output) {
return (output == "auto" || output == "" || output == DefaultOutput());
}
bool PhononEngine::CustomDeviceSupport(const QString &output) {
Q_UNUSED(output);
return false;
}
bool PhononEngine::ALSADeviceSupport(const QString &output) {
Q_UNUSED(output);
return false;
}

View File

@ -1,89 +0,0 @@
/*
* Strawberry Music Player
* This file was part of Clementine
* Copyright 2010, David Sansome <me@davidsansome.com>
* Copyright 2017-2018, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef PHONONENGINE_H
#define PHONONENGINE_H
#include "config.h"
#include <phonon/mediaobject.h>
#include <phonon/audiooutput.h>
#include <QtGlobal>
#include <QObject>
#include <QUrl>
#include "enginebase.h"
class QTimer;
class TaskManager;
class PhononEngine : public Engine::Base {
Q_OBJECT
public:
explicit PhononEngine(TaskManager *task_manager);
~PhononEngine();
bool Init();
OutputDetailsList GetOutputsList() const;
bool CanDecode(const QUrl &url);
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();
Engine::State state() const;
uint position() const;
uint length() const;
void Seek(const quint64 offset_nanosec);
qint64 position_nanosec() const;
qint64 length_nanosec() const;
QString DefaultOutput() { return QString(""); }
bool ValidOutput(const QString &output);
bool CustomDeviceSupport(const QString &output);
bool ALSADeviceSupport(const QString &output);
protected:
void SetVolumeSW(const uint percent );
private slots:
void PhononFinished();
void PhononStateChanged(const Phonon::State new_state);
void StateTimeoutExpired();
private:
Phonon::MediaObject *media_object_;
Phonon::AudioOutput *audio_output_;
QTimer *state_timer_;
qint64 seek_offset_;
};
#endif // PHONONENGINE_H

View File

@ -100,9 +100,6 @@ void BackendSettingsPage::Load() {
#ifdef HAVE_VLC
ui_->combobox_engine->addItem(IconLoader::Load("vlc"), EngineDescription(Engine::VLC), QVariant::fromValue(Engine::VLC));
#endif
#ifdef HAVE_PHONON
ui_->combobox_engine->addItem(IconLoader::Load("speaker"), EngineDescription(Engine::Phonon), QVariant::fromValue(Engine::Phonon));
#endif
enginetype_current_ = enginetype;
output_current_ = s_.value("output", QString()).toString();