m_mltConsumer->connect(*m_mltProducer);
m_mltProducer->set_speed(0.0);
m_refreshTimer.setSingleShot(true);
- m_refreshTimer.setInterval(70);
+ m_refreshTimer.setInterval(100);
connect(&m_refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
connect(this, SIGNAL(multiStreamFound(const QString &,QList<int>,QList<int>,stringMap)), this, SLOT(slotMultiStreamProducerFound(const QString &,QList<int>,QList<int>,stringMap)));
}
transition->set("mlt_service", "composite");
transition->set("a_track", 0);
transition->set("b_track", i);
- transition->set("distort", 1);
+ transition->set("distort", 0);
+ transition->set("aligned", 0);
transition->set("internal_added", "200");
QString geometry;
switch (screen) {
filePropertyMap["progressive"] = QString::number(original_profile->progressive());
filePropertyMap["colorspace"] = QString::number(original_profile->colorspace());
filePropertyMap["fps"] = QString::number(original_profile->fps());
+ filePropertyMap["aspect_ratio"] = QString::number(original_profile->sar());
delete tmpProd;
delete original_profile;
}
filePropertyMap["frame_size"] = QString::number(frame->get_int("width")) + 'x' + QString::number(frame->get_int("height"));
filePropertyMap["frequency"] = QString::number(frame->get_int("frequency"));
filePropertyMap["channels"] = QString::number(frame->get_int("channels"));
- filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio");
+ if (!filePropertyMap.contains("aspect_ratio")) filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio");
if (frame->get_int("test_image") == 0) {
- if (url.path().endsWith(".mlt") || url.path().endsWith(".westley") || url.path().endsWith(".kdenlive")) {
+ if (mltService == "xml" || mltService == "consumer") {
filePropertyMap["type"] = "playlist";
metadataPropertyMap["comment"] = QString::fromUtf8(producer->get("title"));
} else if (frame->get_int("test_audio") == 0)
emit stopped();
if (position == -1 && producer->get("id") == currentId) position = consumerPosition;
if (position != -1) producer->seek(position);
+ m_fps = producer->get_fps();
int volume = KdenliveSettings::volume();
+ if (producer->get_int("_audioclip") == 1) {
+ // This is an audio only clip, create fake multitrack to apply audiowave filter
+ Mlt::Tractor *tractor = new Mlt::Tractor();
+ Mlt::Producer *color= new Mlt::Producer(*m_mltProfile, "color:red");
+ color->set_in_and_out(0, producer->get_out());
+ tractor->set_track(*producer, 0);
+ tractor->set_track(*color, 1);
+
+ Mlt::Consumer xmlConsumer(*m_mltProfile, "xml:audio_hack");
+ if (!xmlConsumer.is_valid()) return -1;
+ xmlConsumer.set("terminate_on_pause", 1);
+ xmlConsumer.connect(tractor->parent());
+ xmlConsumer.run();
+ delete tractor;
+ delete color;
+ delete producer;
+ QString playlist = QString::fromUtf8(xmlConsumer.get("audio_hack"));
+
+ Mlt::Producer *result = new Mlt::Producer(*m_mltProfile, "xml-string", playlist.toUtf8().constData());
+ Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, "audiowave");
+ result->attach(*filter);
+ tractor = new Mlt::Tractor();
+ tractor->set_track(*result, 0);
+ delete result;
+ delete filter;
+ producer = &(tractor->parent());
+ m_mltConsumer->connect(*producer);
+ }
+
producer->set("meta.volume", (double)volume / 100);
- m_fps = producer->get_fps();
blockSignals(false);
m_mltConsumer->connect(*producer);
return;
if (m_mltConsumer) {
if (m_mltConsumer->is_stopped()) m_mltConsumer->start();
- m_mltConsumer->purge();
+ //m_mltConsumer->purge();
m_mltConsumer->set("refresh", 1);
}
}
const uchar* image = frame.get_image(format, width, height);
QImage qimage(width, height, QImage::Format_ARGB32_Premultiplied);
memcpy(qimage.scanLine(0), image, width * height * 4);
-
- /*mlt_image_format format = mlt_image_rgb24;
- int width = 0;
- int height = 0;
- const uchar* image = frame.get_image(format, width, height);
- QImage qimage(width, height, QImage::Format_RGB888);
- memcpy(qimage.bits(), image, width * height * 3);*/
emit frameUpdated(qimage.rgbSwapped());
}