Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KdenliveApp::initView (  )  [protected]

creates the centerwidget of the KTMainWindow instance and sets it as the view

Definition at line 1379 of file kdenlive.cpp.

References activateWorkspaceMonitor(), Gui::KTrackView::clearFunctions(), Gui::MonitorManager::createCaptureMonitor(), Gui::MonitorManager::createMonitor(), Gui::MonitorManager::deleteMonitors(), effectList(), getDocument(), m_doc, m_monitorManager, m_projectList, Gui::KTrackView::registerFunction(), renderManager(), Gui::KTrackView::setDragFunction(), Gui::KTimeLine::setEditMode(), KdenliveDoc::setModified(), Gui::KTrackView::setReady(), Gui::KTimeLine::setSnapToBorder(), Gui::KTimeLine::setSnapToFrame(), Gui::KTimeLine::setSnapToMarker(), slot_insertClips(), slotDisplayTimeLineContextMenu(), slotLookAtClip(), slotSetClipMonitorSource(), slotSetClipMonitorSourceAndSeek(), Gui::KTimeLine::slotSetFramesPerSecond(), Gui::KTimeLine::slotSetProjectLength(), slotSetRenderProgress(), slotSyncTimeLineWithDocument(), snapToBorderEnabled(), snapToFrameEnabled(), snapToMarkersEnabled(), KRenderManager::stopRenderers(), and Gui::KTimeLine::trackView().

