From 8e89e7f20a052ef81ef0d71afaeae656fb1bf047 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sat, 1 Jun 2013 16:13:06 +0200 Subject: [PATCH] const'ref --- src/renderer.cpp | 20 +++++++++++--------- src/renderer.h | 10 +++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/renderer.cpp b/src/renderer.cpp index 08a011f6..041f82ab 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -3037,7 +3037,7 @@ bool Render::mltEditTrackEffect(int track, EffectsParameterList params) 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"); @@ -3117,7 +3117,8 @@ bool Render::mltEditEffect(int track, GenTime position, EffectsParameterList par delete clip; service.unlock(); - if (doRefresh) refresh(); + if (doRefresh) + refresh(); return true; } if (params.hasParam("_sync_in_out")) { @@ -3126,22 +3127,23 @@ bool Render::mltEditEffect(int track, GenTime position, EffectsParameterList par 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 effectIndexes, bool disable) +bool Render::mltEnableEffects(int track, const GenTime &position, const QList &effectIndexes, bool disable) { if (position < GenTime()) { return mltEnableTrackEffects(track, effectIndexes, disable); @@ -3183,7 +3185,7 @@ bool Render::mltEnableEffects(int track, GenTime position, QList effectInd return true; } -bool Render::mltEnableTrackEffects(int track, QList effectIndexes, bool disable) +bool Render::mltEnableTrackEffects(int track, const QList &effectIndexes, bool disable) { Mlt::Service service(m_mltProducer->parent().get_service()); Mlt::Tractor tractor(service); @@ -3206,7 +3208,7 @@ bool Render::mltEnableTrackEffects(int track, QList effectIndexes, bool di 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); @@ -3240,7 +3242,7 @@ void Render::mltUpdateEffectPosition(int track, GenTime position, int oldPos, in 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); diff --git a/src/renderer.h b/src/renderer.h index 0c6c46fa..6656a17b 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -250,25 +250,25 @@ class Render: public AbstractRender * @param position The start position of the clip * @param effectIndexes The list of effect indexes to enable / disable * @param disable True if effects should be disabled, false otherwise */ - bool mltEnableEffects(int track, GenTime position, QList effectIndexes, bool disable); + bool mltEnableEffects(int track, const GenTime &position, const QList &effectIndexes, bool disable); /** @brief Enable / disable track effects. * @param track The track where the effect is * @param effectIndexes The list of effect indexes to enable / disable * @param disable True if effects should be disabled, false otherwise */ - bool mltEnableTrackEffects(int track, QList effectIndexes, bool disable); + bool mltEnableTrackEffects(int track, const QList &effectIndexes, bool disable); /** @brief Edits an effect parameters in MLT's playlist. */ - bool mltEditEffect(int track, GenTime position, EffectsParameterList params); + bool mltEditEffect(int track, const GenTime &position, EffectsParameterList params); bool mltEditTrackEffect(int track, EffectsParameterList params); /** @brief Updates the "kdenlive_ix" (index) value of an effect. */ - void mltUpdateEffectPosition(int track, GenTime position, int oldPos, int newPos); + void mltUpdateEffectPosition(int track, const GenTime &position, int oldPos, int newPos); /** @brief Changes the order of effects in MLT's playlist. * * It switches effects from oldPos and newPos, updating the "kdenlive_ix" * (index) value. */ - void mltMoveEffect(int track, GenTime position, int oldPos, int newPos); + void mltMoveEffect(int track, const GenTime &position, int oldPos, int newPos); void mltMoveTrackEffect(int track, int oldPos, int newPos); /** @brief Enables/disables audio/video in a track. */ -- 2.39.2