1 /***************************************************************************
4 begin : Fri Nov 22 2002
5 copyright : (C) 2002 by Jason Wood
6 email : jasonwood@blueyonder.co.uk
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
23 #include <QDomElement>
28 #include <mlt++/Mlt.h>
31 /**KRender encapsulates the client side of the interface to a renderer.
32 From Kdenlive's point of view, you treat the KRender object as the
33 renderer, and simply use it as if it was local. Calls are asyncrhonous -
34 you send a call out, and then receive the return value through the
35 relevant signal that get's emitted once the call completes.
51 class KThumb: public QObject
56 KThumb(ClipManager *clipManager, KUrl url, const QString &id, const QString &hash, QObject * parent = 0, const char *name = 0);
58 void setProducer(Mlt::Producer *producer);
59 void askForAudioThumbs(const QString &id);
60 bool hasProducer() const;
62 void updateThumbUrl(const QString &hash);
65 void extractImage(int frame, int frame2);
66 QPixmap extractImage(int frame, int width, int height);
67 void updateClipUrl(KUrl url, const QString &hash);
68 static QPixmap getImage(KUrl url, int width, int height);
69 // static QPixmap getImage(QDomElement xml, int frame, int width, int height);
70 /* void getImage(KUrl url, int frame, int width, int height);
71 void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/
72 void stopAudioThumbs();
73 void removeAudioThumb();
74 void getAudioThumbs(int channel, double frame, double frameLength, int arrayWidth);
75 static QPixmap getImage(KUrl url, int frame, int width, int height);
76 static QImage getFrame(Mlt::Producer *producer, int framepos, int width, int height);
79 void slotAudioThumbOver();
80 void slotCreateAudioThumbs();
83 QFuture<void> m_audioThumbProducer;
87 Mlt::Producer *m_producer;
88 ClipManager *m_clipManager;
90 QList <int> m_requestedThumbs;
91 QFuture<void> m_future;
92 QFile m_audioThumbFile;
93 bool m_stopAudioThumbs;
102 void thumbReady(int, QImage);
103 void mainThumbReady(const QString &, QPixmap);
104 void audioThumbReady(QMap <int, QMap <int, QByteArray> >);