Referenced by KdenliveApp(), openDocumentFile(), readProperties(), and slotFileNew().

                               {
      ////////////////////////////////////////////////////////////////////
      // create the main widget here that is managed by KTMainWindow's view-region and
      // connect the widget to your document to display document contents.
      kdDebug()<<"****************  INIT DOCUMENT VIEW ***************"<<endl;
      m_timeline->trackView()->setReady(false);
      renderManager()->stopRenderers();

      if (m_transitionPanel) delete m_transitionPanel;

      m_transitionPanel = new TransitionDialog(this, m_dockTransition);

      m_dockTransition->setWidget(m_transitionPanel);
      m_transitionPanel->show();

      if (m_exportDvd) delete m_exportDvd;
      m_exportDvd = 0;
      if (m_projectList) delete m_projectList;
      m_projectList = 0;

      m_projectList = new ProjectList(this, getDocument(), false, m_dockProjectList);
      m_dockProjectList->setWidget(m_projectList);
      m_projectList->slot_UpdateList();
      m_projectList->show();
      connect(m_doc, SIGNAL(selectProjectItem(int)), m_projectList, SLOT(selectItem(int)));

      m_dockProjectList->update();

      if (m_effectListDialog) delete m_effectListDialog;
      m_effectListDialog =
          new EffectListDialog(effectList(), m_timelineWidget, "effect list");
      m_dockEffectList->setWidget(m_effectListDialog);
      m_effectListDialog->show();
      m_dockEffectList->update();
      if (m_effectStackDialog) delete m_effectStackDialog;
      m_effectStackDialog =
          new EffectStackDialog(this, getDocument(), m_dockEffectStack,
          "effect stack");
//      QToolTip::add( m_dockEffectStack, i18n( "All effects on selected clip." ) );
      m_dockEffectStack->setWidget(m_effectStackDialog);
      m_effectStackDialog->show();
      m_dockEffectStack->update();
      m_monitorManager.deleteMonitors();
      if (m_workspaceMonitor) delete m_workspaceMonitor;
      if (m_clipMonitor) delete m_clipMonitor;


      m_workspaceMonitor = m_monitorManager.createMonitor(getDocument(), m_dockWorkspaceMonitor, "Document");
      m_workspaceMonitor->setNoSeek(true);
      m_dockWorkspaceMonitor->setWidget(m_workspaceMonitor);
      m_workspaceMonitor->show();
      m_dockWorkspaceMonitor->update();

      m_clipMonitor = m_monitorManager.createMonitor( getDocument(),m_dockClipMonitor, "ClipMonitor");
      m_dockClipMonitor->setWidget(m_clipMonitor);
      m_clipMonitor->show();
      m_dockClipMonitor->update();
      //activateWorkspaceMonitor();
      //activateClipMonitor();
        if (m_captureMonitor) delete m_captureMonitor;
      m_captureMonitor = m_monitorManager.createCaptureMonitor( getDocument(), m_dockCaptureMonitor, "Capture Monitor" );
      m_dockCaptureMonitor->setWidget( m_captureMonitor );
      m_captureMonitor->show();
      m_dockCaptureMonitor->update();


      connect(getDocument(), SIGNAL(signalOpenClip(DocClipRef *)),
          this, SLOT(slotSetClipMonitorSourceAndSeek(DocClipRef *)));
      connect(getDocument(), SIGNAL(signalClipSelected(DocClipRef *)),
          m_effectStackDialog, SLOT(slotSetEffectStack(DocClipRef *)));
      connect(getDocument(), SIGNAL(effectStackChanged(DocClipRef *)),
          m_effectStackDialog, SLOT(slotSetEffectStack(DocClipRef *)));
      connect(m_effectStackDialog, SIGNAL(generateSceneList()),
          getDocument(), SLOT(hasBeenModified()));

      connect(m_effectListDialog, SIGNAL(effectSelected(const QString &)), this,
        SLOT(slotAddEffect(const QString &)));

      connect(m_effectStackDialog, SIGNAL(redrawTrack(int, GenTime, GenTime)), m_timeline,
          SLOT(drawPartialTrack(int, GenTime, GenTime)));
        
        connect(getDocument(), SIGNAL(clipReferenceChanged()), this,
                SLOT(clipReferenceChanged()));

      connect(getDocument(), SIGNAL(clipListUpdated()), m_projectList,
          SLOT(slot_UpdateList()));
        
        connect(getDocument(), SIGNAL(timelineClipUpdated()), m_timeline,
                SLOT(drawTrackViewBackBuffer()));

        connect(getDocument(), SIGNAL(refreshCurrentClipTrack(int, int, GenTime, GenTime)), m_timeline,
                SLOT(drawCurrentTrack(int, int, GenTime, GenTime)));

      connect(getDocument(), SIGNAL(clipChanged(DocClipRef *)),
          m_projectList, SLOT(slot_clipChanged(DocClipRef *)));
        
      connect(getDocument(), SIGNAL(nodeDeleted(DocumentBaseNode *)),
          m_projectList, SLOT(slot_nodeDeleted(DocumentBaseNode *)));

      connect(getDocument()->renderer(),
          SIGNAL(effectListChanged(const QPtrList < EffectDesc > &)),
          m_effectListDialog,
          SLOT(setEffectList(const QPtrList < EffectDesc > &)));

      connect(getDocument()->renderer(),
          SIGNAL(rendering(const GenTime &)), this,
          SLOT(slotSetRenderProgress(const GenTime &)));
      connect(getDocument()->renderer(), SIGNAL(renderFinished()), this,
          SLOT(slotSetRenderFinished()));

      connect(getDocument(), SIGNAL(trackListChanged()), this,
          SLOT(slotSyncTimeLineWithDocument()));
      
        connect(getDocument(), SIGNAL(clipChanged(DocClipRef *)),
          this, SLOT(refreshClipTrack(DocClipRef *)));
        
      connect(getDocument(),
          SIGNAL(documentLengthChanged(const GenTime &)), m_timeline,
          SLOT(slotSetProjectLength(const GenTime &)));

      connect(m_projectList, SIGNAL(clipSelected(DocClipRef *)), this,
          SLOT(slotSetClipMonitorSource(DocClipRef *)));

      connect(m_projectList, SIGNAL(dragDropOccured(QDropEvent *, QListViewItem *)), this,
          SLOT(slot_insertClips(QDropEvent *, QListViewItem *)));
        
        connect(m_projectList, SIGNAL(editItem()), this, SLOT(slotProjectEditClip()));

      connect(m_timeline, SIGNAL(seekPositionChanged(const GenTime &)),
        this, SLOT(activateWorkspaceMonitor()));
        
      connect(m_timeline, SIGNAL(rightButtonPressed()), this,
          SLOT(slotDisplayTimeLineContextMenu()));

      connect(m_timeline, SIGNAL(headerRightButtonPressed()), this,
          SLOT(slotDisplayTrackHeaderContextMenu()));

      connect(m_timeline, SIGNAL(rulerRightButtonPressed()), this,
          SLOT(slotDisplayRulerContextMenu()));


      m_timeline->trackView()->clearFunctions();

      m_moveFunction = new TrackPanelClipMoveFunction(this, m_timeline, getDocument());
      m_timeline->trackView()->registerFunction("move", m_moveFunction);

      connect(m_moveFunction, SIGNAL(checkTransition(DocClipRef *)), this, SLOT(slotCheckTransition(DocClipRef *)));

      m_resizeFunction =
          new TrackPanelClipResizeFunction(this, m_timeline,
          getDocument());
      m_timeline->trackView()->registerFunction("resize",
          m_resizeFunction);

      TrackPanelKeyFrameFunction *keyFrameFunction =
          new TrackPanelKeyFrameFunction(this, m_timeline,
          getDocument());
      m_timeline->trackView()->registerFunction("keyframe",
          keyFrameFunction);
        
        TrackPanelTransitionResizeFunction *transitionResizeFunction =
                new TrackPanelTransitionResizeFunction(this, m_timeline,
                                               getDocument());
        m_timeline->trackView()->registerFunction("transitionresize",
        transitionResizeFunction);
        
        TrackPanelTransitionMoveFunction *transitionMoveFunction =
                new TrackPanelTransitionMoveFunction(this, m_timeline,
                getDocument());
        m_timeline->trackView()->registerFunction("transitionmove",
        transitionMoveFunction);

      m_rollFunction = new TrackPanelClipRollFunction(this, m_timeline, getDocument());

      //register roll function -reh
      m_timeline->trackView()->registerFunction("roll", m_rollFunction);

      // connects for clip/timeline monitor activation (i.e. making sure they are visible when needed)

      connect(m_transitionPanel, SIGNAL(transitionChanged(bool)),
                getDocument(), SLOT(activateSceneListGeneration(bool)));

      connect(keyFrameFunction, SIGNAL(signalKeyFrameChanged(bool)),
          getDocument(), SLOT(activateSceneListGeneration(bool)));
        
        connect(transitionMoveFunction, SIGNAL(transitionChanged(bool)),
                getDocument(), SLOT(activateSceneListGeneration(bool)));

      connect(transitionMoveFunction, SIGNAL(editTransition(Transition *)), this, SLOT(slotEditTransition(Transition *)));

        
        connect(transitionResizeFunction, SIGNAL(transitionChanged(bool)),
                getDocument(), SLOT(activateSceneListGeneration(bool)));

      connect(keyFrameFunction, SIGNAL(redrawTrack()),
          m_effectStackDialog, SLOT(updateKeyFrames()));

      connect(m_resizeFunction,
          SIGNAL(signalClipCropStartChanged(DocClipRef *)), this,
          SLOT(slotSetClipMonitorSource(DocClipRef *)));
      connect(m_resizeFunction,
          SIGNAL(signalClipCropEndChanged(DocClipRef *)), this,
          SLOT(slotSetClipMonitorSource(DocClipRef *)));

      /*connect(rollFunction,
          SIGNAL(signalClipCropStartChanged(DocClipRef *)), this,
          SLOT(slotSetClipMonitorSource(DocClipRef *)));*/
      connect(m_rollFunction,
          SIGNAL(signalClipCropEndChanged(DocClipRef *)), this,
          SLOT(slotSetClipMonitorSource(DocClipRef *)));

      /*connect(rollFunction,
          SIGNAL(signalClipCropStartChanged(DocClipRef *)),
          m_clipMonitor, SLOT(slotClipCropStartChanged(DocClipRef *)));*/

      m_markerFunction = new TrackPanelMarkerFunction(this, m_timeline, getDocument());

      m_timeline->trackView()->registerFunction("marker", m_markerFunction);
      
      connect(m_markerFunction, SIGNAL(lookingAtClip(DocClipRef *, const GenTime &)), this,
          SLOT(slotLookAtClip(DocClipRef *, const GenTime &)));

      m_timeline->trackView()->registerFunction("spacer",
          new TrackPanelSpacerFunction(this, m_timeline, getDocument()));

      //m_timeline->trackView()->registerFunction("effects", new TrackPanelSpacerFunction(this, m_timeline, getDocument()));

      TrackPanelRazorFunction *razorFunction =
          new TrackPanelRazorFunction(this, m_timeline, getDocument());
      m_timeline->trackView()->registerFunction("razor", razorFunction);
      connect(razorFunction, SIGNAL(lookingAtClip(DocClipRef *, const GenTime &)), this,
          SLOT(slotLookAtClip(DocClipRef *, const GenTime &)));
        
        connect(razorFunction, SIGNAL(sceneListChanged(bool)),
                getDocument(), SLOT(activateSceneListGeneration(bool)));


      m_timeline->trackView()->registerFunction("selectnone",
          new TrackPanelSelectNoneFunction(this, m_timeline,
            getDocument()));
      m_timeline->trackView()->setDragFunction("move");

      m_timeline->setSnapToFrame(snapToFrameEnabled());
      m_timeline->setSnapToBorder(snapToBorderEnabled());
      m_timeline->setSnapToMarker(snapToMarkersEnabled());
      m_timeline->setEditMode("move");

      connectMonitors();
      slotSyncTimeLineWithDocument();
      m_timeline->slotSetFramesPerSecond(KdenliveSettings::defaultfps());
      m_timeline->slotSetProjectLength(getDocument()->projectClip().duration());
      m_timeline->trackView()->setReady(true);
      m_doc->setModified(false);
      
    }


Generated by  Doxygen 1.6.0   Back to index