]> git.sesse.net Git - kdenlive/blob - src/kthumb.h
Fix location of audiothumbs
[kdenlive] / src / kthumb.h
1 /***************************************************************************
2                          kthumb.h  -  description
3                             -------------------
4    begin                : Fri Nov 22 2002
5    copyright            : (C) 2002 by Jason Wood
6    email                : jasonwood@blueyonder.co.uk
7 ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
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.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef KTHUMB_H
19 #define KTHUMB_H
20
21 #include <qobject.h>
22 #include <qpixmap.h>
23 #include <qfile.h>
24 #include <qthread.h>
25
26 #include <kurl.h>
27
28 #include <mlt++/Mlt.h>
29
30 /**KRender encapsulates the client side of the interface to a renderer.
31 From Kdenlive's point of view, you treat the KRender object as the
32 renderer, and simply use it as if it was local. Calls are asyncrhonous -
33 you send a call out, and then recieve the return value through the
34 relevant signal that get's emitted once the call completes.
35   *@author Jason Wood
36   */
37
38
39 namespace Mlt {
40     class Miracle;
41     class Consumer;
42     class Producer;
43     class Frame;
44     class Profile;
45 };
46
47
48 class MyThread : public QThread {
49
50     public:
51         virtual void run();
52         void init(KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth);
53         bool isWorking();
54         bool stop_me;
55
56     private:
57         QFile f;
58         KUrl m_url;
59         double m_frame;
60         double m_frameLength;
61         int m_frequency;
62         int m_channels;
63         int m_arrayWidth;
64         bool m_isWorking;
65     };
66
67
68 class KThumb:public QObject {
69   Q_OBJECT public:
70
71
72      KThumb(KUrl url, int width, int height, QObject * parent = 0, const char *name = 0);
73     ~KThumb();
74
75 public slots:
76         void extractImage( int frame, int frame2);
77         static QPixmap getImage(KUrl url, int width, int height);
78 /*      void getImage(KUrl url, int frame, int width, int height);
79         void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/
80         void stopAudioThumbs();
81         void removeAudioThumb();
82         void getAudioThumbs(int channel, double frame, double frameLength, int arrayWidth);
83
84 private:
85         MyThread thumbProducer;
86         KUrl m_url;
87         QString m_thumbFile;
88         int m_width;
89         int m_height;
90         Mlt::Profile *m_profile;
91
92 signals:
93         void thumbReady(int frame, QPixmap pm);
94         void audioThumbReady(QMap <int, QMap <int, QByteArray> >);
95 };
96
97 #endif