tmetadataloader.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef METADATALOADER_H
  2. #define METADATALOADER_H
  3. #include <QObject>
  4. #include <QTimer>
  5. #include "metadatavalue.h"
  6. #include "abstractmetadataloader.h"
  7. namespace TagLib {
  8. //start
  9. /** Loads metadata from mp3 files using TagLib 1.6.3.
  10. http://developer.kde.org/~wheeler/taglib.html.
  11. Tested on linux and windows. Much faster than the mobility version.
  12. Known issues: sometimes reports 0 for track time?
  13. */
  14. class MetaDataLoader : public Abstract::MetaDataLoader {
  15. Q_OBJECT
  16. public:
  17. typedef Abstract::MetaDataLoader SUPER;
  18. explicit MetaDataLoader(QObject *parent = 0);
  19. static MetaDataLoader* instance();
  20. virtual ~MetaDataLoader() {}
  21. const QStringList &supportedExtensions() ;
  22. /** non-blocking method that fetches metadata.
  23. A fetched() signal is emitted when metadata is ready.
  24. */
  25. MetaDataLoader* clone(QObject *parent) ;
  26. void get(QUrl url);
  27. void get(QList<QUrl> urls);
  28. bool isRunning() const {return m_running;}
  29. public slots:
  30. void cancel();
  31. private slots:
  32. void checkForWork();
  33. private:
  34. bool m_running;
  35. bool m_canceled;
  36. int m_processingMax;
  37. QList<QUrl> m_queue;
  38. QTimer m_timer;
  39. };
  40. }
  41. //end
  42. #endif // METADATALOADER_H