[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdemultimedia/noatun/modules/akode-engine
From:       Stefan Gehn <mETz81 () web ! de>
Date:       2007-02-01 14:16:27
Message-ID: 1170339387.802042.10856.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 629124 by metz:

- Try to return a sensible list of mimetypes for aKode


 M  +44 -3     noatun_akode.cpp  
 M  +4 -0      noatun_akode.h  


--- trunk/KDE/kdemultimedia/noatun/modules/akode-engine/noatun_akode.cpp #629123:629124
@@ -27,6 +27,7 @@
 #include <qfile.h>
 
 using namespace Noatun;
+using namespace std;
 
 
 // ---------------------------------------------------------------------------
@@ -155,9 +156,49 @@
 
 QStringList AKodePlugin::mimeTypes() const
 {
-	QStringList ret;
-	ret << "audio/mp3" << "audio/ogg";
-	return ret;
+	QSet<QString> types;
+	types << "audio/x-wav"; // built into akode
+
+	// aKode lacks a way to determine supported mimetypes :(
+	const list<string> decoderList = aKode::DecoderPluginHandler::listDecoderPlugins();
+	for (list<string>::const_iterator i = decoderList.begin(); i != decoderList.end(); i++)
+	{
+		if (*i == "mpeg")
+		{
+			types << "audio/x-mp2";
+			types << "audio/x-mp3";
+		}
+		else if (*i == "mpc")
+		{
+			types << "audio/x-musepack";
+		}
+		else if (*i == "xiph")
+		{
+			//FIXME: we cannot know which formats the xiph decoder supports :(
+			types << "application/ogg";
+			types << "audio/x-flac";
+			types << "audio/x-speex";
+		}
+		else if (*i == "ffmpeg")
+		{
+			types << "audio/vnd.rn-realaudio";
+			types << "audio/x-pn-realaudio";
+			types << "audio/x-flac";
+			types << "audio/x-oggflac";
+			types << "audio/x-speex";
+			types << "audio/mp4";
+			types << "audio/ac3";
+			types << "audio/aac";
+			types << "audio/vorbis";
+			types << "audio/x-mp3";
+			types << "audio/x-mp1";
+			types << "audio/x-mp2";
+			types << "audio/mpeg";
+			types << "audio/x-ms-wma";
+		}
+	}
+
+	return types.toList();
 }
 
 
--- trunk/KDE/kdemultimedia/noatun/modules/akode-engine/noatun_akode.h #629123:629124
@@ -26,6 +26,10 @@
 
 using namespace Noatun;
 
+/**
+ * @author Stefan Gehn
+ * @todo Add an Equalizer as soon as libnoatun has an effects API
+ **/
 class AKodePlugin : public Plugin, public EngineInterface, public aKode::Player::Manager
 {
 Q_OBJECT
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic