X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkthumb.h;h=0c312205781be30072792b8c9e5595de62d900b0;hb=516f782159e77d9af02409ba7cb5300607397445;hp=ffdf310a1ccd8a96f1a8f073a83735ac5df65805;hpb=c870cfe9a399db7049d5a3460057f80ce0a49971;p=kdenlive diff --git a/src/kthumb.h b/src/kthumb.h index ffdf310a..0c312205 100644 --- a/src/kthumb.h +++ b/src/kthumb.h @@ -18,15 +18,16 @@ #ifndef KTHUMB_H #define KTHUMB_H -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include + /**KRender encapsulates the client side of the interface to a renderer. From Kdenlive's point of view, you treat the KRender object as the renderer, and simply use it as if it was local. Calls are asyncrhonous - @@ -37,61 +38,71 @@ relevant signal that get's emitted once the call completes. namespace Mlt { - class Miracle; - class Consumer; - class Producer; - class Frame; - class Profile; +class Miracle; +class Consumer; +class Producer; +class Frame; +class Profile; }; +class ClipManager; class MyThread : public QThread { - public: - virtual void run(); - void init(KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth); - bool isWorking(); - bool stop_me; +public: + virtual void run(); + void init(QObject *parent, KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth); + bool isWorking(); + bool stop_me; - private: - QFile f; - KUrl m_url; - double m_frame; - double m_frameLength; - int m_frequency; - int m_channels; - int m_arrayWidth; - bool m_isWorking; - }; +private: + QFile f; + KUrl m_url; + double m_frame; + double m_frameLength; + int m_frequency; + int m_channels; + int m_arrayWidth; + bool m_isWorking; + QObject *m_parent; +}; -class KThumb:public QObject { - Q_OBJECT public: +class KThumb: public QObject { +Q_OBJECT public: - KThumb(KUrl url, int width, int height, QObject * parent = 0, const char *name = 0); + KThumb(ClipManager *clipManager, KUrl url, QObject * parent = 0, const char *name = 0); ~KThumb(); + void setProducer(Mlt::Producer *producer); public slots: - void extractImage( int frame, int frame2); - static QPixmap getImage(KUrl url, int width, int height); -/* void getImage(KUrl url, int frame, int width, int height); - void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/ - void stopAudioThumbs(); - void removeAudioThumb(); - void getAudioThumbs(int channel, double frame, double frameLength, int arrayWidth); + void extractImage(int frame, int frame2); + void updateClipUrl(KUrl url); + static QPixmap getImage(KUrl url, int width, int height); + static QPixmap getImage(QDomElement xml, int frame, int width, int height); + /* void getImage(KUrl url, int frame, int width, int height); + void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/ + void stopAudioThumbs(); + void removeAudioThumb(); + void getAudioThumbs(int channel, double frame, double frameLength, int arrayWidth); + static QPixmap getImage(KUrl url, int frame, int width, int height); + static QPixmap getFrame(Mlt::Producer producer, int framepos, int width, int height); + +protected: + virtual void customEvent(QEvent * event); private: - MyThread thumbProducer; - KUrl m_url; - QString m_thumbFile; - int m_width; - int m_height; - Mlt::Profile *m_profile; + MyThread thumbProducer; + KUrl m_url; + QString m_thumbFile; + Mlt::Profile *m_profile; + Mlt::Producer *m_producer; + ClipManager *m_clipManager; signals: - void thumbReady(int frame, QPixmap pm); - void audioThumbReady(QMap >); + void thumbReady(int frame, QPixmap pm); + void audioThumbReady(QMap >); }; #endif