From kde-commits Thu Feb 01 14:16:27 2007 From: Stefan Gehn Date: Thu, 01 Feb 2007 14:16:27 +0000 To: kde-commits Subject: KDE/kdemultimedia/noatun/modules/akode-engine Message-Id: <1170339387.802042.10856.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=117033941931524 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 using namespace Noatun; +using namespace std; // --------------------------------------------------------------------------- @@ -155,9 +156,49 @@ QStringList AKodePlugin::mimeTypes() const { - QStringList ret; - ret << "audio/mp3" << "audio/ogg"; - return ret; + QSet types; + types << "audio/x-wav"; // built into akode + + // aKode lacks a way to determine supported mimetypes :( + const list decoderList = aKode::DecoderPluginHandler::listDecoderPlugins(); + for (list::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