From dd86b60411ba5f5a236bb7d85229bd52c3afcfda Mon Sep 17 00:00:00 2001 From: David Sansome Date: Thu, 15 Apr 2010 12:39:34 +0000 Subject: [PATCH] CMake variables and commandline options to allow multiple engines to be built. Thanks christoph.gysin. Fixes issue #203 --- CMakeLists.txt | 21 +- src/AddEngine.cmake | 77 +++++ src/CMakeLists.txt | 43 ++- src/commandlineoptions.cpp | 33 +- src/commandlineoptions.h | 4 + src/engines/engine_fwd.h | 2 + src/engines/phononengine.cpp | 26 +- src/engines/phononengine.h | 18 +- src/engines/vlcengine.cpp | 38 +-- src/engines/vlcengine.h | 20 +- src/engines/xine-engine.cpp | 486 +++++++++++++++--------------- src/engines/xine-engine.h | 87 +++--- src/main.cpp | 2 +- src/mainwindow.cpp | 4 +- src/mainwindow.h | 3 +- src/pig.txt | 26 ++ src/player.cpp | 51 +++- src/player.h | 3 +- src/translations/cs.po | 23 +- src/translations/de.po | 8 + src/translations/el.po | 22 +- src/translations/es.po | 30 +- src/translations/fr.po | 12 +- src/translations/nb.po | 8 + src/translations/pl.po | 14 +- src/translations/pt.po | 15 +- src/translations/pt_BR.po | 11 +- src/translations/ru.po | 24 +- src/translations/sk.po | 15 +- src/translations/sv.po | 16 +- src/translations/tr.po | 7 + src/translations/translations.pot | 7 + 32 files changed, 730 insertions(+), 426 deletions(-) create mode 100644 src/AddEngine.cmake create mode 100644 src/pig.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0048c2a39..49d906a88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,14 +9,11 @@ if (CMAKE_FIND_ROOT_PATH) set(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib) endif (CMAKE_FIND_ROOT_PATH) -find_package(Qt4 REQUIRED) -set(QT_USE_QTOPENGL 1) -set(QT_USE_QTSQL 1) -set(QT_USE_QTNETWORK 1) -set(QT_USE_QTXML 1) +find_package(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtNetwork QtXml) if(UNIX AND NOT APPLE) - set(QT_USE_QTDBUS 1) + find_package(Qt4 REQUIRED QtDbus) endif(UNIX AND NOT APPLE) +find_package(Qt4 COMPONENTS Phonon) find_package(OpenGL REQUIRED) find_package(Boost REQUIRED) @@ -35,19 +32,13 @@ if(WIN32) find_library(GLIB_LIBRARIES glib-2.0) find_library(GOBJECT_LIBRARIES gobject-2.0) else(WIN32) - pkg_check_modules(TAGLIB taglib) + pkg_check_modules(TAGLIB REQUIRED taglib>=1.6) pkg_check_modules(GSTREAMER gstreamer-0.10) pkg_check_modules(GSTREAMER_BASE gstreamer-base-0.10) - - if (TAGLIB_VERSION VERSION_LESS 1.6) - message(FATAL_ERROR "Taglib version 1.6 or greater is required") - endif (TAGLIB_VERSION VERSION_LESS 1.6) + pkg_check_modules(VLC libvlc) + pkg_check_modules(XINE libxine) endif(WIN32) -if (NOT Boost_FOUND) - message(FATAL_ERROR "Boost not found") -endif (NOT Boost_FOUND) - find_library(LASTFM_LIBRARY_DIRS lastfm) find_path(LASTFM_INCLUDE_DIRS lastfm/ws.h) diff --git a/src/AddEngine.cmake b/src/AddEngine.cmake new file mode 100644 index 000000000..934d3f7c2 --- /dev/null +++ b/src/AddEngine.cmake @@ -0,0 +1,77 @@ +# 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 + add_definitions(-DHAVE_${name}) + + # add sources and MOC headers + list(APPEND CLEMENTINE-SOURCES ${src_list}) + list(APPEND CLEMENTINE-MOC-HEADERS ${moc_list}) + + # add libraries to link against + foreach(lib ${lib_list}) + set(ENGINE_LIBRARIES ${ENGINE_LIBRARIES} ${${lib}_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}") + + 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) + + message("building engines:${ENGINES_ENABLED}") + message("skipping engines:${ENGINES_DISABLED}") +endmacro(print_engines) + +# print the pig :) +macro(pig) + file(READ pig.txt pig) + message(${pig}) +endmacro(pig) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e141b6a16..c7124a065 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,9 +12,6 @@ set(CLEMENTINE-SOURCES playlist.cpp playlistitem.cpp engines/enginebase.cpp - engines/gstengine.cpp - engines/gstequalizer.cpp - engines/gstenginepipeline.cpp analyzers/baranalyzer.cpp analyzers/analyzerbase.cpp fht.cpp @@ -88,8 +85,6 @@ set(CLEMENTINE-MOC-HEADERS librarybackend.h playlist.h engines/enginebase.h - engines/gstengine.h - engines/gstenginepipeline.h sliderwidget.h playlistview.h backgroundthread.h @@ -144,6 +139,41 @@ set(CLEMENTINE-MOC-HEADERS stickyslider.h ) +# lists of engine source files +set(GST_ENGINE_SRC + engines/gstengine.cpp + engines/gstequalizer.cpp + engines/gstenginepipeline.cpp +) +set(GST_ENGINE_MOC + engines/gstengine.h + engines/gstenginepipeline.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 +) + +# try to add engines +include(AddEngine.cmake) +add_engine(gst "${GST_ENGINE_LIB}" "${GST_ENGINE_SRC}" "${GST_ENGINE_MOC}" ON) +add_engine(vlc VLC engines/vlcengine.cpp engines/vlcengine.h OFF) +add_engine(xine XINE "${XINE_ENGINE_SRC}" "${XINE_ENGINE_MOC}" OFF) +add_engine(qt-phonon QT_PHONON engines/phononengine.cpp engines/phononengine.h OFF) +print_engines() + +# need at least 1 engine +if(NOT ENGINES_ENABLED) + message(FATAL_ERROR "no engine enabled!") +endif(NOT ENGINES_ENABLED) + # UI files set(CLEMENTINE-UI mainwindow.ui @@ -319,10 +349,9 @@ target_link_libraries(clementine_lib lastfm ${GOBJECT_LIBRARIES} ${GLIB_LIBRARIES} - ${GSTREAMER_LIBRARIES} - ${GSTREAMER_BASE_LIBRARIES} ${TAGLIB_LIBRARIES} ${QT_LIBRARIES} + ${ENGINE_LIBRARIES} ) if (APPLE) target_link_libraries(clementine_lib diff --git a/src/commandlineoptions.cpp b/src/commandlineoptions.cpp index 546641c45..fdc10b460 100644 --- a/src/commandlineoptions.cpp +++ b/src/commandlineoptions.cpp @@ -45,7 +45,8 @@ const char* CommandlineOptions::kHelpText = " -k, --play-track %19\n" "\n" "%20:\n" - " -o, --show-osd %21\n"; + " -o, --show-osd %21\n" + " -e, --engine %22\n"; CommandlineOptions::CommandlineOptions(int argc, char** argv) @@ -58,7 +59,8 @@ CommandlineOptions::CommandlineOptions(int argc, char** argv) seek_to_(-1), seek_by_(0), play_track_at_(-1), - show_osd_(false) + show_osd_(false), + engine_(Engine::gstreamer) { } @@ -83,6 +85,7 @@ bool CommandlineOptions::Parse() { {"play-track", required_argument, 0, 'k'}, {"show-osd", no_argument, 0, 'o'}, + {"engine", required_argument, 0, 'e'}, {0, 0, 0, 0} }; @@ -91,7 +94,7 @@ bool CommandlineOptions::Parse() { int option_index = 0; bool ok = false; forever { - int c = getopt_long(argc_, argv_, "hptusrfv:alk:o", kOptions, &option_index); + int c = getopt_long(argc_, argv_, "hptusrfv:alk:oe:", kOptions, &option_index); // End of the options if (c == -1) @@ -117,7 +120,8 @@ bool CommandlineOptions::Parse() { tr("Loads files/URLs, replacing current playlist")).arg( tr("Play the th track in the playlist"), tr("Other options"), - tr("Display the on-screen-display")); + tr("Display the on-screen-display"), + tr("Select engine")); std::cout << translated_help_text.toLocal8Bit().constData(); return false; @@ -155,6 +159,27 @@ bool CommandlineOptions::Parse() { if (!ok) play_track_at_ = -1; break; + case 'e': + { + ok = true; + QString engine = optarg; + if(engine == "gst") + engine_ = Engine::gstreamer; + else if(engine == "vlc") + engine_ = Engine::vlc; + else if(engine == "xine") + engine_ = Engine::xine; + else if(engine == "qt-phonon") + engine_ = Engine::qt_phonon; + else + { + qFatal("%s %s", + tr("Unknown audio engine \"%1\". Choices are:").arg(engine).toAscii().data(), + "gst vlc xine qt-phonon"); + } + } + break; + case '?': default: return false; diff --git a/src/commandlineoptions.h b/src/commandlineoptions.h index 5dfa1aad7..1e37a2296 100644 --- a/src/commandlineoptions.h +++ b/src/commandlineoptions.h @@ -21,6 +21,8 @@ #include #include +#include "engines/engine_fwd.h" + class CommandlineOptions { friend QDataStream& operator<<(QDataStream& s, const CommandlineOptions& a); friend QDataStream& operator>>(QDataStream& s, CommandlineOptions& a); @@ -59,6 +61,7 @@ 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_; } QByteArray Serialize() const; void Load(const QByteArray& serialized); @@ -89,6 +92,7 @@ class CommandlineOptions { int seek_by_; int play_track_at_; bool show_osd_; + Engine::Type engine_; QList urls_; }; diff --git a/src/engines/engine_fwd.h b/src/engines/engine_fwd.h index d14a62cae..d93eea09a 100644 --- a/src/engines/engine_fwd.h +++ b/src/engines/engine_fwd.h @@ -10,6 +10,8 @@ namespace Engine class SimpleMetaBundle; class Base; + enum Type { gstreamer, vlc, xine, qt_phonon }; + /** * You should return: * Playing when playing, diff --git a/src/engines/phononengine.cpp b/src/engines/phononengine.cpp index 042c31cc1..a08e7102c 100644 --- a/src/engines/phononengine.cpp +++ b/src/engines/phononengine.cpp @@ -38,21 +38,21 @@ PhononEngine::~PhononEngine() { delete audio_output_; } -bool PhononEngine::init() { +bool PhononEngine::Init() { return true; } -bool PhononEngine::canDecode(const QUrl &url) const { +bool PhononEngine::CanDecode(const QUrl &url) { // TODO return true; } -bool PhononEngine::load(const QUrl &url, bool stream) { +bool PhononEngine::Load(const QUrl &url, Engine::TrackChangeType change ) { media_object_->setCurrentSource(Phonon::MediaSource(url)); return true; } -bool PhononEngine::play(uint offset) { +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; @@ -61,15 +61,15 @@ bool PhononEngine::play(uint offset) { return true; } -void PhononEngine::stop() { +void PhononEngine::Stop() { media_object_->stop(); } -void PhononEngine::pause() { +void PhononEngine::Pause() { media_object_->pause(); } -void PhononEngine::unpause() { +void PhononEngine::Unpause() { media_object_->play(); } @@ -98,21 +98,21 @@ uint PhononEngine::length() const { return media_object_->totalTime(); } -void PhononEngine::seek(uint ms) { +void PhononEngine::Seek(uint ms) { media_object_->seek(ms); } -void PhononEngine::setVolumeSW(uint) { - audio_output_->setVolume(qreal(m_volume) / 100.0); +void PhononEngine::SetVolumeSW(uint volume) { + audio_output_->setVolume(volume); } void PhononEngine::PhononFinished() { - emit trackEnded(); + emit TrackEnded(); } void PhononEngine::PhononStateChanged(Phonon::State new_state) { if (new_state == Phonon::ErrorState) { - emit error(media_object_->errorString()); + emit Error(media_object_->errorString()); } if (new_state == Phonon::PlayingState && seek_offset_ != -1) { media_object_->seek(seek_offset_); @@ -124,5 +124,5 @@ void PhononEngine::PhononStateChanged(Phonon::State new_state) { } void PhononEngine::StateTimeoutExpired() { - emit stateChanged(state()); + emit StateChanged(state()); } diff --git a/src/engines/phononengine.h b/src/engines/phononengine.h index 5ca502aad..41a3e0427 100644 --- a/src/engines/phononengine.h +++ b/src/engines/phononengine.h @@ -31,24 +31,24 @@ class PhononEngine : public Engine::Base { PhononEngine(); ~PhononEngine(); - bool init(); + bool Init(); - bool canDecode( const QUrl &url ) const; + bool CanDecode( const QUrl &url ); - bool load( const QUrl &url, bool stream = false ); - bool play( uint offset = 0 ); - void stop(); - void pause(); - void unpause(); + 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 ); + void Seek( uint ms ); protected: - void setVolumeSW( uint percent ); + void SetVolumeSW( uint percent ); private slots: void PhononFinished(); diff --git a/src/engines/vlcengine.cpp b/src/engines/vlcengine.cpp index 95c37258b..e043a2d8b 100644 --- a/src/engines/vlcengine.cpp +++ b/src/engines/vlcengine.cpp @@ -113,23 +113,23 @@ void VlcEngine::StateChangedCallback(const libvlc_event_t* e, void* data) { case libvlc_MediaPlayerEndReached: engine->state_ = Engine::Idle; - emit engine->trackEnded(); + emit engine->TrackEnded(); return; // Don't emit state changed here } - emit engine->stateChanged(engine->state_); + emit engine->StateChanged(engine->state_); } -bool VlcEngine::init() { +bool VlcEngine::Init() { return true; } -bool VlcEngine::canDecode(const QUrl &url) const { +bool VlcEngine::CanDecode(const QUrl &url) { // TODO return true; } -bool VlcEngine::load(const QUrl &url, bool stream) { +bool VlcEngine::Load(const QUrl &url, Engine::TrackChangeType change) { // Create the media object VlcScopedRef media( libvlc_media_new(instance_, url.toEncoded().constData(), &exception_)); @@ -143,27 +143,27 @@ bool VlcEngine::load(const QUrl &url, bool stream) { return true; } -bool VlcEngine::play(uint offset) { +bool VlcEngine::Play(uint offset) { libvlc_media_player_play(player_, &exception_); if (libvlc_exception_raised(&exception_)) return false; - seek(offset); + Seek(offset); return true; } -void VlcEngine::stop() { +void VlcEngine::Stop() { libvlc_media_player_stop(player_, &exception_); HandleErrors(); } -void VlcEngine::pause() { +void VlcEngine::Pause() { libvlc_media_player_pause(player_, &exception_); HandleErrors(); } -void VlcEngine::unpause() { +void VlcEngine::Unpause() { libvlc_media_player_play(player_, &exception_); HandleErrors(); } @@ -198,7 +198,7 @@ uint VlcEngine::length() const { return len; } -void VlcEngine::seek(uint ms) { +void VlcEngine::Seek(uint ms) { uint len = length(); if (len == 0) return; @@ -209,7 +209,7 @@ void VlcEngine::seek(uint ms) { HandleErrors(); } -void VlcEngine::setVolumeSW(uint volume) { +void VlcEngine::SetVolumeSW(uint volume) { libvlc_audio_set_volume(instance_, volume, &exception_); HandleErrors(); } @@ -233,19 +233,19 @@ void VlcEngine::SetScopeData(float* data, int size) { } } -const Engine::Scope& VlcEngine::scope() { +const Engine::Scope& VlcEngine::Scope() { QMutexLocker l(&scope_mutex_); // Leave the scope unchanged if there's not enough data - if (scope_data_.size() < uint(SCOPESIZE)) - return m_scope; + if (scope_data_.size() < uint(kScopeSize)) + return scope_; // Take the samples off the front of the circular buffer - for (uint i=0 ; iresume(); // safety call if the engine is in the pause state s_fader->wait(); } @@ -95,19 +95,19 @@ XineEngine::~XineEngine() delete s_outfader; delete prune_; - if( m_fadeoutOnExit ) { + if( fadeoutOnExit_ ) { bool terminateFader = false; - fadeOut( m_fadeoutDuration, &terminateFader, true ); // true == exiting + fadeOut( fadeoutDuration_, &terminateFader, true ); // true == exiting } - //if( m_xine ) xine_config_save( m_xine, configPath() ); + //if( xine_ ) xine_config_save( xine_, configPath() ); - if( m_stream ) xine_close( m_stream ); - if( m_eventQueue ) xine_event_dispose_queue( m_eventQueue ); - if( m_stream ) xine_dispose( m_stream ); - if( m_audioPort ) xine_close_audio_driver( m_xine, m_audioPort ); - if( m_post ) xine_post_dispose( m_xine, m_post ); - if( m_xine ) xine_exit( m_xine ); + 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"; @@ -117,15 +117,15 @@ XineEngine::~XineEngine() } void XineEngine::reloadSettings() { - m_currentAudioPlugin = m_settings.value("XineAudioOutput", "auto").toString(); - m_fadeoutEnabled = m_settings.value("FadeoutEnabled", true).toBool(); - m_fadeoutOnExit = m_settings.value("FadeoutOnExit", true).toBool(); - m_fadeoutDuration = m_settings.value("FadeoutDuration", 2000).toInt(); - m_crossfadeEnabled = m_settings.value("CrossfadeEnabled", true).toBool(); + 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() +XineEngine::Init() { qDebug() << "'Bringing joy to small mexican gerbils, a few weeks at a time.'"; @@ -137,23 +137,23 @@ XineEngine::init() setenv("XINE_PLUGIN_PATH", QString(QCoreApplication::applicationDirPath() + "/../PlugIns/xine").toAscii().constData(), 1); #endif // Q_OS_DARWIN - QMutexLocker l(&m_initMutex); + QMutexLocker l(&initMutex_); - m_xine = xine_new(); + xine_ = xine_new(); - if( !m_xine ) { - emit error("Could not initialize xine."); + if( !xine_ ) { + emit Error("Could not initialize xine."); return false; } #ifdef XINE_SAFE_MODE - xine_engine_set_param( m_xine, XINE_ENGINE_PARAM_VERBOSITY, 99 ); + xine_engine_set_param( xine_, XINE_ENGINE_PARAM_VERBOSITY, 99 ); #endif - //xine_config_load( m_xine, configPath() ); + //xine_config_load( xine_, configPath() ); //debug() << "w00t" << configPath() << endl; - xine_init( m_xine ); + xine_init( xine_ ); makeNewStream(); @@ -168,41 +168,41 @@ XineEngine::init() bool XineEngine::makeNewStream() { - m_audioPort = xine_open_audio_driver( m_xine, m_currentAudioPlugin.toLocal8Bit().constData(), NULL ); - if( !m_audioPort ) { + 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."); + emit Error("xine was unable to initialize any audio drivers."); return false; } - m_stream = xine_stream_new( m_xine, m_audioPort, NULL ); - if( !m_stream ) { - xine_close_audio_driver( m_xine, m_audioPort ); - m_audioPort = NULL; - emit error("Could not create a new xine stream"); + 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( m_eventQueue ) - xine_event_dispose_queue( m_eventQueue ); + if( eventQueue_ ) + xine_event_dispose_queue( eventQueue_ ); xine_event_create_listener_thread( - m_eventQueue = xine_event_new_queue( m_stream ), + eventQueue_ = xine_event_new_queue( stream_ ), &XineEngine::XineEventListener, (void*)this ); #ifndef XINE_SAFE_MODE //implemented in xine-scope.h - m_post = scope_plugin_new( m_xine, m_audioPort ); + post_ = scope_plugin_new( xine_, audioPort_ ); - xine_set_param( m_stream, XINE_PARAM_METRONOM_PREBUFFER, 6000 ); - xine_set_param( m_stream, XINE_PARAM_IGNORE_VIDEO, 1 ); + 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) && !(m_xfadeLength > 0) ) { + if ( xine_check_version(1,1,1) && !(xfadeLength_ > 0) ) { // enable gapless playback qDebug() << "gapless playback enabled."; - //xine_set_param(m_stream, XINE_PARAM_EARLY_FINISHED_EVENT, 1 ); + //xine_set_param(stream_, XINE_PARAM_EARLY_FINISHED_EVENT, 1 ); } #endif return true; @@ -212,55 +212,55 @@ XineEngine::makeNewStream() bool XineEngine::ensureStream() { - if( !m_stream ) + if( !stream_ ) return makeNewStream(); return true; } bool -XineEngine::load( const QUrl &url, bool isStream ) +XineEngine::Load( const QUrl &url ,Engine::TrackChangeType change ) { if( !ensureStream() ) return false; - Engine::Base::load( url, isStream ); + Engine::Base::Load( url, change ); if( s_outfader ) { s_outfader->finish(); delete s_outfader; } - if( m_xfadeLength > 0 && xine_get_status( m_stream ) == XINE_STATUS_PLAY && + if( xfadeLength_ > 0 && xine_get_status( stream_ ) == XINE_STATUS_PLAY && url.scheme().toLower() == "file" && - xine_get_param( m_stream, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE && - ( m_xfadeNextTrack || //set by engine controller when switching tracks automatically - m_crossfadeEnabled)) + xine_get_param( stream_, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE && + ( xfadeNextTrack_ || //set by engine controller when switching tracks automatically + crossfadeEnabled_)) { - m_xfadeNextTrack = false; + xfadeNextTrack_ = false; // Stop a probably running fader if( s_fader ) { - m_stopFader = true; + stopFader_ = true; s_fader->finish(); // makes the fader stop abruptly delete s_fader; } - s_fader = new Fader( this, m_xfadeLength ); - setEqualizerParameters( m_intPreamp, m_equalizerGains ); + 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( m_stream ); + xine_close( stream_ ); qDebug() << "Before xine_open() *****"; - if( xine_open( m_stream, url.toEncoded() ) ) + if( xine_open( stream_, url.toEncoded() ) ) { qDebug() << "After xine_open() *****"; #ifndef XINE_SAFE_MODE - xine_post_out_t *source = xine_get_audio_source( m_stream ); - xine_post_in_t *target = (xine_post_in_t*)xine_post_input( m_post, const_cast("audio in") ); + 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 @@ -271,8 +271,8 @@ XineEngine::load( const QUrl &url, bool isStream ) else { #ifdef XINE_PARAM_GAPLESS_SWITCH - //if ( xine_check_version(1,1,1) && !(m_xfadeLength > 0) ) - //xine_set_param( m_stream, XINE_PARAM_GAPLESS_SWITCH, 0); + //if ( xine_check_version(1,1,1) && !(xfadeLength_ > 0) ) + //xine_set_param( stream_, XINE_PARAM_GAPLESS_SWITCH, 0); #endif } @@ -284,20 +284,20 @@ XineEngine::load( const QUrl &url, bool isStream ) } bool -XineEngine::play( uint offset ) +XineEngine::Play( uint offset ) { if( !ensureStream() ) return false; - const bool has_audio = xine_get_stream_info( m_stream, XINE_STREAM_INFO_HAS_AUDIO ); - const bool audio_handled = xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_HANDLED ); + 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( m_stream, 0, offset )) + if (has_audio && audio_handled && xine_play( stream_, 0, offset )) { if( s_fader ) s_fader->start( QThread::LowestPriority ); - emit stateChanged( Engine::Playing ); + emit StateChanged( Engine::Playing ); return true; } @@ -305,11 +305,11 @@ XineEngine::play( uint offset ) //we need to stop the track that is prepped for crossfade delete s_fader; - emit stateChanged( Engine::Empty ); + emit StateChanged( Engine::Empty ); determineAndShowErrorMessage(); - xine_close( m_stream ); + xine_close( stream_ ); return false; } @@ -320,7 +320,7 @@ XineEngine::determineAndShowErrorMessage() QString body; qDebug() << "xine_get_error()"; - switch (xine_get_error( m_stream )) { + 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; @@ -346,17 +346,17 @@ XineEngine::determineAndShowErrorMessage() // but there may be! We check for other errors below. default: - if (!xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_HANDLED )) + 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(m_url.path()).completeSuffix(); + QString const ext = QFileInfo(url_.path()).completeSuffix(); // TODO //if (ext == "mp3" && EngineController::installDistroCodec( "xine-engine" )) // return; } - else if (!xine_get_stream_info( m_stream, XINE_STREAM_INFO_HAS_AUDIO )) + else if (!xine_get_stream_info( stream_, XINE_STREAM_INFO_HAS_AUDIO )) body = "There is no audio channel!"; break; } @@ -366,79 +366,79 @@ XineEngine::determineAndShowErrorMessage() } void -XineEngine::stop() +XineEngine::Stop() { if( s_fader && s_fader->isRunning()) s_fader->resume(); // safety call if the engine is in the pause state - if ( !m_stream ) + if ( !stream_ ) return; - if( (m_fadeoutEnabled && !m_fadeOutRunning) || state() == Engine::Paused ) + if( (fadeoutEnabled_ && !fadeOutRunning_) || state() == Engine::Paused ) { - s_outfader = new OutFader( this, m_fadeoutDuration ); + 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() - m_url = QUrl(); //to ensure we return Empty from state() + url_ = QUrl(); //to ensure we return Empty from state() - std::fill( m_scope.begin(), m_scope.end(), 0 ); + std::fill( scope_.begin(), scope_.end(), 0 ); } - else if( !m_fadeOutRunning ) + else if( !fadeOutRunning_ ) { - xine_stop( m_stream ); - xine_close( m_stream ); - xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); + xine_stop( stream_ ); + xine_close( stream_ ); + xine_set_param( stream_, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); } - emit stateChanged( Engine::Empty ); + emit StateChanged( Engine::Empty ); } void -XineEngine::pause() +XineEngine::Pause() { - if ( !m_stream ) + if ( !stream_ ) return; - if( xine_get_param( m_stream, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE ) + if( xine_get_param( stream_, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE ) { if( s_fader && s_fader->isRunning() ) s_fader->pause(); - xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); - xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); - emit stateChanged( Engine::Paused ); + 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() +XineEngine::Unpause() { - if ( !m_stream ) + if ( !stream_ ) return; - if( xine_get_param( m_stream, XINE_PARAM_SPEED ) == XINE_SPEED_PAUSE ) + if( xine_get_param( stream_, XINE_PARAM_SPEED ) == XINE_SPEED_PAUSE ) { if( s_fader && s_fader->isRunning() ) s_fader->resume(); - xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL ); - emit stateChanged( Engine::Playing ); + xine_set_param( stream_, XINE_PARAM_SPEED, XINE_SPEED_NORMAL ); + emit StateChanged( Engine::Playing ); } } Engine::State XineEngine::state() const { - if ( !m_stream || m_fadeOutRunning ) + if ( !stream_ || fadeOutRunning_ ) return Engine::Empty; - switch( xine_get_status( m_stream ) ) + switch( xine_get_status( stream_ ) ) { - case XINE_STATUS_PLAY: return xine_get_param( m_stream, XINE_PARAM_SPEED ) != XINE_SPEED_PAUSE ? Engine::Playing : Engine::Paused; + 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 m_url.isEmpty() ? Engine::Empty : Engine::Idle; + default: return url_.isEmpty() ? Engine::Empty : Engine::Idle; } } @@ -456,7 +456,7 @@ XineEngine::position() const int tmp = 0, i = 0; while( ++i < 4 ) { - xine_get_pos_length( m_stream, &pos, &time, &length ); + xine_get_pos_length( stream_, &pos, &time, &length ); if( time > tmp ) break; usleep( 100000 ); } @@ -466,12 +466,12 @@ XineEngine::position() const if ( state() != Engine::Idle && state() != Engine::Empty ) { const Engine::SimpleMetaBundle bundle = fetchMetaData(); - if( bundle.title != m_currentBundle.title || bundle.artist != m_currentBundle.artist ) { + if( bundle.title != currentBundle_.title || bundle.artist != currentBundle_.artist ) { qDebug() << "Metadata received."; - m_currentBundle = bundle; + currentBundle_ = bundle; XineEngine* p = const_cast( this ); - p->emit metaData( bundle ); + p->emit MetaData( bundle ); } } @@ -481,13 +481,13 @@ XineEngine::position() const uint XineEngine::length() const { - if ( !m_stream ) + if ( !stream_ ) return 0; // xine often delivers nonsense values for VBR files and such, so we only // use the length for remote files - if( m_url.scheme().toLower() == "file" ) + if( url_.scheme().toLower() == "file" ) return 0; else { @@ -495,7 +495,7 @@ XineEngine::length() const int time; int length = 0; - xine_get_pos_length( m_stream, &pos, &time, &length ); + xine_get_pos_length( stream_, &pos, &time, &length ); if( length < 0 ) length=0; @@ -504,38 +504,38 @@ XineEngine::length() const } void -XineEngine::seek( uint ms ) +XineEngine::Seek( uint ms ) { if( !ensureStream() ) return; - if( xine_get_param( m_stream, XINE_PARAM_SPEED ) == XINE_SPEED_PAUSE ) { + 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( m_stream, 0, (int)ms ); - xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); + xine_play( stream_, 0, (int)ms ); + xine_set_param( stream_, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); } else - xine_play( m_stream, 0, (int)ms ); + xine_play( stream_, 0, (int)ms ); } void -XineEngine::setVolumeSW( uint vol ) +XineEngine::SetVolumeSW( uint vol ) { - if ( !m_stream ) + if ( !stream_ ) return; if( !s_fader ) - xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL, static_cast( vol * m_preamp ) ); + xine_set_param( stream_, XINE_PARAM_AUDIO_AMP_LEVEL, static_cast( vol * preamp_ ) ); } void XineEngine::fadeOut( uint fadeLength, bool* terminate, bool exiting ) { - if( m_fadeOutRunning ) //Let us not start another fadeout... + if( fadeOutRunning_ ) //Let us not start another fadeout... return; - m_fadeOutRunning = !m_fadeOutRunning; - const bool isPlaying = m_stream && ( xine_get_status( m_stream ) == XINE_STATUS_PLAY ); - const float originalVol = Engine::Base::makeVolumeLogarithmic( m_volume ) * m_preamp; + 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; @@ -555,31 +555,31 @@ XineEngine::fadeOut( uint fadeLength, bool* terminate, bool exiting ) if( *terminate ) break; ::usleep( stepSizeUs ); - float vol = Engine::Base::makeVolumeLogarithmic( m_volume ) * m_preamp; + float vol = Engine::Base::MakeVolumeLogarithmic( volume_ ) * preamp_; float mix = (float)t.elapsed() / (float)length; if ( mix > 1.0 ) { break; } - if ( m_stream ) + if ( stream_ ) { float v = 4.0 * (1.0 - mix) / 3.0; - xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); + xine_set_param( stream_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); } } } - if( m_fadeOutRunning && m_stream ) - xine_set_param( m_stream, XINE_PARAM_AUDIO_AMP_LEVEL, (uint) originalVol ); - m_fadeOutRunning = !m_fadeOutRunning; + if( fadeOutRunning_ && stream_ ) + xine_set_param( stream_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint) originalVol ); + fadeOutRunning_ = !fadeOutRunning_; } void XineEngine::setEqualizerEnabled( bool enable ) { - if ( !m_stream ) + if ( !stream_ ) return; - m_equalizerEnabled = enable; + equalizerEnabled_ = enable; if( !enable ) { QList gains; @@ -604,38 +604,38 @@ post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off) void XineEngine::setEqualizerParameters( int preamp, const QList &gains ) { - if ( !m_stream ) + if ( !stream_ ) return; - m_equalizerGains = gains; - m_intPreamp = preamp; + equalizerGains_ = gains; + intPreamp_ = preamp; QList::ConstIterator it = gains.begin(); - xine_set_param( m_stream, XINE_PARAM_EQ_30HZ, int( (*it )*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_60HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_125HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_250HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_500HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_1000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_2000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_4000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_8000HZ, int( (*++it)*0.995 + 100 ) ); - xine_set_param( m_stream, XINE_PARAM_EQ_16000HZ, int( (*++it)*0.995 + 100 ) ); + 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 ) ); - m_preamp = ( preamp - 0.1 * preamp + 100 ) / 100.0; - setVolume( m_volume ); + preamp_ = ( preamp - 0.1 * preamp + 100 ) / 100.0; + SetVolume( volume_ ); } bool -XineEngine::canDecode( const QUrl &url ) const +XineEngine::CanDecode( const QUrl &url ) { static QStringList list; if(list.isEmpty()) { - QMutexLocker l(&const_cast(this)->m_initMutex); + QMutexLocker l(&const_cast(this)->initMutex_); if (list.isEmpty()) { - char* exts = xine_get_file_extensions( m_xine ); + char* exts = xine_get_file_extensions( xine_ ); list = QString(exts).split(' '); free( exts ); exts = NULL; //images @@ -678,30 +678,30 @@ XineEngine::canDecode( const QUrl &url ) const const Engine::Scope& XineEngine::scope() { - if( !m_post || !m_stream || xine_get_status( m_stream ) != XINE_STATUS_PLAY ) - return m_scope; + if( !post_ || !stream_ || xine_get_status( stream_ ) != XINE_STATUS_PLAY ) + return scope_; - MyNode* const myList = scope_plugin_list( m_post ); - metronom_t* const myMetronom = scope_plugin_metronom( m_post ); - const int myChannels = scope_plugin_channels( m_post ); + 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 m_scope; + 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 <= m_currentVpts && (!best_node || node->vpts > best_node->vpts) ) + if( node->vpts <= currentVpts_ && (!best_node || node->vpts > best_node->vpts) ) best_node = node; - if( !best_node || best_node->vpts_end < m_currentVpts ) { + if( !best_node || best_node->vpts_end < currentVpts_ ) { Log::noSuitableBuffer++; break; } int64_t - diff = m_currentVpts; + diff = currentVpts_; diff -= best_node->vpts; diff *= 1<<16; diff /= myMetronom->pts_per_smpls; @@ -725,30 +725,30 @@ XineEngine::scope() for( a = c = 0; c < myChannels; ++c ) { // we now give interleaved pcm to the scope - m_scope[scopeidx++] = data16[c]; + scope_[scopeidx++] = data16[c]; if (myChannels == 1) // duplicate mono samples - m_scope[scopeidx++] = data16[c]; + scope_[scopeidx++] = data16[c]; } } - m_currentVpts = best_node->vpts_end; - m_currentVpts++; //FIXME needs to be done for some reason, or you get situations where it uses same buffer again and again + 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 m_scope; + return scope_; } void XineEngine::PruneScope() { - if ( !m_stream ) + if ( !stream_ ) return; //here we prune the buffer list regularly - MyNode *myList = scope_plugin_list( m_post ); + MyNode *myList = scope_plugin_list( post_ ); if ( ! myList ) return; @@ -756,8 +756,8 @@ XineEngine::PruneScope() MyNode * const first_node = myList->next; MyNode const * const list_end = myList; - m_currentVpts = (xine_get_status( m_stream ) == XINE_STATUS_PLAY) - ? xine_get_current_vpts( m_stream ) + 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 @@ -765,7 +765,7 @@ XineEngine::PruneScope() { //we never delete first_node //this maintains thread-safety - if( node->vpts_end < m_currentVpts ) { + if( node->vpts_end < currentVpts_ ) { prev->next = node->next; free( node->mem ); @@ -786,38 +786,38 @@ XineEngine::event( QEvent* e ) switch( e->type() ) { case XineEvent::PlaybackFinished: //XINE_EVENT_UI_PLAYBACK_FINISHED - emit trackEnded(); + emit TrackEnded(); return true; case XineEvent::InfoMessage: - emit infoMessage( (*message).arg( m_url.toString() ) ); + emit InfoMessage( (*message).arg( url_.toString() ) ); delete message; return true; case XineEvent::StatusMessage: - emit statusText( *message ); + 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 != m_currentBundle.title || bundle.artist != m_currentBundle.artist ) { - m_currentBundle = bundle; + if( bundle.title != currentBundle_.title || bundle.artist != currentBundle_.artist ) { + currentBundle_ = bundle; - emit metaData( bundle ); + emit MetaData( bundle ); } return true; } case XineEvent::Redirecting: - emit statusText( QString("Redirecting to: ").arg( *message ) ); - load( QUrl( *message ), false ); - play(); + emit StatusText( QString("Redirecting to: ").arg( *message ) ); + Load( QUrl( *message ), Engine::Auto ); + Play(); delete message; return true; case XineEvent::LastFMTrackChanged: - emit lastFmTrackChange(); + emit LastFmTrackChange(); return true; default: ; @@ -834,16 +834,16 @@ XineEngine::playlistChanged() // TODO /*#ifdef XINE_PARAM_EARLY_FINISHED_EVENT #ifdef XINE_PARAM_GAPLESS_SWITCH -if ( xine_check_version(1,1,1) && !(m_xfadeLength > 0) -&& m_url.isLocalFile() && Playlist::instance()->isTrackAfter() ) +if ( xine_check_version(1,1,1) && !(xfadeLength_ > 0) +&& url_.isLocalFile() && Playlist::instance()->isTrackAfter() ) { -xine_set_param(m_stream, XINE_PARAM_EARLY_FINISHED_EVENT, 1 ); +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(m_stream, XINE_PARAM_EARLY_FINISHED_EVENT, 0 ); + xine_set_param(stream_, XINE_PARAM_EARLY_FINISHED_EVENT, 0 ); debug() << "XINE_PARAM_EARLY_FINISHED_EVENT disabled" << endl; } #endif @@ -877,12 +877,12 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) #ifdef XINE_PARAM_GAPLESS_SWITCH // TODO - /*if ( xine_check_version(1,1,1) && xe->m_url.isLocalFile() //Remote media break with gapless + /*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->m_stream, XINE_PARAM_GAPLESS_SWITCH, 1);*/ + xine_set_param( xe->stream_, XINE_PARAM_GAPLESS_SWITCH, 1);*/ #endif //emit signal from GUI thread QApplication::postEvent( xe, new XineEvent(XineEvent::PlaybackFinished) ); @@ -1030,15 +1030,15 @@ Engine::SimpleMetaBundle XineEngine::fetchMetaData() const { Engine::SimpleMetaBundle bundle; - bundle.title = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TITLE ) ); - bundle.artist = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ARTIST ) ); - bundle.album = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ALBUM ) ); - bundle.comment = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_COMMENT ) ); - bundle.genre = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_GENRE ) ); - bundle.bitrate = QString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_BITRATE ) / 1000 ); - bundle.samplerate = QString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ); - bundle.year = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_YEAR ) ); - bundle.tracknr = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TRACK_NUMBER ) ); + 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; } @@ -1046,7 +1046,7 @@ XineEngine::fetchMetaData() const bool XineEngine::metaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b) { bool result = false; - xine_stream_t* tmpstream = xine_stream_new(m_xine, NULL, NULL); + 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)); @@ -1109,17 +1109,17 @@ bool XineEngine::getAudioCDContents(const QString &device, QList &urls) if (!device.isNull()) { qDebug() << "xine-engine setting CD Device to: " << device; xine_cfg_entry_t config; - if (!xine_config_lookup_entry(m_xine, "input.cdda_device", &config)) { - emit statusText("Failed CD device lookup in xine engine"); + 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(m_xine, &config); + xine_config_update_entry(xine_, &config); } - emit statusText("Getting AudioCD contents..."); + emit StatusText("Getting AudioCD contents..."); - xine_urls = xine_get_autoplay_mrls(m_xine, "CD", &num); + xine_urls = xine_get_autoplay_mrls(xine_, "CD", &num); if (xine_urls) { while (xine_urls[i]) { @@ -1127,7 +1127,7 @@ bool XineEngine::getAudioCDContents(const QString &device, QList &urls) ++i; } } - else emit statusText("Could not read AudioCD"); + else emit StatusText("Could not read AudioCD"); return true; } @@ -1148,21 +1148,21 @@ bool XineEngine::lastFmProxyRequired() Fader::Fader( XineEngine *engine, uint fadeMs ) : QThread(engine) - , m_engine( engine ) - , m_xine( engine->m_xine ) - , m_decrease( engine->m_stream ) - , m_increase( 0 ) - , m_port( engine->m_audioPort ) - , m_post( engine->m_post ) - , m_fadeLength( fadeMs ) - , m_paused( false ) - , m_terminated( false ) + , 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() ) { - m_increase = engine->m_stream; + increase_ = engine->stream_; - xine_set_param( m_increase, XINE_PARAM_AUDIO_AMP_LEVEL, 0 ); + xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, 0 ); } else { s_fader = 0; @@ -1174,15 +1174,15 @@ Fader::~Fader() { wait(); - xine_close( m_decrease ); - xine_dispose( m_decrease ); - xine_close_audio_driver( m_xine, m_port ); - if( m_post ) xine_post_dispose( m_xine, m_post ); + xine_close( decrease_ ); + xine_dispose( decrease_ ); + xine_close_audio_driver( xine_, port_ ); + if( post_ ) xine_post_dispose( xine_, post_ ); - if( !m_engine->m_stopFader ) - m_engine->setVolume( m_engine->volume() ); + if( !engine_->stopFader_ ) + engine_->SetVolume( engine_->volume() ); - m_engine->m_stopFader = false; + engine_->stopFader_ = false; s_fader = 0; } @@ -1190,52 +1190,52 @@ void Fader::run() { // do a volume change in 100 steps (or every 10ms) - uint stepsCount = m_fadeLength < 1000 ? m_fadeLength / 10 : 100; - uint stepSizeUs = (int)( 1000.0 * (float)m_fadeLength / (float)stepsCount ); + 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 ( m_terminated ) + if ( terminated_ ) break; // sleep a constant amount of time QThread::usleep( stepSizeUs ); - if ( m_paused ) + if ( paused_ ) continue; elapsedUs += stepSizeUs; // get volume (amarok main * equalizer preamp) - float vol = Engine::Base::makeVolumeLogarithmic( m_engine->m_volume ) * m_engine->m_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)m_fadeLength; + float mix = (elapsedUs / 1000.0) / (float)fadeLength_; if ( mix > 1.0 ) { - if ( m_increase ) - xine_set_param( m_increase, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)vol ); + 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 ( m_decrease ) + if ( decrease_ ) { - //xine_set_param( m_decrease, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)(vol * (1.0 - mix)) ); // linear + //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( m_decrease, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); + xine_set_param( decrease_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); } - if ( m_increase ) + if ( increase_ ) { - //xine_set_param( m_increase, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)(vol * mix) ); //linear + //xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)(vol * mix) ); //linear float v = 4.0 * mix / 3.0; - xine_set_param( m_increase, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); + xine_set_param( increase_, XINE_PARAM_AUDIO_AMP_LEVEL, (uint)( v < 1.0 ? vol * v : vol ) ); } } //stop using cpu! - xine_stop( m_decrease ); + xine_stop( decrease_ ); deleteLater(); } @@ -1243,19 +1243,19 @@ Fader::run() void Fader::pause() { - m_paused = true; + paused_ = true; } void Fader::resume() { - m_paused = false; + paused_ = false; } void Fader::finish() { - m_terminated = true; + terminated_ = true; } ////////////////////////////////////////////////////////////////////////////// @@ -1264,9 +1264,9 @@ Fader::finish() OutFader::OutFader( XineEngine *engine, uint fadeLength ) : QThread(engine) - , m_engine( engine ) - , m_terminated( false ) - , m_fadeLength( fadeLength ) + , engine_( engine ) + , terminated_( false ) + , fadeLength_( fadeLength ) { } @@ -1280,11 +1280,11 @@ OutFader::~OutFader() void OutFader::run() { - m_engine->fadeOut( m_fadeLength, &m_terminated ); + engine_->fadeOut( fadeLength_, &terminated_ ); - xine_stop( m_engine->m_stream ); - xine_close( m_engine->m_stream ); - xine_set_param( m_engine->m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); + xine_stop( engine_->stream_ ); + xine_close( engine_->stream_ ); + xine_set_param( engine_->stream_, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); deleteLater(); } @@ -1292,7 +1292,7 @@ OutFader::run() void OutFader::finish() { - m_terminated = true; + terminated_ = true; } PruneScopeThread::PruneScopeThread(XineEngine *parent) diff --git a/src/engines/xine-engine.h b/src/engines/xine-engine.h index 9b7e01ff5..59b9ac8dd 100644 --- a/src/engines/xine-engine.h +++ b/src/engines/xine-engine.h @@ -57,16 +57,16 @@ class XineEngine : public Engine::Base ~XineEngine(); - virtual bool init(); - virtual bool canDecode( const QUrl& ) const; - virtual bool load( const QUrl &url, bool stream ); - virtual bool play( uint = 0 ); - virtual void stop(); - virtual void pause(); - virtual void unpause(); + 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 void Seek( uint ); virtual bool metaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b); virtual bool getAudioCDContents(const QString &device, QList &urls); @@ -77,7 +77,7 @@ class XineEngine : public Engine::Base virtual void setEqualizerEnabled( bool ); virtual void setEqualizerParameters( int preamp, const QList& ); - virtual void setVolumeSW( uint ); + virtual void SetVolumeSW( uint ); virtual void fadeOut( uint fadeLength, bool* terminate, bool exiting = false ); static void XineEventListener( void*, const xine_event_t* ); @@ -95,35 +95,38 @@ class XineEngine : public Engine::Base void determineAndShowErrorMessage(); //call after failure to load/play - xine_t *m_xine; - xine_stream_t *m_stream; - xine_audio_port_t *m_audioPort; - xine_event_queue_t *m_eventQueue; - xine_post_t *m_post; + xine_t *xine_; + xine_stream_t *stream_; + xine_audio_port_t *audioPort_; + xine_event_queue_t *eventQueue_; + xine_post_t *post_; - int64_t m_currentVpts; - float m_preamp; + int64_t currentVpts_; + float preamp_; - bool m_stopFader; - bool m_fadeOutRunning; + bool stopFader_; + bool fadeOutRunning_; - QString m_currentAudioPlugin; //to see if audio plugin has been changed + 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 m_equalizerEnabled; - int m_intPreamp; - QList m_equalizerGains; + bool equalizerEnabled_; + int intPreamp_; + QList equalizerGains_; - QMutex m_initMutex; + QMutex initMutex_; - QSettings m_settings; - bool m_fadeoutOnExit; - bool m_fadeoutEnabled; - bool m_crossfadeEnabled; - int m_fadeoutDuration; + QSettings settings_; + bool fadeoutOnExit_; + bool fadeoutEnabled_; + bool crossfadeEnabled_; + int fadeoutDuration_; + int xfadeLength_; + bool xfadeNextTrack_; + QUrl url_; PruneScopeThread* prune_; - mutable Engine::SimpleMetaBundle m_currentBundle; + mutable Engine::SimpleMetaBundle currentBundle_; public: XineEngine(); @@ -133,19 +136,21 @@ public: signals: void resetConfig(xine_t *xine); + void InfoMessage(const QString&); + void LastFmTrackChange(); }; class Fader : public QThread { - XineEngine *m_engine; - xine_t *m_xine; - xine_stream_t *m_decrease; - xine_stream_t *m_increase; - xine_audio_port_t *m_port; - xine_post_t *m_post; - uint m_fadeLength; - bool m_paused; - bool m_terminated; + 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(); @@ -159,9 +164,9 @@ public: class OutFader : public QThread { - XineEngine *m_engine; - bool m_terminated; - uint m_fadeLength; + XineEngine *engine_; + bool terminated_; + uint fadeLength_; virtual void run(); diff --git a/src/main.cpp b/src/main.cpp index 86dbf4380..b947044b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) { #endif // Window - MainWindow w(&network); + MainWindow w(&network, options.engine()); #ifdef Q_OS_DARWIN mac::SetApplicationHandler(&w); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index aa9b7b3fc..960fdf12a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -72,7 +72,7 @@ const char* MainWindow::kSettingsGroup = "MainWindow"; const char* MainWindow::kMediaFilterSpec = "Music (*.mp3 *.ogg *.flac *.mpc *.m4a *.aac *.wma);;Playlists (*.m3u *.xspf *.xml)"; -MainWindow::MainWindow(QNetworkAccessManager* network, QWidget *parent) +MainWindow::MainWindow(QNetworkAccessManager* network, Engine::Type engine, QWidget *parent) : QMainWindow(parent), #ifdef Q_OS_DARWIN tray_icon_(NULL), @@ -88,7 +88,7 @@ MainWindow::MainWindow(QNetworkAccessManager* network, QWidget *parent) about_dialog_(new About), radio_model_(new RadioModel(this)), playlist_(new Playlist(this)), - player_(new Player(playlist_, radio_model_->GetLastFMService(), this)), + player_(new Player(playlist_, radio_model_->GetLastFMService(), engine, this)), library_(new Library(player_->GetEngine(), this)), global_shortcuts_(new GlobalShortcuts(this)), settings_dialog_(new SettingsDialog), diff --git a/src/mainwindow.h b/src/mainwindow.h index 28f12b2fd..74795d54d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -24,6 +24,7 @@ #include #include "ui_mainwindow.h" +#include "engines/engine_fwd.h" class Playlist; class Player; @@ -55,7 +56,7 @@ class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow(QNetworkAccessManager* network, QWidget *parent = 0); + MainWindow(QNetworkAccessManager* network, Engine::Type engine, QWidget *parent = 0); ~MainWindow(); static const char* kSettingsGroup; diff --git a/src/pig.txt b/src/pig.txt new file mode 100644 index 000000000..f6829c40f --- /dev/null +++ b/src/pig.txt @@ -0,0 +1,26 @@ + ___ + ,---. /""`_,' + | `\``""-; / + \ /`\\ ';' + .') | __ \ + / (` / /(O\. _| + .-`| `"` ` .-\_ + .-' \ ` ;=-. + .' . ._, / o o\ + .-'` . '-._;_._.J + .-'` `.-'` + _.-` ' .' + .' '- ._.-' + /` / + / You have been warned! | + ._ ; | | + )).-| | | / + (/`.-| \ \ / .; + ( (_)| | \ ; .' | + '--'; | `\ / / | + \ | `\ /.' / + \ / ; |`\ | + '. .' _.-| | | | + '-. .-';_"---'`.__| | | \ + `'-._ ``'-. | \ \__\\ + `''--.___\\ \__\\ diff --git a/src/player.cpp b/src/player.cpp index 71ab3c9d0..3b99b8747 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -17,7 +17,20 @@ #include "player.h" #include "playlist.h" #include "lastfmservice.h" -#include "engines/gstengine.h" +#include "engines/enginebase.h" + +#ifdef HAVE_GSTREAMER +# include "engines/gstengine.h" +#endif +#ifdef HAVE_VLC +# include "engines/vlcengine.h" +#endif +#ifdef HAVE_XINE +# include "engines/xine-engine.h" +#endif +#ifdef HAVE_QT_PHONON +# include "engines/phononengine.h" +#endif #ifdef Q_WS_X11 # include "mpris_player.h" @@ -54,14 +67,15 @@ const QDBusArgument& operator>> (const QDBusArgument& arg, DBusStatus& status) { } #endif -Player::Player(Playlist* playlist, LastFMService* lastfm, QObject* parent) +Player::Player(Playlist* playlist, LastFMService* lastfm, Engine::Type engine, QObject* parent) : QObject(parent), playlist_(playlist), lastfm_(lastfm), current_item_options_(PlaylistItem::Default), - engine_(new GstEngine), stream_change_type_(Engine::First) { + engine_ = createEngine(engine); + settings_.beginGroup("Player"); SetVolume(settings_.value("volume", 50).toInt()); @@ -79,6 +93,37 @@ Player::Player(Playlist* playlist, LastFMService* lastfm, QObject* parent) #endif } +EngineBase* Player::createEngine(Engine::Type engine) { + + switch(engine) { +#ifdef HAVE_GSTREAMER + case Engine::gstreamer: + return new GstEngine(); + break; +#endif +#ifdef HAVE_VLC + case Engine::vlc: + return new VlcEngine(); + break; +#endif +#ifdef HAVE_XINE + case Engine::xine: + return new XineEngine(); + break; +#endif +#ifdef HAVE_QT_PHONON + case Engine::qt_phonon: + 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/player.h b/src/player.h index f51eb4369..bd3a0581b 100644 --- a/src/player.h +++ b/src/player.h @@ -52,8 +52,9 @@ class Player : public QObject { Q_OBJECT public: - Player(Playlist* playlist, LastFMService* lastfm, QObject* parent = 0); + Player(Playlist* playlist, LastFMService* lastfm, Engine::Type engine, QObject* parent = 0); + EngineBase* createEngine(Engine::Type engine); void Init(); EngineBase* GetEngine() { return engine_; } diff --git a/src/translations/cs.po b/src/translations/cs.po index 03b66f099..1f0402a92 100644 --- a/src/translations/cs.po +++ b/src/translations/cs.po @@ -550,6 +550,14 @@ msgstr "" msgid "Display the on-screen-display" msgstr "" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -692,8 +700,7 @@ msgid "Tools" msgstr "Nástroje" msgid "These folders will be scanned for music to make up your library" -msgstr "" -"Tyto složky budou prohledány a nalezená hudba bude přidána do knihovny" +msgstr "Tyto složky budou prohledány a nalezená hudba bude přidána do knihovny" msgid "Add new folder..." msgstr "Přidat novou složku..." @@ -732,11 +739,11 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" -"Pamatujte, že musíte být platící " -"uživatel abyste v Clementine mohli poslouchat rádio Last.fm." +"Pamatujte, že musíte být platící uživatel abyste v Clementine mohli poslouchat rádio Last.fm." msgid "Authenticating..." msgstr "Ověřuji..." @@ -747,8 +754,8 @@ msgstr "Přehrát umělce nebo značku" msgid "" "Enter an artist or tag to start listening to Last.fm radio." msgstr "" -"Zadejte umělce nebo značku pro spuštění poslouchání rádia " -"Last.fm." +"Zadejte umělce nebo značku pro spuštění poslouchání rádia Last." +"fm." msgid "Tag" msgstr "Značka" diff --git a/src/translations/de.po b/src/translations/de.po index e1e6d38d4..ba1b2fd51 100644 --- a/src/translations/de.po +++ b/src/translations/de.po @@ -555,6 +555,14 @@ msgstr "Einstellungen" msgid "Display the on-screen-display" msgstr "" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" diff --git a/src/translations/el.po b/src/translations/el.po index 051742343..00f2a6a5d 100644 --- a/src/translations/el.po +++ b/src/translations/el.po @@ -541,8 +541,7 @@ msgid "Append files/URLs to the playlist" msgstr "Προσάρτηση αρχείων/URLs στην λίστα αναπαραγωγής" msgid "Loads files/URLs, replacing current playlist" -msgstr "" -"Φορτώνει αρχεία/URLs, αντικαθιστώντας την τρέχουσα λίστα αναπαραγωγής" +msgstr "Φορτώνει αρχεία/URLs, αντικαθιστώντας την τρέχουσα λίστα αναπαραγωγής" msgid "Play the th track in the playlist" msgstr "Αναπαραγωγή του ου κομματιού της λίστας αναπαραγωγής" @@ -553,6 +552,14 @@ msgstr "Άλλες επιλογές" msgid "Display the on-screen-display" msgstr "Απεικόνιση της «απεικόνισης στην οθόνη»" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -695,8 +702,7 @@ msgid "Tools" msgstr "Εργαλεία" msgid "These folders will be scanned for music to make up your library" -msgstr "" -"Οι φάκελοι αυτοί θα σαρωθούν για μουσικά αρχεία για την βιβλιοθήκη σας" +msgstr "Οι φάκελοι αυτοί θα σαρωθούν για μουσικά αρχεία για την βιβλιοθήκη σας" msgid "Add new folder..." msgstr "Προσθήκη νέου φακέλου..." @@ -735,11 +741,11 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "Εμφάνισε τα κουμπιά \"αγάπη\"και \"απαγόρευση\"" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" -"Σημείωσε πως πρέπει να είσαι συνδρομητής για να ακούσεις Last.fm από το Clementine." +"Σημείωσε πως πρέπει να είσαι συνδρομητής για να ακούσεις Last.fm από το Clementine." msgid "Authenticating..." msgstr "Πιστοποίηση..." diff --git a/src/translations/es.po b/src/translations/es.po index 597b31c5d..5973e4eb4 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -255,8 +255,7 @@ msgid "This stream is for paid subscribers only" msgstr "Este flujo es solo para Suscriptores de Paga" msgid "Last.fm is currently busy, please try again in a few minutes" -msgstr "" -"Last.fm está actualmente saturado, intente nuevamente en unos minutos" +msgstr "Last.fm está actualmente saturado, intente nuevamente en unos minutos" msgid "Not enough content" msgstr "No hay suficiente contenido" @@ -378,8 +377,8 @@ msgstr "Establecer carátula personalizada" msgid "" "Images (*.png *.jpg *.jpeg *.bmp *.gif *.xpm *.pbm *.pgm *.ppm *.xbm *.tiff)" msgstr "" -"Imágenes (*.png *.jpg *.jpeg *.bmp *.gif *.xpm *.pbm *.pgm *.ppm *.xbm " -"*.tiff)" +"Imágenes (*.png *.jpg *.jpeg *.bmp *.gif *.xpm *.pbm *.pgm *.ppm *.xbm *." +"tiff)" msgid "All files (*)" msgstr "Todos los archivos (*)" @@ -553,6 +552,14 @@ msgstr "Otras opciones" msgid "Display the on-screen-display" msgstr "Mostrar la indicación-en-pantalla" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -708,8 +715,7 @@ msgid "Options" msgstr "Opciones" msgid "Automatically open single categories in the library tree" -msgstr "" -"Automaticamente expandir categorias unicas en el árbol de la colección" +msgstr "Automaticamente expandir categorias unicas en el árbol de la colección" msgid "Form" msgstr "Formulario" @@ -736,8 +742,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "Mostrar los botones \"Me encanta\" y \"Prohibir\"" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" "Recuerda que tienes que ser un Suscriptor " "de Paga para poder escuchar la radio de Last.fm desde Clementine." @@ -751,8 +757,8 @@ msgstr "Reproducir Artista o Etiqueta" msgid "" "Enter an artist or tag to start listening to Last.fm radio." msgstr "" -"Ingrese un artista o etiqueta para escuchar la radio de " -"Last.fm." +"Ingrese un artista o etiqueta para escuchar la radio de Last." +"fm." msgid "Tag" msgstr "Etiqueta" @@ -1050,8 +1056,8 @@ msgstr "Habilitar el ecualizador" #~ msgstr "Acceso por defecto:" #~ msgid "" -#~ "You are about to reset to global shortcuts default values. Are you sure you " -#~ "want to continue?" +#~ "You are about to reset to global shortcuts default values. Are you sure " +#~ "you want to continue?" #~ msgstr "" #~ "Estas por reinicar las teclas rapidas a sus valores por defecto. Estás " #~ "seguro que deseas continuar?" diff --git a/src/translations/fr.po b/src/translations/fr.po index f65fe4960..2715c90fb 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -553,6 +553,14 @@ msgstr "Autres options" msgid "Display the on-screen-display" msgstr "" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -736,8 +744,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" "N'oubliez pas que vous devez être abonné " "(payant) pour écouter la radio Last.fm avec Clementine." diff --git a/src/translations/nb.po b/src/translations/nb.po index fddbbb661..efbf66a25 100644 --- a/src/translations/nb.po +++ b/src/translations/nb.po @@ -557,6 +557,14 @@ msgstr "Instillinger" msgid "Display the on-screen-display" msgstr "" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" diff --git a/src/translations/pl.po b/src/translations/pl.po index 6ab5a4495..693281342 100644 --- a/src/translations/pl.po +++ b/src/translations/pl.po @@ -550,6 +550,13 @@ msgstr "" msgid "Display the on-screen-display" msgstr "" +msgid "Select engine" +msgstr "" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "" @@ -731,8 +738,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" "Musisz posiadać opłacone konto aby " "słuchać radia Last.fm w Clementine." @@ -745,8 +752,7 @@ msgstr "Odtwarzaj Wykonawcę lub Znacznik" msgid "" "Enter an artist or tag to start listening to Last.fm radio." -msgstr "" -"Wpisz wykonawcę lub znacznik aby słuchać radia Last.fm." +msgstr "Wpisz wykonawcę lub znacznik aby słuchać radia Last.fm." msgid "Tag" msgstr "Znacznik" diff --git a/src/translations/pt.po b/src/translations/pt.po index b6a5b5aad..725abdf90 100644 --- a/src/translations/pt.po +++ b/src/translations/pt.po @@ -552,6 +552,14 @@ msgstr "Outras opções" msgid "Display the on-screen-display" msgstr "" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -733,8 +741,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "Mostrar os botões \"adorar\" e \"excluir\"" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" "Note que deverá ser um assinante " "para ouvir rádio da Last.fm com o Clementine." @@ -806,8 +814,7 @@ msgid "Choose automatically" msgstr "Escolher automaticamente" msgid "Leave blank for the default. Examples: \"/dev/dsp\", \"front\", etc." -msgstr "" -"Deixar em branco por defeito. Exemplos: \"/dev/dsp\", \"front\", etc." +msgstr "Deixar em branco por defeito. Exemplos: \"/dev/dsp\", \"front\", etc." msgid "Output device" msgstr "Dispositivo de saída" diff --git a/src/translations/pt_BR.po b/src/translations/pt_BR.po index 6ebbc4c6c..12cef5e57 100644 --- a/src/translations/pt_BR.po +++ b/src/translations/pt_BR.po @@ -549,6 +549,13 @@ msgstr "" msgid "Display the on-screen-display" msgstr "" +msgid "Select engine" +msgstr "" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "" @@ -730,8 +737,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" msgid "Authenticating..." diff --git a/src/translations/ru.po b/src/translations/ru.po index 1ca90b0fd..bbc96b32a 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -375,8 +375,8 @@ msgstr "Укажите обложку вручную" msgid "" "Images (*.png *.jpg *.jpeg *.bmp *.gif *.xpm *.pbm *.pgm *.ppm *.xbm *.tiff)" msgstr "" -"Изображения (*.png *.jpg *.jpeg *.bmp *.gif *.xpm *.pbm *.pgm *.ppm *.xbm " -"*.tiff)" +"Изображения (*.png *.jpg *.jpeg *.bmp *.gif *.xpm *.pbm *.pgm *.ppm *.xbm *." +"tiff)" msgid "All files (*)" msgstr "Все файлы (*)" @@ -550,6 +550,14 @@ msgstr "Другие настройки" msgid "Display the on-screen-display" msgstr "Показывать экранное уведомление" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -732,12 +740,11 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "Показывать кнопки \"Избранное\" и \"Запретить\"" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" -"Обратите внимание, что вы должны быть платным подписчиком ,чтобы слушать радио Last.fm из " -"Clementine." +"Обратите внимание, что вы должны быть платным подписчиком ,чтобы слушать радио Last.fm из Clementine." msgid "Authenticating..." msgstr "Аутентификация..." @@ -747,8 +754,7 @@ msgstr "Проиграть исполнителя или тег" msgid "" "Enter an artist or tag to start listening to Last.fm radio." -msgstr "" -"Укажите исполнителя или тег чтобы слушать радио Last.fm." +msgstr "Укажите исполнителя или тег чтобы слушать радио Last.fm." msgid "Tag" msgstr "Тег" diff --git a/src/translations/sk.po b/src/translations/sk.po index c013a2e88..b1bad1ce4 100644 --- a/src/translations/sk.po +++ b/src/translations/sk.po @@ -551,6 +551,13 @@ msgstr "" msgid "Display the on-screen-display" msgstr "" +msgid "Select engine" +msgstr "" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "" @@ -732,8 +739,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" "Pam§tajte, že musíte byť platiaci " "odberateľ aby ste mohli počúvať Last.fm rádio v Clementine." @@ -1039,8 +1046,8 @@ msgstr "" #~ msgstr "Pôvodný kľúč" #~ msgid "" -#~ "You are about to reset to global shortcuts default values. Are you sure you " -#~ "want to continue?" +#~ "You are about to reset to global shortcuts default values. Are you sure " +#~ "you want to continue?" #~ msgstr "" #~ "Pokúšate sa zresetovať pôvodné globálne skratky. Ste si istý, že chcete " #~ "pokračovať?" diff --git a/src/translations/sv.po b/src/translations/sv.po index f87e990c0..52bcf9974 100644 --- a/src/translations/sv.po +++ b/src/translations/sv.po @@ -550,6 +550,14 @@ msgstr "Övriga alternativ" msgid "Display the on-screen-display" msgstr "" +#, fuzzy +msgid "Select engine" +msgstr "Clementine" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "Clementine" @@ -733,8 +741,8 @@ msgid "Show the \"love\" and \"ban\" buttons" msgstr "Visa knapparna \"gilla\" och \"banlys\"" msgid "" -"Note that you must be a paid " -"subscriber to listen to Last.fm radio from within Clementine." +"Note that you must be a paid subscriber to listen to Last.fm radio from within Clementine." msgstr "" "Du måste ha ett betalabonnemang för " "att kunna lyssna på Last.fm radio i Clementine." @@ -748,8 +756,8 @@ msgstr "Spela upp artist eller tagg" msgid "" "Enter an artist or tag to start listening to Last.fm radio." msgstr "" -"Skriv in en artist eller tagg för att börja lyssna till " -"Last.fm radio." +"Skriv in en artist eller tagg för att börja lyssna till Last." +"fm radio." msgid "Tag" msgstr "Tagg" diff --git a/src/translations/tr.po b/src/translations/tr.po index 36341fa18..4cc9fdac3 100644 --- a/src/translations/tr.po +++ b/src/translations/tr.po @@ -549,6 +549,13 @@ msgstr "" msgid "Display the on-screen-display" msgstr "" +msgid "Select engine" +msgstr "" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr "" diff --git a/src/translations/translations.pot b/src/translations/translations.pot index 98a13aeab..5b43c82fd 100644 --- a/src/translations/translations.pot +++ b/src/translations/translations.pot @@ -540,6 +540,13 @@ msgstr "" msgid "Display the on-screen-display" msgstr "" +msgid "Select engine" +msgstr "" + +#, qt-format +msgid "Unknown audio engine \"%1\". Choices are:" +msgstr "" + msgid "Clementine" msgstr ""