From 6737b8a5c28544afcc6d014b980d4435704f1a11 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 26 Dec 2010 13:01:35 +0000 Subject: [PATCH] Always use the gstreamer engine, remove xine, vlc and phonon engines. --- CMakeLists.txt | 10 +- cmake/AddEngine.cmake | 79 -- pig.txt | 26 - src/CMakeLists.txt | 58 +- src/config.h.in | 6 - src/core/commandlineoptions.cpp | 51 +- src/core/commandlineoptions.h | 4 - src/core/player.cpp | 47 +- src/core/player.h | 3 +- src/core/songloader.cpp | 15 - src/core/songloader.h | 9 +- src/engines/engine_fwd.h | 7 - src/engines/phononengine.cpp | 129 --- src/engines/phononengine.h | 68 -- src/engines/vlcengine.cpp | 252 ------ src/engines/vlcengine.h | 81 -- src/engines/vlcscopedref.h | 66 -- src/engines/xine-engine.cpp | 1309 ----------------------------- src/engines/xine-engine.h | 191 ----- src/engines/xine-scope.c | 186 ---- src/engines/xine-scope.h | 50 -- src/main.cpp | 11 +- src/translations/ar.po | 13 +- src/translations/be.po | 7 - src/translations/bg.po | 7 - src/translations/br.po | 7 - src/translations/ca.po | 13 +- src/translations/cs.po | 13 +- src/translations/cy.po | 7 - src/translations/da.po | 13 +- src/translations/de.po | 13 +- src/translations/el.po | 13 +- src/translations/en.po | 7 - src/translations/en_CA.po | 13 +- src/translations/en_GB.po | 13 +- src/translations/eo.po | 7 - src/translations/es.po | 13 +- src/translations/et.po | 10 +- src/translations/eu.po | 7 - src/translations/fi.po | 7 - src/translations/fr.po | 13 +- src/translations/gl.po | 7 - src/translations/he.po | 7 - src/translations/hi.po | 7 - src/translations/hr.po | 7 - src/translations/hu.po | 13 +- src/translations/it.po | 13 +- src/translations/ja.po | 13 +- src/translations/kk.po | 7 - src/translations/lt.po | 7 - src/translations/nb.po | 7 - src/translations/nl.po | 13 +- src/translations/oc.po | 7 - src/translations/pl.po | 13 +- src/translations/pt.po | 13 +- src/translations/pt_BR.po | 13 +- src/translations/ro.po | 7 - src/translations/ru.po | 13 +- src/translations/sk.po | 13 +- src/translations/sl.po | 13 +- src/translations/sr.po | 10 +- src/translations/sv.po | 13 +- src/translations/tr.po | 13 +- src/translations/translations.pot | 7 - src/translations/uk.po | 13 +- src/translations/zh_CN.po | 10 +- src/translations/zh_TW.po | 7 - src/ui/mainwindow.cpp | 31 +- src/ui/mainwindow.h | 2 +- src/ui/settingsdialog.cpp | 15 +- 70 files changed, 184 insertions(+), 2984 deletions(-) delete mode 100644 cmake/AddEngine.cmake delete mode 100644 pig.txt delete mode 100644 src/engines/phononengine.cpp delete mode 100644 src/engines/phononengine.h delete mode 100644 src/engines/vlcengine.cpp delete mode 100644 src/engines/vlcengine.h delete mode 100644 src/engines/vlcscopedref.h delete mode 100644 src/engines/xine-engine.cpp delete mode 100644 src/engines/xine-engine.h delete mode 100644 src/engines/xine-scope.c delete mode 100644 src/engines/xine-scope.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ca7bf58fa..cfafdedbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ if(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE) if(NOT APPLE) - find_package(Qt4 COMPONENTS Phonon QtWebKit) + find_package(Qt4 COMPONENTS QtWebKit) endif(NOT APPLE) # Find Qt's lconvert binary. Try qt's binary dir first, fall back to looking in PATH @@ -34,8 +34,6 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(TAGLIB REQUIRED taglib>=1.6) pkg_check_modules(GSTREAMER gstreamer-0.10) pkg_check_modules(GSTREAMER_BASE gstreamer-base-0.10) -pkg_check_modules(LIBVLC libvlc) -pkg_check_modules(LIBXINE libxine) pkg_check_modules(GLIB glib-2.0) pkg_check_modules(LIBXML libxml-2.0) pkg_check_modules(GOBJECT gobject-2.0) @@ -86,11 +84,7 @@ add_definitions(${QT_DEFINITIONS}) link_directories(${TAGLIB_LIBRARY_DIRS}) link_directories(${GSTREAMER_LIBRARY_DIRS}) -# Don't try to use Phonon or webkit if their include directories couldn't be found. -if (NOT QT_PHONON_INCLUDE_DIR) - set (QT_USE_PHONON 0) -endif (NOT QT_PHONON_INCLUDE_DIR) - +# Don't try to use webkit if their include directories couldn't be found. if (NOT QT_QTWEBKIT_INCLUDE_DIR) set (QT_USE_QTWEBKIT 0) endif (NOT QT_QTWEBKIT_INCLUDE_DIR) diff --git a/cmake/AddEngine.cmake b/cmake/AddEngine.cmake deleted file mode 100644 index 0c9be6c7f..000000000 --- a/cmake/AddEngine.cmake +++ /dev/null @@ -1,79 +0,0 @@ -# add an engine -macro(add_engine engine lib_list src_list moc_list supported) - - # recreate list - set(lib_list ${lib_list}) - list(GET lib_list 0 name) - - # add a user selectable build option, supported engines enabled by default - option(ENGINE_${name}_ENABLED "enable engine ${engine}" ${supported}) - - # check for all needed libraries - foreach(lib ${lib_list}) - if(${lib}_NOTFOUND) - set(ENGINE_${name}_LIB_MISSING TRUE) - endif(${lib}_NOTFOUND) - endforeach(lib ${lib_list}) - - # check if engine is enabled and needed librares are available - if(ENGINE_${name}_ENABLED AND NOT ENGINE_${name}_LIB_MISSING) - - # add to list of unsupported engines - set(supported ${supported}) - if(NOT supported) - set(ENGINES_UNSUPPORTED "${ENGINES_UNSUPPORTED} ${engine}") - endif(NOT supported) - - # add define -DHAVE_ so we can clutter the code with #ifdefs - set("HAVE_${name}" 1 CACHE INTERNAL ${name}) - - # add sources and MOC headers - list(APPEND SOURCES ${src_list}) - list(APPEND HEADERS ${moc_list}) - - # add libraries to link against - foreach(lib ${lib_list}) - set(ENGINE_LIBRARIES ${ENGINE_LIBRARIES} ${${lib}_LIBRARIES} CACHE INTERNAL libraries) - endforeach(lib ${lib_list}) - - # add to list of enabled engines - set(ENGINES_ENABLED "${ENGINES_ENABLED} ${engine}") - - else(ENGINE_${name}_ENABLED AND NOT ENGINE_${name}_LIB_MISSING) - - # add to list of disabled engines - set(ENGINES_DISABLED "${ENGINES_DISABLED} ${engine}") - set("HAVE_${name}" 0 CACHE INTERNAL ${name}) - - endif(ENGINE_${name}_ENABLED AND NOT ENGINE_${name}_LIB_MISSING) - -endmacro(add_engine engine lib_list src_list moc_list supported) - -# print engines to be built -macro(print_engines) - # show big warning if building unsupported engines - if(ENGINES_UNSUPPORTED) - message("") - message(" *********************************") - message(" ************ WARNING ************") - message(" *********************************") - message("") - message(" The following engines are NOT supported by clementine developers:") - message(" ${ENGINES_UNSUPPORTED}") - message("") - message(" Don't post any bugs if you use them, fix them yourself!") - message("") - pig() - message("") - endif(ENGINES_UNSUPPORTED) - # need at least 1 engine - if(NOT ENGINES_ENABLED) - message(FATAL_ERROR "no engine enabled!") - endif(NOT ENGINES_ENABLED) -endmacro(print_engines) - -# print the pig :) -macro(pig) - file(READ ${CMAKE_SOURCE_DIR}/pig.txt pig) - message(${pig}) -endmacro(pig) diff --git a/pig.txt b/pig.txt deleted file mode 100644 index f6829c40f..000000000 --- a/pig.txt +++ /dev/null @@ -1,26 +0,0 @@ - ___ - ,---. /""`_,' - | `\``""-; / - \ /`\\ ';' - .') | __ \ - / (` / /(O\. _| - .-`| `"` ` .-\_ - .-' \ ` ;=-. - .' . ._, / o o\ - .-'` . '-._;_._.J - .-'` `.-'` - _.-` ' .' - .' '- ._.-' - /` / - / You have been warned! | - ._ ; | | - )).-| | | / - (/`.-| \ \ / .; - ( (_)| | \ ; .' | - '--'; | `\ / / | - \ | `\ /.' / - \ / ; |`\ | - '. .' _.-| | | | - '-. .-';_"---'`.__| | | \ - `'-._ ``'-. | \ \__\\ - `''--.___\\ \__\\ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a9854758e..94f80d6af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,6 @@ if(HAVE_LIBLASTFM) endif(HAVE_LIBLASTFM) cmake_policy(SET CMP0011 NEW) -include(../cmake/AddEngine.cmake) include(../cmake/ParseArguments.cmake) include(../cmake/Translations.cmake) @@ -82,6 +81,9 @@ set(SOURCES devices/filesystemdevice.cpp engines/enginebase.cpp + engines/gstengine.cpp + engines/gstenginepipeline.cpp + engines/gstelementdeleter.cpp library/groupbydialog.cpp library/library.cpp @@ -171,6 +173,9 @@ set(SOURCES songinfo/ultimatelyricsprovider.cpp songinfo/ultimatelyricsreader.cpp + transcoder/transcodedialog.cpp + transcoder/transcoder.cpp + ui/about.cpp ui/addstreamdialog.cpp ui/edittagdialog.cpp @@ -251,6 +256,9 @@ set(HEADERS devices/filesystemdevice.h engines/enginebase.h + engines/gstengine.h + engines/gstenginepipeline.h + engines/gstelementdeleter.h library/groupbydialog.h library/library.h @@ -329,6 +337,9 @@ set(HEADERS songinfo/ultimatelyricsprovider.h songinfo/ultimatelyricsreader.h + transcoder/transcodedialog.h + transcoder/transcoder.h + ui/about.h ui/addstreamdialog.h ui/edittagdialog.h @@ -395,6 +406,9 @@ set(UI songinfo/lyricsettings.ui + transcoder/transcodedialog.ui + transcoder/transcodelogdialog.ui + ui/about.ui ui/addstreamdialog.ui ui/edittagdialog.ui @@ -436,27 +450,6 @@ else (LINGUAS STREQUAL "All") endif (NOT LINGUAS OR LINGUAS STREQUAL "None") endif (LINGUAS STREQUAL "All") -# Engines -set(GST_ENGINE_SRC - engines/gstengine.cpp - engines/gstenginepipeline.cpp - engines/gstelementdeleter.cpp -) -set(GST_ENGINE_MOC - engines/gstengine.h - engines/gstenginepipeline.h - engines/gstelementdeleter.h -) -set(GST_ENGINE_LIB GSTREAMER GSTREAMER_BASE) -set(XINE_ENGINE_SRC engines/xine-engine.cpp engines/xine-scope.c) -set(XINE_ENGINE_MOC engines/xine-engine.h) - -add_engine(gst "${GST_ENGINE_LIB}" "${GST_ENGINE_SRC}" "${GST_ENGINE_MOC}" ON) -add_engine(vlc LIBVLC engines/vlcengine.cpp engines/vlcengine.h OFF) -add_engine(xine LIBXINE "${XINE_ENGINE_SRC}" "${XINE_ENGINE_MOC}" OFF) -add_engine(qt-phonon QT_PHONON engines/phononengine.cpp engines/phononengine.h OFF) -print_engines() - # Visualisations if(ENABLE_VISUALISATIONS) option(VISUALISATIONS_USE_INSTALL_PREFIX "Look for visualisations in CMAKE_INSTALL_PREFIX" ON) @@ -518,24 +511,6 @@ if(HAVE_LIBLASTFM) ) endif(HAVE_LIBLASTFM) -# Transcoder -if(HAVE_GSTREAMER) - list(APPEND SOURCES - transcoder/transcodedialog.cpp - transcoder/transcoder.cpp - ) - - list(APPEND HEADERS - transcoder/transcodedialog.h - transcoder/transcoder.h - ) - - list(APPEND UI - transcoder/transcodedialog.ui - transcoder/transcodelogdialog.ui - ) -endif(HAVE_GSTREAMER) - # OSDs if(APPLE) list(APPEND SOURCES widgets/osd_mac.mm) @@ -782,7 +757,8 @@ target_link_libraries(clementine_lib ${GLIB_LIBRARIES} ${TAGLIB_LIBRARIES} ${QT_LIBRARIES} - ${ENGINE_LIBRARIES} + ${GSTREAMER_BASE_LIBRARIES} + ${GSTREAMER_LIBRARIES} ${QTSINGLEAPPLICATION_LIBRARIES} ${QTSINGLECOREAPPLICATION_LIBRARIES} ${QTIOCOMPRESSOR_LIBRARIES} diff --git a/src/config.h.in b/src/config.h.in index 31e16b388..0068378f4 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -33,12 +33,6 @@ #cmakedefine SNOW_LEOPARD #cmakedefine LEOPARD #cmakedefine HAVE_SPARKLE - -#cmakedefine HAVE_GSTREAMER -#cmakedefine HAVE_LIBVLC -#cmakedefine HAVE_LIBXINE -#cmakedefine HAVE_QT_PHONON - #cmakedefine HAVE_STATIC_SQLITE #cmakedefine HAVE_LIBGPOD diff --git a/src/core/commandlineoptions.cpp b/src/core/commandlineoptions.cpp index 9e2f0611d..641cb6541 100644 --- a/src/core/commandlineoptions.cpp +++ b/src/core/commandlineoptions.cpp @@ -48,8 +48,7 @@ const char* CommandlineOptions::kHelpText = "\n" "%20:\n" " -o, --show-osd %21\n" - " -e, --engine %22\n" - " -g, --language %23\n"; + " -g, --language %22\n"; CommandlineOptions::CommandlineOptions(int argc, char** argv) @@ -62,16 +61,7 @@ CommandlineOptions::CommandlineOptions(int argc, char** argv) seek_to_(-1), seek_by_(0), play_track_at_(-1), - show_osd_(false), -#ifdef HAVE_GSTREAMER - engine_(Engine::Type_GStreamer) -#elif defined(HAVE_LIBVLC) - engine_(Engine::Type_VLC) -#elif defined(HAVE_LIBXINE) - engine_(Engine::Type_Xine) -#elif defined(HAVE_QT_PHONON) - engine_(Engine::Type_QtPhonon) -#endif + show_osd_(false) { #ifdef Q_OS_DARWIN // Remove -psn_xxx option that Mac passes when opened from Finder. @@ -116,7 +106,6 @@ bool CommandlineOptions::Parse() { {"play-track", required_argument, 0, 'k'}, {"show-osd", no_argument, 0, 'o'}, - {"engine", required_argument, 0, 'e'}, {"language", required_argument, 0, 'g'}, {0, 0, 0, 0} @@ -125,7 +114,7 @@ bool CommandlineOptions::Parse() { // Parse the arguments bool ok = false; forever { - int c = getopt_long(argc_, argv_, "hptusrfv:alk:oe:g:", kOptions, NULL); + int c = getopt_long(argc_, argv_, "hptusrfv:alk:og:", kOptions, NULL); // End of the options if (c == -1) @@ -152,7 +141,6 @@ bool CommandlineOptions::Parse() { tr("Play the th track in the playlist"), tr("Other options"), tr("Display the on-screen-display"), - tr("Select engine"), tr("Change the language")); std::cout << translated_help_text.toLocal8Bit().constData(); @@ -192,39 +180,6 @@ bool CommandlineOptions::Parse() { if (!ok) play_track_at_ = -1; break; - case 'e': - { - ok = true; - QString engine = optarg; - if(engine == "gst") - engine_ = Engine::Type_GStreamer; - else if(engine == "vlc") - engine_ = Engine::Type_VLC; - else if(engine == "xine") - engine_ = Engine::Type_Xine; - else if(engine == "qt-phonon") - engine_ = Engine::Type_QtPhonon; - else - { - qFatal("%s%s", - tr("Unknown audio engine \"%1\". Choices are:").arg(engine).toAscii().data(), -#ifdef HAVE_GSTREAMER - " gst" -#endif -#ifdef HAVE_LIBVLC - " vlc" -#endif -#ifdef HAVE_LIBXINE - " xine" -#endif -#ifdef HAVE_QT_PHONON - " qt-phonon" -#endif - ); - } - } - break; - case '?': default: return false; diff --git a/src/core/commandlineoptions.h b/src/core/commandlineoptions.h index 36335b29f..4bf2ba84d 100644 --- a/src/core/commandlineoptions.h +++ b/src/core/commandlineoptions.h @@ -22,8 +22,6 @@ #include #include -#include "engines/engine_fwd.h" - class CommandlineOptions { friend QDataStream& operator<<(QDataStream& s, const CommandlineOptions& a); friend QDataStream& operator>>(QDataStream& s, CommandlineOptions& a); @@ -62,7 +60,6 @@ class CommandlineOptions { int play_track_at() const { return play_track_at_; } bool show_osd() const { return show_osd_; } QList urls() const { return urls_; } - Engine::Type engine() const { return engine_; } QString language() const { return language_; } QByteArray Serialize() const; @@ -95,7 +92,6 @@ class CommandlineOptions { int seek_by_; int play_track_at_; bool show_osd_; - Engine::Type engine_; QString language_; QList urls_; diff --git a/src/core/player.cpp b/src/core/player.cpp index 4194dd5cb..108015b76 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -18,24 +18,13 @@ #include "config.h" #include "player.h" #include "engines/enginebase.h" +#include "engines/gstengine.h" #include "library/librarybackend.h" #include "playlist/playlist.h" #include "playlist/playlistitem.h" #include "playlist/playlistmanager.h" #include "mpris_common.h" -#ifdef HAVE_GSTREAMER -# include "engines/gstengine.h" -#endif -#ifdef HAVE_LIBVLC -# include "engines/vlcengine.h" -#endif -#ifdef HAVE_LIBXINE -# include "engines/xine-engine.h" -#endif -#ifdef HAVE_QT_PHONON -# include "engines/phononengine.h" -#endif #ifdef HAVE_LIBLASTFM # include "radio/lastfmservice.h" #endif @@ -59,7 +48,7 @@ Player::Player(MainWindow* main_window, PlaylistManager* playlists, #ifdef HAVE_LIBLASTFM LastFMService* lastfm, #endif - Engine::Type engine, QObject* parent) + QObject* parent) : QObject(parent), art_loader_(new mpris::ArtLoader(this)), mpris1_(NULL), @@ -68,7 +57,7 @@ Player::Player(MainWindow* main_window, PlaylistManager* playlists, #ifdef HAVE_LIBLASTFM lastfm_(lastfm), #endif - engine_(CreateEngine(engine)), + engine_(new GstEngine), stream_change_type_(Engine::First), last_state_(Engine::Empty), volume_before_mute_(50) @@ -101,36 +90,6 @@ Player::Player(MainWindow* main_window, PlaylistManager* playlists, Player::~Player() { } -EngineBase* Player::CreateEngine(Engine::Type engine) { - switch(engine) { -#ifdef HAVE_GSTREAMER - case Engine::Type_GStreamer: - return new GstEngine(); - break; -#endif -#ifdef HAVE_LIBVLC - case Engine::Type_VLC: - return new VlcEngine(); - break; -#endif -#ifdef HAVE_LIBXINE - case Engine::Type_Xine: - return new XineEngine(); - break; -#endif -#ifdef HAVE_QT_PHONON - case Engine::Type_QtPhonon: - return new PhononEngine(); - break; -#endif - default: - qFatal("Selected engine not compiled in"); - break; - } - /* NOT REACHED */ - return NULL; -} - void Player::Init() { if (!engine_->Init()) qFatal("Error initialising audio engine"); diff --git a/src/core/player.h b/src/core/player.h index ef6999b1a..1feee067d 100644 --- a/src/core/player.h +++ b/src/core/player.h @@ -56,10 +56,9 @@ class Player : public QObject { #ifdef HAVE_LIBLASTFM LastFMService* lastfm, #endif - Engine::Type engine, QObject* parent = 0); + QObject* parent = 0); ~Player(); - EngineBase* CreateEngine(Engine::Type engine); void Init(); EngineBase* engine() const { return engine_.get(); } diff --git a/src/core/songloader.cpp b/src/core/songloader.cpp index 478936fc8..db0390738 100644 --- a/src/core/songloader.cpp +++ b/src/core/songloader.cpp @@ -52,18 +52,14 @@ SongLoader::SongLoader(LibraryBackendInterface* library, QObject *parent) timeout_timer_->setSingleShot(true); -#ifdef HAVE_GSTREAMER connect(timeout_timer_, SIGNAL(timeout()), SLOT(Timeout())); -#endif } SongLoader::~SongLoader() { -#ifdef HAVE_GSTREAMER if (pipeline_) { state_ = Finished; gst_element_set_state(pipeline_.get(), GST_STATE_NULL); } -#endif // HAVE_GSTREAMER } SongLoader::Result SongLoader::Load(const QUrl& url) { @@ -80,15 +76,8 @@ SongLoader::Result SongLoader::Load(const QUrl& url) { return Success; } -#ifdef HAVE_GSTREAMER timeout_timer_->start(timeout_); return LoadRemote(); -#else - // If we don't have GStreamer we can't check the type of remote playlists, - // so just assume it's a raw stream and get on with our lives. - AddAsRawStream(); - return Success; -#endif } SongLoader::Result SongLoader::LoadLocal(const QString& filename, bool block, @@ -212,7 +201,6 @@ void SongLoader::Timeout() { } void SongLoader::StopTypefind() { -#ifdef HAVE_GSTREAMER // Destroy the pipeline if (pipeline_) { gst_element_set_state(pipeline_.get(), GST_STATE_NULL); @@ -233,12 +221,10 @@ void SongLoader::StopTypefind() { // It wasn't a playlist - just put the URL in as a stream AddAsRawStream(); } -#endif // HAVE_GSTREAMER emit LoadFinished(success_); } -#ifdef HAVE_GSTREAMER SongLoader::Result SongLoader::LoadRemote() { qDebug() << "Loading remote file" << url_; @@ -439,4 +425,3 @@ void SongLoader::StopTypefindAsync(bool success) { metaObject()->invokeMethod(this, "StopTypefind", Qt::QueuedConnection); } -#endif // HAVE_GSTREAMER diff --git a/src/core/songloader.h b/src/core/songloader.h index 223712aed..dc543377f 100644 --- a/src/core/songloader.h +++ b/src/core/songloader.h @@ -21,14 +21,11 @@ #include #include -#include "config.h" #include "song.h" #include -#ifdef HAVE_GSTREAMER -# include -#endif +#include class LibraryBackendInterface; class ParserBase; @@ -79,7 +76,6 @@ private: void AddAsRawStream(); -#ifdef HAVE_GSTREAMER Result LoadRemote(); // GStreamer callbacks @@ -92,7 +88,6 @@ private: void ErrorMessageReceived(GstMessage* msg); void EndOfStreamReached(); void MagicReady(); -#endif // HAVE_GSTREAMER private: static QSet sRawUriSchemes; @@ -112,9 +107,7 @@ private: QByteArray buffer_; LibraryBackendInterface* library_; -#ifdef HAVE_GSTREAMER boost::shared_ptr pipeline_; -#endif }; #endif // SONGLOADER_H diff --git a/src/engines/engine_fwd.h b/src/engines/engine_fwd.h index a809c4b84..ff5156d85 100644 --- a/src/engines/engine_fwd.h +++ b/src/engines/engine_fwd.h @@ -10,13 +10,6 @@ namespace Engine struct SimpleMetaBundle; class Base; - enum Type { - Type_GStreamer, - Type_VLC, - Type_Xine, - Type_QtPhonon, - }; - /** * You should return: * Playing when playing, diff --git a/src/engines/phononengine.cpp b/src/engines/phononengine.cpp deleted file mode 100644 index 866b1132c..000000000 --- a/src/engines/phononengine.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* This file is part of Clementine. - Copyright 2010, David Sansome - - Clementine 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. - - Clementine 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 Clementine. If not, see . -*/ - -#include "phononengine.h" - -#include - -PhononEngine::PhononEngine() - : media_object_(new Phonon::MediaObject(this)), - audio_output_(new Phonon::AudioOutput(Phonon::MusicCategory, this)), - state_timer_(new QTimer(this)), - seek_offset_(-1) -{ - 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) { - // TODO - return true; -} - -bool PhononEngine::Load(const QUrl &url, Engine::TrackChangeType change ) { - media_object_->setCurrentSource(Phonon::MediaSource(url)); - return true; -} - -bool PhononEngine::Play(uint offset) { - // The seek happens in PhononStateChanged - phonon doesn't seem to change - // currentTime() if we seek before we start playing :S - seek_offset_ = offset; - - media_object_->play(); - return true; -} - -void PhononEngine::Stop() { - 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(uint ms) { - media_object_->seek(ms); -} - -void PhononEngine::SetVolumeSW(uint volume) { - audio_output_->setVolume(volume); -} - -void PhononEngine::PhononFinished() { - emit TrackEnded(); -} - -void PhononEngine::PhononStateChanged(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()); -} diff --git a/src/engines/phononengine.h b/src/engines/phononengine.h deleted file mode 100644 index 013955f51..000000000 --- a/src/engines/phononengine.h +++ /dev/null @@ -1,68 +0,0 @@ -/* This file is part of Clementine. - Copyright 2010, David Sansome - - Clementine 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. - - Clementine 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 Clementine. If not, see . -*/ - -#ifndef PHONONENGINE_H -#define PHONONENGINE_H - -#include "enginebase.h" - -#include -#include - -class QTimer; - -class PhononEngine : public Engine::Base { - Q_OBJECT - - public: - PhononEngine(); - ~PhononEngine(); - - bool Init(); - - bool CanDecode( const QUrl &url ); - - bool Load( const QUrl &url, Engine::TrackChangeType change ); - bool Play( uint offset = 0 ); - void Stop(); - void Pause(); - void Unpause(); - - Engine::State state() const; - uint position() const; - uint length() const; - - void Seek( uint ms ); - - protected: - void SetVolumeSW( uint percent ); - - private slots: - void PhononFinished(); - void PhononStateChanged(Phonon::State new_state); - void StateTimeoutExpired(); - - private: - Phonon::MediaObject* media_object_; - Phonon::AudioOutput* audio_output_; - - QTimer* state_timer_; - - qint64 seek_offset_; -}; - -#endif // PHONONENGINE_H diff --git a/src/engines/vlcengine.cpp b/src/engines/vlcengine.cpp deleted file mode 100644 index dc55952ca..000000000 --- a/src/engines/vlcengine.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* This file is part of Clementine. - Copyright 2010, David Sansome - - Clementine 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. - - Clementine 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 Clementine. If not, see . -*/ - -#include "vlcengine.h" -#include "vlcscopedref.h" - -#include -#include -#include -#include - -#include - -VlcEngine* VlcEngine::sInstance = NULL; - -VlcEngine::VlcEngine() - : instance_(NULL), - player_(NULL), - scope_data_(4096), - state_(Engine::Empty) -{ - static const char * const args[] = { - "-I", "dummy", // Don't use any interface - "--ignore-config", // Don't use VLC's config - "--extraintf=logger", // log anything - "--verbose=2", // be much more verbose then normal for debugging purpose - - // Our scope plugin - "--audio-filter=clementine_scope", - "--no-plugins-cache", - - // Try to stop audio stuttering - "--file-caching=500", // msec - "--http-caching=500", - -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - "--aout=alsa", // The default, pulseaudio, is buggy -#endif - }; - - // Create the VLC instance - libvlc_exception_init(&exception_); - instance_ = libvlc_new(sizeof(args) / sizeof(args[0]), args, &exception_); - HandleErrors(); - - // Create the media player - player_ = libvlc_media_player_new(instance_, &exception_); - HandleErrors(); - - // Add event handlers - libvlc_event_manager_t* player_em = - libvlc_media_player_event_manager(player_, &exception_); - HandleErrors(); - - AttachCallback(player_em, libvlc_MediaPlayerEncounteredError, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerNothingSpecial, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerOpening, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerBuffering, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerPlaying, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerPaused, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerStopped, StateChangedCallback); - AttachCallback(player_em, libvlc_MediaPlayerEndReached, StateChangedCallback); - HandleErrors(); - - sInstance = this; -} - -VlcEngine::~VlcEngine() { - libvlc_media_player_stop(player_, &exception_); - libvlc_media_player_release(player_); - libvlc_release(instance_); - HandleErrors(); -} - -void VlcEngine::AttachCallback(libvlc_event_manager_t* em, libvlc_event_type_t type, - libvlc_callback_t callback) { - libvlc_event_attach(em, type, callback, this, &exception_); - HandleErrors(); -} - -void VlcEngine::StateChangedCallback(const libvlc_event_t* e, void* data) { - VlcEngine* engine = reinterpret_cast(data); - - switch (e->type) { - case libvlc_MediaPlayerNothingSpecial: - case libvlc_MediaPlayerStopped: - case libvlc_MediaPlayerEncounteredError: - engine->state_ = Engine::Empty; - break; - - case libvlc_MediaPlayerOpening: - case libvlc_MediaPlayerBuffering: - case libvlc_MediaPlayerPlaying: - engine->state_ = Engine::Playing; - break; - - case libvlc_MediaPlayerPaused: - engine->state_ = Engine::Paused; - break; - - case libvlc_MediaPlayerEndReached: - engine->state_ = Engine::Idle; - emit engine->TrackEnded(); - return; // Don't emit state changed here - } - - emit engine->StateChanged(engine->state_); -} - -bool VlcEngine::Init() { - return true; -} - -bool VlcEngine::CanDecode(const QUrl &url) { - // TODO - return true; -} - -bool VlcEngine::Load(const QUrl &url, Engine::TrackChangeType change) { - // Create the media object - VlcScopedRef media( - libvlc_media_new(instance_, url.toEncoded().constData(), &exception_)); - if (libvlc_exception_raised(&exception_)) - return false; - - libvlc_media_player_set_media(player_, media, &exception_); - if (libvlc_exception_raised(&exception_)) - return false; - - return true; -} - -bool VlcEngine::Play(uint offset) { - libvlc_media_player_play(player_, &exception_); - if (libvlc_exception_raised(&exception_)) - return false; - - Seek(offset); - - return true; -} - -void VlcEngine::Stop() { - libvlc_media_player_stop(player_, &exception_); - HandleErrors(); -} - -void VlcEngine::Pause() { - libvlc_media_player_pause(player_, &exception_); - HandleErrors(); -} - -void VlcEngine::Unpause() { - libvlc_media_player_play(player_, &exception_); - HandleErrors(); -} - -uint VlcEngine::position() const { - bool is_playing = libvlc_media_player_is_playing( - player_, const_cast(&exception_)); - HandleErrors(); - - if (!is_playing) - return 0; - - float pos = libvlc_media_player_get_position( - player_, const_cast(&exception_)); - HandleErrors(); - - return pos * length(); -} - -uint VlcEngine::length() const { - bool is_playing = libvlc_media_player_is_playing( - player_, const_cast(&exception_)); - HandleErrors(); - - if (!is_playing) - return 0; - - libvlc_time_t len = libvlc_media_player_get_length( - player_, const_cast(&exception_)); - HandleErrors(); - - return len; -} - -void VlcEngine::Seek(uint ms) { - uint len = length(); - if (len == 0) - return; - - float pos = float(ms) / len; - - libvlc_media_player_set_position(player_, pos, &exception_); - HandleErrors(); -} - -void VlcEngine::SetVolumeSW(uint volume) { - libvlc_audio_set_volume(instance_, volume, &exception_); - HandleErrors(); -} - -void VlcEngine::HandleErrors() const { - if (libvlc_exception_raised(&exception_)) { - qFatal("libvlc error: %s", libvlc_exception_get_message(&exception_)); - } -} - -void VlcEngine::SetScopeData(float* data, int size) { - if (!sInstance) - return; - - QMutexLocker l(&sInstance->scope_mutex_); - - // This gets called by our VLC plugin. Just push the data on to the end of - // the circular buffer and let it get consumed by scope() - for (int i=0 ; iscope_data_.push_back(data[i]); - } -} - -const Engine::Scope& VlcEngine::Scope() { - QMutexLocker l(&scope_mutex_); - - // Leave the scope unchanged if there's not enough data - if (scope_data_.size() < uint(kScopeSize)) - return scope_; - - // Take the samples off the front of the circular buffer - for (uint i=0 ; i - - Clementine 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. - - Clementine 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 Clementine. If not, see . -*/ - -#ifndef VLCENGINE_H -#define VLCENGINE_H - -#include "enginebase.h" - -#include -#include - -#include - -class QTimer; - -class VlcEngine : public Engine::Base { - Q_OBJECT - - public: - VlcEngine(); - ~VlcEngine(); - - bool Init(); - - bool CanDecode( const QUrl &url ); - - bool Load( const QUrl &url, Engine::TrackChangeType change ); - bool Play( uint offset = 0 ); - void Stop(); - void Pause(); - void Unpause(); - - Engine::State state() const { return state_; } - uint position() const; - uint length() const; - - void Seek( uint ms ); - - static void SetScopeData(float* data, int size); - const Engine::Scope& Scope(); - - protected: - void SetVolumeSW( uint percent ); - - private: - void HandleErrors() const; - void AttachCallback(libvlc_event_manager_t* em, libvlc_event_type_t type, - libvlc_callback_t callback); - static void StateChangedCallback(const libvlc_event_t* e, void* data); - - private: - // The callbacks need access to this - static VlcEngine* sInstance; - - // VLC bits and pieces - libvlc_exception_t exception_; - libvlc_instance_t* instance_; - libvlc_media_player_t* player_; - - // Our clementine_scope VLC plugin puts data in here - QMutex scope_mutex_; - boost::circular_buffer scope_data_; - - Engine::State state_; -}; - -#endif // VLCENGINE_H diff --git a/src/engines/vlcscopedref.h b/src/engines/vlcscopedref.h deleted file mode 100644 index c6214598d..000000000 --- a/src/engines/vlcscopedref.h +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of Clementine. - Copyright 2010, David Sansome - - Clementine 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. - - Clementine 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 Clementine. If not, see . -*/ - -#ifndef VLCSCOPEDREF_H -#define VLCSCOPEDREF_H - -#include - -template -class VlcScopedRef { - public: - VlcScopedRef(T* ptr); - ~VlcScopedRef(); - - operator T* () const { return ptr_; } - operator bool () const { return ptr_; } - T* operator ->() const { return ptr_; } - - private: - VlcScopedRef(VlcScopedRef&) {} - VlcScopedRef& operator =(const VlcScopedRef&) { return *this; } - - T* ptr_; -}; - - -#define VLCSCOPEDREF_DEFINE2(type, dtor) \ - template <> void VlcScopedRef_Release(libvlc_##type##_t* ptr) { \ - dtor(ptr); \ - } -#define VLCSCOPEDREF_DEFINE(type) VLCSCOPEDREF_DEFINE2(type, libvlc_##type##_release) - -template -void VlcScopedRef_Release(T* ptr); - -VLCSCOPEDREF_DEFINE2(instance, libvlc_release); -VLCSCOPEDREF_DEFINE(media_player); -VLCSCOPEDREF_DEFINE(media); - -template <> void VlcScopedRef_Release(char* ptr) { free(ptr); } - -template -VlcScopedRef::VlcScopedRef(T* ptr) - : ptr_(ptr) { -} - -template -VlcScopedRef::~VlcScopedRef() { - VlcScopedRef_Release(ptr_); -} - -#endif // VLCSCOPEDREF_H diff --git a/src/engines/xine-engine.cpp b/src/engines/xine-engine.cpp deleted file mode 100644 index 142e7b5b8..000000000 --- a/src/engines/xine-engine.cpp +++ /dev/null @@ -1,1309 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 Christophe Thommeret * - * (C) 2005 Ian Monroe * - * (C) 2005,6 Mark Kretschmann * - * (C) 2004,5 Max Howell * - * (C) 2003,4 J. Kofler * - * * - * This program 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 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#define DEBUG_PREFIX "xine-engine" - -#include "xine-engine.h" -#include "xine-scope.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern "C" -{ -#include -} - -#ifndef LLONG_MAX -#define LLONG_MAX 9223372036854775807LL -#endif - - -//define this to use xine in a more standard way -#ifdef Q_OS_WIN32 -#define XINE_SAFE_MODE -#endif - - -///some logging static globals -namespace Log -{ - static uint bufferCount = 0; - static uint scopeCallCount = 1; //prevent divideByZero - static uint noSuitableBuffer = 0; -} - -static Fader *s_fader = 0; -static OutFader *s_outfader = 0; - - -XineEngine::XineEngine() - : EngineBase() - , xine_( 0 ) - , stream_( 0 ) - , audioPort_( 0 ) - , eventQueue_( 0 ) - , post_( 0 ) - , preamp_( 1.0 ) - , stopFader_( false ) - , fadeOutRunning_ ( false ) - , equalizerEnabled_( false ) - , prune_(NULL) -{ - settings_.beginGroup(kSettingsGroup); - reloadSettings(); -} - -XineEngine::~XineEngine() -{ - // Wait until the fader thread is done - if( s_fader ) { - stopFader_ = true; - s_fader->resume(); // safety call if the engine is in the pause state - s_fader->wait(); - } - - // Wait until the prune scope thread is done - if (prune_) { - prune_->exit(); - prune_->wait(); - } - - delete s_fader; - delete s_outfader; - delete prune_; - - if( fadeoutOnExit_ ) { - bool terminateFader = false; - fadeOut( fadeoutDuration_, &terminateFader, true ); // true == exiting - } - - //if( xine_ ) xine_config_save( xine_, configPath() ); - - if( stream_ ) xine_close( stream_ ); - if( eventQueue_ ) xine_event_dispose_queue( eventQueue_ ); - if( stream_ ) xine_dispose( stream_ ); - if( audioPort_ ) xine_close_audio_driver( xine_, audioPort_ ); - if( post_ ) xine_post_dispose( xine_, post_ ); - if( xine_ ) xine_exit( xine_ ); - - qDebug() << "xine closed"; - - qDebug() << "Scope statistics:"; - qDebug() << " Average list size: " << Log::bufferCount / Log::scopeCallCount; - qDebug() << " Buffer failure: " << double(Log::noSuitableBuffer*100) / Log::scopeCallCount << "%"; -} - -void XineEngine::reloadSettings() { - currentAudioPlugin_ = settings_.value("XineAudioOutput", "auto").toString(); - fadeoutEnabled_ = settings_.value("FadeoutEnabled", true).toBool(); - fadeoutOnExit_ = settings_.value("FadeoutOnExit", true).toBool(); - fadeoutDuration_ = settings_.value("FadeoutDuration", 2000).toInt(); - crossfadeEnabled_ = settings_.value("CrossfadeEnabled", true).toBool(); -} - -bool -XineEngine::Init() -{ - qDebug() << "'Bringing joy to small mexican gerbils, a few weeks at a time.'"; - -#ifdef Q_OS_WIN32 - putenv(QString("XINE_PLUGIN_PATH=" + QCoreApplication::applicationDirPath() + "/xine/plugins").toAscii().constData()); -#endif // Q_OS_WIN32 - -#ifdef Q_OS_DARWIN - setenv("XINE_PLUGIN_PATH", QString(QCoreApplication::applicationDirPath() + "/../PlugIns/xine").toAscii().constData(), 1); -#endif // Q_OS_DARWIN - - QMutexLocker l(&initMutex_); - - xine_ = xine_new(); - - if( !xine_ ) { - emit Error("Could not initialize xine."); - return false; - } - -#ifdef XINE_SAFE_MODE - xine_engine_set_param( xine_, XINE_ENGINE_PARAM_VERBOSITY, 99 ); -#endif - - //xine_config_load( xine_, configPath() ); - //debug() << "w00t" << configPath() << endl; - - xine_init( xine_ ); - - makeNewStream(); - -#ifndef XINE_SAFE_MODE - prune_ = new PruneScopeThread(this); - prune_->start(); -#endif - - return true; -} - -bool -XineEngine::makeNewStream() -{ - audioPort_ = xine_open_audio_driver( xine_, currentAudioPlugin_.toLocal8Bit().constData(), NULL ); - if( !audioPort_ ) { - //TODO make engine method that is the same but parents the dialog for us - emit Error("xine was unable to initialize any audio drivers."); - return false; - } - - stream_ = xine_stream_new( xine_, audioPort_, NULL ); - if( !stream_ ) { - xine_close_audio_driver( xine_, audioPort_ ); - audioPort_ = NULL; - emit Error("Could not create a new xine stream"); - return false; - } - - if( eventQueue_ ) - xine_event_dispose_queue( eventQueue_ ); - - xine_event_create_listener_thread( - eventQueue_ = xine_event_new_queue( stream_ ), - &XineEngine::XineEventListener, - (void*)this ); - -#ifndef XINE_SAFE_MODE - //implemented in xine-scope.h - post_ = scope_plugin_new( xine_, audioPort_ ); - - xine_set_param( stream_, XINE_PARAM_METRONOM_PREBUFFER, 6000 ); - xine_set_param( stream_, XINE_PARAM_IGNORE_VIDEO, 1 ); -#endif -#ifdef XINE_PARAM_EARLY_FINISHED_EVENT - if ( xine_check_version(1,1,1) && !(xfadeLength_ > 0) ) { - // enable gapless playback - qDebug() << "gapless playback enabled."; - //xine_set_param(stream_, XINE_PARAM_EARLY_FINISHED_EVENT, 1 ); - } -#endif - return true; -} - -// Makes sure an audio port and a stream exist. -bool -XineEngine::ensureStream() -{ - if( !stream_ ) - return makeNewStream(); - - return true; -} - -bool -XineEngine::Load( const QUrl &url ,Engine::TrackChangeType change ) -{ - if( !ensureStream() ) - return false; - - Engine::Base::Load( url, change ); - - if( s_outfader ) { - s_outfader->finish(); - delete s_outfader; - } - - if( xfadeLength_ > 0 && xine_get_status( stream_ ) == XINE_STATUS_PLAY && - url.scheme().toLower() == "file" && - xine_get_param( stream_, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE && - ( xfadeNextTrack_ || //set by engine controller when switching tracks automatically - crossfadeEnabled_)) - { - xfadeNextTrack_ = false; - // Stop a probably running fader - if( s_fader ) { - stopFader_ = true; - s_fader->finish(); // makes the fader stop abruptly - delete s_fader; - } - s_fader = new Fader( this, xfadeLength_ ); - setEqualizerParameters( intPreamp_, equalizerGains_ ); - } - - // for users who stubbonly refuse to use DMIX or buy a good soundcard - // why doesn't xine do this? I cannot say. - xine_close( stream_ ); - - qDebug() << "Before xine_open() *****"; - - if( xine_open( stream_, url.toEncoded() ) ) - { - qDebug() << "After xine_open() *****"; - -#ifndef XINE_SAFE_MODE - xine_post_out_t *source = xine_get_audio_source( stream_ ); - xine_post_in_t *target = (xine_post_in_t*)xine_post_input( post_, const_cast("audio in") ); - xine_post_wire( source, target ); -#endif - - playlistChanged(); - - return true; - } - else - { -#ifdef XINE_PARAM_GAPLESS_SWITCH - //if ( xine_check_version(1,1,1) && !(xfadeLength_ > 0) ) - //xine_set_param( stream_, XINE_PARAM_GAPLESS_SWITCH, 0); -#endif - } - - // FAILURE to load! - //s_fader will delete itself - determineAndShowErrorMessage(); - - return false; -} - -bool -XineEngine::Play( uint offset ) -{ - if( !ensureStream() ) - return false; - - const bool has_audio = xine_get_stream_info( stream_, XINE_STREAM_INFO_HAS_AUDIO ); - const bool audio_handled = xine_get_stream_info( stream_, XINE_STREAM_INFO_AUDIO_HANDLED ); - - if (has_audio && audio_handled && xine_play( stream_, 0, offset )) - { - if( s_fader ) - s_fader->start( QThread::LowestPriority ); - - emit StateChanged( Engine::Playing ); - - return true; - } - - //we need to stop the track that is prepped for crossfade - delete s_fader; - - emit StateChanged( Engine::Empty ); - - determineAndShowErrorMessage(); - - xine_close( stream_ ); - - return false; -} - -void -XineEngine::determineAndShowErrorMessage() -{ - QString body; - - qDebug() << "xine_get_error()"; - switch (xine_get_error( stream_ )) { - case XINE_ERROR_NO_INPUT_PLUGIN: - body = "No suitable input plugin. This often means that the url's protocol is not supported. Network failures are other possible causes."; - break; - - case XINE_ERROR_NO_DEMUX_PLUGIN: - body = "No suitable demux plugin. This often means that the file format is not supported."; - break; - - case XINE_ERROR_DEMUX_FAILED: - body = "Demuxing failed."; - break; - - case XINE_ERROR_INPUT_FAILED: - body = "Could not open file."; - break; - - case XINE_ERROR_MALFORMED_MRL: - body = "The location is malformed."; - break; - - case XINE_ERROR_NONE: - // xine is thick. xine doesn't think there is an error - // but there may be! We check for other errors below. - - default: - if (!xine_get_stream_info( stream_, XINE_STREAM_INFO_AUDIO_HANDLED )) - { - // xine can read the plugin but it didn't find any codec - // THUS xine=daft for telling us it could handle the format in canDecode! - body = "There is no available decoder."; - QString const ext = QFileInfo(url_.path()).completeSuffix(); - // TODO - //if (ext == "mp3" && EngineController::installDistroCodec( "xine-engine" )) - // return; - } - else if (!xine_get_stream_info( stream_, XINE_STREAM_INFO_HAS_AUDIO )) - body = "There is no audio channel!"; - break; - } - - // TODO - qWarning() << body; -} - -void -XineEngine::Stop() -{ - if( s_fader && s_fader->isRunning()) - s_fader->resume(); // safety call if the engine is in the pause state - - if ( !stream_ ) - return; - - if( (fadeoutEnabled_ && !fadeOutRunning_) || state() == Engine::Paused ) - { - s_outfader = new OutFader( this, fadeoutDuration_ ); - s_outfader->start(); - ::usleep( 100 ); //to be sure engine state won't be changed before it is checked in fadeOut() - url_ = QUrl(); //to ensure we return Empty from state() - - std::fill( scope_.begin(), scope_.end(), 0 ); - } - else if( !fadeOutRunning_ ) - { - xine_stop( stream_ ); - xine_close( stream_ ); - xine_set_param( stream_, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); - } - - emit StateChanged( Engine::Empty ); -} - - void -XineEngine::Pause() -{ - if ( !stream_ ) - return; - - if( xine_get_param( stream_, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE ) - { - if( s_fader && s_fader->isRunning() ) - s_fader->pause(); - - xine_set_param( stream_, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); - xine_set_param( stream_, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); - emit StateChanged( Engine::Paused ); - - } -} - -void -XineEngine::Unpause() -{ - if ( !stream_ ) - return; - - if( xine_get_param( stream_, XINE_PARAM_SPEED ) == XINE_SPEED_PAUSE ) - { - if( s_fader && s_fader->isRunning() ) - s_fader->resume(); - - xine_set_param( stream_, XINE_PARAM_SPEED, XINE_SPEED_NORMAL ); - emit StateChanged( Engine::Playing ); - } -} - -Engine::State -XineEngine::state() const -{ - if ( !stream_ || fadeOutRunning_ ) - return Engine::Empty; - - switch( xine_get_status( stream_ ) ) - { - case XINE_STATUS_PLAY: return xine_get_param( stream_, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE ? Engine::Playing : Engine::Paused; - case XINE_STATUS_IDLE: return Engine::Empty; - case XINE_STATUS_STOP: - default: return url_.isEmpty() ? Engine::Empty : Engine::Idle; - } -} - -uint -XineEngine::position() const -{ - if ( state() == Engine::Empty ) - return 0; - - int pos; - int time = 0; - int length; - - // Workaround for problems when you seek too quickly, see BUG 99808 - int tmp = 0, i = 0; - while( ++i < 4 ) - { - xine_get_pos_length( stream_, &pos, &time, &length ); - if( time > tmp ) break; - usleep( 100000 ); - } - - // Here we check for new metadata periodically, because xine does not emit an event - // in all cases (e.g. with ogg streams). See BUG 122505 - if ( state() != Engine::Idle && state() != Engine::Empty ) - { - const Engine::SimpleMetaBundle bundle = fetchMetaData(); - if( bundle.title != currentBundle_.title || bundle.artist != currentBundle_.artist ) { - qDebug() << "Metadata received."; - currentBundle_ = bundle; - - XineEngine* p = const_cast( this ); - p->emit MetaData( bundle ); - } - } - - return time; -} - -uint -XineEngine::length() const -{ - if ( !stream_ ) - return 0; - - // xine often delivers nonsense values for VBR files and such, so we only - // use the length for remote files - - if( url_.scheme().toLower() == "file" ) - return 0; - - else { - int pos; - int time; - int length = 0; - - xine_get_pos_length( stream_, &pos, &time, &length ); - if( length < 0 ) - length=0; - - return length; - } -} - -void -XineEngine::Seek( uint ms ) -{ - if( !ensureStream() ) - return; - - if( xine_get_param( stream_, XINE_PARAM_SPEED ) == XINE_SPEED_PAUSE ) { - // FIXME this is a xine API issue really, they need to add a seek function - xine_play( stream_, 0, (int)ms ); - xine_set_param( stream_, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); - } - else - xine_play( stream_, 0, (int)ms ); -} - -void -XineEngine::SetVolumeSW( uint vol ) -{ - if ( !stream_ ) - return; - if( !s_fader ) - xine_set_param( stream_, XINE_PARAM_AUDIO_AMP_LEVEL, static_cast( vol * preamp_ ) ); -} - -void -XineEngine::fadeOut( uint fadeLength, bool* terminate, bool exiting ) -{ - if( fadeOutRunning_ ) //Let us not start another fadeout... - return; - - fadeOutRunning_ = !fadeOutRunning_; - const bool isPlaying = stream_ && ( xine_get_status( stream_ ) == XINE_STATUS_PLAY ); - const float originalVol = Engine::Base::MakeVolumeLogarithmic( volume_ ) * preamp_; - - // On shutdown, limit fadeout to 3 secs max, so that we don't risk getting killed - const int length = exiting ? qMin( fadeLength, 3000u ) : fadeLength; - - if( length > 0 && isPlaying ) - { - // fader-class doesn't work in this spot as is, so some parts need to be copied here... (ugly) - uint stepsCount = length < 1000 ? length / 10 : 100; - uint stepSizeUs = (int)( 1000.0 * (float)length / (float)stepsCount ); - - ::usleep( stepSizeUs ); - QTime t; - t.start(); - float mix = 0.0; - while ( mix < 1.0 ) - { - if( *terminate ) break; - - ::usleep( stepSizeUs ); - float vol = Engine::Base::MakeVolumeLogarithmic( volume_ ) * preamp_; - float mix = (float)t.elapsed() / (float)length; - if ( mix > 1.0 ) - { - break; - } - if ( stream_ ) - { - float v = 4.0 * (1.0 - mix) / 3.0; - xine_set_param( stream_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); - } - } - } - if( fadeOutRunning_ && stream_ ) - xine_set_param( stream_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint) originalVol ); - fadeOutRunning_ = !fadeOutRunning_; -} - -void -XineEngine::setEqualizerEnabled( bool enable ) -{ - if ( !stream_ ) - return; - - equalizerEnabled_ = enable; - - if( !enable ) { - QList gains; - for( uint x = 0; x < 10; x++ ) - gains << -101; // sets eq gains to zero. - - setEqualizerParameters( 0, gains ); - } -} - -/* - sets the eq params for xine engine - have to rescale eq params to fitting range (adapted from kaffeine and xfmedia) - - preamp -pre: (-100..100) -post: (0.1..1.9) - this is not really a preamp but we use the xine preamp parameter for our normal volume. so we make a postamp. - -gains -pre: (-100..100) -post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off) - */ -void -XineEngine::setEqualizerParameters( int preamp, const QList &gains ) -{ - if ( !stream_ ) - return; - - equalizerGains_ = gains; - intPreamp_ = preamp; - QList::ConstIterator it = gains.begin(); - - xine_set_param( stream_, XINE_PARAM_EQ_30HZ, int( (*it )*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_60HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_125HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_250HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_500HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_1000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_2000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_4000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_8000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( stream_, XINE_PARAM_EQ_16000HZ, int( (*++it)*0.995 + 100 ) ); - - preamp_ = ( preamp - 0.1 * preamp + 100 ) / 100.0; - SetVolume( volume_ ); -} - -bool -XineEngine::CanDecode( const QUrl &url ) -{ - static QStringList list; - if(list.isEmpty()) - { - QMutexLocker l(&const_cast(this)->initMutex_); - - if (list.isEmpty()) { - char* exts = xine_get_file_extensions( xine_ ); - list = QString(exts).split(' '); - free( exts ); exts = NULL; - //images - list.removeAll("png"); - list.removeAll("jpg"); - list.removeAll("jpeg"); - list.removeAll("gif"); - list.removeAll("ilbm"); - list.removeAll("iff"); - //subtitles - list.removeAll("asc"); - list.removeAll("txt"); - list.removeAll("sub"); - list.removeAll("srt"); - list.removeAll("smi"); - list.removeAll("ssa"); - //HACK we also check for m4a because xine plays them but - //for some reason doesn't return the extension - if(!list.contains("m4a")) - list << "m4a"; - } - } - - if (url.scheme() == "cdda") - // play audio CDs pls - return true; - - QString path = url.path(); - - // partial downloads from Konqi and other browsers - // tend to have a .part extension - if (path.endsWith( ".part" )) - path = path.left( path.length() - 5 ); - - const QString ext = path.mid( path.lastIndexOf( '.' ) + 1 ).toLower(); - - return list.contains( ext ); -} - -const Engine::Scope& -XineEngine::scope() -{ - if( !post_ || !stream_ || xine_get_status( stream_ ) != XINE_STATUS_PLAY ) - return scope_; - - MyNode* const myList = scope_plugin_list( post_ ); - metronom_t* const myMetronom = scope_plugin_metronom( post_ ); - const int myChannels = scope_plugin_channels( post_ ); - int scopeidx = 0; - - if (myChannels > 2) - return scope_; - - for( int n, frame = 0; frame < 512; ) - { - MyNode *best_node = 0; - - for( MyNode *node = myList->next; node != myList; node = node->next, Log::bufferCount++ ) - if( node->vpts <= currentVpts_ && (!best_node || node->vpts > best_node->vpts) ) - best_node = node; - - if( !best_node || best_node->vpts_end < currentVpts_ ) { - Log::noSuitableBuffer++; break; } - - int64_t - diff = currentVpts_; - diff -= best_node->vpts; - diff *= 1<<16; - diff /= myMetronom->pts_per_smpls; - - const int16_t* - data16 = best_node->mem; - data16 += diff; - - diff += diff % myChannels; //important correction to ensure we don't overflow the buffer - diff /= myChannels; //use units of frames, not samples - - //calculate the number of available samples in this buffer - n = best_node->num_frames; - n -= diff; - n += frame; //clipping for # of frames we need - - if( n > 512 ) - n = 512; //we don't want more than 512 frames - - for( int a, c; frame < n; ++frame, data16 += myChannels ) { - for( a = c = 0; c < myChannels; ++c ) - { - // we now give interleaved pcm to the scope - scope_[scopeidx++] = data16[c]; - if (myChannels == 1) // duplicate mono samples - scope_[scopeidx++] = data16[c]; - } - } - - currentVpts_ = best_node->vpts_end; - currentVpts_++; //FIXME needs to be done for some reason, or you get situations where it uses same buffer again and again - } - - Log::scopeCallCount++; - - return scope_; -} - -void -XineEngine::PruneScope() -{ - if ( !stream_ ) - return; - - //here we prune the buffer list regularly - - MyNode *myList = scope_plugin_list( post_ ); - - if ( ! myList ) return; - - //we operate on a subset of the list for thread-safety - MyNode * const first_node = myList->next; - MyNode const * const list_end = myList; - - currentVpts_ = (xine_get_status( stream_ ) == XINE_STATUS_PLAY) - ? xine_get_current_vpts( stream_ ) - : LLONG_MAX; //if state is not playing OR paused, empty the list - //: std::numeric_limits::max(); //TODO don't support crappy gcc 2.95 - - for( MyNode *prev = first_node, *node = first_node->next; node != list_end; node = node->next ) - { - //we never delete first_node - //this maintains thread-safety - if( node->vpts_end < currentVpts_ ) { - prev->next = node->next; - - free( node->mem ); - free( node ); - - node = prev; - } - - prev = node; - } -} - -bool -XineEngine::event( QEvent* e ) -{ -#define message static_cast(static_cast(e)->data()) - - switch( e->type() ) - { - case XineEvent::PlaybackFinished: //XINE_EVENT_UI_PLAYBACK_FINISHED - emit TrackEnded(); - return true; - - case XineEvent::InfoMessage: - emit InfoMessage( (*message).arg( url_.toString() ) ); - delete message; - return true; - - case XineEvent::StatusMessage: - emit StatusText( *message ); - delete message; - return true; - - case XineEvent::MetaInfoChanged: { //meta info has changed - qDebug() << "Metadata received."; - const Engine::SimpleMetaBundle bundle = fetchMetaData(); - if( bundle.title != currentBundle_.title || bundle.artist != currentBundle_.artist ) { - currentBundle_ = bundle; - - emit MetaData( bundle ); - } - return true; - } - - case XineEvent::Redirecting: - emit StatusText( QString("Redirecting to: ").arg( *message ) ); - Load( QUrl( *message ), Engine::Auto ); - Play(); - delete message; - return true; - case XineEvent::LastFMTrackChanged: - emit LastFmTrackChange(); - return true; - default: - ; - } - -#undef message - return false; -} - -//SLOT -void -XineEngine::playlistChanged() -{ - // TODO - /*#ifdef XINE_PARAM_EARLY_FINISHED_EVENT -#ifdef XINE_PARAM_GAPLESS_SWITCH -if ( xine_check_version(1,1,1) && !(xfadeLength_ > 0) -&& url_.isLocalFile() && Playlist::instance()->isTrackAfter() ) -{ -xine_set_param(stream_, XINE_PARAM_EARLY_FINISHED_EVENT, 1 ); -debug() << "XINE_PARAM_EARLY_FINISHED_EVENT enabled" << endl; -} -else -{ - //we don't want an early finish event if there is no track after the current one - xine_set_param(stream_, XINE_PARAM_EARLY_FINISHED_EVENT, 0 ); - debug() << "XINE_PARAM_EARLY_FINISHED_EVENT disabled" << endl; - } -#endif -#endif*/ -} - -static time_t last_error_time = 0; // hysteresis on xine errors -static int last_error = XINE_MSG_NO_ERROR; - -void -XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) -{ - time_t current; - - if( !p ) return; - -#define xe static_cast(p) - - switch( xineEvent->type ) - { - case XINE_EVENT_UI_SET_TITLE: - - qDebug() << "XINE_EVENT_UI_SET_TITLE"; - - QApplication::postEvent( xe, new XineEvent( XineEvent::MetaInfoChanged ) ); - - break; - - case XINE_EVENT_UI_PLAYBACK_FINISHED: - qDebug() << "XINE_EVENT_UI_PLAYBACK_FINISHED"; - -#ifdef XINE_PARAM_GAPLESS_SWITCH - // TODO - /*if ( xine_check_version(1,1,1) && xe->url_.isLocalFile() //Remote media break with gapless - //don't prepare for a track that isn't coming - && Playlist::instance() - && Playlist::instance()->isTrackAfter() - && !AmarokConfig::crossfade() ) - xine_set_param( xe->stream_, XINE_PARAM_GAPLESS_SWITCH, 1);*/ -#endif - //emit signal from GUI thread - QApplication::postEvent( xe, new XineEvent(XineEvent::PlaybackFinished) ); - break; - - case XINE_EVENT_PROGRESS: { - xine_progress_data_t* pd = (xine_progress_data_t*)xineEvent->data; - - QString - msg = "%1 %2%"; - msg = msg.arg( QString::fromUtf8( pd->description ) ) - .arg( QString::number(pd->percent) + QLocale::system().percent() ); - - XineEvent *e = new XineEvent( XineEvent::StatusMessage ); - e->setData( new QString( msg ) ); - - QApplication::postEvent( xe, e ); - - } break; - - case XINE_EVENT_MRL_REFERENCE_EXT: { - /// xine has read the stream and found it actually links to something else - /// so we need to play that instead - - QString message = QString::fromUtf8( - static_cast(xineEvent->data)->mrl); - XineEvent *e = new XineEvent( XineEvent::Redirecting ); - e->setData( new QString( message ) ); - - QApplication::postEvent( xe, e ); - - } break; - - case XINE_EVENT_UI_MESSAGE: - { - qDebug() << "message received from xine"; - - xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data; - QString message; - - switch( data->type ) - { - case XINE_MSG_NO_ERROR: - { - //series of \0 separated strings, terminated with a \0\0 - char str[2000]; - char *p = str; - for( char *msg = data->messages; !(*msg == '\0' && *(msg+1) == '\0'); ++msg, ++p ) - *p = *msg == '\0' ? '\n' : *msg; - *p = '\0'; - - qDebug() << str; - - break; - } - - case XINE_MSG_ENCRYPTED_SOURCE: - break; - - case XINE_MSG_UNKNOWN_HOST: - message = "The host is unknown for the URL: %1"; goto param; - case XINE_MSG_UNKNOWN_DEVICE: - message = "The device name you specified seems invalid."; goto param; - case XINE_MSG_NETWORK_UNREACHABLE: - message = "The network appears unreachable."; goto param; - case XINE_MSG_AUDIO_OUT_UNAVAILABLE: - message = "Audio output unavailable; the device is busy."; goto param; - case XINE_MSG_CONNECTION_REFUSED: - message = "The connection was refused for the URL: %1"; goto param; - case XINE_MSG_FILE_NOT_FOUND: - message = "xine could not find the URL: %1"; goto param; - case XINE_MSG_PERMISSION_ERROR: - message = "Access was denied for the URL: %1"; goto param; - case XINE_MSG_READ_ERROR: - message = "The source cannot be read for the URL: %1"; goto param; - case XINE_MSG_LIBRARY_LOAD_ERROR: - message = "A problem occurred while loading a library or decoder."; goto param; - - case XINE_MSG_GENERAL_WARNING: - message = "General Warning"; goto explain; - case XINE_MSG_SECURITY: - message = "Security Warning"; goto explain; - default: - message = "Unknown Error"; goto explain; - - - explain: - - // Don't flood the user with error messages - if( (last_error_time + 10) > time( ¤t ) && - data->type == last_error ) - { - last_error_time = current; - return; - } - last_error_time = current; - last_error = data->type; - - if( data->explanation ) - { - message.prepend( "" ); - message += ":

