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 ***************************************************************************/
25 #include <QDomElement>
30 #include <mlt++/Mlt.h>
33 /**KRender encapsulates the client side of the interface to a renderer.
34 From Kdenlive's point of view, you treat the KRender object as the
35 renderer, and simply use it as if it was local. Calls are asyncrhonous -
36 you send a call out, and then receive the return value through the
37 relevant signal that get's emitted once the call completes.
55 class MyThread : public QThread
60 void init(KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth);
75 void audioThumbProgress(const int);
76 void audioThumbOver();
79 class KThumb: public QObject
84 KThumb(ClipManager *clipManager, KUrl url, const QString &id, const QString &hash, QObject * parent = 0, const char *name = 0);
86 void setProducer(Mlt::Producer *producer);
87 void askForAudioThumbs(const QString &id);
88 bool hasProducer() const;
90 void updateThumbUrl(const QString &hash);
93 void extractImage(int frame, int frame2);
94 QPixmap extractImage(int frame, int width, int height);
95 void updateClipUrl(KUrl url, const QString &hash);
96 static QPixmap getImage(KUrl url, int width, int height);
97 // static QPixmap getImage(QDomElement xml, int frame, int width, int height);
98 /* void getImage(KUrl url, int frame, int width, int height);
99 void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/
100 void stopAudioThumbs();
101 void removeAudioThumb();
102 void getAudioThumbs(int channel, double frame, double frameLength, int arrayWidth);
103 static QPixmap getImage(KUrl url, int frame, int width, int height);
104 static QImage getFrame(Mlt::Producer *producer, int framepos, int width, int height);
107 void slotAudioThumbProgress(const int progress);
108 void slotAudioThumbOver();
111 MyThread m_audioThumbProducer;
115 Mlt::Producer *m_producer;
116 ClipManager *m_clipManager;
118 QList <int> m_requestedThumbs;
119 QFuture<void> m_future;
123 void thumbReady(int, QImage);
124 void mainThumbReady(const QString &, QPixmap);
125 void audioThumbReady(QMap <int, QMap <int, QByteArray> >);