summaryrefslogtreecommitdiffstats
path: root/opensuse/core/tdebase/libkonq-kdemm.diff
blob: 6eb45eab43db48ffb04f3d0dd3086a46baf9ee05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Index: libkonq/Makefile.am
===================================================================
--- libkonq/Makefile.am.orig
+++ libkonq/Makefile.am
@@ -53,14 +53,10 @@ include_HEADERS = konq_popupmenu.h knewm
     konq_faviconmgr.h konq_xmlguiclient.h konqbookmarkmanager.h konq_filetip.h
 
 
-if include_ARTS
-ARTS_MODULE = konq_sound.la
-endif
-
-kde_module_LTLIBRARIES = $(ARTS_MODULE)
+kde_module_LTLIBRARIES = konq_sound.la
 konq_sound_la_SOURCES = konq_sound.cc
 konq_sound_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
-konq_sound_la_LIBADD = -lsoundserver_idl -lartskde
+konq_sound_la_LIBADD = -lkdemm
 
 noinst_HEADERS = konq_sound.h
 
Index: libkonq/konq_sound.cc
===================================================================
--- libkonq/konq_sound.cc.orig
+++ libkonq/konq_sound.cc
@@ -16,10 +16,9 @@
    Boston, MA 02110-1301, USA.
 */
 
-#include <kartsdispatcher.h>
 #include <kdebug.h>
-#include <kplayobjectfactory.h>
-#include <soundserver.h>
+#include <kdemm/simpleplayer.h>
+#include <kdemm/factory.h>
 
 #include "konq_sound.h"
 
@@ -39,71 +38,38 @@ public:
 private:
 	QStringList m_mimeTypes;
 
-	KArtsDispatcher     m_dispatcher;
-	Arts::SoundServerV2 m_soundServer;
-	KDE::PlayObjectFactory *m_factory;
-	KDE::PlayObject        *m_player;
+	KDE::Multimedia::SimplePlayer m_player;
 };
 
 KonqSoundPlayerImpl::KonqSoundPlayerImpl()
-	: m_player(0)
 {
-	m_soundServer = Arts::Reference("global:Arts_SoundServerV2");
-	m_factory = new KDE::PlayObjectFactory(m_soundServer);
 }
 
 KonqSoundPlayerImpl::~KonqSoundPlayerImpl()
 {
-	delete m_player;
-	delete m_factory;
 }
 
 const QStringList &KonqSoundPlayerImpl::mimeTypes()
 {
-	if (m_mimeTypes.isEmpty())
-	{
-		Arts::TraderQuery query;
-		vector<Arts::TraderOffer> *offers = query.query();
-
-		for (vector<Arts::TraderOffer>::iterator it = offers->begin();
-			it != offers->end(); ++it)
-		{
-			vector<string> *prop = (*it).getProperty("MimeType");
-			for (vector<string>::iterator mt = prop->begin();
-				mt != prop->end(); ++mt)
-				if ((*mt).length()) // && (*mt).find("video/") == string::npos)
-					m_mimeTypes << (*mt).c_str();
-			delete prop;
-		}
-		delete offers;
-	}
+	if( m_mimeTypes.isEmpty() )
+		m_mimeTypes = KDE::Multimedia::Factory::self()->playableMimeTypes();
+
 	return m_mimeTypes;
 }
 
 void KonqSoundPlayerImpl::play(const QString &fileName)
 {
-	if (m_soundServer.isNull())
-		return;
-
-	delete m_player;
-	if ((m_player = m_factory->createPlayObject(fileName, true)))
-	{
-		if (m_player->isNull())
-			stop();
-		else
-			m_player->play();
-	}
+	m_player.play( KURL( fileName ) );
 }
 
 void KonqSoundPlayerImpl::stop()
 {
-	delete m_player;
-	m_player = 0;
+	m_player.stop();
 }
 
 bool KonqSoundPlayerImpl::isPlaying()
 {
-	return m_player ? (m_player->state() == Arts::posPlaying) : false;
+	return m_player.isPlaying();
 }
 
 class KonqSoundFactory : public KLibFactory