Logo Search packages:      
Sourcecode: kdenlive version File versions

void DocTrackBase::addEffectToClip ( const GenTime position,
int  effectIndex,
Effect effect 
) [inherited]

Add a new effect to a clip on the track, and emit a signal.

Definition at line 801 of file doctrackbase.cpp.

References Effect::addKeyFrame(), Effect::effectDescription(), DocTrackBase::effectStackChanged(), DocTrackBase::getClipAt(), Effect::parameter(), DocTrackBase::redrawSection(), and GenTime::seconds().

Referenced by Command::KAddEffectCommand::addEffect().

{
    DocClipRef *clip = getClipAt(position);
    if (clip) {
      // If a new effect is inserted, create default keyframes at end and beginning
      if (effect->parameter(0) != NULL
          && (effect->effectDescription().parameter(0)->type() ==
            "double"
            || effect->effectDescription().parameter(0)->type() ==
            "complex") && effect->parameter(0)->numKeyFrames() == 0) {
          effect->addKeyFrame(0, 0.0);
          effect->addKeyFrame(0, 1.0);
      }

      clip->addEffect(effectIndex, effect);
      emit effectStackChanged(clip);
      emit redrawSection(clip->trackNum(), clip->trackStart(), clip->trackEnd());
    } else {
      kdError() <<
          "DocTrackBase::addEffectToClip() - cannot find clip at position "
          << position.seconds() << endl;
    }
}


Generated by  Doxygen 1.6.0   Back to index