]> git.sesse.net Git - kdenlive/commitdiff
Add license, continue work on project tree view
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 13 Jan 2008 12:22:19 +0000 (12:22 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 13 Jan 2008 12:22:19 +0000 (12:22 +0000)
svn path=/branches/KDE4/; revision=1798

23 files changed:
src/CMakeLists.txt
src/addclipcommand.cpp [new file with mode: 0644]
src/addclipcommand.h
src/customruler.cpp
src/definitions.h
src/documenttrack.cpp
src/documenttrack.h
src/kdenlivedoc.cpp
src/kdenlivedoc.h
src/mainwindow.cpp
src/mainwindow.h
src/monitor.cpp
src/monitor.h
src/monitormanager.cpp
src/monitormanager.h
src/projectitem.cpp
src/projectitem.h
src/projectlist.cpp
src/projectlist.h
src/smallruler.cpp
src/smallruler.h
src/trackview.cpp
src/trackview.h

index 6bdd8332b9f51effa52946a4fd81ef8f67d5daa0..ec0f9d65606384beda7bcebb2ccf5cb90adb5d0b 100644 (file)
@@ -1,18 +1,21 @@
 
 add_subdirectory( widgets )
 
+find_package(Nepomuk REQUIRED)
 
 include_directories(
     ${CMAKE_SOURCE_DIR}/src/widgets
     ${LIBMLT_INCLUDE_DIR}
     ${LIBMLTPLUS_INCLUDE_DIR}
     ${LIBFFMPEG_INCLUDE_DIR}
+    ${NEPOMUK_INCLUDES}
 )
 
 LINK_DIRECTORIES(
 ${LIBMLT_LIBRARY}
 ${LIBMLTPLUS_LIBRARY}
 ${LIBFFMPEG_LIBRARY}
+${NEPOMUK_LIBRARIES}
 )
 
 
@@ -24,6 +27,7 @@ kde4_add_ui_files(kdenlive_UI
 )
  
 set(kdenlive_SRCS 
+  addclipcommand.cpp
   main.cpp
   mainwindow.cpp
   customruler.cpp
@@ -42,6 +46,9 @@ set(kdenlive_SRCS
   documentvideotrack.cpp
   documentaudiotrack.cpp
   headertrack.cpp
+  trackpanelfunctionfactory.cpp
+  trackpanelfunction.cpp
+  trackpanelclipmovefunction.cpp
 )
 
 kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
@@ -53,6 +60,7 @@ target_link_libraries(kdenlive
   ${KDE4_KIO_LIBS} 
   ${LIBMLTPLUS_LIBRARY}
   ${LIBMLT_LIBRARY}
+  ${NEPOMUK_LIBRARIES}
 )
  
 install(TARGETS kdenlive DESTINATION ${BIN_INSTALL_DIR})
diff --git a/src/addclipcommand.cpp b/src/addclipcommand.cpp
new file mode 100644 (file)
index 0000000..2121c3d
--- /dev/null
@@ -0,0 +1,46 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+#include "addclipcommand.h"
+
+AddClipCommand::AddClipCommand(ProjectList *list, const QStringList &names, const QDomElement &xml, const int id, const KUrl &url, bool doIt)
+         : m_list(list), m_names(names), m_xml(xml), m_id(id), m_url(url), m_doIt(doIt) {
+           if (doIt) setText(i18n("Add clip"));
+           else setText(i18n("Delete clip"));
+         }
+
+
+// virtual 
+void AddClipCommand::undo()
+{
+  if (!m_list) kDebug()<<"----  ERROR, NO LIST FOR undoing action";
+kDebug()<<"----  undoing action";
+  if (m_doIt) m_list->deleteClip(m_id);
+  else m_list->addClip(m_names, m_xml, m_id, m_url);
+}
+// virtual 
+void AddClipCommand::redo()
+{
+  if (!m_list) kDebug()<<"----  ERROR, NO LIST FOR redoing action";
+kDebug()<<"----  redoing action";
+  if (m_doIt) m_list->addClip(m_names, m_xml, m_id, m_url);
+  else m_list->deleteClip(m_id);
+}
+
+#include "addclipcommand.moc"
index a8b05fa5d5932def8d333ae5674cda385cb17b54..2fb455bd80b017736cf78cf7a6dba1d42bcdf0d3 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef ADDCLIPCOMMAND_H
 #define ADDCLIPCOMMAND_H
 
 class AddClipCommand : public QUndoCommand
  {
  public:
-     AddClipCommand(ProjectList *list, const QStringList &names, const QDomElement &xml, const int id, const KUrl &url, bool doIt)
-         : m_list(list), m_names(names), m_xml(xml), m_id(id), m_url(url), m_doIt(doIt) {
-           if (doIt) setText(i18n("Add clip"));
-           else setText(i18n("Delete clip"));
-         }
-     virtual void undo()
-         {
-           kDebug()<<"----  undoing action";
-           if (m_doIt) m_list->deleteClip(m_id);
-           else m_list->addClip(m_names, m_xml, m_id, m_url);
-        }
-     virtual void redo()
-         {
-           kDebug()<<"----  redoing action";
-           if (m_doIt) m_list->addClip(m_names, m_xml, m_id, m_url);
-           else m_list->deleteClip(m_id);
-        }
+     AddClipCommand(ProjectList *list, const QStringList &names, const QDomElement &xml, const int id, const KUrl &url, bool doIt);
+
+    virtual void undo();
+    virtual void redo();
+
  private:
      ProjectList *m_list;
      QStringList m_names;
index 9cf8037ca5903dad91ae1506d2992834ba1bd7d1..f1edad9a2e527a88ea812f3db0ff1d0a16228f13 100644 (file)
@@ -110,8 +110,7 @@ void CustomRuler::paintEvent(QPaintEvent * /*e*/)
    int value  = this->value(),
      minval = minimum(),
      maxval;
-     maxval = maximum()
-     + offset() - endOffset();
+     maxval = maximum() + offset() - endOffset();
 
      //ioffsetval = value-offset;
      //    pixelpm = (int)ppm;
@@ -121,11 +120,15 @@ void CustomRuler::paintEvent(QPaintEvent * /*e*/)
      offsetmin=(double)(minval-offset()),
      offsetmax=(double)(maxval-offset()),
      fontOffset = (((double)minval)>offsetmin)?(double)minval:offsetmin;
+   QRect bg = QRect(offsetmin, 0, offsetmax, height());
+
+   QPalette palette;
+   //p.fillRect(bg, palette.light());
    // draw labels
    QFont font = p.font();
    font.setPointSize(LABEL_SIZE);
    p.setFont( font );
+   p.setPen(palette.dark().color());
    // draw littlemarklabel
  
    // draw mediummarklabel
index b1e6f22638350f6d6d14430466c83e9ab71a5965..efeb5648167d7291d51c8a923e7a0f76d988b862 100644 (file)
@@ -1,6 +1,33 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef DEFINITIONS_H
 #define DEFINITIONS_H
 
 #define FRAME_SIZE 90
 
+struct TrackViewClip {
+  int startTime;
+  int duration;
+  int cropTime;
+  QString producer;
+};
+
 #endif
index fa65d2cca32a5b8eebc78e40a6f9095ec3500407..060f55a82a5dcf6f881518049f0a4a72b93bf00a 100644 (file)
@@ -14,9 +14,29 @@ DocumentTrack::DocumentTrack(QDomElement xml, TrackView * view, QWidget *parent)
     : QWidget(parent), m_xml(xml), m_trackDuration(0)
 {
   setFixedHeight(50);
+  addFunctionDecorator("move", "move");
   parseXml();
 }
 
+int DocumentTrack::documentTrackIndex()
+{
+  return 0;
+}
+
+TrackViewClip *DocumentTrack::getClipAt(GenTime pos)
+{
+  return 0;
+}
+
+void DocumentTrack::addFunctionDecorator(const QString & mode, const QString & function) 
+{
+  m_trackPanelFunctions[mode].append(function);
+}
+
+QStringList DocumentTrack::applicableFunctions(const QString & mode) 
+{
+  return m_trackPanelFunctions[mode];
+}
 
 void DocumentTrack::parseXml()
 {
index 26143e518d6e18f3082007dddf9950eee0bc3250..2084634e7a77f50b0584f64175c5cc8a6ff7500a 100644 (file)
@@ -3,15 +3,17 @@
 
 #include <QDomElement>
 #include <QList>
+#include <QWidget>
+#include <QMap>
+#include <QStringList>
 
+#include "definitions.h"
+#include "gentime.h"
+
+
+class TrackPanelFunction;
 class TrackView;
 
-struct TrackViewClip {
-  int startTime;
-  int duration;
-  int cropTime;
-  QString producer;
-};
   
 class DocumentTrack : public QWidget
 {
@@ -22,6 +24,10 @@ class DocumentTrack : public QWidget
 
     QList <TrackViewClip> clipList();
     int duration();
+    int documentTrackIndex();
+    TrackViewClip *getClipAt(GenTime pos);
+    void addFunctionDecorator(const QString & mode, const QString & function);
+    QStringList applicableFunctions(const QString & mode);
 
   protected:
     virtual void paintEvent(QPaintEvent * /*e*/);
@@ -31,6 +37,9 @@ class DocumentTrack : public QWidget
     QList <TrackViewClip> m_clipList;
     void parseXml();
     int m_trackDuration;
+      /** A map of lists of track panel functions. */
+    QMap < QString, QStringList > m_trackPanelFunctions;
+
 
   public slots:
 
index d372a33cdcd54d2e27fedbbfa2a4d987329daf49..bab68a294643ccb287772492a346d688a182f9d2 100644 (file)
@@ -1,28 +1,22 @@
 /***************************************************************************
-                        kdenlivedoc.cpp  -  description
-                           -------------------
-  begin                : Fri Nov 22 2002
-  copyright            : (C) 2002 by Jason Wood
-  email                : jasonwood@blueyonder.co.uk
-  copyright            : (C) 2005 Lucio Flavio Correa
-  email                : lucio.correa@gmail.com
-  copyright            : (C) Marco Gittler
-  email                : g.marco@freenet.de
-  copyright            : (C) 2006 Jean-Baptiste Mardelle
-  email                : jb@ader.ch
-
-***************************************************************************/
-
-/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
-
 #include <KDebug>
 #include <KStandardDirs>
 #include <KMessageBox>
@@ -37,7 +31,7 @@
 KdenliveDoc::KdenliveDoc(KUrl url, double fps, int width, int height, QWidget *parent):QObject(parent), m_render(NULL), m_url(url), m_fps(fps), m_width(width), m_height(height), m_projectName(NULL)
 {
 
-  m_commandStack = new KUndoStack(this);
+  m_commandStack = new KUndoStack();
   if (!url.isEmpty()) {
     QString tmpFile;
     if(KIO::NetAccess::download(url.path(), tmpFile, parent))
@@ -102,6 +96,7 @@ KdenliveDoc::KdenliveDoc(KUrl url, double fps, int width, int height, QWidget *p
 
 KdenliveDoc::~KdenliveDoc()
 {
+  delete m_commandStack;
 }
 
 KUndoStack *KdenliveDoc::commandStack()
index 4788639cddef3a18d60edd1f3c6c910aa60d26ab..0b1967f1aaab8087bbaf1e60e53a1226ef0aa354 100644 (file)
@@ -1,20 +1,23 @@
 /***************************************************************************
-                         krender.h  -  description
-                            -------------------
-   begin                : Fri Nov 22 2002
-   copyright            : (C) 2002 by Jason Wood
-   email                : jasonwood@blueyonder.co.uk
-***************************************************************************/
-
-/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
+
 #ifndef KDENLIVEDOC_H
 #define KDENLIVEDOC_H
 
index 3efa1c4581655150345f4b7abcf926d499173a0f..98a9d04eca5e713d0bddb006fd3a278da8721ea7 100644 (file)
@@ -1,3 +1,22 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
 
 
 #include <QTextStream>
@@ -26,7 +45,7 @@
  
 MainWindow::MainWindow(QWidget *parent)
     : KXmlGuiWindow(parent),
-      fileName(QString()), m_activeDocument(NULL)
+      fileName(QString()), m_activeDocument(NULL), m_commandStack(NULL)
 {
   m_timelineArea = new KTabWidget(this);
   m_timelineArea->setHoverCloseButton(true);
@@ -35,7 +54,6 @@ MainWindow::MainWindow(QWidget *parent)
   setCentralWidget(m_timelineArea);
 
   m_monitorManager = new MonitorManager();
-  m_commandStack = new KUndoStack(this);
 
   projectListDock = new QDockWidget(i18n("Project Tree"), this);
   projectListDock->setObjectName("project_tree");
@@ -79,6 +97,7 @@ MainWindow::MainWindow(QWidget *parent)
   undoViewDock->setObjectName("undo_history");
   m_undoView = new QUndoView(this);
   undoViewDock->setWidget(m_undoView);
+  m_undoView->setStack(m_commandStack);
   addDockWidget(Qt::TopDockWidgetArea, undoViewDock);
 
   setupActions();
@@ -212,7 +231,7 @@ void MainWindow::saveFile()
  
 void MainWindow::openFile() //changed
 {
-  openFile(KFileDialog::getOpenFileName(KUrl(), "application/vnd.kde.kdenlive"));
+  openFile(KFileDialog::getOpenFileName(KUrl(), "application/vnd.kde.kdenlive,*.kdenlive"));
 }
  
 void MainWindow::openFile(const QString &inputFileName) //new
@@ -221,7 +240,7 @@ void MainWindow::openFile(const QString &inputFileName) //new
   TrackView *trackView = new TrackView(doc);
   m_timelineArea->setCurrentIndex(m_timelineArea->addTab(trackView, QIcon(), doc->documentName()));
   m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
-  connectDocument(trackView, doc);
+  //connectDocument(trackView, doc);
 }
 
 void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //changed
@@ -235,6 +254,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //chang
   m_projectList->setDocument(doc);
   m_monitorManager->setTimecode(doc->timecode());
   doc->setRenderer(m_projectMonitor->render);
+  //m_undoView->setStack(0);
   m_commandStack = doc->commandStack();
 
   QAction *redo = m_commandStack->createRedoAction(actionCollection());
@@ -252,8 +272,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //chang
     w->addAction(undo);
     w->addAction(redo);
   }
-  m_undoView->setStack(m_commandStack);
-  
+  m_undoView->setStack(doc->commandStack());
   m_activeDocument = doc;
 }
 
index cc67ed8d1bbad33649c1f857c9cddaf4ce812f8c..5c47b182a7a538f336fcaeb2e237dd0498dfc2c6 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
  
index dacacf3bdba441c223105402aecf70366d7fd0a3..111156fcab04b756532480c34d8f8d1709a038d1 100644 (file)
@@ -1,3 +1,22 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
 
 #include <QMouseEvent>
 #include <QStylePainter>
index 6472a608ec98191554f20d7ee5fcedcc54492aed..4259677305d95a7332db2bb6dc072245fb23f787 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef MONITOR_H
 #define MONITOR_H
 
index 6ef4bd80eb1563c49ec17e8949f35d9fc50df839..1660fadcffbcf027983deff263be1583aa686495 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #include <QObject>
 #include <QTimer>
 
index 075b63694775329c590a23672145f1e1447d3d44..f9b8d76d1d831fb51e8f8777bea262b3d8fefd9f 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef MONITORMANAGER_H
 #define MONITORMANAGER_H
 
index a5c4e9dec0b91de181a061fbb1b34135dfd913fd..4a46eb3b00194936174895a476a1fdf2daee442c 100644 (file)
@@ -1,3 +1,22 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
 
 #include <QMouseEvent>
 #include <QStylePainter>
index 72fa3a03abf03b3745036e2965bcb98976821338..34d39f9d813f6600cf12b5aed68b01c68676e124 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef PROJECTITEM_H
 #define PROJECTITEM_H
 
@@ -15,7 +35,7 @@ class ProjectItem : public QTreeWidgetItem
     ProjectItem(QTreeWidget * parent, const QStringList & strings, QDomElement xml, int clipId);
     ProjectItem(QTreeWidgetItem * parent, const QStringList & strings, QDomElement xml, int clipId);
     ProjectItem(QTreeWidget * parent, const QStringList & strings);
-    ~ProjectItem();
+    virtual ~ProjectItem();
     QDomElement toXml();
 
     void setProperties(const QMap < QString, QString > &attributes, const QMap < QString, QString > &metadata);
index b458053267660c4221bd268a6365efdd7b37da96..369370d06b92009d735dd4a9819af7eb53b09de9 100644 (file)
@@ -1,3 +1,22 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
 
 #include <QMouseEvent>
 #include <QStylePainter>
@@ -9,6 +28,8 @@
 #include <KAction>
 #include <KLocale>
 #include <KFileDialog>
+#include <nepomuk/resourcemanager.h>
+#include <kio/netaccess.h>
 
 #include "projectlist.h"
 #include "projectitem.h"
@@ -143,6 +164,7 @@ void ProjectList::slotEditClip()
 
 void ProjectList::slotRemoveClip()
 {
+  if (!m_commandStack) kDebug()<<"!!!!!!!!!!!!!!!!  NO CMD STK";
   if (!listView->currentItem()) return;
   ProjectItem *item = ((ProjectItem *)listView->currentItem());
   AddClipCommand *command = new AddClipCommand(this, item->names(), item->toXml(), item->clipId(), KUrl(item->data(1, FullPathRole).toString()), false);
@@ -156,15 +178,19 @@ void ProjectList::selectItemById(const int clipId)
   if (item) listView->setCurrentItem(item);
 }
 
-void ProjectList::addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url)
+void ProjectList::addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url, int parentId)
 {
   kDebug()<<"/////////  ADDING VCLIP=: "<<name;
   ProjectItem *item;
+  ProjectItem *groupItem = NULL;
   QString group = elem.attribute("group", QString::null);
-  if (!group.isEmpty()) {
+  if (parentId != -1) {
+    groupItem = getItemById(parentId);
+  }
+  else if (!group.isEmpty()) {
     // Clip is in a group
     QList<QTreeWidgetItem *> groupList = listView->findItems(group, Qt::MatchExactly, 1);
-    ProjectItem *groupItem;
+
     if (groupList.isEmpty())  {
        QStringList groupName;
        groupName<<QString::null<<group;
@@ -172,12 +198,40 @@ void ProjectList::addClip(const QStringList &name, const QDomElement &elem, cons
        groupItem = new ProjectItem(listView, groupName);
     }
     else groupItem = (ProjectItem *) groupList.first();
-    item = new ProjectItem(groupItem, name, elem, clipId);
   }
+  if (groupItem) item = new ProjectItem(groupItem, name, elem, clipId);
   else item = new ProjectItem(listView, name, elem, clipId);
   if (!url.isEmpty()) {
     item->setData(1, FullPathRole, url.path());
+/*    Nepomuk::File f( url.path() );
+    QString annotation = f.getAnnotation();
+    if (!annotation.isEmpty()) item->setText(2, annotation);*/
+    QString resource = url.path();
+    if (resource.endsWith("westley") || resource.endsWith("kdenlive")) {
+       QString tmpfile;
+       QDomDocument doc;
+       if (KIO::NetAccess::download(url, tmpfile, 0)) {
+           QFile file(tmpfile);
+           if (file.open(QIODevice::ReadOnly)) {
+             doc.setContent(&file, false);
+             file.close();
+           }
+           KIO::NetAccess::removeTempFile(tmpfile);
+
+           QDomNodeList subProds = doc.elementsByTagName("producer");
+           int ct = subProds.count();
+           for (int i = 0; i <  ct ; i++)
+           {
+             QDomElement e = subProds.item(i).toElement();
+             if (!e.isNull()) {
+               addProducer(e, clipId);
+             }
+           }  
+         }
+    }
+
   }
+
   if (elem.isNull() ) {
     QDomDocument doc;
     QDomElement element = doc.createElement("producer");
@@ -196,7 +250,7 @@ void ProjectList::deleteClip(const int clipId)
 
 void ProjectList::slotAddClip()
 {
-   
+  if (!m_commandStack) kDebug()<<"!!!!!!!!!!!!!!!!  NO CMD STK";
   KUrl::List list = KFileDialog::getOpenUrls( KUrl(), "application/vnd.kde.kdenlive application/vnd.westley.scenelist application/flv application/vnd.rn-realmedia video/x-dv video/x-msvideo video/mpeg video/x-ms-wmv audio/x-mp3 audio/x-wav application/ogg *.m2t *.dv video/mp4 video/quicktime image/gif image/jpeg image/png image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr");
   if (list.isEmpty()) return;
   KUrl::List::Iterator it;
@@ -217,6 +271,7 @@ void ProjectList::slotAddClip()
 
 void ProjectList::slotAddColorClip()
 {
+  if (!m_commandStack) kDebug()<<"!!!!!!!!!!!!!!!!  NO CMD STK";
   QDialog *dia = new QDialog;
   Ui::ColorClip_UI *dia_ui = new Ui::ColorClip_UI();
   dia_ui->setupUi(dia);
@@ -239,7 +294,7 @@ void ProjectList::slotAddColorClip()
     itemEntry.append(dia_ui->clip_name->text());
     AddClipCommand *command = new AddClipCommand(this, itemEntry, element, m_clipIdCounter++, KUrl(), true);
     m_commandStack->push(command);
-    //ProjectItem *item = new ProjectItem(listView, itemEntry, element);
+    // ProjectItem *item = new ProjectItem(listView, itemEntry, element, m_clipIdCounter++);
     /*QPixmap pix(60, 40);
     pix.fill(dia_ui->clip_color->color());
     item->setIcon(0, QIcon(pix));*/
@@ -275,7 +330,7 @@ QDomElement ProjectList::producersList()
   QDomDocument doc;
   QDomElement prods = doc.createElement("producerlist");
   doc.appendChild(prods);
-
+  kDebug()<<"////////////  PRO LIST BUILD PRDSLIST ";
     QTreeWidgetItemIterator it(listView);
      while (*it) {
          if (!((ProjectItem *)(*it))->isGroup())
@@ -312,8 +367,9 @@ ProjectItem *ProjectList::getItemById(int id)
 }
 
 
-void ProjectList::addProducer(QDomElement producer)
+void ProjectList::addProducer(QDomElement producer, int parentId)
 {
+  if (!m_commandStack) kDebug()<<"!!!!!!!!!!!!!!!!  NO CMD STK";
   DocClipBase::CLIPTYPE type = (DocClipBase::CLIPTYPE) producer.attribute("type").toInt();
 
     /*QDomDocument doc;
@@ -325,15 +381,16 @@ void ProjectList::addProducer(QDomElement producer)
   //kDebug()<<"//////  ADDING PRODUCER:\n "<<doc.toString()<<"\n+++++++++++++++++";
   int id = producer.attribute("id").toInt();
   if (id >= m_clipIdCounter) m_clipIdCounter = id + 1;
+  else if (id == 0) id = m_clipIdCounter++;
 
-  if (type == DocClipBase::AUDIO || type == DocClipBase::VIDEO || type == DocClipBase::AV)
+  if (type == DocClipBase::AUDIO || type == DocClipBase::VIDEO || type == DocClipBase::AV || type == DocClipBase::IMAGE  || type == DocClipBase::PLAYLIST)
   {
     KUrl resource = KUrl(producer.attribute("resource"));
     if (!resource.isEmpty()) {
       QStringList itemEntry;
       itemEntry.append(QString::null);
       itemEntry.append(resource.fileName());
-      addClip(itemEntry, producer, id, resource);
+      addClip(itemEntry, producer, id, resource, parentId);
       /*AddClipCommand *command = new AddClipCommand(this, itemEntry, producer, id, resource, true);
       m_commandStack->push(command);*/
 
@@ -351,8 +408,8 @@ void ProjectList::addProducer(QDomElement producer)
     pix.fill(QColor(colour.left(7)));
     QStringList itemEntry;
     itemEntry.append(QString::null);
-    itemEntry.append(producer.attribute("name"));
-    addClip(itemEntry, producer, id, KUrl());
+    itemEntry.append(producer.attribute("name", i18n("Color clip")));
+    addClip(itemEntry, producer, id, KUrl(), parentId);
     /*AddClipCommand *command = new AddClipCommand(this, itemEntry, producer, id, KUrl(), true);
     m_commandStack->push(command);*/
     //ProjectItem *item = new ProjectItem(listView, itemEntry, producer);
index 042ed4d7e5cbd5d41cb371e06c90a57d0f84cfcf..95cd4d6c2303c15625ee0339e965373f53c9bfda 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef PRJECTLIST_H
 #define PRJECTLIST_H
 
@@ -25,12 +45,12 @@ class ProjectList : public QWidget
     QDomElement producersList();
     void setRenderer(Render *projectRender);
 
-    void addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url = KUrl());
+    void addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url = KUrl(), int parentId = -1);
     void deleteClip(const int clipId);
 
   public slots:
     void setDocument(KdenliveDoc *doc);
-    void addProducer(QDomElement producer);
+    void addProducer(QDomElement producer, int parentId = -1);
     void slotReplyGetImage(int clipId, int pos, const QPixmap &pix, int w, int h);
     void slotReplyGetFileProperties(int clipId, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata);
 
index a7265072a6fdc15821f1f7821e195ec7e360095d..b1353db6bc33b9a3abde5778f24a17d0df1ad84c 100644 (file)
@@ -1,3 +1,22 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
 
 #include <QMouseEvent>
 #include <QStylePainter>
index 04404c395fc26499d9b0e7c31741bdfa6754ac6c..c4731b16056d3211c136db8e4cecbdcb15c4196a 100644 (file)
@@ -1,3 +1,23 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
 #ifndef SMALLRULER_H
 #define SMALLRULER_H
 
index 236e3ee3074b676ccb8d99b021befd35d21d997e..77b76dfeaf7ddf8ac1e77a8aa2a72a83dbd91ba2 100644 (file)
 #include "documentaudiotrack.h"
 #include "headertrack.h"
 #include "trackview.h"
+#include "trackpanelclipmovefunction.h"
 
 TrackView::TrackView(KdenliveDoc *doc, QWidget *parent)
-    : QWidget(parent), m_doc(doc), m_scale(1.0)
+    : QWidget(parent), m_doc(doc), m_scale(1.0), m_panelUnderMouse(NULL), m_function(NULL)
 {
+  setMouseTracking(true);
   view = new Ui::TimeLine_UI();
   view->setupUi(this);
   m_ruler = new CustomRuler(doc->timecode());
@@ -49,9 +51,18 @@ TrackView::TrackView(KdenliveDoc *doc, QWidget *parent)
 
   parseDocument(doc->toXml());
 
+  TrackPanelClipMoveFunction *m_moveFunction = new TrackPanelClipMoveFunction(this);
+  registerFunction("move", m_moveFunction);
+  setEditMode("move");
+
   connect(view->horizontalSlider, SIGNAL(valueChanged ( int )), this, SLOT(slotChangeZoom( int )));
 }
 
+void TrackView::registerFunction(const QString & name, TrackPanelFunction * function) 
+{
+  m_factory.registerFunction(name, function);
+}
+
 void TrackView::parseDocument(QDomDocument doc)
 {
   QDomNodeList tracks = doc.elementsByTagName("playlist");
@@ -89,6 +100,11 @@ const double TrackView::zoomFactor() const
   return m_scale * FRAME_SIZE;
 }
 
+const int TrackView::mapLocalToValue(int x) const
+{
+  return (int) x * zoomFactor();
+}
+
 KdenliveDoc *TrackView::document()
 {
   return m_doc;
@@ -116,4 +132,80 @@ int TrackView::slotAddVideoTrack(int ix, QDomElement xml)
   //track->show();
 }
 
+DocumentTrack *TrackView::panelAt(int y)
+{
+  return NULL;
+}
+
+void TrackView::setEditMode(const QString & editMode)
+{
+  m_editMode = editMode;
+}
+
+const QString & TrackView::editMode() const
+{
+  return m_editMode;
+}
+
+/** This event occurs when the mouse has been moved. */
+    void TrackView::mouseMoveEvent(QMouseEvent * event) {
+    kDebug()<<"--------  TRACKVIEW MOUSE MOVE EVENT -----";
+       if (m_panelUnderMouse) {
+           if (event->buttons() & Qt::LeftButton) {
+               bool result = false;
+               if (m_function)
+                   result =
+                       m_function->mouseMoved(m_panelUnderMouse, event);
+               if (!result) {
+                   m_panelUnderMouse = 0;
+                   m_function = 0;
+               }
+           } else {
+               if (m_function) {
+                   m_function->mouseReleased(m_panelUnderMouse, event);
+                   m_function = 0;
+               }
+               m_panelUnderMouse = 0;
+           }
+       } else {
+           DocumentTrack *panel = panelAt(event->y());
+           if (panel) {
+               QCursor result(Qt::ArrowCursor);
+
+               TrackPanelFunction *function =
+                   getApplicableFunction(panel, editMode(),
+                   event);
+               if (function)
+                   result = function->getMouseCursor(panel, event);
+
+               setCursor(result);
+           } else {
+               setCursor(QCursor(Qt::ArrowCursor));
+           }
+       }
+    }
+
+    TrackPanelFunction *TrackView::getApplicableFunction(DocumentTrack *
+       panel, const QString & editMode, QMouseEvent * event) {
+       TrackPanelFunction *function = 0;
+
+       QStringList list = panel->applicableFunctions(editMode);
+       QStringList::iterator itt = list.begin();
+
+       while (itt != list.end()) {
+           TrackPanelFunction *testFunction = m_factory.function(*itt);
+           if (testFunction) {
+               if (testFunction->mouseApplies(panel, event)) {
+                   function = testFunction;
+                   break;
+               }
+           }
+
+           ++itt;
+       }
+
+       return function;
+    }
+
+
 #include "trackview.moc"
index e7797b2f9ccb4978055ddb6e74e4d28ded969d3a..410ecef0a208854b47b73a69744b23444a2e8562 100644 (file)
@@ -12,6 +12,8 @@
 #include "customruler.h"
 #include "kdenlivedoc.h"
 #include "documenttrack.h"
+#include "trackpanelfunctionfactory.h"
+#include "trackpanelfunction.h"
 
 class TrackView : public QWidget
 {
@@ -20,7 +22,14 @@ class TrackView : public QWidget
   public:
     TrackView(KdenliveDoc *doc, QWidget *parent=0);
 
+       /** This event occurs when the mouse has been moved. */
+    void mouseMoveEvent(QMouseEvent * event);
+
     const double zoomFactor() const;
+    DocumentTrack *panelAt(int y);
+    const int mapLocalToValue(int x) const;
+    void setEditMode(const QString & editMode);
+    const QString & editMode() const;
 
   public slots:
     KdenliveDoc *document();
@@ -31,6 +40,11 @@ class TrackView : public QWidget
     double m_scale;
     QList <DocumentTrack*> documentTracks;
     int m_projectDuration;
+    TrackPanelFunctionFactory m_factory;
+    DocumentTrack *m_panelUnderMouse;
+       /** The currently applied function. This lasts from mousePressed until mouseRelease. */
+    TrackPanelFunction *m_function;
+    QString m_editMode;
 
     KdenliveDoc *m_doc;
     QVBoxLayout *m_tracksLayout;
@@ -41,7 +55,8 @@ class TrackView : public QWidget
     void parseDocument(QDomDocument doc);
     int slotAddAudioTrack(int ix, QDomElement xml);
     int slotAddVideoTrack(int ix, QDomElement xml);
-
+    void registerFunction(const QString & name, TrackPanelFunction * function);
+    TrackPanelFunction *getApplicableFunction(DocumentTrack * panel, const QString & editMode, QMouseEvent * event);
 
   private slots:
     void slotChangeZoom(int factor);