Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KdenliveApp::slotAddTransition ( int  ix = 0  )  [private, slot]

Add a transition between the 2 selected clips

Definition at line 4291 of file kdenlive.cpp.

References addCommand(), Command::KAddTransitionCommand::appendTransition(), DocClipProject::getClipAt(), getDocument(), KdenliveDoc::indirectlyModified(), KdenliveDoc::projectClip(), DocClipProject::selectedClip(), Gui::KTimeLine::timeUnderMouse(), and Gui::KTimeLine::trackView().

Referenced by KdenliveApp().

                                              {
        if (getDocument()->projectClip().hasSelectedClips() == 0) {
            KMessageBox::sorry(this, i18n("Please select a clip to apply transition"));
            return;
        }
      QString transitionName = transitionsMenu->text(ix);
        GenTime mouseTime;
      QPoint position = mousePosition();
        mouseTime = m_timeline->timeUnderMouse(m_timeline->trackView()->mapFromGlobal(position).x());
      int b_track = getDocument()->projectClip().selectedClip()->trackNum() + 1;
      DocClipRef *b_clip = getDocument()->projectClip().getClipAt(b_track, mouseTime);
      if (b_clip)
          addCommand(Command::KAddTransitionCommand::appendTransition(getDocument(), getDocument()->projectClip().selectedClip(), b_clip, transitionName), true);
      else addCommand(Command::KAddTransitionCommand::appendTransition(getDocument(), getDocument()->projectClip().selectedClip(), mouseTime, transitionName), true);
      getDocument()->indirectlyModified();
    }


Generated by  Doxygen 1.6.0   Back to index