#include <KDebug>
#include <KStandardDirs>
#include <KMessageBox>
-#include <KLocale>
+#include <KLocalizedString>
#include <KTemporaryFile>
#include <QTimer>
emit self->mltFrameReceived(new Mlt::Frame(frame_ptr));
}
-Render::Render(Kdenlive::MONITORID rendererName, int winid, QString profile, QWidget *parent) :
+Render::Render(Kdenlive::MonitorId rendererName, int winid, QString profile, QWidget *parent) :
AbstractRender(rendererName, parent),
requestedSeekPosition(SEEK_INACTIVE),
showFrameSemaphore(1),
m_blackClip = new Mlt::Producer(*m_mltProfile, "colour:black");
m_blackClip->set("id", "black");
m_blackClip->set("mlt_type", "producer");
- if (KdenliveSettings::external_display() && m_name != Kdenlive::clipMonitor && m_winid != 0) {
+ if (KdenliveSettings::external_display() && m_name != Kdenlive::ClipMonitor && m_winid != 0) {
// Use blackmagic card for video output
int device = KdenliveSettings::blackmagic_output_device();
if (device >= 0) {
if (m_winid == 0) {
// OpenGL monitor
if (!m_mltConsumer) {
- if (KdenliveSettings::external_display() && m_name != Kdenlive::clipMonitor) {
+ if (KdenliveSettings::external_display() && m_name != Kdenlive::ClipMonitor) {
int device = KdenliveSettings::blackmagic_output_device();
if (device >= 0) {
QString decklink = "decklink:" + QString::number(KdenliveSettings::blackmagic_output_device());
}
KUrl url(path);
Mlt::Producer *producer = NULL;
- CLIPTYPE type = (CLIPTYPE)info.xml.attribute("type").toInt();
- if (type == COLOR) {
+ ClipType type = (ClipType)info.xml.attribute("type").toInt();
+ if (type == Color) {
producer = new Mlt::Producer(*m_mltProfile, 0, ("colour:" + info.xml.attribute("colour")).toUtf8().constData());
- } else if (type == TEXT) {
+ } else if (type == Text) {
producer = new Mlt::Producer(*m_mltProfile, 0, ("kdenlivetitle:" + info.xml.attribute("resource")).toUtf8().constData());
if (producer && producer->is_valid() && info.xml.hasAttribute("xmldata"))
producer->set("xmldata", info.xml.attribute("xmldata").toUtf8().constData());
if (info.xml.hasAttribute("out")) clipOut = info.xml.attribute("out").toInt();
// setup length here as otherwise default length (currently 15000 frames in MLT) will be taken even if outpoint is larger
- if (type == COLOR || type == TEXT || type == IMAGE || type == SLIDESHOW) {
+ if (type == Color || type == Text || type == Image || type == SlideShow) {
int length;
if (info.xml.hasAttribute("length")) {
length = info.xml.attribute("length").toInt();
filePropertyMap["duration"] = QString::number(duration);
//kDebug() << "/////// PRODUCER: " << url.path() << " IS: " << producer->get_playtime();
- if (type == SLIDESHOW) {
+ if (type == SlideShow) {
int ttl = info.xml.hasAttribute("ttl") ? info.xml.attribute("ttl").toInt() : 0;
if (ttl) producer->set("ttl", ttl);
if (!info.xml.attribute("animation").isEmpty()) {
Mlt::Consumer xmlConsumer(*m_mltProfile, ("xml:" + url.path()).toUtf8().constData());
m_mltProducer->optimise();
xmlConsumer.set("terminate_on_pause", 1);
- if (m_name == Kdenlive::clipMonitor) {
+ if (m_name == Kdenlive::ClipMonitor) {
Mlt::Producer *prod = m_mltProducer->cut(zone.x(), zone.y());
Mlt::Playlist list;
list.insert_at(0, prod, 0);
{
if (!m_mltConsumer || !m_mltProducer) return;
m_mltProducer->set("meta.volume", (double)volume / 100.0);
- return;
+ //return;
/*osdTimer->stop();
m_mltConsumer->set("refresh", 0);
// Attach filter for on screen display of timecode
mlt_properties_set_int( properties, "meta.attr.timecode", 0);
if (m_mltProducer->attach(*m_osdInfo) == 1) kDebug()<<"////// error attaching filter";
}*/
- refresh();
+ //refresh();
//m_osdTimer->setSingleShot(2500);
}
return;
if (m_isZoneMode) resetZoneMode();
if (play && m_paused) {
- if (m_name == Kdenlive::clipMonitor && m_mltConsumer->position() == m_mltProducer->get_out()) m_mltProducer->seek(0);
+ if (m_name == Kdenlive::ClipMonitor && m_mltConsumer->position() == m_mltProducer->get_out()) m_mltProducer->seek(0);
m_paused = false;
m_mltProducer->set_speed(1.0);
if (m_mltConsumer->is_stopped()) {
return true;
}
-bool Render::mltEditEffect(int track, GenTime position, EffectsParameterList params)
+bool Render::mltEditEffect(int track, const GenTime &position, EffectsParameterList params)
{
int index = params.paramValue("kdenlive_ix").toInt();
QString tag = params.paramValue("tag");
delete clip;
service.unlock();
- if (doRefresh) refresh();
+ if (doRefresh)
+ refresh();
return true;
}
if (params.hasParam("_sync_in_out")) {
filter->set_in_and_out(clip->get_in(), clip->get_out());
}
- for (int j = 0; j < params.count(); j++) {
+ for (int j = 0; j < params.count(); ++j) {
filter->set(params.at(j).name().toUtf8().constData(), params.at(j).value().toUtf8().constData());
}
- for (int j = 0; j < filtersList.count(); j++) {
+ for (int j = 0; j < filtersList.count(); ++j) {
clip->attach(*(filtersList.at(j)));
}
delete clip;
service.unlock();
- if (doRefresh) refresh();
+ if (doRefresh)
+ refresh();
return true;
}
-bool Render::mltEnableEffects(int track, GenTime position, QList <int> effectIndexes, bool disable)
+bool Render::mltEnableEffects(int track, const GenTime &position, const QList <int> &effectIndexes, bool disable)
{
if (position < GenTime()) {
return mltEnableTrackEffects(track, effectIndexes, disable);
return true;
}
-bool Render::mltEnableTrackEffects(int track, QList <int> effectIndexes, bool disable)
+bool Render::mltEnableTrackEffects(int track, const QList <int> &effectIndexes, bool disable)
{
Mlt::Service service(m_mltProducer->parent().get_service());
Mlt::Tractor tractor(service);
return true;
}
-void Render::mltUpdateEffectPosition(int track, GenTime position, int oldPos, int newPos)
+void Render::mltUpdateEffectPosition(int track, const GenTime &position, int oldPos, int newPos)
{
Mlt::Service service(m_mltProducer->parent().get_service());
Mlt::Tractor tractor(service);
if (doRefresh) refresh();
}
-void Render::mltMoveEffect(int track, GenTime position, int oldPos, int newPos)
+void Render::mltMoveEffect(int track, const GenTime &position, int oldPos, int newPos)
{
if (position < GenTime()) {
mltMoveTrackEffect(track, oldPos, newPos);
//if (m_isBlocked == 0) m_mltConsumer->set("refresh", 1);
}
-QMap<QString, QString> Render::mltGetTransitionParamsFromXml(QDomElement xml)
+QMap<QString, QString> Render::mltGetTransitionParamsFromXml(const QDomElement &xml)
{
QDomNodeList attribs = xml.elementsByTagName("parameter");
QMap<QString, QString> map;
}
-QString Render::updateSceneListFps(double current_fps, double new_fps, QString scene)
+QString Render::updateSceneListFps(double current_fps, double new_fps, const QString &scene)
{
// Update all frame positions to the new fps value
//WARNING: there are probably some effects or other that hold a frame value
return true;
}
-void Render::slotMultiStreamProducerFound(const QString path, QList<int> audio_list, QList<int> video_list, stringMap data)
+void Render::slotMultiStreamProducerFound(const QString &path, QList<int> audio_list, QList<int> video_list, stringMap data)
{
if (KdenliveSettings::automultistreams()) {
for (int i = 1; i < video_list.count(); ++i) {