blockSignals(true);
m_endThumbTimer.stop();
m_startThumbTimer.stop();
- if (scene()) scene()->removeItem(this);
+ if (scene())
+ scene()->removeItem(this);
if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW || m_clipType == PLAYLIST) {
//disconnect(m_clip->thumbProducer(), SIGNAL(thumbReady(int,QImage)), this, SLOT(slotThumbReady(int,QImage)));
//disconnect(m_clip, SIGNAL(gotAudioData()), this, SLOT(slotGotAudioData()));
delete m_timeLine;
}
-ClipItem *ClipItem::clone(ItemInfo info) const
+ClipItem *ClipItem::clone(const ItemInfo &info) const
{
ClipItem *duplicate = new ClipItem(m_clip, info, m_fps, m_speed, m_strobe, FRAME_SIZE);
if (m_clipType == IMAGE || m_clipType == TEXT) duplicate->slotSetStartThumb(m_startPix);
return duplicate;
}
-void ClipItem::setEffectList(const EffectsList effectList)
+void ClipItem::setEffectList(const EffectsList &effectList)
{
m_effectList.clone(effectList);
m_effectNames = m_effectList.effectNames().join(" / ");
if (!m_effectList.isEmpty()) {
- for (int i = 0; i < m_effectList.count(); i++) {
+ for (int i = 0; i < m_effectList.count(); ++i) {
QDomElement effect = m_effectList.at(i);
QString effectId = effect.attribute("id");
// check if it is a fade effect
// Init parameter value & keyframes if required
QDomNodeList params = effect.elementsByTagName("parameter");
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (e.isNull())
}
}
-const QString ClipItem::adjustKeyframes(QString keyframes, int offset)
+const QString ClipItem::adjustKeyframes(const QString &keyframes, int offset)
{
QStringList result;
// Simple keyframes
const QStringList list = keyframes.split(';', QString::SkipEmptyParts);
foreach(const QString &keyframe, list) {
- int pos = keyframe.section(':', 0, 0).toInt() - offset;
- QString newKey = QString::number(pos) + ":" + keyframe.section(':', 1);
- result.append(newKey);
+ int pos = keyframe.section(':', 0, 0).toInt() - offset;
+ QString newKey = QString::number(pos) + ":" + keyframe.section(':', 1);
+ result.append(newKey);
}
return result.join(";");
}
return clipEffectsModified;
}
-void ClipItem::setKeyframes(const int ix, const QStringList keyframes)
+void ClipItem::setKeyframes(const int ix, const QStringList &keyframes)
{
QDomElement effect = m_effectList.at(ix);
if (effect.attribute("disable") == "1") return;
QLocale locale;
QDomNodeList params = effect.elementsByTagName("parameter");
int keyframeParams = 0;
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && (!e.hasAttribute("intimeline") || e.attribute("intimeline") == "1")) {
e.setAttribute("keyframes", keyframes.at(keyframeParams));
QDomElement effect = effectAtIndex(m_selectedEffect);
if (!effect.isNull() && effect.attribute("disable") != "1") {
QDomNodeList params = effect.elementsByTagName("parameter");
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && (!e.hasAttribute("intimeline") || e.attribute("intimeline") == "1")) {
m_keyframes.clear();
QDomElement effect = m_effectList.at(index);
QDomNodeList params = effect.elementsByTagName("parameter");
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && e.attribute("type") == "geometry") {
geom = e.attribute("value");
QDomElement effect = m_effectList.at(index);
QDomNodeList params = effect.elementsByTagName("parameter");
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe"))
result.append(e.attribute("keyframes"));
}
-void ClipItem::slotSetStartThumb(QImage img)
+void ClipItem::slotSetStartThumb(const QImage &img)
{
if (!img.isNull() && img.format() == QImage::Format_ARGB32) {
QPixmap pix = QPixmap::fromImage(img);
}
}
-void ClipItem::slotSetEndThumb(QImage img)
+void ClipItem::slotSetEndThumb(const QImage &img)
{
if (!img.isNull() && img.format() == QImage::Format_ARGB32) {
QPixmap pix = QPixmap::fromImage(img);
}
}
-void ClipItem::slotThumbReady(int frame, QImage img)
+void ClipItem::slotThumbReady(int frame, const QImage &img)
{
if (scene() == NULL) return;
QRectF r = boundingRect();
}
}
-void ClipItem::slotSetStartThumb(const QPixmap pix)
+void ClipItem::slotSetStartThumb(const QPixmap &pix)
{
m_startPix = pix;
}
-void ClipItem::slotSetEndThumb(const QPixmap pix)
+void ClipItem::slotSetEndThumb(const QPixmap &pix)
{
m_endPix = pix;
}
QPointF startPos = mapped.topLeft();
int startOffset = m_info.cropStart.frames(m_fps);
if (clipType() == IMAGE || clipType() == TEXT) {
- for (int i = left; i <= right; i++) {
+ for (int i = left; i <= right; ++i) {
painter->drawPixmap(startPos + QPointF(FRAME_SIZE *(i - startOffset), 0), m_startPix);
}
}
QPen pen(Qt::white);
pen.setStyle(Qt::DotLine);
QList <int> missing;
- for (int i = left; i <= right; i++) {
+ for (int i = left; i <= right; ++i) {
img = m_clip->thumbProducer()->findCachedThumb(path + QString::number(i));
QPointF xpos = startPos + QPointF(FRAME_SIZE *(i - startOffset), 0);
if (img.isNull()) missing << i;
}
if (m_isMainSelectedClip) {
- framePen.setColor(Qt::red);
- textBgColor = Qt::red;
+ framePen.setColor(Qt::red);
+ textBgColor = Qt::red;
}
// only paint details if clip is big enough
}
-OPERATIONTYPE ClipItem::operationMode(QPointF pos)
+OPERATIONTYPE ClipItem::operationMode(const QPointF &pos)
{
if (isItemLocked()) return NONE;
const double scale = projectScene()->scale().x();
if (parentItem()) {
QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
QList<QGraphicsItem *> list = dragGroup->childItems();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == AVWIDGET) {
ClipItem *c = static_cast <ClipItem*>(list.at(i));
if (c->startPos() != startPos()) return MOVE;
if (parentItem()) {
QGraphicsItemGroup *dragGroup = static_cast <QGraphicsItemGroup *>(parentItem());
QList<QGraphicsItem *> list = dragGroup->childItems();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == AVWIDGET) {
ClipItem *c = static_cast <ClipItem*>(list.at(i));
if (c->endPos() != endPos()) return MOVE;
QList < GenTime > markers = m_clip->snapMarkers();
GenTime pos;
- for (int i = 0; i < markers.size(); i++) {
+ for (int i = 0; i < markers.size(); ++i) {
pos = GenTime((int)(markers.at(i).frames(m_fps) / qAbs(m_speed) + 0.5), m_fps) - cropStart();
if (pos > GenTime()) {
if (pos > cropDuration()) break;
QList < CommentedTime > markers = m_clip->commentedSnapMarkers();
GenTime pos;
- for (int i = 0; i < markers.size(); i++) {
+ for (int i = 0; i < markers.size(); ++i) {
pos = GenTime((int)(markers.at(i).time().frames(m_fps) / qAbs(m_speed) + 0.5), m_fps) - cropStart();
if (pos > GenTime()) {
if (pos > cropDuration()) break;
QPainter pixpainter(&m_audioThumbCachePic[startCache]);
- for (int i = 0; i < channels; i++) {
+ for (int i = 0; i < channels; ++i) {
if (simplifiedAudio) {
positiveChannelPaths[i].moveTo(-1, channelHeight);
}
pixpainter.setBrush(Qt::NoBrush);
}
pixpainter.setRenderHint(QPainter::Antialiasing, false);
- for (int i = 0; i < channels; i++) {
+ for (int i = 0; i < channels; ++i) {
if (fullAreaDraw) {
pixpainter.drawPath(positiveChannelPaths[i].united(negativeChannelPaths.value(i)));
} else
bool forwardMove = newPos.x() > pos().x();
int offset = 0;
if (!items.isEmpty()) {
- for (int i = 0; i < items.count(); i++) {
+ for (int i = 0; i < items.count(); ++i) {
if (!items.at(i)->isEnabled()) continue;
if (items.at(i)->type() == type()) {
// Collision!
}*/
}
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull()) {
if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
int ClipItem::nextFreeEffectGroupIndex() const
{
int freeGroupIndex = 0;
- for (int i = 0; i < m_effectList.count(); i++) {
+ for (int i = 0; i < m_effectList.count(); ++i) {
QDomElement effect = m_effectList.at(i);
EffectInfo effectInfo;
effectInfo.fromString(effect.attribute("kdenlive_info"));
QDomNodeList effectlist = e.elementsByTagName("effect");
int freeGroupIndex = nextFreeEffectGroupIndex();
EffectInfo effectInfo;
- for (int i = 0; i < effectlist.count(); i++) {
+ for (int i = 0; i < effectlist.count(); ++i) {
QDomElement effect = effectlist.at(i).toElement();
effectInfo.fromString(effect.attribute("kdenlive_info"));
effectInfo.groupIndex = freeGroupIndex;
effect.setAttribute("active_keyframe", pos);
m_editedKeyframe = pos;
QDomNodeList params = effect.elementsByTagName("parameter");
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
QString kfr = e.attribute("keyframes");
QDomNodeList params = effect.elementsByTagName("parameter");
int start = cropStart().frames(m_fps);
int end = (cropStart() + cropDuration()).frames(m_fps) - 1;
- for (int i = 0; i < params.count(); i++) {
+ for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
QString kfr = e.attribute("keyframes");
QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height, ItemInfo oldInfo)
{
QMap<int, QDomElement> effects;
- for (int i = 0; i < m_effectList.count(); i++) {
+ for (int i = 0; i < m_effectList.count(); ++i) {
QDomElement effect = m_effectList.at(i);
if (effect.attribute("id").startsWith("fade")) {