"; - message += QString::fromUtf8( (char*)data + data->explanation ); - } - else break; //if no explanation then why bother! - - //FALL THROUGH - - param: - - // Don't flood the user with error messages - if((last_error_time + 10) > time(¤t) && - data->type == last_error) - { - last_error_time = current; - return; - } - last_error_time = current; - last_error = data->type; - - message.prepend( "

" ); - message += "

"; - - if(data->explanation) - { - message += "xine parameters: "; - message += QString::fromUtf8( (char*)data + data->parameters ); - message += ""; - } - else message += "Sorry, no additional information is available."; - - QApplication::postEvent( xe, new XineEvent(XineEvent::InfoMessage, new QString(message)) ); - } - - } //case - case XINE_EVENT_UI_CHANNELS_CHANGED: //Flameeyes used this for last.fm track changes - QApplication::postEvent( xe, new XineEvent(XineEvent::LastFMTrackChanged) ); - break; - } //switch - -#undef xe -} - -Engine::SimpleMetaBundle -XineEngine::fetchMetaData() const -{ - Engine::SimpleMetaBundle bundle; - bundle.title = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_TITLE ) ); - bundle.artist = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_ARTIST ) ); - bundle.album = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_ALBUM ) ); - bundle.comment = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_COMMENT ) ); - bundle.genre = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_GENRE ) ); - bundle.bitrate = QString::number( xine_get_stream_info( stream_, XINE_STREAM_INFO_AUDIO_BITRATE ) / 1000 ); - bundle.samplerate = QString::number( xine_get_stream_info( stream_, XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ); - bundle.year = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_YEAR ) ); - bundle.tracknr = QString::fromUtf8( xine_get_meta_info( stream_, XINE_META_INFO_TRACK_NUMBER ) ); - - return bundle; -} - -bool XineEngine::metaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b) -{ - bool result = false; - xine_stream_t* tmpstream = xine_stream_new(xine_, NULL, NULL); - if (xine_open(tmpstream, QFile::encodeName(url.toString()))) { - QString audioCodec = QString::fromUtf8(xine_get_meta_info(tmpstream, XINE_META_INFO_SYSTEMLAYER)); - - if (audioCodec == "CDDA") { - QString title = QString::fromUtf8( - xine_get_meta_info(tmpstream, XINE_META_INFO_TITLE)); - if ((!title.isNull()) && (!title.isEmpty())) { //no meta info - b.title = title; - b.artist = - QString::fromUtf8( - xine_get_meta_info(tmpstream, XINE_META_INFO_ARTIST)); - b.album = - QString::fromUtf8( - xine_get_meta_info(tmpstream, XINE_META_INFO_ALBUM)); - b.genre = - QString::fromUtf8( - xine_get_meta_info(tmpstream, XINE_META_INFO_GENRE)); - b.year = - QString::fromUtf8( - xine_get_meta_info(tmpstream, XINE_META_INFO_YEAR)); - b.tracknr = - QString::fromUtf8( - xine_get_meta_info(tmpstream, XINE_META_INFO_TRACK_NUMBER)); - if( b.tracknr.isEmpty() ) - b.tracknr = QFileInfo(url.path()).fileName(); - } else { - b.title = QString("Track %1").arg(QFileInfo(url.path()).fileName()); - b.album = "AudioCD"; - } - } - - if (audioCodec == "CDDA" || audioCodec == "WAV") { - result = true; - int samplerate = xine_get_stream_info( tmpstream, XINE_STREAM_INFO_AUDIO_SAMPLERATE ); - - // xine would provide a XINE_STREAM_INFO_AUDIO_BITRATE, but unfortunately not for CDDA or WAV - // so we calculate the bitrate by our own - int bitsPerSample = xine_get_stream_info( tmpstream, XINE_STREAM_INFO_AUDIO_BITS ); - int nbrChannels = xine_get_stream_info( tmpstream, XINE_STREAM_INFO_AUDIO_CHANNELS ); - int bitrate = (samplerate * bitsPerSample * nbrChannels) / 1000; - - b.bitrate = QString::number(bitrate); - b.samplerate = QString::number(samplerate); - int pos, time, length = 0; - xine_get_pos_length(tmpstream, &pos, &time, &length); - b.length = QString::number(length / 1000); - } - xine_close(tmpstream); - } - xine_dispose(tmpstream); - return result; -} - -bool XineEngine::getAudioCDContents(const QString &device, QList &urls) -{ - char **xine_urls = NULL; - int num; - int i = 0; - - if (!device.isNull()) { - qDebug() << "xine-engine setting CD Device to: " << device; - xine_cfg_entry_t config; - if (!xine_config_lookup_entry(xine_, "input.cdda_device", &config)) { - emit StatusText("Failed CD device lookup in xine engine"); - return false; - } - config.str_value = (char *)device.toAscii().constData(); - xine_config_update_entry(xine_, &config); - } - - emit StatusText("Getting AudioCD contents..."); - - xine_urls = xine_get_autoplay_mrls(xine_, "CD", &num); - - if (xine_urls) { - while (xine_urls[i]) { - urls << QUrl(xine_urls[i]); - ++i; - } - } - else emit StatusText("Could not read AudioCD"); - - return true; -} - -bool XineEngine::flushBuffer() -{ - return false; -} - -bool XineEngine::lastFmProxyRequired() -{ - return !( xine_check_version(1,1,9) ); -} - -////////////////////////////////////////////////////////////////////////////// -/// class Fader -////////////////////////////////////////////////////////////////////////////// - -Fader::Fader( XineEngine *engine, uint fadeMs ) - : QThread(engine) - , engine_( engine ) - , xine_( engine->xine_ ) - , decrease_( engine->stream_ ) - , increase_( 0 ) - , port_( engine->audioPort_ ) - , post_( engine->post_ ) - , fadeLength_( fadeMs ) - , paused_( false ) - , terminated_( false ) -{ - if( engine->makeNewStream() ) - { - increase_ = engine->stream_; - - xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, 0 ); - } - else { - s_fader = 0; - deleteLater(); - } -} - -Fader::~Fader() -{ - wait(); - - xine_close( decrease_ ); - xine_dispose( decrease_ ); - xine_close_audio_driver( xine_, port_ ); - if( post_ ) xine_post_dispose( xine_, post_ ); - - if( !engine_->stopFader_ ) - engine_->SetVolume( engine_->volume() ); - - engine_->stopFader_ = false; - s_fader = 0; -} - -void -Fader::run() -{ - // do a volume change in 100 steps (or every 10ms) - uint stepsCount = fadeLength_ < 1000 ? fadeLength_ / 10 : 100; - uint stepSizeUs = (int)( 1000.0 * (float)fadeLength_ / (float)stepsCount ); - - float mix = 0.0; - float elapsedUs = 0.0; - while ( mix < 1.0 ) - { - if ( terminated_ ) - break; - // sleep a constant amount of time - QThread::usleep( stepSizeUs ); - - if ( paused_ ) - continue; - - elapsedUs += stepSizeUs; - - // get volume (amarok main * equalizer preamp) - float vol = Engine::Base::MakeVolumeLogarithmic( engine_->volume_ ) * engine_->preamp_; - - // compute the mix factor as the percentage of time spent since fade begun - float mix = (elapsedUs / 1000.0) / (float)fadeLength_; - if ( mix > 1.0 ) - { - if ( increase_ ) - xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)vol ); - break; - } - - // change volume of streams (using dj-like cross-fade profile) - if ( decrease_ ) - { - //xine_set_param( decrease_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)(vol * (1.0 - mix)) ); // linear - float v = 4.0 * (1.0 - mix) / 3.0; - xine_set_param( decrease_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); - } - if ( increase_ ) - { - //xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)(vol * mix) ); //linear - float v = 4.0 * mix / 3.0; - xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); - } - } - - //stop using cpu! - xine_stop( decrease_ ); - - deleteLater(); -} - - void -Fader::pause() -{ - paused_ = true; -} - - void -Fader::resume() -{ - paused_ = false; -} - - void -Fader::finish() -{ - terminated_ = true; -} - -////////////////////////////////////////////////////////////////////////////// -/// class OutFader -////////////////////////////////////////////////////////////////////////////// - -OutFader::OutFader( XineEngine *engine, uint fadeLength ) - : QThread(engine) - , engine_( engine ) - , terminated_( false ) - , fadeLength_( fadeLength ) -{ -} - -OutFader::~OutFader() -{ - wait(); - - s_outfader = 0; -} - -void -OutFader::run() -{ - engine_->fadeOut( fadeLength_, &terminated_ ); - - xine_stop( engine_->stream_ ); - xine_close( engine_->stream_ ); - xine_set_param( engine_->stream_, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); - - deleteLater(); -} - -void -OutFader::finish() -{ - terminated_ = true; -} - -PruneScopeThread::PruneScopeThread(XineEngine *parent) - : engine_(parent) -{ -} - -void PruneScopeThread::run() { - QTimer timer; - connect(&timer, SIGNAL(timeout()), engine_, SLOT(PruneScope()), Qt::DirectConnection); - timer.start(1000); - - exec(); -} diff --git a/src/engines/xine-engine.h b/src/engines/xine-engine.h deleted file mode 100644 index 59b9ac8dd..000000000 --- a/src/engines/xine-engine.h +++ /dev/null @@ -1,191 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004,5 Max Howell * - * * - * This program 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 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef XINE_ENGINE_H -#define XINE_ENGINE_H - -#include "enginebase.h" -#include -#include -#include -#include - -extern "C" -{ - #include - #include -} - -class XineConfigDialog; - -class XineEvent : public QEvent { -public: - enum EventType { - PlaybackFinished = QEvent::User + 1, - InfoMessage, - StatusMessage, - MetaInfoChanged, - Redirecting, - LastFMTrackChanged, - }; - - XineEvent(EventType type, void* data = NULL) : QEvent(QEvent::Type(type)), data_(data) {} - - void setData(void* data) { data_ = data; } - void* data() const { return data_; } - -private: - void* data_; -}; - -class PruneScopeThread; - -class XineEngine : public Engine::Base -{ - Q_OBJECT - - friend class Fader; - friend class OutFader; - friend class PruneScopeThread; - - ~XineEngine(); - - virtual bool Init(); - virtual bool CanDecode( const QUrl& ); - virtual bool Load( const QUrl &url, Engine::TrackChangeType change ); - virtual bool Play( uint = 0 ); - virtual void Stop(); - virtual void Pause(); - virtual void Unpause(); - virtual uint position() const; - virtual uint length() const; - virtual void Seek( uint ); - - virtual bool metaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b); - virtual bool getAudioCDContents(const QString &device, QList &urls); - virtual bool flushBuffer(); - - virtual Engine::State state() const; - virtual const Engine::Scope &scope(); - - virtual void setEqualizerEnabled( bool ); - virtual void setEqualizerParameters( int preamp, const QList& ); - virtual void SetVolumeSW( uint ); - virtual void fadeOut( uint fadeLength, bool* terminate, bool exiting = false ); - - static void XineEventListener( void*, const xine_event_t* ); - virtual bool event( QEvent* ); - - virtual void playlistChanged(); - virtual void reloadSettings(); - - Engine::SimpleMetaBundle fetchMetaData() const; - - virtual bool lastFmProxyRequired(); - - bool makeNewStream(); - bool ensureStream(); - - void determineAndShowErrorMessage(); //call after failure to load/play - - xine_t *xine_; - xine_stream_t *stream_; - xine_audio_port_t *audioPort_; - xine_event_queue_t *eventQueue_; - xine_post_t *post_; - - int64_t currentVpts_; - float preamp_; - - bool stopFader_; - bool fadeOutRunning_; - - QString currentAudioPlugin_; //to see if audio plugin has been changed - //need to save these for when the audio plugin is changed and xine reloaded - bool equalizerEnabled_; - int intPreamp_; - QList equalizerGains_; - - QMutex initMutex_; - - QSettings settings_; - bool fadeoutOnExit_; - bool fadeoutEnabled_; - bool crossfadeEnabled_; - int fadeoutDuration_; - int xfadeLength_; - bool xfadeNextTrack_; - QUrl url_; - - PruneScopeThread* prune_; - - mutable Engine::SimpleMetaBundle currentBundle_; - -public: - XineEngine(); - - private slots: - void PruneScope(); - -signals: - void resetConfig(xine_t *xine); - void InfoMessage(const QString&); - void LastFmTrackChange(); -}; - -class Fader : public QThread -{ - XineEngine *engine_; - xine_t *xine_; - xine_stream_t *decrease_; - xine_stream_t *increase_; - xine_audio_port_t *port_; - xine_post_t *post_; - uint fadeLength_; - bool paused_; - bool terminated_; - - virtual void run(); - -public: - Fader( XineEngine *, uint fadeLengthMs ); - ~Fader(); - void pause(); - void resume(); - void finish(); -}; - -class OutFader : public QThread -{ - XineEngine *engine_; - bool terminated_; - uint fadeLength_; - - virtual void run(); - -public: - OutFader( XineEngine *, uint fadeLengthMs ); - ~OutFader(); - - void finish(); -}; - -class PruneScopeThread : public QThread { -public: - PruneScopeThread(XineEngine* parent); - -protected: - virtual void run(); - -private: - XineEngine* engine_; -}; - -#endif diff --git a/src/engines/xine-scope.c b/src/engines/xine-scope.c deleted file mode 100644 index d7913e2da..000000000 --- a/src/engines/xine-scope.c +++ /dev/null @@ -1,186 +0,0 @@ -/* Author: Max Howell , (C) 2004 - Copyright: See COPYING file that comes with this distribution - - This has to be a c file or for some reason it won't link! (GCC 3.4.1) -*/ - -/* gcc doesn't like inline for me */ -#define inline -/* need access to port_ticket */ -#define XINE_ENGINE_INTERNAL - -#include "xine-scope.h" -#include -#include - -typedef struct scope_plugin_s scope_plugin_t; - -struct scope_plugin_s -{ - post_plugin_t post; - - metronom_t metronom; - int channels; - MyNode *list; -}; - -/************************* - * post plugin functions * - *************************/ - -static int -scope_port_open( xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode ) -{ - #define port ((post_audio_port_t*)port_gen) - #define this ((scope_plugin_t*)((post_audio_port_t*)port_gen)->post) - - _x_post_rewire( (post_plugin_t*)port->post ); - _x_post_inc_usage( port ); - - port->stream = stream; - port->bits = bits; - port->rate = rate; - port->mode = mode; - - this->channels = _x_ao_mode2channels( mode ); - - return port->original_port->open( port->original_port, stream, bits, rate, mode ); -} - -static void -scope_port_close( xine_audio_port_t *port_gen, xine_stream_t *stream ) -{ - MyNode *node; - - /* ensure the buffers are deleted during the next XineEngine::timerEvent() */ - for( node = this->list->next; node != this->list; node = node->next ) - node->vpts = node->vpts_end = -1; - - port->stream = NULL; - port->original_port->close( port->original_port, stream ); - - _x_post_dec_usage( port ); -} - -static void -scope_port_put_buffer( xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream ) -{ -/* FIXME With 8-bit samples the scope won't work correctly. For a special 8-bit code path, - the sample size could be checked like this: if( port->bits == 8 ) */ - - const int num_samples = buf->num_frames * this->channels; - metronom_t *myMetronom = &this->metronom; - MyNode *new_node; - - /* I keep my own metronom because xine wouldn't for some reason */ - memcpy( &this->metronom, stream->metronom, sizeof(metronom_t) ); - - new_node = malloc( sizeof(MyNode) ); - new_node->vpts = myMetronom->got_audio_samples( myMetronom, buf->vpts, buf->num_frames ); - new_node->num_frames = buf->num_frames; - new_node->mem = malloc( num_samples * 2 ); - memcpy( new_node->mem, buf->mem, num_samples * 2 ); - - { - int64_t - K = myMetronom->pts_per_smpls; /*smpls = 1<<16 samples*/ - K *= num_samples; - K /= (1<<16); - K += new_node->vpts; - - new_node->vpts_end = K; - } - - port->original_port->put_buffer( port->original_port, buf, stream ); - - /* finally we should append the current buffer to the list - * this is thread-safe due to the way we handle the list in the GUI thread */ - new_node->next = this->list->next; - this->list->next = new_node; - - #undef port - #undef this -} - -static void -scope_dispose( post_plugin_t *this ) -{ - MyNode *list = ((scope_plugin_t*)this)->list; - MyNode *prev; - MyNode *node = list; - - /* Free all elements of the list (a ring buffer) */ - do { - prev = node->next; - - free( node->mem ); - free( node ); - - node = prev; - } - while( node != list ); - - - free( this ); -} - - -/************************ - * plugin init function * - ************************/ - -xine_post_t* -scope_plugin_new( xine_t *xine, xine_audio_port_t *audio_target ) -{ - scope_plugin_t *scope_plugin = calloc( 1, sizeof(scope_plugin_t) ); - post_plugin_t *post_plugin = (post_plugin_t*)scope_plugin; - - { - post_in_t *input; - post_out_t *output; - post_audio_port_t *port; - - _x_post_init( post_plugin, 1, 0 ); - - port = _x_post_intercept_audio_port( post_plugin, audio_target, &input, &output ); - port->new_port.open = scope_port_open; - port->new_port.close = scope_port_close; - port->new_port.put_buffer = scope_port_put_buffer; - - post_plugin->xine_post.audio_input[0] = &port->new_port; - post_plugin->xine_post.type = PLUGIN_POST; - - post_plugin->dispose = scope_dispose; - } - - /* code is straight from xine_init_post() - can't use that function as it only dlopens the plugins - and our plugin is statically linked in */ - - post_plugin->running_ticket = xine->port_ticket; - post_plugin->xine = xine; - - /* scope_plugin_t init */ - scope_plugin->list = calloc( 1, sizeof(MyNode) ); - scope_plugin->list->next = scope_plugin->list; - - return &post_plugin->xine_post; -} - -MyNode* -scope_plugin_list( void *post ) -{ - return ((scope_plugin_t*)post)->list; -} - -int -scope_plugin_channels( void *post ) -{ - return ((scope_plugin_t*)post)->channels; -} - -metronom_t* -scope_plugin_metronom( void *post ) -{ - return &((scope_plugin_t*)post)->metronom; -} diff --git a/src/engines/xine-scope.h b/src/engines/xine-scope.h deleted file mode 100644 index ce2d7ee7d..000000000 --- a/src/engines/xine-scope.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Author: Max Howell , (C) 2004 - Copyright: See COPYING file that comes with this distribution - - This has to be a c file or for some reason it won't link! (GCC 3.4.1) -*/ - -#ifndef XINESCOPE_H -#define XINESCOPE_H - -/* need access to some stuff for scope time stamping */ -#define METRONOM_INTERNAL - -#include -#include - -typedef struct my_node_s MyNode; - -struct my_node_s -{ - MyNode *next; - int16_t *mem; - int num_frames; - int64_t vpts; - int64_t vpts_end; -}; - -#ifdef __cplusplus -extern "C" -{ -#endif - xine_post_t* - scope_plugin_new( xine_t*, xine_audio_port_t* ); - - /* we sacrifice type-safety here because some GCCs appear broken - * and choke on redefining the xine_post_t typedef - */ - - MyNode* - scope_plugin_list( void* ); - - int - scope_plugin_channels( void* ); - - metronom_t* - scope_plugin_metronom( void* ); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/main.cpp b/src/main.cpp index 3701bb29c..11445178f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -53,6 +53,7 @@ #include #include +#include #include @@ -61,15 +62,11 @@ #include #endif - #ifdef HAVE_LIBLASTFM #include "radio/lastfmservice.h" #endif -#ifdef HAVE_GSTREAMER -# include - class GstEnginePipeline; -#endif +class GstEnginePipeline; // Load sqlite plugin on windows and mac. #ifdef HAVE_STATIC_SQLITE @@ -174,11 +171,9 @@ int main(int argc, char *argv[]) { qRegisterMetaType("ColumnAlignmentMap"); qRegisterMetaTypeStreamOperators >("ColumnAlignmentMap"); -#ifdef HAVE_GSTREAMER qRegisterMetaType("GstBuffer*"); qRegisterMetaType("GstElement*"); qRegisterMetaType("GstEnginePipeline*"); -#endif #ifdef HAVE_LIBLASTFM lastfm::ws::ApiKey = LastFMService::kApiKey; @@ -263,7 +258,7 @@ int main(int argc, char *argv[]) { srand(time(NULL)); // Window - MainWindow w(options.engine()); + MainWindow w; QObject::connect(&a, SIGNAL(messageReceived(QByteArray)), &w, SLOT(CommandlineOptionsReceived(QByteArray))); w.CommandlineOptionsReceived(options); diff --git a/src/translations/ar.po b/src/translations/ar.po index fef476349..9bed1348f 100644 --- a/src/translations/ar.po +++ b/src/translations/ar.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "اختر المحرك" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "مجهول" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "محرك الصوت \"%1\" غير معروف. الخيارات هي:" - msgid "Unknown error" msgstr "خطأ مجهول" @@ -2555,6 +2548,12 @@ msgstr "" msgid "track %1" msgstr "" +#~ msgid "Select engine" +#~ msgstr "اختر المحرك" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "محرك الصوت \"%1\" غير معروف. الخيارات هي:" + #~ msgid "Options" #~ msgstr "خيارات" diff --git a/src/translations/be.po b/src/translations/be.po index 7c3750275..627ce3ba4 100644 --- a/src/translations/be.po +++ b/src/translations/be.po @@ -1944,9 +1944,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2294,10 +2291,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/bg.po b/src/translations/bg.po index 60c75e711..d57d5cd2e 100644 --- a/src/translations/bg.po +++ b/src/translations/bg.po @@ -1934,9 +1934,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2284,10 +2281,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/br.po b/src/translations/br.po index 400f4c958..6dedbc45e 100644 --- a/src/translations/br.po +++ b/src/translations/br.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/ca.po b/src/translations/ca.po index 98c2b7d55..a19ef0b68 100644 --- a/src/translations/ca.po +++ b/src/translations/ca.po @@ -1968,9 +1968,6 @@ msgstr "Seleccionar-ho tot" msgid "Select None" msgstr "No selecciones res" -msgid "Select engine" -msgstr "Seleccionar motor" - msgid "Select visualizations" msgstr "Seleccioneu visualitzacions" @@ -2328,10 +2325,6 @@ msgstr "No es pot descarregar %1 (%2)" msgid "Unknown" msgstr "Desconegut" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Motor d'àudio \"%1\" desconegut. Les opcions són:" - msgid "Unknown error" msgstr "Error desconegut" @@ -2609,6 +2602,12 @@ msgstr "atura" msgid "track %1" msgstr "peça %1" +#~ msgid "Select engine" +#~ msgstr "Seleccionar motor" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Motor d'àudio \"%1\" desconegut. Les opcions són:" + #~ msgid "Editing %n tracks" #~ msgstr "Editant %n pistes" diff --git a/src/translations/cs.po b/src/translations/cs.po index b1d7bcbf5..a5712a9cd 100644 --- a/src/translations/cs.po +++ b/src/translations/cs.po @@ -1969,9 +1969,6 @@ msgstr "Vybrat vše" msgid "Select None" msgstr "Nevybrat žádnou skladbu" -msgid "Select engine" -msgstr "Vybrat stroj" - msgid "Select visualizations" msgstr "Vybrat znázornění" @@ -2332,10 +2329,6 @@ msgstr "Nepodařilo se stáhnout %1 (%2)" msgid "Unknown" msgstr "Neznámý" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Neznámý zvukový stroj \"%1\". Možnostmi na výběr jsou:" - msgid "Unknown error" msgstr "Neznámá chyba" @@ -2618,6 +2611,12 @@ msgstr "Zastavit" msgid "track %1" msgstr "Skladba %1" +#~ msgid "Select engine" +#~ msgstr "Vybrat stroj" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Neznámý zvukový stroj \"%1\". Možnostmi na výběr jsou:" + #~ msgid "Editing %n tracks" #~ msgstr "Úprava %n skladeb" diff --git a/src/translations/cy.po b/src/translations/cy.po index 0999a76b7..99babddd5 100644 --- a/src/translations/cy.po +++ b/src/translations/cy.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/da.po b/src/translations/da.po index 9e18e1828..4d2db7f42 100644 --- a/src/translations/da.po +++ b/src/translations/da.po @@ -1937,9 +1937,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "Vælg motor" - msgid "Select visualizations" msgstr "" @@ -2287,10 +2284,6 @@ msgstr "" msgid "Unknown" msgstr "Ukendt" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Ukendt lydmotor \"%1\". Valgmulighederne er:" - msgid "Unknown error" msgstr "Ukendt fejl" @@ -2562,6 +2555,12 @@ msgstr "" msgid "track %1" msgstr "spor %1" +#~ msgid "Select engine" +#~ msgstr "Vælg motor" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Ukendt lydmotor \"%1\". Valgmulighederne er:" + #~ msgid "Editing %n tracks" #~ msgstr "Redigerer %n spor" diff --git a/src/translations/de.po b/src/translations/de.po index d0a1ef3c7..9c7c468a0 100644 --- a/src/translations/de.po +++ b/src/translations/de.po @@ -1972,9 +1972,6 @@ msgstr "Alle auswählen" msgid "Select None" msgstr "Auswahl aufheben" -msgid "Select engine" -msgstr "Engine:" - msgid "Select visualizations" msgstr "Visualisierungen auswählen" @@ -2337,10 +2334,6 @@ msgstr "Konnte %1 nicht herunterladen (%2)" msgid "Unknown" msgstr "Unbekannt" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Ubekannte Engine \"%1\". Wahlmöglichkeiten:" - msgid "Unknown error" msgstr "Unbekannter Fehler" @@ -2626,6 +2619,12 @@ msgstr "Anhalten" msgid "track %1" msgstr "Stück %1" +#~ msgid "Select engine" +#~ msgstr "Engine:" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Ubekannte Engine \"%1\". Wahlmöglichkeiten:" + #~ msgid "Editing %n tracks" #~ msgstr "%n Stücke bearbeiten" diff --git a/src/translations/el.po b/src/translations/el.po index 1b485ec7d..561252856 100644 --- a/src/translations/el.po +++ b/src/translations/el.po @@ -1979,9 +1979,6 @@ msgstr "Επιλογή όλων" msgid "Select None" msgstr "Επιλογή κανενός" -msgid "Select engine" -msgstr "Επιλογή μηχανής" - msgid "Select visualizations" msgstr "Επιλογή οπτικών εφέ" @@ -2346,10 +2343,6 @@ msgstr "Αδυναμία \"κατεβάσματος\" του %1 (%2)" msgid "Unknown" msgstr "Άγνωστο" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Άγνωστη μηχανή \"%1\". ΟΙ επιλογές είναι:" - msgid "Unknown error" msgstr "Άγνωστο σφάλμα" @@ -2635,6 +2628,12 @@ msgstr "διακοπή" msgid "track %1" msgstr "κομμάτι %1" +#~ msgid "Select engine" +#~ msgstr "Επιλογή μηχανής" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Άγνωστη μηχανή \"%1\". ΟΙ επιλογές είναι:" + #~ msgid "Editing %n tracks" #~ msgstr "Τροποποίηση %n κομματιών" diff --git a/src/translations/en.po b/src/translations/en.po index fe84460e9..cb67858eb 100644 --- a/src/translations/en.po +++ b/src/translations/en.po @@ -1919,9 +1919,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2269,10 +2266,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/en_CA.po b/src/translations/en_CA.po index 1a36ea3fb..b95fab192 100644 --- a/src/translations/en_CA.po +++ b/src/translations/en_CA.po @@ -1935,9 +1935,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "Select engine" - msgid "Select visualizations" msgstr "Select visualisations" @@ -2285,10 +2282,6 @@ msgstr "" msgid "Unknown" msgstr "Unknown" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Unknown audio engine \"%1\". Choices are:" - msgid "Unknown error" msgstr "Unknown error" @@ -2560,6 +2553,12 @@ msgstr "" msgid "track %1" msgstr "track %1" +#~ msgid "Select engine" +#~ msgstr "Select engine" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Unknown audio engine \"%1\". Choices are:" + #~ msgid "Editing %n tracks" #~ msgstr "Editing %n tracks" diff --git a/src/translations/en_GB.po b/src/translations/en_GB.po index 1866b7d46..7f3aa3151 100644 --- a/src/translations/en_GB.po +++ b/src/translations/en_GB.po @@ -1932,9 +1932,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "Select engine" - msgid "Select visualizations" msgstr "Select visualisations" @@ -2282,10 +2279,6 @@ msgstr "" msgid "Unknown" msgstr "Unknown" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Unknown audio engine \"%1\". Choices are:" - msgid "Unknown error" msgstr "Unknown error" @@ -2557,6 +2550,12 @@ msgstr "" msgid "track %1" msgstr "track %1" +#~ msgid "Select engine" +#~ msgstr "Select engine" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Unknown audio engine \"%1\". Choices are:" + #~ msgid "Editing %n tracks" #~ msgstr "Editing %n tracks" diff --git a/src/translations/eo.po b/src/translations/eo.po index 7f1c3ac9d..30767ad22 100644 --- a/src/translations/eo.po +++ b/src/translations/eo.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/es.po b/src/translations/es.po index 20c3c1447..c455e3e75 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -1980,9 +1980,6 @@ msgstr "Seleccionar Todo" msgid "Select None" msgstr "No seleccionar nada" -msgid "Select engine" -msgstr "Seleccione motor de audio" - msgid "Select visualizations" msgstr "Seleccionar visualizaciones" @@ -2342,10 +2339,6 @@ msgstr "Imposible descargar %1 (%2)" msgid "Unknown" msgstr "Desconocido" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Motor de audio \"%1\" desconocido. Las opciones son:" - msgid "Unknown error" msgstr "Error desconocido" @@ -2630,6 +2623,12 @@ msgstr "detener" msgid "track %1" msgstr "Pista %1" +#~ msgid "Select engine" +#~ msgstr "Seleccione motor de audio" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Motor de audio \"%1\" desconocido. Las opciones son:" + #~ msgid "Editing %n tracks" #~ msgstr "Editando %n pistas" diff --git a/src/translations/et.po b/src/translations/et.po index 28753c398..fbbaf931d 100644 --- a/src/translations/et.po +++ b/src/translations/et.po @@ -1932,9 +1932,6 @@ msgstr "Vali kõik" msgid "Select None" msgstr "Tühista valik." -msgid "Select engine" -msgstr "Vali mootor" - msgid "Select visualizations" msgstr "" @@ -2282,10 +2279,6 @@ msgstr "" msgid "Unknown" msgstr "Tundmatu" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Tundmatu viga" @@ -2557,6 +2550,9 @@ msgstr "peata" msgid "track %1" msgstr "" +#~ msgid "Select engine" +#~ msgstr "Vali mootor" + #~ msgid "[click to edit]" #~ msgstr "[Muutmiseks kliki]" diff --git a/src/translations/eu.po b/src/translations/eu.po index a81bafc90..b013e8aef 100644 --- a/src/translations/eu.po +++ b/src/translations/eu.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/fi.po b/src/translations/fi.po index c46140531..e5f51daea 100644 --- a/src/translations/fi.po +++ b/src/translations/fi.po @@ -1932,9 +1932,6 @@ msgstr "Valitse kaikki" msgid "Select None" msgstr "Poista valinnat" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2282,10 +2279,6 @@ msgstr "" msgid "Unknown" msgstr "Tuntematon" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Tuntematon virhe" diff --git a/src/translations/fr.po b/src/translations/fr.po index d54b82cb5..271bf0d3f 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -1985,9 +1985,6 @@ msgstr "Tout sélectionner" msgid "Select None" msgstr "Ne rien sélectionner" -msgid "Select engine" -msgstr "Sélectionner un moteur" - msgid "Select visualizations" msgstr "Sélectionner visualisation" @@ -2353,10 +2350,6 @@ msgstr "Impossible de télécharger %1 (%2)" msgid "Unknown" msgstr "Inconnu" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Moteur audio inconnu « %1 ». Les choix sont :" - msgid "Unknown error" msgstr "Erreur de type inconnu" @@ -2642,6 +2635,12 @@ msgstr "stop" msgid "track %1" msgstr "piste %1" +#~ msgid "Select engine" +#~ msgstr "Sélectionner un moteur" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Moteur audio inconnu « %1 ». Les choix sont :" + #~ msgid "Editing %n tracks" #~ msgstr "Éditer %n pistes" diff --git a/src/translations/gl.po b/src/translations/gl.po index aae1834a0..787e51722 100644 --- a/src/translations/gl.po +++ b/src/translations/gl.po @@ -1936,9 +1936,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2286,10 +2283,6 @@ msgstr "" msgid "Unknown" msgstr "Descoñecido" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Erro descoñecido" diff --git a/src/translations/he.po b/src/translations/he.po index 7d68a18b7..9c3bbc4df 100644 --- a/src/translations/he.po +++ b/src/translations/he.po @@ -1938,9 +1938,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2288,10 +2285,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/hi.po b/src/translations/hi.po index 96d51eeef..4597df99b 100644 --- a/src/translations/hi.po +++ b/src/translations/hi.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/hr.po b/src/translations/hr.po index 1bb967907..2bde69a06 100644 --- a/src/translations/hr.po +++ b/src/translations/hr.po @@ -1936,9 +1936,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2286,10 +2283,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/hu.po b/src/translations/hu.po index 3f50ff2d2..3a79a71a9 100644 --- a/src/translations/hu.po +++ b/src/translations/hu.po @@ -1968,9 +1968,6 @@ msgstr "Összes kiválasztása" msgid "Select None" msgstr "Kiválasztás megszüntetése" -msgid "Select engine" -msgstr "Meghajtó kiválasztása" - msgid "Select visualizations" msgstr "Megjelenítések kiválasztása" @@ -2332,10 +2329,6 @@ msgstr "%1 (%2) nem letölthető" msgid "Unknown" msgstr "Ismeretlen" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Ismeretlen audio motor: %1. A lehetőségek:" - msgid "Unknown error" msgstr "Ismeretlen hiba" @@ -2618,6 +2611,12 @@ msgstr "leállítás" msgid "track %1" msgstr "%1. szám" +#~ msgid "Select engine" +#~ msgstr "Meghajtó kiválasztása" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Ismeretlen audio motor: %1. A lehetőségek:" + #~ msgid "Editing %n tracks" #~ msgstr "%n szám szerkesztése" diff --git a/src/translations/it.po b/src/translations/it.po index e2b9dab96..e67792d3a 100644 --- a/src/translations/it.po +++ b/src/translations/it.po @@ -1976,9 +1976,6 @@ msgstr "Seleziona tutto" msgid "Select None" msgstr "Selezione nulla" -msgid "Select engine" -msgstr "Seleziona motore" - msgid "Select visualizations" msgstr "Seleziona visualizzazioni" @@ -2345,10 +2342,6 @@ msgstr "Impossibile scaricare %1 (%2)" msgid "Unknown" msgstr "Sconosciuto" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Motore audio \"%1\" sconosciuto. Puoi scegliere tra:" - msgid "Unknown error" msgstr "Errore sconosciuto" @@ -2632,6 +2625,12 @@ msgstr "ferma" msgid "track %1" msgstr "traccia %1" +#~ msgid "Select engine" +#~ msgstr "Seleziona motore" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Motore audio \"%1\" sconosciuto. Puoi scegliere tra:" + #~ msgid "Editing %n tracks" #~ msgstr "Modifica di %n tracce" diff --git a/src/translations/ja.po b/src/translations/ja.po index 4380ea058..0ed983fcd 100644 --- a/src/translations/ja.po +++ b/src/translations/ja.po @@ -1958,9 +1958,6 @@ msgstr "すべて選択" msgid "Select None" msgstr "選択しない" -msgid "Select engine" -msgstr "エンジンの選択" - msgid "Select visualizations" msgstr "視覚化の選択" @@ -2316,10 +2313,6 @@ msgstr "%1 をダウンロードすることができません (%2)" msgid "Unknown" msgstr "不明" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "不明なオーディオ エンジン \"%1\" です。選択肢:" - msgid "Unknown error" msgstr "不明なエラー" @@ -2601,6 +2594,12 @@ msgstr "停止" msgid "track %1" msgstr "トラック %1" +#~ msgid "Select engine" +#~ msgstr "エンジンの選択" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "不明なオーディオ エンジン \"%1\" です。選択肢:" + #~ msgid "Editing %n tracks" #~ msgstr "%n 個のトラックを編集しています" diff --git a/src/translations/kk.po b/src/translations/kk.po index ae829c73f..e27e86bcb 100644 --- a/src/translations/kk.po +++ b/src/translations/kk.po @@ -1932,9 +1932,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2282,10 +2279,6 @@ msgstr "" msgid "Unknown" msgstr "Белгісіз" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Белгісіз қате" diff --git a/src/translations/lt.po b/src/translations/lt.po index 1625ae4ee..ac8e075ba 100644 --- a/src/translations/lt.po +++ b/src/translations/lt.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/nb.po b/src/translations/nb.po index b48cc867a..accaf0f30 100644 --- a/src/translations/nb.po +++ b/src/translations/nb.po @@ -1944,9 +1944,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2295,10 +2292,6 @@ msgstr "" msgid "Unknown" msgstr "Ukjent" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Ukjent feil" diff --git a/src/translations/nl.po b/src/translations/nl.po index 9d1f27919..02ea298ef 100644 --- a/src/translations/nl.po +++ b/src/translations/nl.po @@ -1963,9 +1963,6 @@ msgstr "Alles selecteren" msgid "Select None" msgstr "Niets selecteren" -msgid "Select engine" -msgstr "Engine kiezen" - msgid "Select visualizations" msgstr "Visualisaties kiezen" @@ -2331,10 +2328,6 @@ msgstr "Kon %1 niet downloaden (%2)" msgid "Unknown" msgstr "Onbekend" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Onbekende audioengine \"%1\". U kunt kiezen uit:" - msgid "Unknown error" msgstr "Onbekende fout" @@ -2618,6 +2611,12 @@ msgstr "stoppen" msgid "track %1" msgstr "track %1" +#~ msgid "Select engine" +#~ msgstr "Engine kiezen" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Onbekende audioengine \"%1\". U kunt kiezen uit:" + #~ msgid "Editing %n tracks" #~ msgstr "%n tracks bewerken" diff --git a/src/translations/oc.po b/src/translations/oc.po index f8bd56e74..2f6d5ab86 100644 --- a/src/translations/oc.po +++ b/src/translations/oc.po @@ -1930,9 +1930,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2280,10 +2277,6 @@ msgstr "" msgid "Unknown" msgstr "Desconegut" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Error desconeguda" diff --git a/src/translations/pl.po b/src/translations/pl.po index 5819fca08..9bcd465d7 100644 --- a/src/translations/pl.po +++ b/src/translations/pl.po @@ -1963,9 +1963,6 @@ msgstr "Zaznacz wszystko" msgid "Select None" msgstr "Odznacz wszystkie" -msgid "Select engine" -msgstr "Wybierz silnik odtwarzania" - msgid "Select visualizations" msgstr "Wybierz wizualizacje" @@ -2325,10 +2322,6 @@ msgstr "Niemożliwe ściągnięcie %1 (%2)" msgid "Unknown" msgstr "nieznany" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Nie znany silnik audio \"%1\". Do wyboru są:" - msgid "Unknown error" msgstr "Nieznany błąd" @@ -2608,6 +2601,12 @@ msgstr "zatrzymaj" msgid "track %1" msgstr "utwór %1" +#~ msgid "Select engine" +#~ msgstr "Wybierz silnik odtwarzania" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Nie znany silnik audio \"%1\". Do wyboru są:" + #~ msgid "Editing %n tracks" #~ msgstr "Edytowanie %n ścieżek" diff --git a/src/translations/pt.po b/src/translations/pt.po index 83f4408e5..6f2ef71b1 100644 --- a/src/translations/pt.po +++ b/src/translations/pt.po @@ -1973,9 +1973,6 @@ msgstr "Todas" msgid "Select None" msgstr "Nenhuma" -msgid "Select engine" -msgstr "Selecione o sistema" - msgid "Select visualizations" msgstr "Selecione as visualizações" @@ -2338,10 +2335,6 @@ msgstr "Incapaz de transferir %1 (%2)" msgid "Unknown" msgstr "Desconhecido" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Sistema de áudio desconhecido \"%1\". As possibilidades são:" - msgid "Unknown error" msgstr "Erro desconhecido" @@ -2626,6 +2619,12 @@ msgstr "parar" msgid "track %1" msgstr "faixa %1" +#~ msgid "Select engine" +#~ msgstr "Selecione o sistema" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Sistema de áudio desconhecido \"%1\". As possibilidades são:" + #~ msgid "Editing %n tracks" #~ msgstr "Editando %n faixas" diff --git a/src/translations/pt_BR.po b/src/translations/pt_BR.po index 7557de368..0ed428482 100644 --- a/src/translations/pt_BR.po +++ b/src/translations/pt_BR.po @@ -1969,9 +1969,6 @@ msgstr "Selecionar Todos" msgid "Select None" msgstr "Desmarcar Tudo" -msgid "Select engine" -msgstr "Selecionar mecanismo" - msgid "Select visualizations" msgstr "Selecionar visualizações" @@ -2320,10 +2317,6 @@ msgstr "Não foi poddível baixar %1 (%2)" msgid "Unknown" msgstr "Desconhecido" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Mecanismo de áudio \"%1\" desconhecido. Escolha:" - msgid "Unknown error" msgstr "Erro desconhecido" @@ -2602,6 +2595,12 @@ msgstr "" msgid "track %1" msgstr "faixa %1" +#~ msgid "Select engine" +#~ msgstr "Selecionar mecanismo" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Mecanismo de áudio \"%1\" desconhecido. Escolha:" + #~ msgid "Editing %n tracks" #~ msgstr "Editando %n faixas" diff --git a/src/translations/ro.po b/src/translations/ro.po index 15df9c278..d947a1b75 100644 --- a/src/translations/ro.po +++ b/src/translations/ro.po @@ -1931,9 +1931,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2281,10 +2278,6 @@ msgstr "" msgid "Unknown" msgstr "Necunoscut" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Eroare necunoscută" diff --git a/src/translations/ru.po b/src/translations/ru.po index 79492f46b..305b412c6 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -1963,9 +1963,6 @@ msgstr "Выбрать все" msgid "Select None" msgstr "Отменить выбор" -msgid "Select engine" -msgstr "Укажите движок" - msgid "Select visualizations" msgstr "Выбрать визуализации" @@ -2326,10 +2323,6 @@ msgstr "Невозможно загрузить %1 (%2)" msgid "Unknown" msgstr "Неизвестный" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Неизвестный аудио движок \"%1\". Варианты:" - msgid "Unknown error" msgstr "Неизвестная ошибка" @@ -2612,6 +2605,12 @@ msgstr "Остановить" msgid "track %1" msgstr "композиция %1" +#~ msgid "Select engine" +#~ msgstr "Укажите движок" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Неизвестный аудио движок \"%1\". Варианты:" + #~ msgid "Editing %n tracks" #~ msgstr "Редактирую %n треков" diff --git a/src/translations/sk.po b/src/translations/sk.po index ed8f03e86..dce04d1f2 100644 --- a/src/translations/sk.po +++ b/src/translations/sk.po @@ -1959,9 +1959,6 @@ msgstr "Vybrať všetky" msgid "Select None" msgstr "Nevybrať nič" -msgid "Select engine" -msgstr "Vybrať engine" - msgid "Select visualizations" msgstr "Vybrať vizualizácie" @@ -2323,10 +2320,6 @@ msgstr "Nedá sa stiahnuť %1 (%2)" msgid "Unknown" msgstr "neznámy" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Neznámy audio engine \"%1\". Na výber sú:" - msgid "Unknown error" msgstr "Neznáma chyba" @@ -2608,6 +2601,12 @@ msgstr "zastaviť" msgid "track %1" msgstr "skladba %1" +#~ msgid "Select engine" +#~ msgstr "Vybrať engine" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Neznámy audio engine \"%1\". Na výber sú:" + #~ msgid "Editing %n tracks" #~ msgstr "Upravovanie %n skladieb" diff --git a/src/translations/sl.po b/src/translations/sl.po index dd9e807b8..a7fac2c68 100644 --- a/src/translations/sl.po +++ b/src/translations/sl.po @@ -1962,9 +1962,6 @@ msgstr "Izberi vse" msgid "Select None" msgstr "Odstrani izbor" -msgid "Select engine" -msgstr "Izberi pogon" - msgid "Select visualizations" msgstr "Izberi predočenja" @@ -2324,10 +2321,6 @@ msgstr "Ni bilo mogoče prenesti %1 (%2)" msgid "Unknown" msgstr "Neznano" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Neznan glasbeni pogon \"%1\". Na voljo so:" - msgid "Unknown error" msgstr "Neznana napaka" @@ -2610,6 +2603,12 @@ msgstr "zaustavi" msgid "track %1" msgstr "skladba %1" +#~ msgid "Select engine" +#~ msgstr "Izberi pogon" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Neznan glasbeni pogon \"%1\". Na voljo so:" + #~ msgid "Editing %n tracks" #~ msgstr "Urejanje %n skladb" diff --git a/src/translations/sr.po b/src/translations/sr.po index bc769a894..d97b5318b 100644 --- a/src/translations/sr.po +++ b/src/translations/sr.po @@ -1935,9 +1935,6 @@ msgstr "Изабери све" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "Одабери мотор" - msgid "Select visualizations" msgstr "Одабери визуелизације" @@ -2285,10 +2282,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "Непозната грешка" @@ -2562,6 +2555,9 @@ msgstr "Заустави" msgid "track %1" msgstr "нумера %1" +#~ msgid "Select engine" +#~ msgstr "Одабери мотор" + #~ msgid "Editing %n tracks" #~ msgstr "Уређивање %n нумера" diff --git a/src/translations/sv.po b/src/translations/sv.po index 2cf039bfb..8bbf5012b 100644 --- a/src/translations/sv.po +++ b/src/translations/sv.po @@ -1964,9 +1964,6 @@ msgstr "Välj alla" msgid "Select None" msgstr "Välj ingen" -msgid "Select engine" -msgstr "Välj motor" - msgid "Select visualizations" msgstr "Välj visualiseringar" @@ -2327,10 +2324,6 @@ msgstr "Det går inte att hämta %1 (%2)" msgid "Unknown" msgstr "Okänt" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Okänd audiomotor \"%1\". Följande val finns:" - msgid "Unknown error" msgstr "Okänt fel" @@ -2612,6 +2605,12 @@ msgstr "stoppa" msgid "track %1" msgstr "spår %1" +#~ msgid "Select engine" +#~ msgstr "Välj motor" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Okänd audiomotor \"%1\". Följande val finns:" + #~ msgid "Editing %n tracks" #~ msgstr "Redigerar %n spår" diff --git a/src/translations/tr.po b/src/translations/tr.po index 8b173387d..95f45aaf3 100644 --- a/src/translations/tr.po +++ b/src/translations/tr.po @@ -1962,9 +1962,6 @@ msgstr "Tümünü Seç" msgid "Select None" msgstr "Hiçbirini Seçme" -msgid "Select engine" -msgstr "Çalma motorunu seç" - msgid "Select visualizations" msgstr "Görsel seç" @@ -2316,10 +2313,6 @@ msgstr "%1 indirilemedi (%2)" msgid "Unknown" msgstr "Bilinmeyen" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Bilinmeyen çalma motoru \"%1\". Seçenekler:" - msgid "Unknown error" msgstr "Bilinmeyen hata" @@ -2602,6 +2595,12 @@ msgstr "durdur" msgid "track %1" msgstr "parça %1" +#~ msgid "Select engine" +#~ msgstr "Çalma motorunu seç" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Bilinmeyen çalma motoru \"%1\". Seçenekler:" + #~ msgid "Editing %n tracks" #~ msgstr "%n parça düzenleniyor" diff --git a/src/translations/translations.pot b/src/translations/translations.pot index f06035cbb..c4633c066 100644 --- a/src/translations/translations.pot +++ b/src/translations/translations.pot @@ -1920,9 +1920,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "" @@ -2270,10 +2267,6 @@ msgstr "" msgid "Unknown" msgstr "" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" diff --git a/src/translations/uk.po b/src/translations/uk.po index 47dbde66e..1549e20a8 100644 --- a/src/translations/uk.po +++ b/src/translations/uk.po @@ -1964,9 +1964,6 @@ msgstr "Вибрати все" msgid "Select None" msgstr "Скасувати вибір" -msgid "Select engine" -msgstr "Вибрати рушій" - msgid "Select visualizations" msgstr "Вибрати візуалізації" @@ -2321,10 +2318,6 @@ msgstr "Не вдалось завантажити %1 (%2)" msgid "Unknown" msgstr "Невідомо" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "Невідомий аудіо рушій \"%1\". Варіанти:" - msgid "Unknown error" msgstr "Невідома помилка" @@ -2607,6 +2600,12 @@ msgstr "зупинити" msgid "track %1" msgstr "доріжка %1" +#~ msgid "Select engine" +#~ msgstr "Вибрати рушій" + +#~ msgid "Unknown audio engine \"%1\". Choices are:" +#~ msgstr "Невідомий аудіо рушій \"%1\". Варіанти:" + #~ msgid "Editing %n tracks" #~ msgstr "Редагування %n доріжок" diff --git a/src/translations/zh_CN.po b/src/translations/zh_CN.po index 1e0494505..c1e5b74ad 100644 --- a/src/translations/zh_CN.po +++ b/src/translations/zh_CN.po @@ -1934,9 +1934,6 @@ msgstr "" msgid "Select None" msgstr "" -msgid "Select engine" -msgstr "选择引擎" - msgid "Select visualizations" msgstr "" @@ -2284,10 +2281,6 @@ msgstr "" msgid "Unknown" msgstr "未知" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "" @@ -2559,6 +2552,9 @@ msgstr "停止" msgid "track %1" msgstr "" +#~ msgid "Select engine" +#~ msgstr "选择引擎" + #~ msgid "Editing %n tracks" #~ msgstr "编辑 %n 歌曲" diff --git a/src/translations/zh_TW.po b/src/translations/zh_TW.po index d13d27c9b..987139d90 100644 --- a/src/translations/zh_TW.po +++ b/src/translations/zh_TW.po @@ -1935,9 +1935,6 @@ msgstr "選擇全部" msgid "Select None" msgstr "不選取" -msgid "Select engine" -msgstr "" - msgid "Select visualizations" msgstr "選取視覺化" @@ -2285,10 +2282,6 @@ msgstr "" msgid "Unknown" msgstr "未知的" -#, qt-format -msgid "Unknown audio engine \"%1\". Choices are:" -msgstr "" - msgid "Unknown error" msgstr "不明的錯誤" diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 4c3b643e0..99a84b750 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -34,6 +34,7 @@ #include "devices/devicestatefiltermodel.h" #include "devices/deviceview.h" #include "engines/enginebase.h" +#include "engines/gstengine.h" #include "library/groupbydialog.h" #include "library/library.h" #include "library/librarybackend.h" @@ -90,10 +91,6 @@ # include "wiimotedev/shortcuts.h" #endif -#ifdef HAVE_GSTREAMER -# include "engines/gstengine.h" -#endif - #ifdef ENABLE_VISUALISATIONS # include "visualisations/visualisationcontainer.h" #endif @@ -131,7 +128,7 @@ const char* MainWindow::kMusicFilterSpec = const char* MainWindow::kAllFilesFilterSpec = QT_TR_NOOP("All Files (*)"); -MainWindow::MainWindow(Engine::Type engine, QWidget *parent) +MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui_(new Ui_MainWindow), tray_icon_(SystemTrayIcon::CreateSystemTrayIcon(this)), @@ -184,7 +181,7 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent) #ifdef HAVE_LIBLASTFM radio_model_->GetLastFMService(), #endif - engine, this); + this); library_ = new Library(database_, task_manager_, this); devices_ = new DeviceManager(database_, task_manager_, this); @@ -219,15 +216,6 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent) background_streams_ = new BackgroundStreams(player_->engine(), this); background_streams_->LoadStreams(); - -#ifdef HAVE_GSTREAMER - if (qobject_cast(player_->engine()) == NULL) { - ui_->action_transcode->setEnabled(false); - } -#else // HAVE_GSTREAMER - ui_->action_transcode->setEnabled(false); -#endif // HAVE_GSTREAMER - // Models library_sort_model_->setSourceModel(library_->model()); library_sort_model_->setSortRole(LibraryModel::Role_SortText); @@ -1646,11 +1634,7 @@ void MainWindow::EnsureSettingsDialogCreated() { settings_dialog_.reset(new SettingsDialog(background_streams_)); settings_dialog_->SetLibraryDirectoryModel(library_->model()->directory_model()); -#ifdef HAVE_GSTREAMER - if (GstEngine* engine = qobject_cast(player_->engine())) { - settings_dialog_->SetGstEngine(engine); - } -#endif + settings_dialog_->SetGstEngine(qobject_cast(player_->engine())); settings_dialog_->SetGlobalShortcutManager(global_shortcuts_); settings_dialog_->SetSongInfoView(song_info_view_); @@ -1698,12 +1682,10 @@ void MainWindow::ShowAboutDialog() { } void MainWindow::ShowTranscodeDialog() { -#ifdef HAVE_GSTREAMER if (!transcode_dialog_) { transcode_dialog_.reset(new TranscodeDialog); } transcode_dialog_->show(); -#endif } void MainWindow::ShowErrorDialog(const QString& message) { @@ -1732,10 +1714,7 @@ void MainWindow::ShowVisualisations() { connect(player_, SIGNAL(ForceShowOSD(Song)), visualisation_.get(), SLOT(SongMetadataChanged(Song))); connect(playlists_, SIGNAL(CurrentSongChanged(Song)), visualisation_.get(), SLOT(SongMetadataChanged(Song))); -#ifdef HAVE_GSTREAMER - if (GstEngine* engine = qobject_cast(player_->engine())) - visualisation_->SetEngine(engine); -#endif + visualisation_->SetEngine(qobject_cast(player_->engine())); } visualisation_->show(); diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index e97f67b3d..c747506d1 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -77,7 +77,7 @@ class MainWindow : public QMainWindow, public PlatformInterface { Q_OBJECT public: - MainWindow(Engine::Type engine, QWidget *parent = 0); + MainWindow(QWidget *parent = 0); ~MainWindow(); static const char* kSettingsGroup; diff --git a/src/ui/settingsdialog.cpp b/src/ui/settingsdialog.cpp index eb56c40d7..642a7f231 100644 --- a/src/ui/settingsdialog.cpp +++ b/src/ui/settingsdialog.cpp @@ -22,6 +22,7 @@ #include "mainwindow.h" #include "settingsdialog.h" #include "engines/enginebase.h" +#include "engines/gstengine.h" #include "playlist/playlistview.h" #include "songinfo/songinfofetcher.h" #include "songinfo/songinfotextview.h" @@ -40,10 +41,6 @@ # include "wiimotedev/shortcuts.h" #endif -#ifdef HAVE_GSTREAMER -# include "engines/gstengine.h" -#endif - #include #include #include @@ -150,9 +147,7 @@ SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent) connect(ui_->fading_cross, SIGNAL(toggled(bool)), SLOT(FadingOptionsChanged())); connect(ui_->fading_out, SIGNAL(toggled(bool)), SLOT(FadingOptionsChanged())); connect(ui_->fading_auto, SIGNAL(toggled(bool)), SLOT(FadingOptionsChanged())); -#ifdef HAVE_GSTREAMER connect(ui_->gst_plugin, SIGNAL(currentIndexChanged(int)), SLOT(GstPluginChanged(int))); -#endif connect(ui_->replaygain_preamp, SIGNAL(valueChanged(int)), SLOT(RgPreampChanged(int))); ui_->replaygain_preamp_label->setMinimumWidth( @@ -303,7 +298,6 @@ void SettingsDialog::accept() { s.setValue("AutoCrossfadeEnabled", ui_->fading_auto->isChecked()); s.endGroup(); -#ifdef HAVE_GSTREAMER s.beginGroup(GstEngine::kSettingsGroup); s.setValue("sink", ui_->gst_plugin->itemData(ui_->gst_plugin->currentIndex()).toString()); s.setValue("device", ui_->gst_device->text()); @@ -313,7 +307,6 @@ void SettingsDialog::accept() { s.setValue("rgcompression", ui_->replaygain_compression->isChecked()); s.setValue("bufferduration", ui_->buffer_duration->value()); s.endGroup(); -#endif // Song info s.beginGroup(SongInfoTextView::kSettingsGroup); @@ -395,7 +388,6 @@ void SettingsDialog::showEvent(QShowEvent*) { QSettings s; loading_settings_ = true; -#ifdef HAVE_GSTREAMER if (ui_->gst_plugin->count() <= 1 && gst_engine_) { GstEngine::PluginDetailsList list = gst_engine_->GetOutputsList(); @@ -409,7 +401,6 @@ void SettingsDialog::showEvent(QShowEvent*) { ui_->gst_group->setEnabled(true); ui_->replaygain_group->setEnabled(true); } -#endif // HAVE_GSTREAMER // Behaviour s.beginGroup(MainWindow::kSettingsGroup); @@ -467,7 +458,6 @@ void SettingsDialog::showEvent(QShowEvent*) { ui_->fading_duration->setValue(s.value("FadeoutDuration", 2000).toInt()); s.endGroup(); -#ifdef HAVE_GSTREAMER s.beginGroup(GstEngine::kSettingsGroup); QString sink = s.value("sink", GstEngine::kAutoSink).toString(); ui_->gst_plugin->setCurrentIndex(0); @@ -484,7 +474,6 @@ void SettingsDialog::showEvent(QShowEvent*) { ui_->replaygain_compression->setChecked(s.value("rgcompression", true).toBool()); ui_->buffer_duration->setValue(s.value("bufferduration", 1000).toInt()); s.endGroup(); -#endif // Notifications s.beginGroup(OSD::kSettingsGroup); @@ -632,14 +621,12 @@ void SettingsDialog::ShowTrayIconToggled(bool on) { } void SettingsDialog::GstPluginChanged(int index) { -#ifdef HAVE_GSTREAMER QString name = ui_->gst_plugin->itemData(index).toString(); bool enabled = GstEngine::DoesThisSinkSupportChangingTheOutputDeviceToAUserEditableString(name); ui_->gst_device->setEnabled(enabled); ui_->gst_device_label->setEnabled(enabled); -#endif // HAVE_GSTREAMER } void SettingsDialog::RgPreampChanged(int value) {