From 0e31c05683b6930bcc40eec89de447e70e3a3be7 Mon Sep 17 00:00:00 2001 From: Till Theato Date: Sun, 23 May 2010 08:29:19 +0000 Subject: [PATCH] cleanup svn path=/trunk/kdenlive/; revision=4477 --- src/clipitem.cpp | 13 ++++------- src/clipitem.h | 60 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/clipitem.cpp b/src/clipitem.cpp index ed2ae836..339f709c 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -504,11 +504,10 @@ void ClipItem::refreshClip(bool checkDuration) if (m_info.cropStart > m_maxDuration) { m_info.cropStart = GenTime(); m_info.cropDuration = qMin(m_info.cropDuration, m_maxDuration); - updateRectGeometry(); } else { m_info.cropDuration = m_maxDuration; - updateRectGeometry(); } + updateRectGeometry(); } } } @@ -646,12 +645,7 @@ DocClipBase *ClipItem::baseClip() const QDomElement ClipItem::xml() const { - QDomElement xml = m_clip->toXML(); - if (m_speed != 1.0) xml.setAttribute("speed", m_speed); - if (m_strobe > 1) xml.setAttribute("strobe", m_strobe); - if (m_audioOnly) xml.setAttribute("audio_only", 1); - else if (m_videoOnly) xml.setAttribute("video_only", 1); - return xml; + itemXml(); } QDomElement ClipItem::itemXml() const @@ -977,7 +971,6 @@ QList ClipItem::snapMarkers() const GenTime pos; 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; @@ -1223,10 +1216,12 @@ bool ClipItem::checkEffectsKeyframesPos(const int previous, const int current, b pos = str.section(':', 0, 0).toInt(); val = str.section(':', 1, 1).toDouble(); if (pos == previous) { + // first or last keyframe kfr[current] = val; modified = true; } else { if ((fromStart && pos >= current) || (!fromStart && pos <= current)) { + // only keyframes in range kfr[pos] = val; modified = true; } diff --git a/src/clipitem.h b/src/clipitem.h index 9ccc98f0..6ef64c16 100644 --- a/src/clipitem.h +++ b/src/clipitem.h @@ -63,36 +63,61 @@ public: void setFadeOut(int pos); void setFadeIn(int pos); void setFades(int in, int out); - /** Give a string list of the clip's effect names */ + + /** @brief Gets the clip's effect names. + * @return The names of the effects in a string list */ QStringList effectNames(); - /** Add an effect to the clip and return the parameters that will be passed to Mlt */ + + /** @brief Adds an effect to the clip. + * @return The parameters that will be passed to Mlt */ EffectsParameterList addEffect(const QDomElement effect, bool animate = true); - /** Get the effect parameters that will be passed to Mlt */ + + /** @brief Gets the effect parameters that will be passed to Mlt. */ EffectsParameterList getEffectArgs(QDomElement effect); - /** Delete effect with id index */ + + /** @brief Deletes the effect with id @param index. */ void deleteEffect(QString index); - /** return the number of effects in that clip */ + + /** @brief Gets the number of effects in this clip. */ int effectsCount(); - /** return a unique effect id */ + + /** @brief Gets a unique (?) effect id. */ int effectsCounter(); - /** return a copy of the xml of effect at index ix in stack */ + + /** @brief Gets a copy of the xml of an effect. + * @param ix The effect's index in effectlist + * @return A copy of the effect's xml */ QDomElement effectAt(int ix) const; - /** return the xml of effect at index ix in stack */ + + /** @brief Gets the xml of an effect. + * @param ix The effect's index in effectlist + * @return The effect's xml */ QDomElement getEffectAt(int ix) const; - /** Replace effect at pos ix with given value */ + + /** @brief Replaces an effect. + * @param ix The effect's index in effectlist + * @param effect The new effect */ void setEffectAt(int ix, QDomElement effect); void flashClip(); void addTransition(Transition*); - /** regenerate audio and video thumbnails */ + + /** @brief Regenerates audio and video thumbnails. + * @param clearExistingThumbs true = regenerate all thumbs, false = only create missing thumbs. */ void resetThumbs(bool clearExistingThumbs); - /** update clip properties from base clip */ + + /** @brief Updates clip properties from base clip. + * @param checkDuration whether or not to check for a valid duration. */ void refreshClip(bool checkDuration); - /** Returns a list of times for this clip's markers */ + + /** @brief Gets clip's marker times. + * @return A list of the times. */ QList snapMarkers() const; QList commentedSnapMarkers() const; - /** Get the position of the fade in effect */ + + /** @brief Gets the position of the fade in effect. */ int fadeIn() const; - /** Get the position of the fade out effect */ + + /** @brief Gets the position of the fade out effect. */ int fadeOut() const; void setSelectedEffect(const int ix); void updateKeyframeEffect(); @@ -117,7 +142,12 @@ public: void setAudioOnly(bool force); bool isVideoOnly() const; bool isAudioOnly() const; - /** Called when clip start is resized, adjust keyframes values */ + + /** @brief Adjusts the keyframe values to fit a clip resizement. + * @param previous Old crop value + * @param current New crop value + * @param fromStart true = crop from start, false = crop from end + * @return true if anything was modified */ bool checkEffectsKeyframesPos(const int previous, const int current, bool fromStart); void insertKeyframe(QDomElement effect, int pos, int val); void movedKeyframe(QDomElement effect, int oldpos, int newpos, double value); -- 2.39.2