1 /***************************************************************************
2 * DocClipBase.cpp - description *
3 * ------------------- *
4 * begin : Fri Apr 12 2002 *
5 * Copyright (C) 2002 by Jason Wood (jasonwood@blueyonder.co.uk) *
6 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
22 ***************************************************************************/
27 #include "docclipbase.h"
28 #include "kdenlivesettings.h"
30 #include "clipmanager.h"
34 #include <QCryptographicHash>
36 DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QString &id):
37 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 > ()), m_videoOnlyProducer(NULL), m_audioTrackProducers(QList <Mlt::Producer *>())
39 int type = xml.attribute("type").toInt();
40 m_clipType = (CLIPTYPE) type;
42 QDomNamedNodeMap attributes = xml.attributes();
43 for (unsigned int i = 0; i < attributes.count(); i++) {
44 m_properties.insert(attributes.item(i).nodeName(), attributes.item(i).nodeValue());
47 KUrl url = KUrl(xml.attribute("resource"));
48 if (!m_properties.contains("file_hash") && !url.isEmpty()) getFileHash(url.path());
50 if (xml.hasAttribute("duration")) {
51 setDuration(GenTime(xml.attribute("duration").toInt(), KdenliveSettings::project_fps()));
53 int out = xml.attribute("out").toInt();
54 int in = xml.attribute("in").toInt();
55 setDuration(GenTime(out - in, KdenliveSettings::project_fps()));
58 if (!m_properties.contains("name")) m_properties.insert("name", url.fileName());
60 //if (!url.isEmpty() && QFile::exists(url.path()))
62 m_thumbProd = new KThumb(clipManager, url, m_id, m_properties.value("file_hash"));
63 if (m_clipType == AV || m_clipType == AUDIO) slotCreateAudioTimer();
65 //kDebug() << "type is video" << (m_clipType == AV) << " " << m_clipType;
68 /*DocClipBase & DocClipBase::operator=(const DocClipBase & clip) {
69 DocClipBase::operator=(clip);
71 m_clipType = clip.clipType();
73 m_duration = clip.duration();
74 m_audioThumbCreated = clip.audioThumbCreated();
75 m_properties = clip.properties();
79 DocClipBase::~DocClipBase()
88 qDeleteAll(m_baseTrackProducers);
89 m_baseTrackProducers.clear();
92 void DocClipBase::setZone(QPoint zone)
94 m_properties.insert("zone_in", QString::number(zone.x()));
95 m_properties.insert("zone_out", QString::number(zone.y()));
98 QPoint DocClipBase::zone() const
101 zone.setX(m_properties.value("zone_in").toInt());
102 zone.setY(m_properties.value("zone_out", "50").toInt());
106 void DocClipBase::slotCreateAudioTimer()
108 connect(m_thumbProd, SIGNAL(audioThumbReady(QMap <int, QMap <int, QByteArray> >)), this , SLOT(updateAudioThumbnail(QMap <int, QMap <int, QByteArray> >)));
109 connect(this, SIGNAL(getAudioThumbs()), this , SLOT(slotGetAudioThumbs()));
110 m_audioTimer = new QTimer(this);
111 connect(m_audioTimer, SIGNAL(timeout()), this, SLOT(slotGetAudioThumbs()));
114 void DocClipBase::askForAudioThumbs()
116 if (m_thumbProd) m_thumbProd->askForAudioThumbs(getId());
119 void DocClipBase::slotClearAudioCache()
121 if (m_thumbProd) m_thumbProd->stopAudioThumbs();
122 if (m_audioTimer != NULL) m_audioTimer->stop();
123 audioFrameChache.clear();
124 m_audioThumbCreated = false;
127 /*void DocClipBase::getClipMainThumb() {
128 if (m_thumbProd) m_thumbProd->getMainThumb(m_properties.value("thumbnail").toInt());
131 KThumb *DocClipBase::thumbProducer()
136 bool DocClipBase::audioThumbCreated() const
138 return m_audioThumbCreated;
141 const QString DocClipBase::name() const
144 return m_properties.value("name");
147 const QString &DocClipBase::getId() const
152 void DocClipBase::setId(const QString &newId)
157 const CLIPTYPE & DocClipBase::clipType() const
162 void DocClipBase::setClipType(CLIPTYPE type)
166 m_properties.insert("type", QString::number((int) type));
167 if (m_thumbProd && m_audioTimer == NULL && (m_clipType == AV || m_clipType == AUDIO))
168 slotCreateAudioTimer();
171 KUrl DocClipBase::fileURL() const
173 QString res = m_properties.value("resource");
174 if (m_clipType != COLOR && !res.isEmpty()) return KUrl(res);
178 void DocClipBase::setClipThumbFrame(const uint &ix)
180 m_properties.insert("thumbnail", QString::number((int) ix));
183 uint DocClipBase::getClipThumbFrame() const
185 return (uint) m_properties.value("thumbnail").toInt();
188 const QString DocClipBase::description() const
190 return m_properties.value("description");
193 bool DocClipBase::isTransparent() const
195 return (m_properties.value("transparency") == "1");
198 const QString DocClipBase::getProperty(const QString prop) const
200 return m_properties.value(prop);
203 void DocClipBase::setDuration(GenTime dur)
206 m_properties.insert("duration", QString::number((int) dur.frames(KdenliveSettings::project_fps())));
209 const GenTime &DocClipBase::duration() const
214 const GenTime DocClipBase::maxDuration() const
216 if (m_clipType == COLOR || m_clipType == IMAGE || m_clipType == TEXT || (m_clipType == SLIDESHOW && m_properties.value("loop") == "1")) {
217 const GenTime dur(15000, KdenliveSettings::project_fps());
223 bool DocClipBase::hasFileSize() const
230 QDomElement DocClipBase::toXML() const
233 QDomElement clip = doc.createElement("producer");
235 QMapIterator<QString, QString> i(m_properties);
236 while (i.hasNext()) {
238 if (!i.value().isEmpty()) clip.setAttribute(i.key(), i.value());
240 doc.appendChild(clip);
241 //kDebug()<<"/// CLIP XML: "<<doc.toString();
242 return doc.documentElement();
246 void DocClipBase::setAudioThumbCreated(bool isDone)
248 m_audioThumbCreated = isDone;
252 void DocClipBase::setThumbnail(const QPixmap & pixmap)
254 m_thumbnail = pixmap;
257 const QPixmap & DocClipBase::thumbnail() const
262 void DocClipBase::updateAudioThumbnail(QMap<int, QMap<int, QByteArray> > data)
264 //kDebug() << "CLIPBASE RECIEDVED AUDIO DATA*********************************************";
265 audioFrameChache = data;
266 m_audioThumbCreated = true;
270 QList < GenTime > DocClipBase::snapMarkers() const
272 QList < GenTime > markers;
274 for (uint count = 0; count < m_snapMarkers.count(); ++count) {
275 markers.append(m_snapMarkers[count].time());
281 QList < CommentedTime > DocClipBase::commentedSnapMarkers() const
283 return m_snapMarkers;
286 void DocClipBase::setSnapMarkers(QList < CommentedTime > markers)
288 m_snapMarkers = markers;
291 void DocClipBase::addSnapMarker(const GenTime & time, QString comment)
293 QList < CommentedTime >::Iterator it = m_snapMarkers.begin();
294 for (it = m_snapMarkers.begin(); it != m_snapMarkers.end(); ++it) {
295 if ((*it).time() >= time)
299 if ((it != m_snapMarkers.end()) && ((*it).time() == time)) {
300 (*it).setComment(comment);
301 //kError() << "trying to add Snap Marker that already exists, this will cause inconsistancies with undo/redo";
303 CommentedTime t(time, comment);
304 m_snapMarkers.insert(it, t);
309 void DocClipBase::editSnapMarker(const GenTime & time, QString comment)
311 QList < CommentedTime >::Iterator it;
312 for (it = m_snapMarkers.begin(); it != m_snapMarkers.end(); ++it) {
313 if ((*it).time() == time)
316 if (it != m_snapMarkers.end()) {
317 (*it).setComment(comment);
319 kError() << "trying to edit Snap Marker that does not already exists";
323 QString DocClipBase::deleteSnapMarker(const GenTime & time)
325 QString result = i18n("Marker");
326 QList < CommentedTime >::Iterator itt = m_snapMarkers.begin();
328 while (itt != m_snapMarkers.end()) {
329 if ((*itt).time() == time)
334 if ((itt != m_snapMarkers.end()) && ((*itt).time() == time)) {
335 result = (*itt).comment();
336 m_snapMarkers.erase(itt);
342 GenTime DocClipBase::hasSnapMarkers(const GenTime & time)
344 QList < CommentedTime >::Iterator itt = m_snapMarkers.begin();
346 while (itt != m_snapMarkers.end()) {
347 if ((*itt).time() == time)
355 GenTime DocClipBase::findPreviousSnapMarker(const GenTime & currTime)
358 for (it = 0; it < m_snapMarkers.count(); it++) {
359 if (m_snapMarkers[it].time() >= currTime)
362 if (it == 0) return GenTime();
363 else if (it == m_snapMarkers.count() - 1 && m_snapMarkers[it].time() < currTime)
364 return m_snapMarkers[it].time();
365 else return m_snapMarkers[it-1].time();
368 GenTime DocClipBase::findNextSnapMarker(const GenTime & currTime)
371 for (it = 0; it < m_snapMarkers.count(); it++) {
372 if (m_snapMarkers[it].time() > currTime)
375 if (it < m_snapMarkers.count() && m_snapMarkers[it].time() > currTime) return m_snapMarkers[it].time();
379 QString DocClipBase::markerComment(GenTime t)
381 QList < CommentedTime >::Iterator itt = m_snapMarkers.begin();
383 while (itt != m_snapMarkers.end()) {
384 if ((*itt).time() == t)
385 return (*itt).comment();
391 void DocClipBase::deleteProducers()
393 qDeleteAll(m_baseTrackProducers);
394 m_baseTrackProducers.clear();
395 if (m_thumbProd) m_thumbProd->clearProducer();
398 void DocClipBase::setProducer(Mlt::Producer *producer)
400 if (producer == NULL) return;
401 QString id = producer->get("id");
402 if (id.contains('_')) {
403 // this is a subtrack producer, insert it at correct place
404 id = id.section('_', 1);
405 if (id.endsWith("audio")) {
406 int pos = id.section('_', 0, 0).toInt();
407 if (pos >= m_audioTrackProducers.count()) {
408 while (m_audioTrackProducers.count() - 1 < pos) {
409 m_audioTrackProducers.append(NULL);
412 if (m_audioTrackProducers.at(pos) == NULL) m_audioTrackProducers[pos] = producer;
415 if (id.endsWith("video")) {
416 m_videoOnlyProducer = producer;
419 int pos = id.toInt();
420 if (pos >= m_baseTrackProducers.count()) {
421 while (m_baseTrackProducers.count() - 1 < pos) {
422 m_baseTrackProducers.append(NULL);
425 if (m_baseTrackProducers.at(pos) == NULL) m_baseTrackProducers[pos] = producer;
427 if (m_baseTrackProducers.isEmpty()) m_baseTrackProducers.append(producer);
428 else if (m_baseTrackProducers.at(0) == NULL) m_baseTrackProducers[0] = producer;
430 //m_clipProducer = producer;
431 //m_clipProducer->set("transparency", m_properties.value("transparency").toInt());
432 if (m_thumbProd && !m_thumbProd->hasProducer()) m_thumbProd->setProducer(producer);
435 Mlt::Producer *DocClipBase::audioProducer(int track)
437 if (m_audioTrackProducers.count() <= track) {
438 while (m_audioTrackProducers.count() - 1 < track) {
439 m_audioTrackProducers.append(NULL);
442 if (m_audioTrackProducers.at(track) == NULL) {
443 Mlt::Producer *base = producer();
444 m_audioTrackProducers[track] = new Mlt::Producer(*(base->profile()), base->get("resource"));
445 if (m_properties.contains("force_aspect_ratio")) m_audioTrackProducers.at(track)->set("force_aspect_ratio", m_properties.value("force_aspect_ratio").toDouble());
446 if (m_properties.contains("threads")) m_audioTrackProducers.at(track)->set("threads", m_properties.value("threads").toInt());
447 m_audioTrackProducers.at(track)->set("video_index", -1);
448 if (m_properties.contains("audio_index")) m_audioTrackProducers.at(track)->set("audio_index", m_properties.value("audio_index").toInt());
449 char *tmp = (char *) qstrdup(QString(getId() + '_' + QString::number(track) + "_audio").toUtf8().data());
450 m_audioTrackProducers.at(track)->set("id", tmp);
453 return m_audioTrackProducers.at(track);
456 Mlt::Producer *DocClipBase::videoProducer()
458 if (m_videoOnlyProducer == NULL) {
460 for (i = 0; i < m_baseTrackProducers.count(); i++)
461 if (m_baseTrackProducers.at(i) != NULL) break;
462 if (i >= m_baseTrackProducers.count()) return NULL;
463 m_videoOnlyProducer = new Mlt::Producer(*m_baseTrackProducers.at(i)->profile(), m_baseTrackProducers.at(i)->get("resource"));
464 if (m_properties.contains("force_aspect_ratio")) m_videoOnlyProducer->set("force_aspect_ratio", m_properties.value("force_aspect_ratio").toDouble());
465 if (m_properties.contains("threads")) m_videoOnlyProducer->set("threads", m_properties.value("threads").toInt());
466 m_videoOnlyProducer->set("audio_index", -1);
467 if (m_properties.contains("video_index")) m_videoOnlyProducer->set("video_index", m_properties.value("video_index").toInt());
468 char *tmp = (char *) qstrdup(QString(getId() + "_video").toUtf8().data());
469 m_videoOnlyProducer->set("id", tmp);
472 return m_videoOnlyProducer;
475 Mlt::Producer *DocClipBase::producer(int track)
477 /*for (int i = 0; i < m_baseTrackProducers.count(); i++) {
478 if (m_baseTrackProducers.at(i)) kDebug() << "// PROD: " << i << ", ID: " << m_baseTrackProducers.at(i)->get("id");
480 if (track == -1 || (m_clipType != AUDIO && m_clipType != AV)) {
481 if (m_baseTrackProducers.count() == 0) return NULL;
482 for (int i = 0; i < m_baseTrackProducers.count(); i++) {
483 if (m_baseTrackProducers.at(i) != NULL)
484 return m_baseTrackProducers.at(i);
488 if (track >= m_baseTrackProducers.count()) {
489 while (m_baseTrackProducers.count() - 1 < track) {
490 m_baseTrackProducers.append(NULL);
493 if (m_baseTrackProducers.at(track) == NULL) {
495 for (i = 0; i < m_baseTrackProducers.count(); i++)
496 if (m_baseTrackProducers.at(i) != NULL) break;
497 if (i >= m_baseTrackProducers.count()) return NULL;
498 m_baseTrackProducers[track] = new Mlt::Producer(*m_baseTrackProducers.at(i)->profile(), m_baseTrackProducers.at(i)->get("resource"));
499 if (m_properties.contains("force_aspect_ratio")) m_baseTrackProducers[track]->set("force_aspect_ratio", m_properties.value("force_aspect_ratio").toDouble());
500 if (m_properties.contains("threads")) m_baseTrackProducers[track]->set("threads", m_properties.value("threads").toInt());
501 if (m_properties.contains("video_index")) m_baseTrackProducers[track]->set("video_index", m_properties.value("video_index").toInt());
502 if (m_properties.contains("audio_index")) m_baseTrackProducers[track]->set("audio_index", m_properties.value("audio_index").toInt());
503 char *tmp = (char *) qstrdup(QString(getId() + '_' + QString::number(track)).toUtf8().data());
504 m_baseTrackProducers[track]->set("id", tmp);
506 if (KdenliveSettings::dropbframes() && m_baseTrackProducers.at(i)->get("skip_loop_filter") && strcmp(m_baseTrackProducers.at(i)->get("skip_loop_filter"), "all") == 0) {
507 m_baseTrackProducers[track]->set("skip_loop_filter", "all");
508 m_baseTrackProducers[track]->set("skip_frame", "bidir");
511 return m_baseTrackProducers.at(track);
514 void DocClipBase::setProducerProperty(const char *name, int data)
516 for (int i = 0; i < m_baseTrackProducers.count(); i++) {
517 if (m_baseTrackProducers.at(i) != NULL)
518 m_baseTrackProducers[i]->set(name, data);
522 void DocClipBase::setProducerProperty(const char *name, const char *data)
524 for (int i = 0; i < m_baseTrackProducers.count(); i++) {
525 if (m_baseTrackProducers.at(i) != NULL)
526 m_baseTrackProducers[i]->set(name, data);
530 const char *DocClipBase::producerProperty(const char *name) const
532 for (int i = 0; i < m_baseTrackProducers.count(); i++) {
533 if (m_baseTrackProducers.at(i) != NULL) {
534 return m_baseTrackProducers.at(i)->get(name);
541 void DocClipBase::slotRefreshProducer()
543 if (m_baseTrackProducers.count() == 0) return;
544 kDebug() << "//////////// REFRESH CLIP !!!!!!!!!!!!!!!!";
545 if (m_clipType == SLIDESHOW) {
546 /*char *tmp = (char *) qstrdup(getProperty("resource").toUtf8().data());
547 Mlt::Producer producer(*(m_clipProducer->profile()), tmp);
549 delete m_clipProducer;
550 m_clipProducer = new Mlt::Producer(producer.get_producer());
551 if (!getProperty("out").isEmpty()) m_clipProducer->set_in_and_out(getProperty("in").toInt(), getProperty("out").toInt());*/
552 setProducerProperty("ttl", getProperty("ttl").toInt());
553 //m_clipProducer->set("id", getProperty("id"));
554 if (getProperty("fade") == "1") {
555 // we want a fade filter effect
556 kDebug() << "//////////// FADE WANTED";
557 Mlt::Service clipService(m_baseTrackProducers.at(0)->get_service());
559 Mlt::Filter *filter = clipService.filter(ct);
561 if (filter->get("mlt_service") == "luma") {
565 filter = clipService.filter(ct);
568 if (filter && filter->get("mlt_service") == "luma") {
569 filter->set("period", getProperty("ttl").toInt() - 1);
570 filter->set("luma.out", getProperty("luma_duration").toInt());
571 QString resource = getProperty("luma_file");
572 char *tmp = (char *) qstrdup(resource.toUtf8().data());
573 filter->set("luma.resource", tmp);
575 if (!getProperty("softness").isEmpty()) {
576 int soft = getProperty("softness").toInt();
577 filter->set("luma.softness", (double) soft / 100.0);
580 // filter does not exist, create it...
581 Mlt::Filter *filter = new Mlt::Filter(*(m_baseTrackProducers.at(0)->profile()), "luma");
582 filter->set("period", getProperty("ttl").toInt() - 1);
583 filter->set("luma.out", getProperty("luma_duration").toInt());
584 QString resource = getProperty("luma_file");
585 char *tmp = (char *) qstrdup(resource.toUtf8().data());
586 filter->set("luma.resource", tmp);
588 if (!getProperty("softness").isEmpty()) {
589 int soft = getProperty("softness").toInt();
590 filter->set("luma.softness", (double) soft / 100.0);
592 clipService.attach(*filter);
595 kDebug() << "//////////// FADE NOT WANTED!!!";
596 Mlt::Service clipService(m_baseTrackProducers.at(0)->get_service());
598 Mlt::Filter *filter = clipService.filter(0);
600 if (filter->get("mlt_service") == "luma") {
601 clipService.detach(*filter);
603 filter = clipService.filter(ct);
609 void DocClipBase::setProperties(QMap <QString, QString> properties)
611 // changing clip type is not allowed
612 properties.remove("type");
613 QMapIterator<QString, QString> i(properties);
614 bool refreshProducer = false;
616 keys << "luma_duration" << "luma_file" << "fade" << "ttl" << "softness";
617 while (i.hasNext()) {
619 setProperty(i.key(), i.value());
620 if (m_clipType == SLIDESHOW && keys.contains(i.key())) refreshProducer = true;
622 if (refreshProducer) slotRefreshProducer();
625 void DocClipBase::setMetadata(QMap <QString, QString> properties)
627 m_metadata = properties;
630 QMap <QString, QString> DocClipBase::metadata() const
635 void DocClipBase::clearProperty(const QString &key)
637 m_properties.remove(key);
640 void DocClipBase::getFileHash(const QString url)
642 if (m_clipType == SLIDESHOW) return;
644 if (file.open(QIODevice::ReadOnly)) { // write size and hash only if resource points to a file
647 //kDebug() << "SETTING HASH of" << value;
648 m_properties.insert("file_size", QString::number(file.size()));
650 * 1 MB = 1 second per 450 files (or faster)
651 * 10 MB = 9 seconds per 450 files (or faster)
653 if (file.size() > 1000000*2) {
654 fileData = file.read(1000000);
655 if (file.seek(file.size() - 1000000))
656 fileData.append(file.readAll());
658 fileData = file.readAll();
660 fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
661 m_properties.insert("file_hash", QString(fileHash.toHex()));
662 //kDebug() << file.fileName() << file.size() << fileHash.toHex();
666 QString DocClipBase::getClipHash() const
669 if (m_clipType == SLIDESHOW) hash = QCryptographicHash::hash(m_properties.value("resource").toAscii().data(), QCryptographicHash::Md5).toHex();
670 else if (m_clipType == COLOR) hash = QCryptographicHash::hash(m_properties.value("colour").toAscii().data(), QCryptographicHash::Md5).toHex();
671 else hash = m_properties.value("file_hash");
675 void DocClipBase::refreshThumbUrl()
677 if (m_thumbProd) m_thumbProd->updateThumbUrl(m_properties.value("file_hash"));
680 void DocClipBase::setProperty(const QString &key, const QString &value)
682 m_properties.insert(key, value);
683 if (key == "resource") {
685 if (m_thumbProd) m_thumbProd->updateClipUrl(KUrl(value), m_properties.value("file_hash"));
686 } else if (key == "out") setDuration(GenTime(value.toInt(), KdenliveSettings::project_fps()));
687 //else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
688 else if (key == "colour") {
689 char *tmp = (char *) qstrdup(value.toUtf8().data());
690 setProducerProperty("colour", tmp);
692 } else if (key == "xmldata") {
693 setProducerProperty("force_reload", 1);
694 } else if (key == "force_aspect_ratio") {
695 if (value.isEmpty()) {
696 m_properties.remove("force_aspect_ratio");
697 setProducerProperty("force_aspect_ratio", 0);
698 } else setProducerProperty("force_aspect_ratio", value.toDouble());
699 } else if (key == "threads") {
700 if (value.isEmpty()) {
701 m_properties.remove("threads");
702 setProducerProperty("threads", 1);
703 } else setProducerProperty("threads", value.toInt());
704 } else if (key == "video_index") {
705 if (value.isEmpty()) {
706 m_properties.remove("video_index");
707 setProducerProperty("video_index", m_properties.value("default_video").toInt());
708 } else setProducerProperty("video_index", value.toInt());
709 } else if (key == "audio_index") {
710 if (value.isEmpty()) {
711 m_properties.remove("audio_index");
712 setProducerProperty("audio_index", m_properties.value("default_audio").toInt());
713 } else setProducerProperty("audio_index", value.toInt());
717 QMap <QString, QString> DocClipBase::properties() const
722 bool DocClipBase::slotGetAudioThumbs()
724 if (m_thumbProd == NULL) return false;
725 if (!KdenliveSettings::audiothumbnails()) {
726 if (m_audioTimer != NULL) m_audioTimer->stop();
729 if (m_audioThumbCreated) {
730 if (m_audioTimer != NULL) m_audioTimer->stop();
733 if (m_audioTimer != NULL)
734 m_audioTimer->start(1500);
735 double lengthInFrames = duration().frames(KdenliveSettings::project_fps());
736 m_thumbProd->getAudioThumbs(2, 0, lengthInFrames /*must be number of frames*/, 20);