]> git.sesse.net Git - kdenlive/blob - src/docclipbase.cpp
Initial support for changing project folder
[kdenlive] / src / docclipbase.cpp
1 /**************************1*************************************************
2                           DocClipBase.cpp  -  description
3                              -------------------
4     begin                : Fri Apr 12 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 #include <QCryptographicHash>
19
20 #include <KDebug>
21
22 #include "kdenlivesettings.h"
23 #include "docclipbase.h"
24 #include "kthumb.h"
25 #include "clipmanager.h"
26
27 DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QString &id):
28         m_id(id), m_description(QString()), m_refcount(0), m_audioThumbCreated(false), m_duration(GenTime()), m_thumbProd(NULL), m_audioTimer(NULL), m_properties(QMap <QString, QString> ()), audioFrameChache(QMap<int, QMap<int, QByteArray> > ()), m_baseTrackProducers(QList <Mlt::Producer *>()), m_snapMarkers(QList < CommentedTime > ())  {
29     int type = xml.attribute("type").toInt();
30     m_clipType = (CLIPTYPE) type;
31     m_name = xml.attribute("name");
32
33     QDomNamedNodeMap attributes = xml.attributes();
34     for (unsigned int i = 0; i < attributes.count(); i++) {
35         m_properties.insert(attributes.item(i).nodeName(), attributes.item(i).nodeValue());
36     }
37
38     KUrl url = KUrl(xml.attribute("resource"));
39     if (!m_properties.contains("file_hash") && !url.isEmpty()) getFileHash(url.path());
40     int out = xml.attribute("out").toInt();
41     if (out != 0) {
42         setDuration(GenTime(out, KdenliveSettings::project_fps()));
43     } else {
44         out = xml.attribute("duration").toInt();
45         if (out != 0) setDuration(GenTime(out, KdenliveSettings::project_fps()));
46     }
47     if (m_name.isEmpty()) m_name = url.fileName();
48
49     //if (!url.isEmpty() && QFile::exists(url.path()))
50     {
51         m_thumbProd = new KThumb(clipManager, url, m_id, m_properties.value("file_hash"));
52         if (m_clipType == AV || m_clipType == AUDIO) slotCreateAudioTimer();
53     }
54     //kDebug() << "type is video" << (m_clipType == AV) << " " << m_clipType;
55 }
56
57 /*DocClipBase & DocClipBase::operator=(const DocClipBase & clip) {
58     DocClipBase::operator=(clip);
59     m_id = clip.getId();
60     m_clipType = clip.clipType();
61     m_name = clip.name();
62     m_duration = clip.duration();
63     m_audioThumbCreated = clip.audioThumbCreated();
64     m_properties = clip.properties();
65     return *this;
66 }*/
67
68 DocClipBase::~DocClipBase() {
69     if (m_thumbProd) delete m_thumbProd;
70     qDeleteAll(m_baseTrackProducers);
71 }
72
73 void DocClipBase::slotCreateAudioTimer() {
74     connect(m_thumbProd, SIGNAL(audioThumbReady(QMap <int, QMap <int, QByteArray> >)), this , SLOT(updateAudioThumbnail(QMap <int, QMap <int, QByteArray> >)));
75     connect(this, SIGNAL(getAudioThumbs()), this , SLOT(slotGetAudioThumbs()));
76     m_audioTimer = new QTimer(this);
77     connect(m_audioTimer, SIGNAL(timeout()), this, SLOT(slotGetAudioThumbs()));
78 }
79
80 void DocClipBase::askForAudioThumbs() {
81     if (m_thumbProd) m_thumbProd->askForAudioThumbs(getId());
82 }
83
84 void DocClipBase::slotClearAudioCache() {
85     if (m_thumbProd) m_thumbProd->stopAudioThumbs();
86     if (m_audioTimer != NULL) m_audioTimer->stop();
87     audioFrameChache.clear();
88     m_audioThumbCreated = false;
89 }
90
91 /*void DocClipBase::getClipMainThumb() {
92     if (m_thumbProd) m_thumbProd->getMainThumb(m_properties.value("thumbnail").toInt());
93 }*/
94
95 KThumb *DocClipBase::thumbProducer() {
96     return m_thumbProd;
97 }
98
99 bool DocClipBase::audioThumbCreated() const {
100     return m_audioThumbCreated;
101 }
102
103 void DocClipBase::setName(const QString name) {
104     m_name = name;
105 }
106
107 const QString & DocClipBase::name() const {
108
109     return m_name;
110 }
111
112 const QString &DocClipBase::getId() const {
113     return m_id;
114 }
115
116 void DocClipBase::setId(const QString &newId) {
117     m_id = newId;
118 }
119
120 const CLIPTYPE & DocClipBase::clipType() const {
121     return m_clipType;
122 }
123
124 void DocClipBase::setClipType(CLIPTYPE type) {
125     m_clipType = type;
126
127     m_properties.insert("type", QString::number((int) type));
128     if (m_thumbProd && m_audioTimer == NULL && (m_clipType == AV || m_clipType == AUDIO))
129         slotCreateAudioTimer();
130 }
131
132 KUrl DocClipBase::fileURL() const {
133     QString res = m_properties.value("resource");
134     if (m_clipType != COLOR && !res.isEmpty()) return KUrl(res);
135     return KUrl();
136 }
137
138 void DocClipBase::setClipThumbFrame(const uint &ix) {
139     m_properties.insert("thumbnail", QString::number((int) ix));
140 }
141
142 uint DocClipBase::getClipThumbFrame() const {
143     return (uint) m_properties.value("thumbnail").toInt();
144 }
145
146 const QString DocClipBase::description() const {
147     return m_properties.value("description");
148 }
149
150 bool DocClipBase::isTransparent() const {
151     return (m_properties.value("transparency") == "1");
152 }
153
154 const QString DocClipBase::getProperty(const QString prop) const {
155     return m_properties.value(prop);
156 }
157
158 void DocClipBase::setDuration(GenTime dur) {
159     m_duration = dur;
160     m_properties.insert("duration", QString::number((int) dur.frames(KdenliveSettings::project_fps())));
161 }
162
163 const GenTime &DocClipBase::duration() const {
164     return m_duration;
165 }
166
167 const GenTime &DocClipBase::maxDuration() const {
168     if (m_clipType == COLOR || m_clipType == IMAGE || m_clipType == TEXT || (m_clipType == SLIDESHOW &&  m_properties.value("loop") == "1")) {
169         const GenTime dur(15000, KdenliveSettings::project_fps());
170         return dur;
171     }
172     return m_duration;
173 }
174
175 bool DocClipBase::hasFileSize() const {
176     return true;
177 }
178
179
180 // virtual
181 QDomElement DocClipBase::toXML() const {
182     QDomDocument doc;
183
184     QDomElement clip = doc.createElement("producer");
185
186     QMapIterator<QString, QString> i(m_properties);
187     while (i.hasNext()) {
188         i.next();
189         if (!i.value().isEmpty()) clip.setAttribute(i.key(), i.value());
190     }
191     //doc.appendChild(clip);
192     //kDebug()<<"/// CLIP XML: "<<doc.toString();
193     return clip;
194 }
195
196 DocClipBase *DocClipBase::
197 createClip(KdenliveDoc *doc, const QDomElement & element) {
198     DocClipBase *clip = 0;
199     QString description;
200     QDomNode node = element;
201     node.normalize();
202     if (element.tagName() != "kdenliveclip") {
203         kWarning() <<
204         "DocClipBase::createClip() element has unknown tagName : " << element.tagName();
205         return 0;
206     }
207
208     QDomNode n = element.firstChild();
209
210     while (!n.isNull()) {
211         QDomElement e = n.toElement();
212         if (!e.isNull()) {
213             QString tagName = e.tagName();
214             if (e.tagName() == "avfile") {
215                 // clip = DocClipAVFile::createClip(e);
216             } else if (e.tagName() == "DocTrackBaseList") {
217                 // clip = DocClipProject::createClip(doc, e);
218             }
219         } else {
220             QDomText text = n.toText();
221             if (!text.isNull()) {
222                 description = text.nodeValue();
223             }
224         }
225
226         n = n.nextSibling();
227     }
228     if (clip == 0) {
229         kWarning() << "DocClipBase::createClip() unable to create clip";
230     } else {
231         // setup DocClipBase specifics of the clip.
232         QMap <QString, QString> props;
233         props.insert("description", description);
234         clip->setProperties(props);
235         clip->setAudioThumbCreated(false);
236     }
237     return clip;
238 }
239
240 void DocClipBase::setAudioThumbCreated(bool isDone) {
241     m_audioThumbCreated = isDone;
242 }
243
244
245 void DocClipBase::setThumbnail(const QPixmap & pixmap) {
246     m_thumbnail = pixmap;
247 }
248
249 const QPixmap & DocClipBase::thumbnail() const {
250     return m_thumbnail;
251 }
252
253 void DocClipBase::updateAudioThumbnail(QMap<int, QMap<int, QByteArray> > data) {
254     //kDebug() << "CLIPBASE RECIEDVED AUDIO DATA*********************************************";
255     audioFrameChache = data;
256     m_audioThumbCreated = true;
257     emit gotAudioData();
258 }
259
260 QList < GenTime > DocClipBase::snapMarkers() const {
261     QList < GenTime > markers;
262
263     for (uint count = 0; count < m_snapMarkers.count(); ++count) {
264         markers.append(m_snapMarkers[count].time());
265     }
266
267     return markers;
268 }
269
270 QList < CommentedTime > DocClipBase::commentedSnapMarkers() const {
271     return m_snapMarkers;
272 }
273
274 void DocClipBase::setSnapMarkers(QList < CommentedTime > markers) {
275     m_snapMarkers = markers;
276 }
277
278 void DocClipBase::addSnapMarker(const GenTime & time, QString comment) {
279     QList < CommentedTime >::Iterator it = m_snapMarkers.begin();
280     for (it = m_snapMarkers.begin(); it != m_snapMarkers.end(); ++it) {
281         if ((*it).time() >= time)
282             break;
283     }
284
285     if ((it != m_snapMarkers.end()) && ((*it).time() == time)) {
286         (*it).setComment(comment);
287         //kError() << "trying to add Snap Marker that already exists, this will cause inconsistancies with undo/redo";
288     } else {
289         CommentedTime t(time, comment);
290         m_snapMarkers.insert(it, t);
291     }
292
293 }
294
295 void DocClipBase::editSnapMarker(const GenTime & time, QString comment) {
296     QList < CommentedTime >::Iterator it;
297     for (it = m_snapMarkers.begin(); it != m_snapMarkers.end(); ++it) {
298         if ((*it).time() == time)
299             break;
300     }
301     if (it != m_snapMarkers.end()) {
302         (*it).setComment(comment);
303     } else {
304         kError() << "trying to edit Snap Marker that does not already exists";
305     }
306 }
307
308 QString DocClipBase::deleteSnapMarker(const GenTime & time) {
309     QString result = i18n("Marker");
310     QList < CommentedTime >::Iterator itt = m_snapMarkers.begin();
311
312     while (itt != m_snapMarkers.end()) {
313         if ((*itt).time() == time)
314             break;
315         ++itt;
316     }
317
318     if ((itt != m_snapMarkers.end()) && ((*itt).time() == time)) {
319         result = (*itt).comment();
320         m_snapMarkers.erase(itt);
321     }
322     return result;
323 }
324
325
326 GenTime DocClipBase::hasSnapMarkers(const GenTime & time) {
327     QList < CommentedTime >::Iterator itt = m_snapMarkers.begin();
328
329     while (itt != m_snapMarkers.end()) {
330         if ((*itt).time() == time)
331             return time;
332         ++itt;
333     }
334
335     return GenTime(0.0);
336 }
337
338 GenTime DocClipBase::findPreviousSnapMarker(const GenTime & currTime) {
339     int it;
340     for (it = 0; it < m_snapMarkers.count(); it++) {
341         if (m_snapMarkers[it].time() >= currTime)
342             break;
343     }
344     if (it == 0) return GenTime();
345     else if (it == m_snapMarkers.count() - 1 && m_snapMarkers[it].time() < currTime)
346         return m_snapMarkers[it].time();
347     else return m_snapMarkers[it-1].time();
348 }
349
350 GenTime DocClipBase::findNextSnapMarker(const GenTime & currTime) {
351     int it;
352     for (it = 0; it < m_snapMarkers.count(); it++) {
353         if (m_snapMarkers[it].time() > currTime)
354             break;
355     }
356     if (it < m_snapMarkers.count() && m_snapMarkers[it].time() > currTime) return m_snapMarkers[it].time();
357     return duration();
358 }
359
360 QString DocClipBase::markerComment(GenTime t) {
361     QList < CommentedTime >::Iterator itt = m_snapMarkers.begin();
362
363     while (itt != m_snapMarkers.end()) {
364         if ((*itt).time() == t)
365             return (*itt).comment();
366         ++itt;
367     }
368     return QString::null;
369 }
370
371 void DocClipBase::setProducer(Mlt::Producer *producer) {
372     if (producer == NULL) return;
373     QString id = producer->get("id");
374     if (id.contains('_')) {
375         // this is a subtrack producer, insert it at correct place
376         int pos = id.section('_', 1, 1).toInt();
377         if (pos >= m_baseTrackProducers.count()) {
378             while (m_baseTrackProducers.count() - 1 < pos) {
379                 m_baseTrackProducers.append(NULL);
380             }
381         }
382         if (m_baseTrackProducers.at(pos) == NULL) m_baseTrackProducers[pos] = producer;
383     } else {
384         if (m_baseTrackProducers.isEmpty()) m_baseTrackProducers.append(producer);
385         else if (m_baseTrackProducers.at(0) == NULL) m_baseTrackProducers[0] = producer;
386     }
387     //m_clipProducer = producer;
388     //m_clipProducer->set("transparency", m_properties.value("transparency").toInt());
389     if (m_thumbProd && !m_thumbProd->hasProducer()) m_thumbProd->setProducer(producer);
390 }
391
392 Mlt::Producer *DocClipBase::producer(int track) {
393     /*for (int i = 0; i < m_baseTrackProducers.count(); i++) {
394         if (m_baseTrackProducers.at(i)) kDebug() << "// PROD: " << i << ", ID: " << m_baseTrackProducers.at(i)->get("id");
395     }*/
396     if (track == -1 || (m_clipType != AUDIO && m_clipType != AV)) {
397         if (m_baseTrackProducers.count() == 0) return NULL;
398         int i;
399         for (i = 0; i < m_baseTrackProducers.count(); i++)
400             if (m_baseTrackProducers.at(i) != NULL) break;
401         if (i < m_baseTrackProducers.count()) return m_baseTrackProducers.at(i);
402         return NULL;
403     }
404     if (track >= m_baseTrackProducers.count()) {
405         while (m_baseTrackProducers.count() - 1 < track) {
406             m_baseTrackProducers.append(NULL);
407         }
408     }
409     if (m_baseTrackProducers.at(track) == NULL) {
410         int i;
411         for (i = 0; i < m_baseTrackProducers.count(); i++)
412             if (m_baseTrackProducers.at(i) != NULL) break;
413         if (i >= m_baseTrackProducers.count()) return NULL;
414         m_baseTrackProducers[track] = new Mlt::Producer(*m_baseTrackProducers.at(i)->profile(), m_baseTrackProducers.at(i)->get("resource"));
415         if (m_properties.contains("force_aspect_ratio")) m_baseTrackProducers[track]->set("force_aspect_ratio", m_properties.value("force_aspect_ratio").toDouble());
416         if (m_properties.contains("threads")) m_baseTrackProducers[track]->set("threads", m_properties.value("threads").toInt());
417         if (m_properties.contains("video_index")) m_baseTrackProducers[track]->set("video_index", m_properties.value("video_index").toInt());
418         if (m_properties.contains("audio_index")) m_baseTrackProducers[track]->set("audio_index", m_properties.value("audio_index").toInt());
419         char *tmp = (char *) qstrdup(QString(getId() + '_' + QString::number(track)).toUtf8().data());
420         m_baseTrackProducers[track]->set("id", tmp);
421         delete[] tmp;
422     }
423     return m_baseTrackProducers.at(track);
424 }
425
426 void DocClipBase::setProducerProperty(const char *name, int data) {
427     for (int i = 0; i < m_baseTrackProducers.count(); i++) {
428         if (m_baseTrackProducers.at(i) != NULL)
429             m_baseTrackProducers[i]->set(name, data);
430     }
431 }
432
433 void DocClipBase::setProducerProperty(const char *name, const char *data) {
434     for (int i = 0; i < m_baseTrackProducers.count(); i++) {
435         if (m_baseTrackProducers.at(i) != NULL)
436             m_baseTrackProducers[i]->set(name, data);
437     }
438 }
439
440 void DocClipBase::slotRefreshProducer() {
441     if (m_baseTrackProducers.count() == 0) return;
442     kDebug() << "////////////   REFRESH CLIP !!!!!!!!!!!!!!!!";
443     if (m_clipType == SLIDESHOW) {
444         /*char *tmp = (char *) qstrdup(getProperty("resource").toUtf8().data());
445                Mlt::Producer producer(*(m_clipProducer->profile()), tmp);
446                delete[] tmp;
447         delete m_clipProducer;
448         m_clipProducer = new Mlt::Producer(producer.get_producer());
449         if (!getProperty("out").isEmpty()) m_clipProducer->set_in_and_out(getProperty("in").toInt(), getProperty("out").toInt());*/
450         setProducerProperty("ttl", getProperty("ttl").toInt());
451         //m_clipProducer->set("id", getProperty("id"));
452         if (getProperty("fade") == "1") {
453             // we want a fade filter effect
454             kDebug() << "////////////   FADE WANTED";
455             Mlt::Service clipService(m_baseTrackProducers.at(0)->get_service());
456             int ct = 0;
457             Mlt::Filter *filter = clipService.filter(ct);
458             while (filter) {
459                 if (filter->get("mlt_service") == "luma") {
460                     break;
461                 }
462                 ct++;
463                 filter = clipService.filter(ct);
464             }
465
466             if (filter && filter->get("mlt_service") == "luma") {
467                 filter->set("period", getProperty("ttl").toInt() - 1);
468                 filter->set("luma.out", getProperty("luma_duration").toInt());
469                 QString resource = getProperty("luma_file");
470                 char *tmp = (char *) qstrdup(resource.toUtf8().data());
471                 filter->set("luma.resource", tmp);
472                 delete[] tmp;
473                 if (getProperty("softness") != QString()) {
474                     int soft = getProperty("softness").toInt();
475                     filter->set("luma.softness", (double) soft / 100.0);
476                 }
477             } else {
478                 // filter does not exist, create it...
479                 Mlt::Filter *filter = new Mlt::Filter(*(m_baseTrackProducers.at(0)->profile()), "luma");
480                 filter->set("period", getProperty("ttl").toInt() - 1);
481                 filter->set("luma.out", getProperty("luma_duration").toInt());
482                 QString resource = getProperty("luma_file");
483                 char *tmp = (char *) qstrdup(resource.toUtf8().data());
484                 filter->set("luma.resource", tmp);
485                 delete[] tmp;
486                 if (getProperty("softness") != QString()) {
487                     int soft = getProperty("softness").toInt();
488                     filter->set("luma.softness", (double) soft / 100.0);
489                 }
490                 clipService.attach(*filter);
491             }
492         } else {
493             kDebug() << "////////////   FADE NOT WANTED!!!";
494             Mlt::Service clipService(m_baseTrackProducers.at(0)->get_service());
495             int ct = 0;
496             Mlt::Filter *filter = clipService.filter(0);
497             while (filter) {
498                 if (filter->get("mlt_service") == "luma") {
499                     clipService.detach(*filter);
500                 } else ct++;
501                 filter = clipService.filter(ct);
502             }
503         }
504     }
505 }
506
507 void DocClipBase::setProperties(QMap <QString, QString> properties) {
508     // changing clip type is not allowed
509     properties.remove("type");
510     QMapIterator<QString, QString> i(properties);
511     bool refreshProducer = false;
512     QStringList keys;
513     keys << "luma_duration" << "luma_file" << "fade" << "ttl" << "softness";
514     while (i.hasNext()) {
515         i.next();
516         setProperty(i.key(), i.value());
517         if (m_clipType == SLIDESHOW && keys.contains(i.key())) refreshProducer = true;
518     }
519     if (refreshProducer) slotRefreshProducer();
520 }
521
522 void DocClipBase::clearProperty(const QString &key) {
523     m_properties.remove(key);
524 }
525
526 void DocClipBase::getFileHash(const QString &url) {
527     if (m_clipType == SLIDESHOW) return;
528     QFile file(url);
529     if (file.open(QIODevice::ReadOnly)) { // write size and hash only if resource points to a file
530         QByteArray fileData;
531         QByteArray fileHash;
532         //kDebug() << "SETTING HASH of" << value;
533         m_properties.insert("file_size", QString::number(file.size()));
534         /*
535                * 1 MB = 1 second per 450 files (or faster)
536                * 10 MB = 9 seconds per 450 files (or faster)
537                */
538         if (file.size() > 1000000*2) {
539             fileData = file.read(1000000);
540             if (file.seek(file.size() - 1000000))
541                 fileData.append(file.readAll());
542         } else
543             fileData = file.readAll();
544         file.close();
545         fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
546         m_properties.insert("file_hash", QString(fileHash.toHex()));
547         //kDebug() << file.fileName() << file.size() << fileHash.toHex();
548     }
549 }
550
551 QString DocClipBase::getClipHash() const {
552     QString hash;
553     if (m_clipType == SLIDESHOW) hash = QCryptographicHash::hash(m_properties.value("resource").toAscii().data(), QCryptographicHash::Md5).toHex();
554     else if (m_clipType == COLOR) hash = QCryptographicHash::hash(m_properties.value("colour").toAscii().data(), QCryptographicHash::Md5).toHex();
555     else hash = m_properties.value("file_hash");
556     return hash;
557 }
558
559 void DocClipBase::refreshThumbUrl() {
560     if (m_thumbProd) m_thumbProd->updateThumbUrl(m_properties.value("file_hash"));
561 }
562
563 void DocClipBase::setProperty(const QString &key, const QString &value) {
564     m_properties.insert(key, value);
565     if (key == "resource") {
566         getFileHash(value);
567         if (m_thumbProd) m_thumbProd->updateClipUrl(KUrl(value), m_properties.value("file_hash"));
568     } else if (key == "out") setDuration(GenTime(value.toInt(), KdenliveSettings::project_fps()));
569     //else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
570     else if (key == "colour") {
571         char *tmp = (char *) qstrdup(value.toUtf8().data());
572         setProducerProperty("colour", tmp);
573         delete[] tmp;
574     } else if (key == "xmldata") {
575         setProducerProperty("force_reload", 1);
576     } else if (key == "force_aspect_ratio") {
577         if (value.isEmpty()) {
578             m_properties.remove("force_aspect_ratio");
579             setProducerProperty("force_aspect_ratio", 0);
580         } else setProducerProperty("force_aspect_ratio", value.toDouble());
581     } else if (key == "threads") {
582         if (value.isEmpty()) {
583             m_properties.remove("threads");
584             setProducerProperty("threads", 1);
585         } else setProducerProperty("threads", value.toInt());
586     } else if (key == "video_index") {
587         if (value.isEmpty()) {
588             m_properties.remove("video_index");
589             setProducerProperty("video_index", m_properties.value("default_video").toInt());
590         } else setProducerProperty("video_index", value.toInt());
591     } else if (key == "audio_index") {
592         if (value.isEmpty()) {
593             m_properties.remove("audio_index");
594             setProducerProperty("audio_index", m_properties.value("default_audio").toInt());
595         } else setProducerProperty("audio_index", value.toInt());
596     }
597 }
598
599 QMap <QString, QString> DocClipBase::properties() const {
600     return m_properties;
601 }
602
603 bool DocClipBase::slotGetAudioThumbs() {
604     if (m_thumbProd == NULL) return false;
605     if (!KdenliveSettings::audiothumbnails()) {
606         if (m_audioTimer != NULL) m_audioTimer->stop();
607         return false;
608     }
609     if (m_audioThumbCreated) {
610         if (m_audioTimer != NULL) m_audioTimer->stop();
611         return false;
612     }
613     if (m_audioTimer != NULL)
614         m_audioTimer->start(1500);
615     double lengthInFrames = duration().frames(KdenliveSettings::project_fps());
616     m_thumbProd->getAudioThumbs(2, 0, lengthInFrames /*must be number of frames*/, 20);
617     return true;
618 }
619
620
621