Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1
kdemultimedia3
juk-kdemm-support.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File juk-kdemm-support.diff of Package kdemultimedia3
--- juk/juk.cpp +++ juk/juk.cpp 2005/03/31 12:37:53 @@ -181,11 +181,6 @@ this, SLOT(slotToggleSystemTray(bool))); - m_outputSelectAction = PlayerManager::playerSelectAction(actions()); - - if(m_outputSelectAction) - m_outputSelectAction->setCurrentItem(0); - new KAction(i18n("&Tag Guesser..."), 0, 0, this, SLOT(slotConfigureTagGuesser()), actions(), "tagGuesserConfig"); @@ -320,9 +315,6 @@ bool showPopups = settingsConfig.readBoolEntry("TrackPopup", false); m_togglePopupsAction->setChecked(showPopups); - if(m_outputSelectAction) - m_outputSelectAction->setCurrentItem(settingsConfig.readNumEntry("MediaSystem", 0)); - m_toggleSplashAction->setChecked(m_showSplash); } @@ -358,8 +350,6 @@ settingsConfig.writeEntry("DockInSystemTray", m_toggleSystemTrayAction->isChecked()); settingsConfig.writeEntry("DockOnClose", m_toggleDockOnCloseAction->isChecked()); settingsConfig.writeEntry("TrackPopup", m_togglePopupsAction->isChecked()); - if(m_outputSelectAction) - settingsConfig.writeEntry("MediaSystem", m_outputSelectAction->currentItem()); KGlobal::config()->sync(); } --- juk/juk.h +++ juk/juk.h 2005/03/31 12:37:53 @@ -87,7 +87,6 @@ KToggleAction *m_togglePopupsAction; KToggleAction *m_toggleSplashAction; KToggleAction *m_loopPlaylistAction; - KSelectAction *m_outputSelectAction; PlayerManager *m_player; KGlobalAccel *m_accel; --- juk/kdemmplayer.cpp +++ juk/kdemmplayer.cpp 2005/03/31 12:37:53 @@ -0,0 +1,139 @@ +/*************************************************************************** + begin : Sun Feb 17 2002 + copyright : (C) 2002 - 2004 by Scott Wheeler + email : wheeler@kde.org + + copyright : (C) 2003,2004 by Matthias Kretz + email : kretz@kde.org + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.com +***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#include "kdemmplayer.h" + +#include <kdebug.h> +#include <kconfig.h> +#include <kstandarddirs.h> + +#include <qdir.h> + +#include <kmessagebox.h> +#include <klocale.h> + +#include <kdemm/simpleplayer.h> + +using namespace KDE::Multimedia; + +//////////////////////////////////////////////////////////////////////////////// +// public methods +//////////////////////////////////////////////////////////////////////////////// + +KDEMMPlayer::KDEMMPlayer() : Player() +{ + m_player = new SimplePlayer(); +} + +KDEMMPlayer::~KDEMMPlayer() +{ + delete m_player; +} + +void KDEMMPlayer::play(const FileHandle &file) +{ + kdDebug( 65432 ) << k_funcinfo << endl; + + if( file.isNull() ) + { + m_player->play( m_currentURL ); + return; + } + if(!file.isNull()) + m_currentURL.setPath(file.absFilePath()); + + kdDebug( 65432 ) << "Opening: " << file.absFilePath() << endl; + + m_player->play( m_currentURL ); +} + +void KDEMMPlayer::pause() +{ + m_player->pause(); +} + +void KDEMMPlayer::stop() +{ + m_player->stop(); +} + +void KDEMMPlayer::setVolume(float volume) +{ + m_player->setVolume(volume); +} + +float KDEMMPlayer::volume() const +{ + return m_player->volume(); +} + +///////////////////////////////////////////////////////////////////////////////// +// player status functions +///////////////////////////////////////////////////////////////////////////////// + +bool KDEMMPlayer::playing() const +{ + return m_player->isPlaying(); +} + +bool KDEMMPlayer::paused() const +{ + return m_player->isPaused(); +} + +int KDEMMPlayer::totalTime() const +{ + if (m_player->totalTime() < 0) + return -1; + return (m_player->totalTime()/1000); +} + +int KDEMMPlayer::currentTime() const +{ + if (m_player->currentTime() < 0) + return -1; + return (m_player->currentTime()/1000); +} + +int KDEMMPlayer::position() const +{ + if( m_player->totalTime() > 0 ) + return (m_player->currentTime()*1000)/m_player->totalTime(); + return -1; +} + +///////////////////////////////////////////////////////////////////////////////// +// player seek functions +///////////////////////////////////////////////////////////////////////////////// + +void KDEMMPlayer::seek(int seekTime) +{ + m_player->seek(seekTime*1000); +} + +void KDEMMPlayer::seekPosition(int position) +{ + int length = m_player->totalTime(); + if (length > 0) m_player->seek((position*length)/1000); +} + +#include "kdemmplayer.moc" + --- juk/kdemmplayer.h +++ juk/kdemmplayer.h 2005/03/31 12:37:53 @@ -0,0 +1,70 @@ +/*************************************************************************** + begin : Sun Feb 17 2002 + copyright : (C) 2002 - 2004 by Scott Wheeler + email : wheeler@kde.org + + copyright : (C) 2003,2004 by Matthias Kretz + email : kretz@kde.org + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.com +***************************************************************************/ + +/*************************************************************************** + * * + * 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 KDEMMPLAYER_H +#define KDEMMPLAYER_H + +#include <config.h> + +#include "player.h" + +#include <kurl.h> + +#include <qstring.h> +#include <qobject.h> + +namespace KDE { namespace Multimedia { class SimplePlayer; } } + +class KDEMMPlayer : public Player +{ + Q_OBJECT + +public: + KDEMMPlayer(); + virtual ~KDEMMPlayer(); + + virtual void play(const FileHandle &file = FileHandle::null()); + virtual void pause(); + virtual void stop(); + + virtual void setVolume(float volume = 1.0); + virtual float volume() const; + + virtual bool playing() const; + virtual bool paused() const; + + virtual int totalTime() const; + virtual int currentTime() const; + virtual int position() const; // in this case not really the percent + + virtual void seek(int seekTime); + virtual void seekPosition(int position); + +private: + KDE::Multimedia::SimplePlayer *m_player; + + KURL m_currentURL; + +}; + +#endif + +// vim: sw=4 ts=8 et --- juk/Makefile.am +++ juk/Makefile.am 2005/03/31 12:37:53 @@ -4,8 +4,6 @@ juk_SOURCES = \ advancedsearchdialog.cpp \ actioncollection.cpp \ - akodeplayer.cpp \ - artsplayer.cpp \ cache.cpp \ categoryreaderinterface.cpp \ collectionlist.cpp \ @@ -24,11 +22,11 @@ filerenameroptions.cpp \ filerenameroptionsbase.ui \ filerenamerconfigdlg.cpp \ - gstreamerplayer.cpp \ googlefetcher.cpp \ googlefetcherdialog.cpp \ historyplaylist.cpp \ juk.cpp \ + kdemmplayer.cpp \ jukIface.skel \ k3bexporter.cpp \ keydialog.cpp \ @@ -80,8 +78,8 @@ endif ################################################## -juk_LDADD = -lm $(LDADD_GST) $(mblibs) $(LIB_KIO) $(taglib_libs) $(LIB_KHTML) $(LIB_ARTS) ../akode/lib/libakode.la -juk_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LDFLAGS_GST) +juk_LDADD = -lm $(mblibs) $(LIB_KIO) $(taglib_libs) $(LIB_KHTML) -lkdemm +juk_LDFLAGS = $(all_libraries) $(KDE_RPATH) tagguessertest_LDADD = $(LIB_KDECORE) tagguessertest_LDFLAGS = $(all_libraries) --- juk/playermanager.cpp +++ juk/playermanager.cpp 2005/03/31 12:38:18 @@ -21,9 +21,7 @@ #include <math.h> -#include "artsplayer.h" -#include "akodeplayer.h" -#include "gstreamerplayer.h" +#include "kdemmplayer.h" #include "playermanager.h" #include "playlistinterface.h" #include "slideraction.h" @@ -44,36 +42,11 @@ // helper functions //////////////////////////////////////////////////////////////////////////////// -enum SoundSystem { ArtsBackend = 0, GStreamerBackend = 1, AkodeBackend = 2 }; - -static Player *createPlayer(int system = ArtsBackend) +static Player *createPlayer() { Player *p = 0; - switch(system) { - case AkodeBackend: - p = new aKodePlayer; - break; -#if HAVE_ARTS - case ArtsBackend: - p = new ArtsPlayer; - break; -#endif -#if HAVE_GSTREAMER - case GStreamerBackend: - p = new GStreamerPlayer; - break; -#endif - default: -#if HAVE_ARTS - p = new ArtsPlayer; -#elif HAVE_GSTREAMER - p = new GStreamerPlayer; -#else - p = new aKodePlayer; -#endif - break; - } + p = new KDEMMPlayer; return p; } @@ -217,14 +190,7 @@ KSelectAction *action = 0; action = new KSelectAction(i18n("&Output To"), 0, parent, "outputSelect"); QStringList l; - l << -#if HAVE_ARTS - i18n("aRts") << -#endif -#if HAVE_GSTREAMER - i18n("GStreamer") << -#endif - i18n("aKode"); + l << i18n("KDEMM"); action->setItems(l); return action; } @@ -503,24 +469,6 @@ m_noSeek = false; } -void PlayerManager::slotSetOutput(const QString &system) -{ - stop(); - setOutput(system); - setup(); -} - -void PlayerManager::setOutput(const QString &system) -{ - delete m_player; - if(system == i18n("aRts")) - m_player = createPlayer(ArtsBackend); - else if(system == i18n("GStreamer")) - m_player = createPlayer(GStreamerBackend); - else if(system == i18n("aKode")) - m_player = createPlayer(AkodeBackend); -} - void PlayerManager::slotSetVolume(int volume) { float scaledVolume; @@ -599,15 +547,7 @@ this, SLOT(slotSetVolume(int))); // Call this method manually to avoid warnings. - - KAction *outputAction = actions()->action("outputSelect"); - - if(outputAction) { - setOutput(static_cast<KSelectAction *>(outputAction)->currentText()); - connect(outputAction, SIGNAL(activated(const QString &)), this, SLOT(slotSetOutput(const QString &))); - } - else - m_player = createPlayer(); + m_player = createPlayer(); float volume; --- juk/playermanager.h +++ juk/playermanager.h 2005/03/31 12:38:25 @@ -87,12 +87,10 @@ private: Player *player() const; void setup(); - void setOutput(const QString &); private slots: void slotPollPlay(); void slotUpdateTime(int position); - void slotSetOutput(const QString &); void slotSetVolume(int volume); private:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor