Logo Search packages:      
Sourcecode: kdenlive version File versions

bool TrackPanelClipMoveFunction::mouseMoved ( Gui::KTrackPanel panel,
QMouseEvent *  event 
) [virtual]

Processes Mouse Move events in the track view area. Returns true if we are continuing with the drag.

Implements TrackPanelFunction.

Definition at line 140 of file trackpanelclipmovefunction.cpp.

References Gui::KdenliveApp::addCommand(), DocClipProject::clipSelected(), Gui::KTrackPanel::documentTrackIndex(), KdenliveDoc::framesPerSecond(), Gui::KTrackPanel::hasDocumentTrackIndex(), initiateDrag(), Gui::KTimeLine::mapLocalToValue(), KdenliveDoc::projectClip(), and KdenliveDoc::track().

{
    bool result = false;
    if (panel->hasDocumentTrackIndex()) {
      DocTrackBase *track =
          m_document->track(panel->documentTrackIndex());
      if (track) {
            GenTime mouseTime((int)(m_timeline->mapLocalToValue(event->x())),
            m_document->framesPerSecond());

          if (m_dragging) {
            m_dragging = false;
            result = true;
          } else {
            if (m_clipUnderMouse) {
                if (!m_document->projectClip().clipSelected(m_clipUnderMouse)) {
                  if ((event->state() & Qt::ControlButton)
                      || (event->state() & Qt::ShiftButton)) {
                      m_app->
                        addCommand(Command::KSelectClipCommand::
                        selectClipAt(m_document, *track,
                            mouseTime), true);
                  } else {
                      KMacroCommand *macroCommand = new KMacroCommand(i18n("Select Clip"));
                      macroCommand->addCommand(Command::KSelectClipCommand::selectNone(m_document));
                      macroCommand->addCommand(new Command::KSelectClipCommand(m_document, m_clipUnderMouse, true));
                      m_app->addCommand(macroCommand, true);
                  }
                }
                m_dragging = true;
                initiateDrag(m_clipUnderMouse, mouseTime);
                result = true;
            }
          }
      }
    }

    return result;
}


Generated by  Doxygen 1.6.0   Back to index