libkonq
Go to the documentation of this file.
20 #include <phonon/mediaobject.h>
21 #include <phonon/backendcapabilities.h>
26 #include <kpluginfactory.h>
33 KonqSoundPlayerImpl();
34 virtual ~KonqSoundPlayerImpl() {}
36 virtual bool isMimeTypeKnown(
const QString& mimeType);
37 virtual void setUrl(
const KUrl &url);
40 virtual bool isPlaying();
43 Phonon::MediaObject *m_player;
46 KonqSoundPlayerImpl::KonqSoundPlayerImpl()
51 bool KonqSoundPlayerImpl::isMimeTypeKnown(
const QString& mimeType)
53 kDebug() << mimeType << Phonon::BackendCapabilities::isMimeTypeAvailable(mimeType);
54 return Phonon::BackendCapabilities::isMimeTypeAvailable(mimeType);
57 void KonqSoundPlayerImpl::setUrl(
const KUrl &url)
61 kDebug() <<
"create AudioPlayer";
62 m_player = Phonon::createPlayer(Phonon::MusicCategory);
63 m_player->setParent(
this);
65 m_player->setCurrentSource(url);
68 void KonqSoundPlayerImpl::play()
75 void KonqSoundPlayerImpl::stop()
82 bool KonqSoundPlayerImpl::isPlaying()
85 const bool isPlaying = (m_player->state() == Phonon::PlayingState || m_player->state() == Phonon::BufferingState);
86 kDebug() << isPlaying;
93 class KonqSoundFactory :
public KPluginFactory
96 KonqSoundFactory(
QObject *parent = 0)
97 : KPluginFactory(0, 0, parent) {}
98 virtual ~KonqSoundFactory() {}
101 virtual QObject *create(
const char *iface,
104 const QVariantList &args,
105 const QString &keyword);
108 QObject *KonqSoundFactory::create(
const char *iface,
QWidget *,
QObject *,
const QVariantList &,
const QString &)
110 if (qstrcmp(iface,
"KonqSoundPlayer") == 0)
111 return new KonqSoundPlayerImpl();
115 K_EXPORT_PLUGIN(KonqSoundFactory)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:18 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.