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>
29 #include <mlt++/Mlt.h>
32 /**KRender encapsulates the client side of the interface to a renderer.
33 From Kdenlive's point of view, you treat the KRender object as the
34 renderer, and simply use it as if it was local. Calls are asyncrhonous -
35 you send a call out, and then recieve the return value through the
36 relevant signal that get's emitted once the call completes.
53 class MyThread : public QThread {
57 void init(QObject *parent, KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth);
73 void audioThumbProgress(const int);
74 void audioThumbOver();
77 class KThumb: public QObject {
81 KThumb(ClipManager *clipManager, KUrl url, const QString &id, const QString &hash, QObject * parent = 0, const char *name = 0);
83 void setProducer(Mlt::Producer *producer);
84 void askForAudioThumbs(const QString &id);
85 bool hasProducer() const;
86 void updateThumbUrl(const QString &hash);
89 void extractImage(int frame, int frame2);
90 QPixmap extractImage(int frame, int width, int height);
91 void updateClipUrl(KUrl url, const QString &hash);
92 static QPixmap getImage(KUrl url, int width, int height);
93 // static QPixmap getImage(QDomElement xml, int frame, int width, int height);
94 /* void getImage(KUrl url, int frame, int width, int height);
95 void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/
96 void stopAudioThumbs();
97 void removeAudioThumb();
98 void getAudioThumbs(int channel, double frame, double frameLength, int arrayWidth);
99 static QPixmap getImage(KUrl url, int frame, int width, int height);
100 static QPixmap getFrame(Mlt::Producer *producer, int framepos, int width, int height);
103 void slotAudioThumbProgress(const int progress);
104 void slotAudioThumbOver();
107 MyThread audioThumbProducer;
111 Mlt::Producer *m_producer;
112 ClipManager *m_clipManager;
117 void thumbReady(int, QPixmap);
118 void mainThumbReady(const QString &, QPixmap);
119 void audioThumbReady(QMap <int, QMap <int, QByteArray> >);