svn path=/branches/KDE4/; revision=3090
27 files changed:
x1 = br.x() + maxw * (i.key() - m_cropStart.frames(m_fps));
y1 = br.bottom() - i.value() * maxh;
if (qAbs(pos.x() - x1) < 6 && qAbs(pos.y() - y1) < 6) {
x1 = br.x() + maxw * (i.key() - m_cropStart.frames(m_fps));
y1 = br.bottom() - i.value() * maxh;
if (qAbs(pos.x() - x1) < 6 && qAbs(pos.y() - y1) < 6) {
- setToolTip("[" + QString::number((GenTime(i.key(), m_fps) - m_cropStart).seconds(), 'f', 2) + i18n("seconds") + ", " + QString::number(i.value(), 'f', 1) + "%]");
+ setToolTip('[' + QString::number((GenTime(i.key(), m_fps) - m_cropStart).seconds(), 'f', 2) + i18n("seconds") + ", " + QString::number(i.value(), 'f', 1) + "%]");
return i.key();
} else if (x1 > pos.x()) break;
++i;
return i.key();
} else if (x1 > pos.x()) break;
++i;
if (m_speed == 1.0) m_clipName = clip->name();
else {
if (m_speed == 1.0) m_clipName = clip->name();
else {
- m_clipName = clip->name() + " - " + QString::number(m_speed * 100, 'f', 0) + "%";
+ m_clipName = clip->name() + " - " + QString::number(m_speed * 100, 'f', 0) + '%';
m_cropDuration = m_cropDuration * m_speed;
}
m_producer = clip->getId();
m_cropDuration = m_cropDuration * m_speed;
}
m_producer = clip->getId();
QString def = e.attribute("default");
// Effect has a keyframe type parameter, we need to set the values
if (e.attribute("keyframes").isEmpty()) {
QString def = e.attribute("default");
// Effect has a keyframe type parameter, we need to set the values
if (e.attribute("keyframes").isEmpty()) {
- e.setAttribute("keyframes", QString::number(m_cropStart.frames(m_fps)) + ":" + def + ";" + QString::number((m_cropStart + m_cropDuration).frames(m_fps)) + ":" + def);
+ e.setAttribute("keyframes", QString::number(m_cropStart.frames(m_fps)) + ':' + def + ';' + QString::number((m_cropStart + m_cropDuration).frames(m_fps)) + ':' + def);
//kDebug() << "///// EFFECT KEYFRAMES INITED: " << e.attribute("keyframes");
break;
}
//kDebug() << "///// EFFECT KEYFRAMES INITED: " << e.attribute("keyframes");
break;
}
int end = (duration() + cropStart()).frames(m_fps);
int start = end;
if (effect.attribute("id") == "fadeout") {
int end = (duration() + cropStart()).frames(m_fps);
int start = end;
if (effect.attribute("id") == "fadeout") {
- if (m_effectList.hasEffect("", "fade_to_black") == -1) {
+ if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) {
start -= EffectsList::parameter(effect, "in").toInt();
} else {
start -= EffectsList::parameter(effect, "in").toInt();
} else {
- QDomElement fadeout = m_effectList.getEffectByTag("", "fade_to_black");
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
start -= EffectsList::parameter(fadeout, "out").toInt() - EffectsList::parameter(fadeout, "in").toInt();
}
} else if (effect.attribute("id") == "fade_to_black") {
start -= EffectsList::parameter(fadeout, "out").toInt() - EffectsList::parameter(fadeout, "in").toInt();
}
} else if (effect.attribute("id") == "fade_to_black") {
- if (m_effectList.hasEffect("", "fadeout") == -1) {
+ if (m_effectList.hasEffect(QString(), "fadeout") == -1) {
start -= EffectsList::parameter(effect, "in").toInt();
} else {
start -= EffectsList::parameter(effect, "in").toInt();
} else {
- QDomElement fadeout = m_effectList.getEffectByTag("", "fadeout");
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
start -= EffectsList::parameter(fadeout, "out").toInt() - EffectsList::parameter(fadeout, "in").toInt();
}
}
start -= EffectsList::parameter(fadeout, "out").toInt() - EffectsList::parameter(fadeout, "in").toInt();
}
}
int start = cropStart().frames(m_fps);
int end = start;
if (effect.attribute("id") == "fadein") {
int start = cropStart().frames(m_fps);
int end = start;
if (effect.attribute("id") == "fadein") {
- if (m_effectList.hasEffect("", "fade_from_black") == -1)
+ if (m_effectList.hasEffect(QString(), "fade_from_black") == -1)
end += EffectsList::parameter(effect, "out").toInt();
else
end += EffectsList::parameter(effect, "out").toInt();
else
- end += EffectsList::parameter(m_effectList.getEffectByTag("", "fade_from_black"), "out").toInt();
+ end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fade_from_black"), "out").toInt();
} else if (effect.attribute("id") == "fade_from_black") {
} else if (effect.attribute("id") == "fade_from_black") {
- if (m_effectList.hasEffect("", "fadein") == -1)
+ if (m_effectList.hasEffect(QString(), "fadein") == -1)
end += EffectsList::parameter(effect, "out").toInt();
else
end += EffectsList::parameter(effect, "out").toInt();
else
- end += EffectsList::parameter(m_effectList.getEffectByTag("", "fadein"), "out").toInt();
+ end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fadein"), "out").toInt();
}
EffectsList::setParameter(effect, "in", QString::number(start));
EffectsList::setParameter(effect, "out", QString::number(end));
}
EffectsList::setParameter(effect, "in", QString::number(start));
EffectsList::setParameter(effect, "out", QString::number(end));
for (int ix = 0; ix < m_effectList.count(); ix ++) {
QString kfr = keyframes(ix);
if (!kfr.isEmpty()) {
for (int ix = 0; ix < m_effectList.count(); ix ++) {
QString kfr = keyframes(ix);
if (!kfr.isEmpty()) {
- const QStringList keyframes = kfr.split(";", QString::SkipEmptyParts);
+ const QStringList keyframes = kfr.split(';', QString::SkipEmptyParts);
QStringList newKeyFrames;
bool cutKeyFrame = false;
bool modified = false;
QStringList newKeyFrames;
bool cutKeyFrame = false;
bool modified = false;
double lastValue = -1;
int start = m_cropStart.frames(m_fps);
int end = (m_cropStart + m_cropDuration).frames(m_fps);
double lastValue = -1;
int start = m_cropStart.frames(m_fps);
int end = (m_cropStart + m_cropDuration).frames(m_fps);
- foreach(const QString str, keyframes) {
- int pos = str.section(":", 0, 0).toInt();
- double val = str.section(":", 1, 1).toDouble();
+ foreach(const QString &str, keyframes) {
+ int pos = str.section(':', 0, 0).toInt();
+ double val = str.section(':', 1, 1).toDouble();
if (pos - start < 0) {
// a keyframe is defined before the start of the clip
cutKeyFrame = true;
if (pos - start < 0) {
// a keyframe is defined before the start of the clip
cutKeyFrame = true;
int diff = pos - lastPos;
double ratio = (double)(start - lastPos) / diff;
double newValue = lastValue + (val - lastValue) * ratio;
int diff = pos - lastPos;
double ratio = (double)(start - lastPos) / diff;
double newValue = lastValue + (val - lastValue) * ratio;
- newKeyFrames.append(QString::number(start) + ":" + QString::number(newValue));
+ newKeyFrames.append(QString::number(start) + ':' + QString::number(newValue));
modified = true;
}
cutKeyFrame = false;
modified = true;
}
cutKeyFrame = false;
if (diff != 0) {
double ratio = (double)(end - lastPos) / diff;
double newValue = lastValue + (val - lastValue) * ratio;
if (diff != 0) {
double ratio = (double)(end - lastPos) / diff;
double newValue = lastValue + (val - lastValue) * ratio;
- newKeyFrames.append(QString::number(end) + ":" + QString::number(newValue));
+ newKeyFrames.append(QString::number(end) + ':' + QString::number(newValue));
modified = true;
}
break;
} else {
modified = true;
}
break;
} else {
- newKeyFrames.append(QString::number(pos) + ":" + QString::number(val));
+ newKeyFrames.append(QString::number(pos) + ':' + QString::number(val));
m_keyframeFactor = 100.0 / (max - min);
m_keyframeDefault = e.attribute("default").toDouble();
// parse keyframes
m_keyframeFactor = 100.0 / (max - min);
m_keyframeDefault = e.attribute("default").toDouble();
// parse keyframes
- const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
- foreach(const QString str, keyframes) {
- int pos = str.section(":", 0, 0).toInt();
- double val = str.section(":", 1, 1).toDouble();
+ const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
+ foreach(const QString &str, keyframes) {
+ int pos = str.section(':', 0, 0).toInt();
+ double val = str.section(':', 1, 1).toDouble();
m_keyframes[pos] = val;
}
update();
m_keyframes[pos] = val;
}
update();
m_keyframeFactor = 100.0 / (max - min);
m_keyframeDefault = e.attribute("default").toDouble();
// parse keyframes
m_keyframeFactor = 100.0 / (max - min);
m_keyframeDefault = e.attribute("default").toDouble();
// parse keyframes
- const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
- foreach(const QString str, keyframes) {
- int pos = str.section(":", 0, 0).toInt();
- double val = str.section(":", 1, 1).toDouble();
+ const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
+ foreach(const QString &str, keyframes) {
+ int pos = str.section(':', 0, 0).toInt();
+ double val = str.section(':', 1, 1).toDouble();
m_keyframes[pos] = val;
}
update();
m_keyframes[pos] = val;
}
update();
double x1;
double y1;
while (i != m_keyframes.constEnd()) {
double x1;
double y1;
while (i != m_keyframes.constEnd()) {
- keyframes.append(QString::number(i.key()) + ":" + QString::number(i.value()) + ";");
+ keyframes.append(QString::number(i.key()) + ':' + QString::number(i.value()) + ';');
QDomElement e = params.item(i).toElement();
if (e.attribute("type") == "keyframe") {
// parse keyframes and adjust values
QDomElement e = params.item(i).toElement();
if (e.attribute("type") == "keyframe") {
// parse keyframes and adjust values
- const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
+ const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
QMap <int, double> kfr;
int pos;
double val;
QMap <int, double> kfr;
int pos;
double val;
- foreach(const QString str, keyframes) {
- pos = str.section(":", 0, 0).toInt();
- val = str.section(":", 1, 1).toDouble();
+ foreach(const QString &str, keyframes) {
+ pos = str.section(':', 0, 0).toInt();
+ val = str.section(':', 1, 1).toDouble();
if (pos == previous) kfr[current] = val;
else {
if (fromStart && pos >= current) kfr[pos] = val;
if (pos == previous) kfr[current] = val;
else {
if (fromStart && pos >= current) kfr[pos] = val;
QString newkfr;
QMap<int, double>::const_iterator k = kfr.constBegin();
while (k != kfr.constEnd()) {
QString newkfr;
QMap<int, double>::const_iterator k = kfr.constBegin();
while (k != kfr.constEnd()) {
- newkfr.append(QString::number(k.key()) + ":" + QString::number(k.value()) + ";");
+ newkfr.append(QString::number(k.key()) + ':' + QString::number(k.value()) + ';');
++k;
}
e.setAttribute("keyframes", newkfr);
++k;
}
e.setAttribute("keyframes", newkfr);
// check if it is a fade effect
if (effectId == "fadein") {
needRepaint = true;
// check if it is a fade effect
if (effectId == "fadein") {
needRepaint = true;
- if (m_effectList.hasEffect("", "fade_from_black") == -1) {
+ if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
} else {
if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
} else {
- QDomElement fadein = m_effectList.getEffectByTag("", "fade_from_black");
+ QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black");
if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
}
} else if (effectId == "fade_from_black") {
needRepaint = true;
if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
}
} else if (effectId == "fade_from_black") {
needRepaint = true;
- if (m_effectList.hasEffect("", "fadein") == -1) {
+ if (m_effectList.hasEffect(QString(), "fadein") == -1) {
if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
} else {
if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
} else {
- QDomElement fadein = m_effectList.getEffectByTag("", "fadein");
+ QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein");
if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
}
} else if (effectId == "fadeout") {
needRepaint = true;
if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
}
} else if (effectId == "fadeout") {
needRepaint = true;
- if (m_effectList.hasEffect("", "fade_to_black") == -1) {
+ if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) {
if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
} else {
if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
} else {
- QDomElement fadeout = m_effectList.getEffectByTag("", "fade_to_black");
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
}
} else if (effectId == "fade_to_black") {
needRepaint = true;
if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
}
} else if (effectId == "fade_to_black") {
needRepaint = true;
- if (m_effectList.hasEffect("", "fadeout") == -1) {
+ if (m_effectList.hasEffect(QString(), "fadeout") == -1) {
if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
} else {
if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
} else {
- QDomElement fadeout = m_effectList.getEffectByTag("", "fadeout");
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
}
if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
}
parameters.addParam("factor", e.attribute("factor", "1"));
parameters.addParam("starttag", e.attribute("starttag", "start"));
parameters.addParam("endtag", e.attribute("endtag", "end"));
parameters.addParam("factor", e.attribute("factor", "1"));
parameters.addParam("starttag", e.attribute("starttag", "start"));
parameters.addParam("endtag", e.attribute("endtag", "end"));
- } else if (e.attribute("namedesc").contains(";")) {
+ } else if (e.attribute("namedesc").contains(';')) {
QString format = e.attribute("format");
QStringList separators = format.split("%d", QString::SkipEmptyParts);
QStringList values = e.attribute("value").split(QRegExp("[,:;x]"));
QString format = e.attribute("format");
QStringList separators = format.split("%d", QString::SkipEmptyParts);
QStringList values = e.attribute("value").split(QRegExp("[,:;x]"));
ix = m_effectList.at(i).attribute("kdenlive_ix");
if (ix == index) {
QString effectId = m_effectList.at(i).attribute("id");
ix = m_effectList.at(i).attribute("kdenlive_ix");
if (ix == index) {
QString effectId = m_effectList.at(i).attribute("id");
- if ((effectId == "fadein" && hasEffect("", "fade_from_black") == -1) ||
- (effectId == "fade_from_black" && hasEffect("", "fadein") == -1)) {
+ if ((effectId == "fadein" && hasEffect(QString(), "fade_from_black") == -1) ||
+ (effectId == "fade_from_black" && hasEffect(QString(), "fadein") == -1)) {
m_startFade = 0;
needRepaint = true;
m_startFade = 0;
needRepaint = true;
- } else if ((effectId == "fadeout" && hasEffect("", "fade_to_black") == -1) ||
- (effectId == "fade_to_black" && hasEffect("", "fadeout") == -1)) {
+ } else if ((effectId == "fadeout" && hasEffect(QString(), "fade_to_black") == -1) ||
+ (effectId == "fade_to_black" && hasEffect(QString(), "fadeout") == -1)) {
m_endFade = 0;
needRepaint = true;
}
m_endFade = 0;
needRepaint = true;
}
QUndoCommand *addClips = new QUndoCommand();
addClips->setText(i18n("Add clips"));
QUndoCommand *addClips = new QUndoCommand();
addClips->setText(i18n("Add clips"));
- foreach(const KUrl file, urls) {
+ foreach(const KUrl &file, urls) {
if (KIO::NetAccess::exists(file, KIO::NetAccess::SourceSide, NULL)) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
if (KIO::NetAccess::exists(file, KIO::NetAccess::SourceSide, NULL)) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
void ClipManager::deleteFolder(const QString &id) {
m_folderList.remove(id);
void ClipManager::deleteFolder(const QString &id) {
m_folderList.remove(id);
-}
\ No newline at end of file
m_view.tabWidget->removeTab(AUDIOTAB);
m_view.tabWidget->removeTab(VIDEOTAB);
m_view.clip_thumb->setHidden(true);
m_view.tabWidget->removeTab(AUDIOTAB);
m_view.tabWidget->removeTab(VIDEOTAB);
m_view.clip_thumb->setHidden(true);
- m_view.clip_color->setColor(QColor("#" + props.value("colour").right(8).left(6)));
+ m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6)));
} else if (t == SLIDESHOW) {
m_view.clip_path->setText(url.directory());
m_view.tabWidget->removeTab(METATAB);
} else if (t == SLIDESHOW) {
m_view.clip_path->setText(url.directory());
m_view.tabWidget->removeTab(METATAB);
if (t == COLOR) {
QString new_color = m_view.clip_color->color().name();
if (t == COLOR) {
QString new_color = m_view.clip_color->color().name();
- if (new_color != QString("#" + old_props.value("colour").right(8).left(6))) {
+ if (new_color != QString('#' + old_props.value("colour").right(8).left(6))) {
m_clipNeedsRefresh = true;
props["colour"] = "0x" + new_color.right(6) + "ff";
}
m_clipNeedsRefresh = true;
props["colour"] = "0x" + new_color.right(6) + "ff";
}
void CustomTrackView::dragEnterEvent(QDragEnterEvent * event) {
if (event->mimeData()->hasFormat("kdenlive/clip")) {
resetSelectionGroup();
void CustomTrackView::dragEnterEvent(QDragEnterEvent * event) {
if (event->mimeData()->hasFormat("kdenlive/clip")) {
resetSelectionGroup();
- QStringList list = QString(event->mimeData()->data("kdenlive/clip")).split(";");
+ QStringList list = QString(event->mimeData()->data("kdenlive/clip")).split(';');
m_selectionGroup = new AbstractGroupItem(m_document->fps());
QPoint pos = QPoint();
DocClipBase *clip = m_document->getBaseClip(list.at(0));
m_selectionGroup = new AbstractGroupItem(m_document->fps());
QPoint pos = QPoint();
DocClipBase *clip = m_document->getBaseClip(list.at(0));
scene()->addItem(m_selectionGroup);
event->acceptProposedAction();
} else if (event->mimeData()->hasFormat("kdenlive/producerslist")) {
scene()->addItem(m_selectionGroup);
event->acceptProposedAction();
} else if (event->mimeData()->hasFormat("kdenlive/producerslist")) {
- QStringList ids = QString(event->mimeData()->data("kdenlive/producerslist")).split(";");
+ QStringList ids = QString(event->mimeData()->data("kdenlive/producerslist")).split(';');
m_scene->clearSelection();
resetSelectionGroup(false);
m_scene->clearSelection();
resetSelectionGroup(false);
while (it.hasNext()) {
it.next();
QDomElement but = doc.createElement("button");
while (it.hasNext()) {
it.next();
QDomElement but = doc.createElement("button");
- but.setAttribute("name", "b" + QString::number(i));
- if (i < max) but.setAttribute("down", "b" + QString::number(i + 1));
+ but.setAttribute("name", 'b' + QString::number(i));
+ if (i < max) but.setAttribute("down", 'b' + QString::number(i + 1));
else but.setAttribute("down", "b0");
else but.setAttribute("down", "b0");
- if (i > 0) but.setAttribute("up", "b" + QString::number(i - 1));
- else but.setAttribute("up", "b" + QString::number(max));
+ if (i > 0) but.setAttribute("up", 'b' + QString::number(i - 1));
+ else but.setAttribute("up", 'b' + QString::number(max));
QRect r = it.value();
int target = it.key();
// TODO:Â solve play all button
QRect r = it.value();
int target = it.key();
// TODO:Â solve play all button
menus.appendChild(pgc);
for (int i = 0; i < buttons.count(); i++) {
QDomElement button = dvddoc.createElement("button");
menus.appendChild(pgc);
for (int i = 0; i < buttons.count(); i++) {
QDomElement button = dvddoc.createElement("button");
- button.setAttribute("name", "b" + QString::number(i));
- QDomText nametext = dvddoc.createTextNode("jump title " + buttonsTarget.at(i) + ";");
+ button.setAttribute("name", 'b' + QString::number(i));
+ QDomText nametext = dvddoc.createTextNode("jump title " + buttonsTarget.at(i) + ';');
button.appendChild(nametext);
pgc.appendChild(button);
}
button.appendChild(nametext);
pgc.appendChild(button);
}
#include "customtrackview.h"
EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, GenTime pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) : m_view(view), m_track(track), m_pos(pos), m_index(effectIndex), m_oldkfr(oldkeyframes), m_newkfr(newkeyframes), m_doIt(doIt) {
#include "customtrackview.h"
EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, GenTime pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) : m_view(view), m_track(track), m_pos(pos), m_index(effectIndex), m_oldkfr(oldkeyframes), m_newkfr(newkeyframes), m_doIt(doIt) {
- int prev = m_oldkfr.split(";", QString::SkipEmptyParts).count();
- int next = m_newkfr.split(";", QString::SkipEmptyParts).count();
+ int prev = m_oldkfr.split(';', QString::SkipEmptyParts).count();
+ int next = m_newkfr.split(';', QString::SkipEmptyParts).count();
if (prev == next) setText(i18n("Edit keyframe"));
else if (prev > next) setText(i18n("Delete keyframe"));
else setText(i18n("Add keyframe"));
if (prev == next) setText(i18n("Edit keyframe"));
else if (prev > next) setText(i18n("Delete keyframe"));
else setText(i18n("Add keyframe"));
filter << "*.xml";
const QStringList fileList = directory.entryList(filter, QDir::Files);
QString itemName;
filter << "*.xml";
const QStringList fileList = directory.entryList(filter, QDir::Files);
QString itemName;
- foreach(const QString filename, fileList) {
+ foreach(const QString &filename, fileList) {
itemName = KUrl(path + filename).path();
QDomDocument doc;
QFile file(itemName);
itemName = KUrl(path + filename).path();
QDomDocument doc;
QFile file(itemName);
} else if (type == "list") {
Ui::Listval_UI *lsval = new Ui::Listval_UI;
lsval->setupUi(toFillin);
} else if (type == "list") {
Ui::Listval_UI *lsval = new Ui::Listval_UI;
lsval->setupUi(toFillin);
- QStringList listitems = pa.attribute("paramlist").split(",");
- QStringList listitemsdisplay = pa.attribute("paramlistdisplay").split(",");
+ QStringList listitems = pa.attribute("paramlist").split(',');
+ QStringList listitemsdisplay = pa.attribute("paramlistdisplay").split(',');
if (listitemsdisplay.count() != listitems.count()) listitemsdisplay = listitems;
//lsval->list->addItems(listitems);
for (int i = 0;i < listitems.count();i++) {
if (listitemsdisplay.count() != listitems.count()) listitemsdisplay = listitems;
//lsval->list->addItems(listitems);
for (int i = 0;i < listitems.count();i++) {
valueItems[paramName] = bval;
uiItems.append(bval);
} else if (type == "complex") {
valueItems[paramName] = bval;
uiItems.append(bval);
} else if (type == "complex") {
- /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(";");
- QStringList max=nodeAtts.namedItem("max").nodeValue().split(";");
- QStringList min=nodeAtts.namedItem("min").nodeValue().split(";");
- QStringList val=value.split(";");
+ /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(';');
+ QStringList max=nodeAtts.namedItem("max").nodeValue().split(';');
+ QStringList min=nodeAtts.namedItem("min").nodeValue().split(';');
+ QStringList val=value.split(';');
kDebug() << "in complex"<<names.size() << " " << max.size() << " " << min.size() << " " << val.size() ;
if ( (names.size() == max.size() ) &&
(names.size()== min.size()) &&
kDebug() << "in complex"<<names.size() << " " << max.size() << " " << min.size() << " " << val.size() ;
if ( (names.size() == max.size() ) &&
(names.size()== min.size()) &&
wipeInfo EffectStackEdit::getWipeInfo(QString value) {
wipeInfo info;
wipeInfo EffectStackEdit::getWipeInfo(QString value) {
wipeInfo info;
- QString start = value.section(";", 0, 0);
- QString end = value.section(";", 1, 1).section("=", 1, 1);
+ QString start = value.section(';', 0, 0);
+ QString end = value.section(';', 1, 1).section('=', 1, 1);
if (start.startsWith("-100%,0")) info.start = LEFT;
else if (start.startsWith("100%,0")) info.start = RIGHT;
else if (start.startsWith("0%,100%")) info.start = DOWN;
if (start.startsWith("-100%,0")) info.start = LEFT;
else if (start.startsWith("100%,0")) info.start = RIGHT;
else if (start.startsWith("0%,100%")) info.start = DOWN;
start = "0%,0%:100%x100%";
break;
}
start = "0%,0%:100%x100%";
break;
}
- start.append(":" + QString::number(info.startTransparency));
+ start.append(':' + QString::number(info.startTransparency));
switch (info.end) {
case LEFT:
switch (info.end) {
case LEFT:
end = "0%,0%:100%x100%";
break;
}
end = "0%,0%:100%x100%";
break;
}
- end.append(":" + QString::number(info.endTransparency));
+ end.append(':' + QString::number(info.endTransparency));
return QString(start + ";-1=" + end);
}
return QString(start + ";-1=" + end);
}
setZValue(999);
setAcceptsHoverEvents(true);
const QFontMetrics metric = m_view->fontMetrics();
setZValue(999);
setAcceptsHoverEvents(true);
const QFontMetrics metric = m_view->fontMetrics();
- m_width = metric.width(" " + m_label + " ") + 2;
+ m_width = metric.width(' ' + m_label + ' ') + 2;
prepareGeometryChange();
}
prepareGeometryChange();
}
m_label = comment;
setToolTip(m_label);
const QFontMetrics metric = m_view->fontMetrics();
m_label = comment;
setToolTip(m_label);
const QFontMetrics metric = m_view->fontMetrics();
- m_width = metric.width(" " + m_label + " ") + 2;
+ m_width = metric.width(' ' + m_label + ' ') + 2;
prepareGeometryChange();
}
}
prepareGeometryChange();
}
}
//QGraphicsLineItem::paint(painter, option, w);
if (KdenliveSettings::showmarkers()) {
QPointF p1 = guideline.p1() + QPointF(1, 0);
//QGraphicsLineItem::paint(painter, option, w);
if (KdenliveSettings::showmarkers()) {
QPointF p1 = guideline.p1() + QPointF(1, 0);
- QRectF txtBounding = painter->boundingRect(p1.x(), p1.y() + 10, m_width, 50, Qt::AlignLeft | Qt::AlignTop, " " + m_label + " ");
+ QRectF txtBounding = painter->boundingRect(p1.x(), p1.y() + 10, m_width, 50, Qt::AlignLeft | Qt::AlignTop, ' ' + m_label + ' ');
QPainterPath path;
path.addRoundedRect(txtBounding, 3, 3);
painter->fillPath(path, QBrush(pen().color()));
QPainterPath path;
path.addRoundedRect(txtBounding, 3, 3);
painter->fillPath(path, QBrush(pen().color()));
filter << "*.xml";
const QStringList fileList = directory.entryList(filter, QDir::Files);
QString itemName;
filter << "*.xml";
const QStringList fileList = directory.entryList(filter, QDir::Files);
QString itemName;
- foreach(const QString filename, fileList) {
+ foreach(const QString &filename, fileList) {
itemName = KUrl(path + filename).path();
QDomDocument doc;
QFile file(itemName);
itemName = KUrl(path + filename).path();
QDomDocument doc;
QFile file(itemName);
if (version == 0.5 || version == 0.7 || version > 0.81) {
kDebug() << "Unable to open document with version " << version;
// TODO: convert 0.7 (0.5?) files to the new document format.
if (version == 0.5 || version == 0.7 || version > 0.81) {
kDebug() << "Unable to open document with version " << version;
// TODO: convert 0.7 (0.5?) files to the new document format.
if (t.attribute("producer") != "black_track") tracksinfo.appendChild(trackinfo);
}
infoXml.appendChild(tracksinfo);
if (t.attribute("producer") != "black_track") tracksinfo.appendChild(trackinfo);
}
infoXml.appendChild(tracksinfo);
}
QDomNode westley = m_document.elementsByTagName("westley").at(1);
}
QDomNode westley = m_document.elementsByTagName("westley").at(1);
//kDebug() << "ready to set additional <avfile />'s attributes (id =" << id << ")";
kproducer.setAttribute("channels", avfile.attribute("channels"));
kproducer.setAttribute("duration", avfile.attribute("duration"));
//kDebug() << "ready to set additional <avfile />'s attributes (id =" << id << ")";
kproducer.setAttribute("channels", avfile.attribute("channels"));
kproducer.setAttribute("duration", avfile.attribute("duration"));
- kproducer.setAttribute("frame_size", avfile.attribute("width") + "x" + avfile.attribute("height"));
+ kproducer.setAttribute("frame_size", avfile.attribute("width") + 'x' + avfile.attribute("height"));
kproducer.setAttribute("frequency", avfile.attribute("frequency"));
if (kproducer.attribute("description").isEmpty() && !avfile.attribute("description").isEmpty())
kproducer.setAttribute("description", avfile.attribute("description"));
kproducer.setAttribute("frequency", avfile.attribute("frequency"));
if (kproducer.attribute("description").isEmpty() && !avfile.attribute("description").isEmpty())
kproducer.setAttribute("description", avfile.attribute("description"));
*/
//kDebug() << "///////////////// END CONVERTEDÂ DOC:";
*/
//kDebug() << "///////////////// END CONVERTEDÂ DOC:";
}
QString KdenliveDoc::colorToString(const QColor& c) {
}
QString KdenliveDoc::colorToString(const QColor& c) {
for (int i = 0; i < maxprod; i++) {
QDomNode m = prods.at(i);
QString prodId = m.toElement().attribute("id");
for (int i = 0; i < maxprod; i++) {
QDomNode m = prods.at(i);
QString prodId = m.toElement().attribute("id");
- if (prodId == id || prodId.startsWith(id + "_")) {
+ if (prodId == id || prodId.startsWith(id + '_')) {
QDomNodeList params = m.childNodes();
for (int j = 0; j < params.count(); j++) {
QDomElement e = params.item(j).toElement();
QDomNodeList params = m.childNodes();
for (int j = 0; j < params.count(); j++) {
QDomElement e = params.item(j).toElement();
while (!stream.atEnd()) {
line = stream.readLine();
if (line.contains("playback")) {
while (!stream.atEnd()) {
line = stream.readLine();
if (line.contains("playback")) {
- deviceId = line.section(":", 0, 0);
- m_configSdl.kcfg_audio_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt()));
+ deviceId = line.section(':', 0, 0);
+ m_configSdl.kcfg_audio_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt()));
}
if (line.contains("capture")) {
}
if (line.contains("capture")) {
- deviceId = line.section(":", 0, 0);
- m_configCapture.kcfg_rmd_alsa_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt()));
+ deviceId = line.section(':', 0, 0);
+ m_configCapture.kcfg_rmd_alsa_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt()));
kDebug() << "// / / / / / READING APLAY: ";
kDebug() << result;
QStringList lines = result.split('\n');
kDebug() << "// / / / / / READING APLAY: ";
kDebug() << result;
QStringList lines = result.split('\n');
- foreach(QString data, lines) {
+ foreach(const QString &data, lines) {
kDebug() << "// READING LINE: " << data;
if (data.simplified().startsWith("card")) {
kDebug() << "// READING LINE: " << data;
if (data.simplified().startsWith("card")) {
- QString card = data.section(":", 0, 0).section(" ", -1);
- QString device = data.section(":", 1, 1).section(" ", -1);
- m_configSdl.kcfg_audio_device->addItem(data.section(":", -1), "plughw:" + card + "," + device);
- m_configCapture.kcfg_rmd_alsa_device->addItem(data.section(":", -1), "plughw:" + card + "," + device);
+ QString card = data.section(':', 0, 0).section(' ', -1);
+ QString device = data.section(':', 1, 1).section(' ', -1);
+ m_configSdl.kcfg_audio_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device);
+ m_configCapture.kcfg_rmd_alsa_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device);
void KdenliveSettingsDialog::slotUpdateDisplay() {
QString currentProfile = m_configMisc.kcfg_profiles_list->itemData(m_configMisc.kcfg_profiles_list->currentIndex()).toString();
QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
void KdenliveSettingsDialog::slotUpdateDisplay() {
QString currentProfile = m_configMisc.kcfg_profiles_list->itemData(m_configMisc.kcfg_profiles_list->currentIndex()).toString();
QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
- m_configMisc.p_size->setText(values.value("width") + "x" + values.value("height"));
- m_configMisc.p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den"));
- m_configMisc.p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den"));
- m_configMisc.p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den"));
+ m_configMisc.p_size->setText(values.value("width") + 'x' + values.value("height"));
+ m_configMisc.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
+ m_configMisc.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
+ m_configMisc.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
if (values.value("progressive").toInt() == 0) m_configMisc.p_progressive->setText(i18n("Interlaced"));
else m_configMisc.p_progressive->setText(i18n("Progressive"));
m_defaultProfile = m_configMisc.kcfg_profiles_list->itemText(m_configMisc.kcfg_profiles_list->currentIndex());
if (values.value("progressive").toInt() == 0) m_configMisc.p_progressive->setText(i18n("Interlaced"));
else m_configMisc.p_progressive->setText(i18n("Progressive"));
m_defaultProfile = m_configMisc.kcfg_profiles_list->itemText(m_configMisc.kcfg_profiles_list->currentIndex());
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
- foreach(QStringList value, effectsList) {
+ foreach(const QStringList &value, effectsList) {
action = new QAction(value.at(0), this);
action->setData(value);
videoEffectsMenu->addAction(action);
action = new QAction(value.at(0), this);
action->setData(value);
videoEffectsMenu->addAction(action);
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
- foreach(QStringList value, effectsList) {
+ foreach(const QStringList &value, effectsList) {
action = new QAction(value.at(0), this);
action->setData(value);
audioEffectsMenu->addAction(action);
action = new QAction(value.at(0), this);
action->setData(value);
audioEffectsMenu->addAction(action);
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
- foreach(QStringList value, effectsList) {
+ foreach(const QStringList &value, effectsList) {
action = new QAction(value.at(0), this);
action->setData(value);
m_customEffectsMenu->addAction(action);
action = new QAction(value.at(0), this);
action->setData(value);
m_customEffectsMenu->addAction(action);
effectInfo = transitions.effectIdInfo(ix);
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
effectInfo = transitions.effectIdInfo(ix);
effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
}
- foreach(QStringList value, effectsList) {
+ foreach(const QStringList &value, effectsList) {
action = new QAction(value.at(0), this);
action->setData(value);
transitionsMenu->addAction(action);
action = new QAction(value.at(0), this);
action->setData(value);
transitionsMenu->addAction(action);
foreach(const QString &folder, directories) {
kDebug() << "// PARSING FIOLER: " << folder;
QDir pluginsDir(folder);
foreach(const QString &folder, directories) {
kDebug() << "// PARSING FIOLER: " << folder;
QDir pluginsDir(folder);
- foreach(QString fileName, pluginsDir.entryList(filters, QDir::Files)) {
+ foreach(const QString &fileName, pluginsDir.entryList(filters, QDir::Files)) {
kDebug() << "// FOUND PLUGIN: " << fileName << "= " << pluginsDir.absoluteFilePath(fileName);
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = loader.instance();
kDebug() << "// FOUND PLUGIN: " << fileName << "= " << pluginsDir.absoluteFilePath(fileName);
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = loader.instance();
QMenu *menu, const char *member,
QActionGroup *actionGroup) {
kDebug() << "// ADD to MENU" << texts;
QMenu *menu, const char *member,
QActionGroup *actionGroup) {
kDebug() << "// ADD to MENU" << texts;
- foreach(QString text, texts) {
+ foreach(const QString &text, texts) {
QAction *action = new QAction(text, plugin);
action->setData(text);
connect(action, SIGNAL(triggered()), this, member);
QAction *action = new QAction(text, plugin);
action->setData(text);
connect(action, SIGNAL(triggered()), this, member);
m_importButton = m_view.buttonBox->button(QDialogButtonBox::Ok);
m_importButton->setText(i18n("import"));
m_view.treeWidget->setIconSize(QSize(70, 50));
m_importButton = m_view.buttonBox->button(QDialogButtonBox::Ok);
m_importButton->setText(i18n("import"));
m_view.treeWidget->setIconSize(QSize(70, 50));
- foreach(const KUrl url, files) {
+ foreach(const KUrl &url, files) {
QStringList text;
text << url.fileName();
KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
QStringList text;
text << url.fileName();
KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
if (ix != -1) {
// this profile name already exists
const QString path = m_view.profiles_list->itemData(ix).toString();
if (ix != -1) {
// this profile name already exists
const QString path = m_view.profiles_list->itemData(ix).toString();
- if (!path.contains("/")) {
+ if (!path.contains('/')) {
KMessageBox::sorry(this, i18n("A profile with same name already exists in MLT's default profiles, please choose another description for your custom profile."));
return false;
}
KMessageBox::sorry(this, i18n("A profile with same name already exists in MLT's default profiles, please choose another description for your custom profile."));
return false;
}
void ProfilesDialog::slotDeleteProfile() {
const QString path = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
void ProfilesDialog::slotDeleteProfile() {
const QString path = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
- if (path.contains("/")) {
+ if (path.contains('/')) {
KIO::NetAccess::del(KUrl(path), this);
fillList();
} else kDebug() << "//// Cannot delete profile " << path << ", does not seem to be custom one";
KIO::NetAccess::del(KUrl(path), this);
fillList();
} else kDebug() << "//// Cannot delete profile " << path << ", does not seem to be custom one";
if (!isCustom) {
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
if (!isCustom) {
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
- if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + "/" + name;
+ if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + '/' + name;
}
if (isCustom || path.isEmpty()) {
path = name;
}
if (isCustom || path.isEmpty()) {
path = name;
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) {
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) {
- KConfig confFile(KdenliveSettings::mltpath() + "/" + name, KConfig::SimpleConfig);
+ KConfig confFile(KdenliveSettings::mltpath() + '/' + name, KConfig::SimpleConfig);
return confFile.entryMap().value("description");
}
return confFile.entryMap().value("description");
}
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) {
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) {
- KConfig confFile(customProfiles.at(i) + "/" + name, KConfig::SimpleConfig);
+ KConfig confFile(customProfiles.at(i) + '/' + name, KConfig::SimpleConfig);
return confFile.entryMap().value("description");
}
}
return confFile.entryMap().value("description");
}
}
//Â List the Mlt profiles
QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
//Â List the Mlt profiles
QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
- KConfig confFile(KdenliveSettings::mltpath() + "/" + profilesFiles.at(i), KConfig::SimpleConfig);
+ KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
QString desc = confFile.entryMap().value("description");
if (!desc.isEmpty()) result.insert(desc, profilesFiles.at(i));
}
QString desc = confFile.entryMap().value("description");
if (!desc.isEmpty()) result.insert(desc, profilesFiles.at(i));
}
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
- KConfig confFile(customProfiles.at(i) + "/" + profilesFiles.at(j), KConfig::SimpleConfig);
+ KConfig confFile(customProfiles.at(i) + '/' + profilesFiles.at(j), KConfig::SimpleConfig);
QString desc = confFile.entryMap().value("description");
QString desc = confFile.entryMap().value("description");
- if (!desc.isEmpty()) result.insert(desc, customProfiles.at(i) + "/" + profilesFiles.at(j));
+ if (!desc.isEmpty()) result.insert(desc, customProfiles.at(i) + '/' + profilesFiles.at(j));
QStringList profilesFilter;
profilesFilter << "*";
QStringList profilesFilter;
profilesFilter << "*";
- if (!path.contains("/")) {
+ if (!path.contains('/')) {
// This is an MLT profile
// This is an MLT profile
- KConfig confFile(KdenliveSettings::mltpath() + "/" + path, KConfig::SimpleConfig);
+ KConfig confFile(KdenliveSettings::mltpath() + '/' + path, KConfig::SimpleConfig);
return confFile.entryMap();
} else {
// This is a custom profile
return confFile.entryMap();
} else {
// This is a custom profile
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
- KConfig confFile(KdenliveSettings::mltpath() + "/" + profilesFiles.at(i), KConfig::SimpleConfig);
+ KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileName) {
values.insert("path", profilesFiles.at(i));
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileName) {
values.insert("path", profilesFiles.at(i));
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profiles.size(); ++i) {
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profiles.size(); ++i) {
- KConfig confFile(customProfiles.at(i) + "/" + profiles.at(i), KConfig::SimpleConfig);
+ KConfig confFile(customProfiles.at(i) + '/' + profiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileName) {
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileName) {
- values.insert("path", customProfiles.at(i) + "/" + profiles.at(i));
+ values.insert("path", customProfiles.at(i) + '/' + profiles.at(i));
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
//Â List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
- KConfig confFile(KdenliveSettings::mltpath() + "/" + profilesFiles.at(i), KConfig::SimpleConfig);
+ KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileDesc) return profilesFiles.at(i);
}
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileDesc) return profilesFiles.at(i);
}
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profiles.size(); ++i) {
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profiles.size(); ++i) {
- KConfig confFile(customProfiles.at(i) + "/" + profiles.at(i), KConfig::SimpleConfig);
+ KConfig confFile(customProfiles.at(i) + '/' + profiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
QMap< QString, QString > values = confFile.entryMap();
- if (values.value("description") == profileDesc) return customProfiles.at(i) + "/" + profiles.at(i);
+ if (values.value("description") == profileDesc) return customProfiles.at(i) + '/' + profiles.at(i);
m_selectedProfileIndex = m_view.profiles_list->currentIndex();
QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
m_selectedProfileIndex = m_view.profiles_list->currentIndex();
QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
- m_isCustomProfile = currentProfile.contains("/");
+ m_isCustomProfile = currentProfile.contains('/');
m_view.button_delete->setEnabled(m_isCustomProfile);
m_view.properties->setEnabled(m_isCustomProfile);
m_view.button_save->setEnabled(m_isCustomProfile);
m_view.button_delete->setEnabled(m_isCustomProfile);
m_view.properties->setEnabled(m_isCustomProfile);
m_view.button_save->setEnabled(m_isCustomProfile);
listView = new ProjectListView(this);;
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
listView = new ProjectListView(this);;
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
- // mbd: I think this has died at some point: m_clipIdCounter = 0;
// setup toolbar
searchView = new KTreeWidgetSearchLine(this);
m_toolbar = new QToolBar("projectToolBar", this);
// setup toolbar
searchView = new KTreeWidgetSearchLine(this);
m_toolbar = new QToolBar("projectToolBar", this);
void ProjectSettings::slotUpdateDisplay() {
QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
void ProjectSettings::slotUpdateDisplay() {
QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
- m_view.p_size->setText(values.value("width") + "x" + values.value("height"));
- m_view.p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den"));
- m_view.p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den"));
- m_view.p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den"));
+ m_view.p_size->setText(values.value("width") + 'x' + values.value("height"));
+ m_view.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
+ m_view.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
+ m_view.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
if (values.value("progressive").toInt() == 0) m_view.p_progressive->setText(i18n("Interlaced"));
else m_view.p_progressive->setText(i18n("Progressive"));
}
if (values.value("progressive").toInt() == 0) m_view.p_progressive->setText(i18n("Interlaced"));
else m_view.p_progressive->setText(i18n("Progressive"));
}
int i = 1;
while (QFile::exists(path)) {
QString num = QString::number(i).rightJustified(4, '0', false);
int i = 1;
while (QFile::exists(path)) {
QString num = QString::number(i).rightJustified(4, '0', false);
- path = KdenliveSettings::capturefolder() + "/capture" + num + "." + extension;
+ path = KdenliveSettings::capturefolder() + "/capture" + num + '.' + extension;
filters << "capture*" + extension;
const QStringList result = dir.entryList(filters, QDir::Files, QDir::Time);
KUrl::List capturedFiles;
filters << "capture*" + extension;
const QStringList result = dir.entryList(filters, QDir::Files, QDir::Time);
KUrl::List capturedFiles;
- foreach(QString name, result) {
+ foreach(const QString &name, result) {
KUrl url = KUrl(dir.filePath(name));
if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) {
KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
KUrl url = KUrl(dir.filePath(name));
if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) {
KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
ManageCapturesDialog *d = new ManageCapturesDialog(capturedFiles, this);
if (d->exec() == QDialog::Accepted) {
capturedFiles = d->importFiles();
ManageCapturesDialog *d = new ManageCapturesDialog(capturedFiles, this);
if (d->exec() == QDialog::Accepted) {
capturedFiles = d->importFiles();
- foreach(KUrl url, capturedFiles) {
+ foreach(const KUrl &url, capturedFiles) {
emit addProjectClip(url);
}
}
emit addProjectClip(url);
}
}
filter << "*." + fileType;
filter << "*." + fileType.toUpper();
more = dir.entryList(filter, QDir::Files);
filter << "*." + fileType;
filter << "*." + fileType.toUpper();
more = dir.entryList(filter, QDir::Files);
- im.load(url.directory() + "/" + more.at(0));
+ im.load(url.directory() + '/' + more.at(0));
} else im.load(url.path());
//pixmap = im.scaled(width, height);
return pixmap;
} else im.load(url.path());
//pixmap = im.scaled(width, height);
return pixmap;
more = dir.entryList( QDir::Files );
for ( it = more.begin() ; it != more.end() ; ++it ) {
if ((*it).endsWith("."+fileType, Qt::CaseInsensitive)) {
more = dir.entryList( QDir::Files );
for ( it = more.begin() ; it != more.end() ; ++it ) {
if ((*it).endsWith("."+fileType, Qt::CaseInsensitive)) {
- if (!im.load(url.directory() + "/" + *it))
- kDebug()<<"++ ERROR LOADIN IMAGE: "<<url.directory() + "/" + *it;
+ if (!im.load(url.directory() + '/' + *it))
+ kDebug()<<"++ ERROR LOADIN IMAGE: "<<url.directory() + '/' + *it;
filePropertyMap["fps"] = producer->get("source_fps");
if (frame && frame->is_valid()) {
filePropertyMap["fps"] = producer->get("source_fps");
if (frame && frame->is_valid()) {
- filePropertyMap["frame_size"] = QString::number(frame->get_int("width")) + "x" + QString::number(frame->get_int("height"));
+ 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");
filePropertyMap["frequency"] = QString::number(frame->get_int("frequency"));
filePropertyMap["channels"] = QString::number(frame->get_int("channels"));
filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio");
// We want a slowmotion producer
double speed = element.attribute("speed", "1.0").toDouble();
QString url = prod->get("resource");
// We want a slowmotion producer
double speed = element.attribute("speed", "1.0").toDouble();
QString url = prod->get("resource");
- url.append("?" + QString::number(speed));
+ url.append('?' + QString::number(speed));
Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
if (!slowprod || slowprod->get_producer() == NULL) {
char *tmp = decodedString(url);
Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
if (!slowprod || slowprod->get_producer() == NULL) {
char *tmp = decodedString(url);
delete[] tmp;
QString id = prod->get("id");
if (id.contains('_')) id = id.section('_', 0, 0);
delete[] tmp;
QString id = prod->get("id");
if (id.contains('_')) id = id.section('_', 0, 0);
- QString producerid = "slowmotion:" + id + ":" + QString::number(speed);
+ QString producerid = "slowmotion:" + id + ':' + QString::number(speed);
tmp = decodedString(producerid);
slowprod->set("id", tmp);
delete[] tmp;
tmp = decodedString(producerid);
slowprod->set("id", tmp);
delete[] tmp;
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
- kDebug()<<"CLIP "<<i<<": ("<<blankStart<<"x"<<blankStart + blankDuration<<")"<<blk;
+ kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
}*/
int cutPos = (int) position.frames(m_fps);
}*/
int cutPos = (int) position.frames(m_fps);
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
- kDebug()<<"CLIP "<<i<<": ("<<blankStart<<"x"<<blankStart + blankDuration<<")"<<blk;
+ kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
- kDebug()<<"CLIP "<<i<<": ("<<blankStart<<"x"<<blankStart + blankDuration<<")"<<blk;
+ kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
}*/
if (trackPlaylist.is_blank(clipIndex)) {
}*/
if (trackPlaylist.is_blank(clipIndex)) {
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
- kDebug()<<"CLIP "<<i<<": ("<<blankStart<<"x"<<blankStart + blankDuration<<")"<<blk;
+ kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
}*/
if (track != 0 && trackPlaylist.count() <= clipIndex) mltCheckLength();
}*/
if (track != 0 && trackPlaylist.count() <= clipIndex) mltCheckLength();
if (serv == "avformat" && speed != 1.0) {
mlt_service_lock(service.get_service());
QString url = clipparent.get("resource");
if (serv == "avformat" && speed != 1.0) {
mlt_service_lock(service.get_service());
QString url = clipparent.get("resource");
- url.append("?" + QString::number(speed));
+ url.append('?' + QString::number(speed));
Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
if (!slowprod || slowprod->get_producer() == NULL) {
char *tmp = decodedString(url);
slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
delete[] tmp;
Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
if (!slowprod || slowprod->get_producer() == NULL) {
char *tmp = decodedString(url);
slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
delete[] tmp;
- QString producerid = "slowmotion:" + id + ":" + QString::number(speed);
+ QString producerid = "slowmotion:" + id + ':' + QString::number(speed);
tmp = decodedString(producerid);
slowprod->set("id", tmp);
delete[] tmp;
tmp = decodedString(producerid);
slowprod->set("id", tmp);
delete[] tmp;
} else if (serv == "framebuffer") {
mlt_service_lock(service.get_service());
QString url = clipparent.get("resource");
} else if (serv == "framebuffer") {
mlt_service_lock(service.get_service());
QString url = clipparent.get("resource");
- url = url.section("?", 0, 0);
- url.append("?" + QString::number(speed));
+ url = url.section('?', 0, 0);
+ url.append('?' + QString::number(speed));
Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
if (!slowprod || slowprod->get_producer() == NULL) {
char *tmp = decodedString(url);
slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
delete[] tmp;
Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
if (!slowprod || slowprod->get_producer() == NULL) {
char *tmp = decodedString(url);
slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
delete[] tmp;
- QString producerid = "slowmotion:" + id.section(":", 1, 1) + ":" + QString::number(speed);
+ QString producerid = "slowmotion:" + id.section(':', 1, 1) + ':' + QString::number(speed);
tmp = decodedString(producerid);
slowprod->set("id", tmp);
delete[] tmp;
tmp = decodedString(producerid);
slowprod->set("id", tmp);
delete[] tmp;
QString kfr = params.paramValue("keyframes");
if (!kfr.isEmpty()) {
QString kfr = params.paramValue("keyframes");
if (!kfr.isEmpty()) {
- QStringList keyFrames = kfr.split(";", QString::SkipEmptyParts);
+ QStringList keyFrames = kfr.split(';', QString::SkipEmptyParts);
kDebug() << "// ADDING KEYFRAME EFFECT: " << params.paramValue("keyframes");
char *starttag = decodedString(params.paramValue("starttag", "start"));
char *endtag = decodedString(params.paramValue("endtag", "end"));
kDebug() << "// ADDING KEYFRAME EFFECT: " << params.paramValue("keyframes");
char *starttag = decodedString(params.paramValue("starttag", "start"));
char *endtag = decodedString(params.paramValue("endtag", "end"));
Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, filterTag);
if (filter && filter->is_valid()) {
filter->set("kdenlive_id", filterId);
Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, filterTag);
if (filter && filter->is_valid()) {
filter->set("kdenlive_id", filterId);
- int x1 = keyFrames.at(i).section(":", 0, 0).toInt() + offset;
- double y1 = keyFrames.at(i).section(":", 1, 1).toDouble();
- int x2 = keyFrames.at(i + 1).section(":", 0, 0).toInt();
- double y2 = keyFrames.at(i + 1).section(":", 1, 1).toDouble();
+ int x1 = keyFrames.at(i).section(':', 0, 0).toInt() + offset;
+ double y1 = keyFrames.at(i).section(':', 1, 1).toDouble();
+ int x2 = keyFrames.at(i + 1).section(':', 0, 0).toInt();
+ double y2 = keyFrames.at(i + 1).section(':', 1, 1).toDouble();
if (x2 == -1) x2 = duration;
for (int j = 0; j < params.count(); j++) {
if (x2 == -1) x2 = duration;
for (int j = 0; j < params.count(); j++) {
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
int blankDuration = trackPlaylist.clip_length(i) - 1;
QString blk;
if (trackPlaylist.is_blank(i)) blk = "(blank)";
- kDebug()<<"CLIP "<<i<<": ("<<blankStart<<"x"<<blankStart + blankDuration<<")"<<blk;
+ kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
}*/
if (trackPlaylist.is_blank_at((int) info.startPos.frames(m_fps))) {
}*/
if (trackPlaylist.is_blank_at((int) info.startPos.frames(m_fps))) {
if (resource == type && startTrack == currentTrack && currentIn <= old_pos && currentOut >= old_pos) {
mlt_transition_set_in_and_out(tr, new_in, new_out);
if (newTrack - startTrack != 0) {
if (resource == type && startTrack == currentTrack && currentIn <= old_pos && currentOut >= old_pos) {
mlt_transition_set_in_and_out(tr, new_in, new_out);
if (newTrack - startTrack != 0) {
- kDebug() << "///// TRANSITIONÂ CHANGEÂ TRACK. CUrrent (b): " << currentTrack << "x" << mlt_transition_get_a_track(tr) << ", NEw: " << newTrack << "x" << newTransitionTrack;
+ kDebug() << "///// TRANSITIONÂ CHANGEÂ TRACK. CUrrent (b): " << currentTrack << 'x' << mlt_transition_get_a_track(tr) << ", NEw: " << newTrack << 'x' << newTransitionTrack;
mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr);
mlt_properties_set_int(properties, "a_track", newTransitionTrack);
mlt_properties_set_int(properties, "b_track", newTrack);
mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr);
mlt_properties_set_int(properties, "a_track", newTransitionTrack);
mlt_properties_set_int(properties, "b_track", newTrack);
- //kDebug() << "set new start & end :" << new_in << new_out<< "TR OFFSET: "<<trackOffset<<", TRACKS: "<<mlt_transition_get_a_track(tr)<<"x"<<mlt_transition_get_b_track(tr);
+ //kDebug() << "set new start & end :" << new_in << new_out<< "TR OFFSET: "<<trackOffset<<", TRACKS: "<<mlt_transition_get_a_track(tr)<<'x'<<mlt_transition_get_b_track(tr);
int currentIn = (int) mlt_transition_get_in(tr);
int currentOut = (int) mlt_transition_get_out(tr);
int currentIn = (int) mlt_transition_get_in(tr);
int currentOut = (int) mlt_transition_get_out(tr);
- // kDebug()<<"Looking for transition : " << currentIn <<"x"<<currentOut<< ", OLD oNE: "<<in_pos<<"x"<<out_pos;
+ // kDebug()<<"Looking for transition : " << currentIn <<'x'<<currentOut<< ", OLD oNE: "<<in_pos<<'x'<<out_pos;
if (resource == type && b_track == currentTrack && currentIn == in_pos && currentOut == out_pos) {
QMap<QString, QString> map = mltGetTransitionParamsFromXml(xml);
if (resource == type && b_track == currentTrack && currentIn == in_pos && currentOut == out_pos) {
QMap<QString, QString> map = mltGetTransitionParamsFromXml(xml);
//map[name]=map[name].replace(".",","); //FIXME how to solve locale conversion of . ,
}
//map[name]=map[name].replace(".",","); //FIXME how to solve locale conversion of . ,
}
- if (e.attribute("namedesc").contains(";")) {
+ if (e.attribute("namedesc").contains(';')) {
QString format = e.attribute("format");
QStringList separators = format.split("%d", QString::SkipEmptyParts);
QStringList values = e.attribute("value").split(QRegExp("[,:;x]"));
QString format = e.attribute("format");
QStringList separators = format.split("%d", QString::SkipEmptyParts);
QStringList values = e.attribute("value").split(QRegExp("[,:;x]"));
mlt_properties properties = MLT_SERVICE_PROPERTIES(nextservice);
QString mlt_type = mlt_properties_get(properties, "mlt_type");
QString resource = mlt_properties_get(properties, "mlt_service");
mlt_properties properties = MLT_SERVICE_PROPERTIES(nextservice);
QString mlt_type = mlt_properties_get(properties, "mlt_type");
QString resource = mlt_properties_get(properties, "mlt_service");
- kDebug() << "// resize transpar from: " << oldStart << ", TO: " << newStart << "x" << newEnd << ", " << track << ", " << id;
+ kDebug() << "// resize transpar from: " << oldStart << ", TO: " << newStart << 'x' << newEnd << ", " << track << ", " << id;
while (mlt_type == "transition") {
mlt_transition tr = (mlt_transition) nextservice;
int currentTrack = mlt_transition_get_b_track(tr);
int currentIn = (int) mlt_transition_get_in(tr);
//mlt_properties props = MLT_TRANSITION_PROPERTIES(tr);
int transitionId = QString(mlt_properties_get(properties, "transparency")).toInt();
while (mlt_type == "transition") {
mlt_transition tr = (mlt_transition) nextservice;
int currentTrack = mlt_transition_get_b_track(tr);
int currentIn = (int) mlt_transition_get_in(tr);
//mlt_properties props = MLT_TRANSITION_PROPERTIES(tr);
int transitionId = QString(mlt_properties_get(properties, "transparency")).toInt();
- kDebug() << "// resize transpar current in: " << currentIn << ", Track: " << currentTrack << ", id: " << id << "x" << transitionId ;
+ kDebug() << "// resize transpar current in: " << currentIn << ", Track: " << currentTrack << ", id: " << id << 'x' << transitionId ;
if (resource == "composite" && track == currentTrack && currentIn == oldStart && transitionId == id) {
if (resource == "composite" && track == currentTrack && currentIn == oldStart && transitionId == id) {
- kDebug() << " / / / / /RESIZE TRANS TO: " << newStart << "x" << newEnd;
+ kDebug() << " / / / / /RESIZE TRANS TO: " << newStart << 'x' << newEnd;
mlt_transition_set_in_and_out(tr, newStart, newEnd);
break;
}
mlt_transition_set_in_and_out(tr, newStart, newEnd);
break;
}
int currentOut = (int) mlt_transition_get_out(tr);
//mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr);
int transitionId = QString(mlt_properties_get(properties, "transparency")).toInt();
int currentOut = (int) mlt_transition_get_out(tr);
//mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr);
int transitionId = QString(mlt_properties_get(properties, "transparency")).toInt();
- //kDebug()<<" + TRANSITION "<<id<<" == "<<transitionId<<", START TMIE: "<<currentIn<<", LOOK FR: "<<startTime<<", TRACK: "<<currentTrack<<"x"<<startTrack;
+ //kDebug()<<" + TRANSITION "<<id<<" == "<<transitionId<<", START TMIE: "<<currentIn<<", LOOK FR: "<<startTime<<", TRACK: "<<currentTrack<<'x'<<startTrack;
if (resource == "composite" && transitionId == id && startTime == currentIn && startTrack == currentTrack) {
kDebug() << "//////MOVING";
mlt_transition_set_in_and_out(tr, endTime, endTime + currentOut - currentIn);
if (resource == "composite" && transitionId == id && startTime == currentIn && startTrack == currentTrack) {
kDebug() << "//////MOVING";
mlt_transition_set_in_and_out(tr, endTime, endTime + currentOut - currentIn);
width = m_profile.width;
height = m_profile.height;
}
width = m_profile.width;
height = m_profile.height;
}
- renderArgs.replace("%dar", "@" + QString::number(m_profile.display_aspect_num) + "/" + QString::number(m_profile.display_aspect_den));
+ renderArgs.replace("%dar", '@' + QString::number(m_profile.display_aspect_num) + '/' + QString::number(m_profile.display_aspect_den));
// Adjust scanning
if (m_view.scanning_list->currentIndex() == 1) renderArgs.append(" progressive=1");
// Adjust scanning
if (m_view.scanning_list->currentIndex() == 1) renderArgs.append(" progressive=1");
// We should parse customprofiles.xml in last position, so that user profiles
// can also override profiles installed by KNewStuff
fileList.removeAll("customprofiles.xml");
// We should parse customprofiles.xml in last position, so that user profiles
// can also override profiles installed by KNewStuff
fileList.removeAll("customprofiles.xml");
- foreach(const QString filename, fileList)
- parseFile(exportFolder + '/' + filename, true);
+ foreach(const QString &filename, fileList)
+ parseFile(exportFolder + '/' + filename, true);
if (QFile::exists(exportFolder + "/customprofiles.xml")) parseFile(exportFolder + "/customprofiles.xml", true);
if (!meta.isEmpty()) {
if (QFile::exists(exportFolder + "/customprofiles.xml")) parseFile(exportFolder + "/customprofiles.xml", true);
if (!meta.isEmpty()) {
void RenderWidget::slotGenerateScript() {
slotExport(true);
void RenderWidget::slotGenerateScript() {
slotExport(true);
-}
\ No newline at end of file
// Number of actual frames in a 10 minute interval :
int tenMinutes = (normalMinuteFrames * 9) + tenthMinuteFrames;
// Number of actual frames in a 10 minute interval :
int tenMinutes = (normalMinuteFrames * 9) + tenthMinuteFrames;
- frames = 6 * duration.section(":", 0, 0).toInt() * tenMinutes;
- int minutes = duration.section(":", 1, 1).toInt();
+ frames = 6 * duration.section(':', 0, 0).toInt() * tenMinutes;
+ int minutes = duration.section(':', 1, 1).toInt();
frames += ((int) minutes / 10) * tenMinutes;
int mins = minutes % 10;
if (mins > 0) {
frames += ((int) minutes / 10) * tenMinutes;
int mins = minutes % 10;
if (mins > 0) {
if (mins > 0) frames += mins * normalMinuteFrames;
}
if (minutes % 10 > 0) frames -= perMinute;
if (mins > 0) frames += mins * normalMinuteFrames;
}
if (minutes % 10 > 0) frames -= perMinute;
- frames += duration.section(":", 2, 2).toInt() * m_displayedFramesPerSecond + duration.section(":", 3, 3).toInt();
+ frames += duration.section(':', 2, 2).toInt() * m_displayedFramesPerSecond + duration.section(':', 3, 3).toInt();
- return (int)((duration.section(":", 0, 0).toInt()*3600.0 + duration.section(":", 1, 1).toInt()*60.0 + duration.section(":", 2, 2).toInt()) * fps + duration.section(":", 3, 3).toInt());
+ return (int)((duration.section(':', 0, 0).toInt()*3600.0 + duration.section(':', 1, 1).toInt()*60.0 + duration.section(':', 2, 2).toInt()) * fps + duration.section(':', 3, 3).toInt());
}
QString Timecode::getTimecode(const GenTime & time, double fps) const {
}
QString Timecode::getTimecode(const GenTime & time, double fps) const {
bool trim = false;
if (hours != 0) {
bool trim = false;
if (hours != 0) {
- text.append(QString::number(hours).rightJustified(2, '0', FALSE));
- text.append(" " + i18n("hour") + " ");
+ text.append(QString::number(hours).rightJustified(2, '0', false));
+ text.append(' ' + i18n("hour") + ' ');
trim = true;
}
if (minutes != 0 || trim) {
if (!trim) {
text.append(QString::number(minutes));
} else
trim = true;
}
if (minutes != 0 || trim) {
if (!trim) {
text.append(QString::number(minutes));
} else
- text.append(QString::number(minutes).rightJustified(2, '0', FALSE));
- text.append(" " + i18n("min.") + " ");
+ text.append(QString::number(minutes).rightJustified(2, '0', false));
+ text.append(' ' + i18n("min.") + ' ');
trim = true;
}
if (seconds != 0 || trim) {
if (!trim) {
text.append(QString::number(seconds));
} else
trim = true;
}
if (seconds != 0 || trim) {
if (!trim) {
text.append(QString::number(seconds));
} else
- text.append(QString::number(seconds).rightJustified(2, '0', FALSE));
- text.append(" " + i18n("sec."));
+ text.append(QString::number(seconds).rightJustified(2, '0', false));
+ text.append(' ' + i18n("sec."));
trim = true;
}
if (!trim) {
text.append(QString::number(frames));
trim = true;
}
if (!trim) {
text.append(QString::number(frames));
- text.append(" " + i18n("frames"));
+ text.append(' ' + i18n("frames"));
- text.append(QString::number(hours).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(minutes).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(seconds).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(frames).rightJustified(2, '0', FALSE));
+ text.append(QString::number(hours).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(minutes).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(seconds).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(frames).rightJustified(2, '0', false));
- text.append(QString::number(hours).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(minutes).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(seconds).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(hundredths).rightJustified(2, '0', FALSE));
+ text.append(QString::number(hours).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(minutes).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(seconds).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(hundredths).rightJustified(2, '0', false));
// THANK FUCK FOR THAT.
QString text;
// THANK FUCK FOR THAT.
QString text;
- text.append(QString::number(hours).rightJustified(2, '0', FALSE));
- text.append(":");
+ text.append(QString::number(hours).rightJustified(2, '0', false));
+ text.append(':');
text.append(QString::number(tenMinuteIntervals));
text.append(QString::number(numMinutes));
text.append(QString::number(tenMinuteIntervals));
text.append(QString::number(numMinutes));
- text.append(":");
- text.append(QString::number(seconds).rightJustified(2, '0', FALSE));
- text.append(":");
- text.append(QString::number(frames).rightJustified(2, '0', FALSE));
+ text.append(':');
+ text.append(QString::number(seconds).rightJustified(2, '0', false));
+ text.append(':');
+ text.append(QString::number(frames).rightJustified(2, '0', false));
QRectF TitleDocument::stringToRect(const QString & s) {
QRectF TitleDocument::stringToRect(const QString & s) {
- QStringList l = s.split(",");
+ QStringList l = s.split(',');
if (l.size() < 4)
return QRectF();
return QRectF(l[0].toDouble(), l[1].toDouble(), l[2].toDouble(), l[3].toDouble());
}
QColor TitleDocument::stringToColor(const QString & s) {
if (l.size() < 4)
return QRectF();
return QRectF(l[0].toDouble(), l[1].toDouble(), l[2].toDouble(), l[3].toDouble());
}
QColor TitleDocument::stringToColor(const QString & s) {
- QStringList l = s.split(",");
+ QStringList l = s.split(',');
if (l.size() < 4)
return QColor();
return QColor(l[0].toInt(), l[1].toInt(), l[2].toInt(), l[3].toInt());;
}
QTransform TitleDocument::stringToTransform(const QString& s) {
if (l.size() < 4)
return QColor();
return QColor(l[0].toInt(), l[1].toInt(), l[2].toInt(), l[3].toInt());;
}
QTransform TitleDocument::stringToTransform(const QString& s) {
- QStringList l = s.split(",");
+ QStringList l = s.split(',');
if (l.size() < 9)
return QTransform();
return QTransform(
if (l.size() < 9)
return QTransform();
return QTransform(
void TitleWidget::slotUpdateZoom(int pos) {
m_scene->setZoom((double) pos / 100);
void TitleWidget::slotUpdateZoom(int pos) {
m_scene->setZoom((double) pos / 100);
- zoom_label->setText(QString::number(pos) + "%");
+ zoom_label->setText(QString::number(pos) + '%');
}
void TitleWidget::slotZoom(bool up) {
}
void TitleWidget::slotZoom(bool up) {
QString id = idString;
double speed = 1.0;
if (idString.startsWith("slowmotion")) {
QString id = idString;
double speed = 1.0;
if (idString.startsWith("slowmotion")) {
- id = idString.section(":", 1, 1);
- speed = idString.section(":", 2, 2).toDouble();
+ id = idString.section(':', 1, 1);
+ speed = idString.section(':', 2, 2).toDouble();
} else id = id.section('_', 0, 0);
DocClipBase *clip = m_doc->clipManager()->getClipById(id);
if (clip != NULL) {
} else id = id.section('_', 0, 0);
DocClipBase *clip = m_doc->clipManager()->getClipById(id);
if (clip != NULL) {
endvalue = effectparam.text().toDouble() * factor;
}
// add first keyframe
endvalue = effectparam.text().toDouble() * factor;
}
// add first keyframe
- keyframes.append(QString::number(effectin) + ":" + QString::number(startvalue) + ";" + QString::number(effectout) + ":" + QString::number(endvalue) + ";");
+ keyframes.append(QString::number(effectin) + ':' + QString::number(startvalue) + ';' + QString::number(effectout) + ':' + QString::number(endvalue) + ';');
QDomNode lastParsedEffect;
ix++;
QDomNode n2 = effects.at(ix);
QDomNode lastParsedEffect;
ix++;
QDomNode n2 = effects.at(ix);
}
}
if (continueParsing) {
}
}
if (continueParsing) {
- keyframes.append(QString::number(effectout) + ":" + QString::number(endvalue) + ";");
+ keyframes.append(QString::number(effectout) + ':' + QString::number(endvalue) + ';');
//painter->drawPixmap(painter->matrix().map(p1) + QPointF(5, 0), transitionPixmap());
QString text = transitionName();
if (m_forceTransitionTrack) text.append("|>");
//painter->drawPixmap(painter->matrix().map(p1) + QPointF(5, 0), transitionPixmap());
QString text = transitionName();
if (m_forceTransitionTrack) text.append("|>");
- QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignHCenter | Qt::AlignVCenter, " " + text + " ");
+ QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignHCenter | Qt::AlignVCenter, ' ' + text + ' ');
painter->fillRect(txtBounding, QBrush(QColor(50, 50, 0, 150)));
txtBounding.translate(QPointF(1, 1));
painter->setPen(QColor(255, 255, 255, 255));
painter->fillRect(txtBounding, QBrush(QColor(50, 50, 0, 150)));
txtBounding.translate(QPointF(1, 1));
painter->setPen(QColor(255, 255, 255, 255));
} else {
checkProcess.waitForFinished();
QString mltVersion = checkProcess.readAllStandardError();
} else {
checkProcess.waitForFinished();
QString mltVersion = checkProcess.readAllStandardError();
- mltVersion = mltVersion.section("\n", 0, 0).simplified();
+ mltVersion = mltVersion.section('\n', 0, 0).simplified();
mltVersion = mltVersion.section(' ', -1).simplified();
version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
kDebug() << "// FOUND MLT version: " << version;
mltVersion = mltVersion.section(' ', -1).simplified();
version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
kDebug() << "// FOUND MLT version: " << version;
QByteArray codecList = checkProcess2.readAllStandardError();
QString acodecList(codecList);
QStringList result;
QByteArray codecList = checkProcess2.readAllStandardError();
QString acodecList(codecList);
QStringList result;
- QStringList alist = acodecList.split("\n", QString::SkipEmptyParts);
+ QStringList alist = acodecList.split('\n', QString::SkipEmptyParts);
for (int i = 0; i < alist.count(); i++) {
if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower());
}
for (int i = 0; i < alist.count(); i++) {
if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower());
}
QByteArray codecList = checkProcess2.readAllStandardError();
QString vcodecList(codecList);
QStringList result;
QByteArray codecList = checkProcess2.readAllStandardError();
QString vcodecList(codecList);
QStringList result;
- QStringList vlist = vcodecList.split("\n", QString::SkipEmptyParts);
+ QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
for (int i = 0; i < vlist.count(); i++) {
if (vlist.at(i).contains("- ")) result.append(vlist.at(i).section("- ", 1).simplified().toLower());
}
for (int i = 0; i < vlist.count(); i++) {
if (vlist.at(i).contains("- ")) result.append(vlist.at(i).section("- ", 1).simplified().toLower());
}
QByteArray codecList = checkProcess2.readAllStandardError();
QString vcodecList(codecList);
QStringList result;
QByteArray codecList = checkProcess2.readAllStandardError();
QString vcodecList(codecList);
QStringList result;
- QStringList vlist = vcodecList.split("\n", QString::SkipEmptyParts);
+ QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
for (int i = 0; i < vlist.count(); i++) {
if (vlist.at(i).contains("- ")) {
QString format = vlist.at(i).section("- ", 1).simplified().toLower();
for (int i = 0; i < vlist.count(); i++) {
if (vlist.at(i).contains("- ")) {
QString format = vlist.at(i).section("- ", 1).simplified().toLower();
QProcess checkProcess2;
checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer");
if (!checkProcess2.waitForStarted())
QProcess checkProcess2;
checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer");
if (!checkProcess2.waitForStarted())
- errorMessage.append(i18n("Error starting MLT's command line player (inigo).") + "\n");
+ errorMessage.append(i18n("Error starting MLT's command line player (inigo).") + '\n');
checkProcess2.waitForFinished();
QByteArray result = checkProcess2.readAllStandardError();
checkProcess2.waitForFinished();
QByteArray result = checkProcess2.readAllStandardError();
- if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + "\n");
+ if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + '\n');
if (!errorMessage.isEmpty()) {
errorMessage.prepend(QString("<b>%1</b><br>").arg(i18n("Fatal Error")));
if (!errorMessage.isEmpty()) {
errorMessage.prepend(QString("<b>%1</b><br>").arg(i18n("Fatal Error")));