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

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/engine/phonon
From:       Mark Kretschmann <markey () web ! de>
Date:       2007-04-20 8:00:44
Message-ID: 1177056044.567573.5243.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 656087 by markey:

Implement canDecode(). Seems to work nicely and fast.


 M  +8 -5      phonon-engine.cpp  
 M  +1 -0      phonon-engine.h  


--- trunk/extragear/multimedia/amarok/src/engine/phonon/phonon-engine.cpp #656086:656087
@@ -1,6 +1,7 @@
 /***************************************************************************
- *   Copyright (C) 2007   Dan Meltzer <hydrogen@notyetimplemented.com>     *
- *                 2007   Seb Ruiz <me@sebruiz.net>                        *
+ *   Copyright (C) 2007  Dan Meltzer <hydrogen@notyetimplemented.com>      *
+ *   Copyright (C) 2007  Seb Ruiz <me@sebruiz.net>                         *
+ *   Copyright (C) 2007  Mark Kretschmann <markey@web.de>                  *
  *                                                                         *
  *   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  *
@@ -20,6 +21,8 @@
 #include "debug.h"
 #include "statusbar/statusbar.h"
 
+#include <kmimetype.h>
+
 #include <phonon/mediaobject.h>
 #include <phonon/audiopath.h>
 #include <phonon/audiooutput.h>
@@ -225,10 +228,10 @@
 bool
 PhononEngine::canDecode( const KUrl &url ) const
 {
-    //TODO: phonon only offers mime type checks, need to investigate.
-    return true;
+    const QString mimeType = KMimeType::findByUrl( url, 0, false, true )->name();
+
+    return Phonon::BackendCapabilities::isMimeTypeKnown( mimeType );
 }
 
-//TODO: Configuration?
 
 #include "phonon-engine.moc"
--- trunk/extragear/multimedia/amarok/src/engine/phonon/phonon-engine.h #656086:656087
@@ -1,5 +1,6 @@
 /***************************************************************************
  *   Copyright (C) 2007 Dan Meltzer <hydrogen@notyetimplemented.com>       *
+ *   Copyright (C) 2007 Mark Kretschmann <markey@web.de>                   *
  *                                                                         *
  *   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  *
[prev in list] [next in list] [prev in thread] [next in thread] 

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