]> git.sesse.net Git - kdenlive/blobdiff - src/customruler.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / customruler.h
index e4b1affcb560e4806e2541df00ed5c361a3e975a..9466e83c34279df172c48f3e6925373be6e3c4e0 100644 (file)
+/***************************************************************************
+ *   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          *
+ ***************************************************************************/
+
+/**
+ * @class CustomRuler
+ * @author Jean-Baptiste Mardelle
+ * @brief Manages the timeline ruler.
+ */
+
 #ifndef CUSTOMRULER_H
 #define CUSTOMRULER_H
 
-#include <KRuler>
+#include <QWidget>
+
+#include "customtrackview.h"
+#include "timecode.h"
 
-#include <timecode.h>
+enum RULER_MOVE { RULER_CURSOR = 0, RULER_START = 1, RULER_MIDDLE = 2, RULER_END = 3 };
+enum MOUSE_MOVE { NO_MOVE = 0, HORIZONTAL_MOVE = 1, VERTICAL_MOVE = 2 };
 
-class CustomRuler : public KRuler
+class CustomRuler : public QWidget
 {
-  Q_OBJECT
-  
-  public:
-    CustomRuler(Timecode tc, QWidget *parent=0);
-    virtual void mousePressEvent ( QMouseEvent * event );
-    virtual void mouseMoveEvent ( QMouseEvent * event );
-    void setPixelPerMark (double rate);
+    Q_OBJECT
+
+public:
+    CustomRuler(const Timecode &tc, CustomTrackView *parent);
+    void setPixelPerMark(int rate);
     static const int comboScale[];
-  protected:
-    virtual void paintEvent(QPaintEvent * /*e*/);
+    int outPoint() const;
+    int inPoint() const;
+    void setDuration(int d);
+    void setZone(const QPoint &p);
+    int offset() const;
+    void updateProjectFps(const Timecode &t);
+    void updateFrameSize();
+    void updatePalette();
+    
+protected:
+    void paintEvent(QPaintEvent * /*e*/);
+    void wheelEvent(QWheelEvent * e);
+    void mousePressEvent(QMouseEvent * event);
+    void mouseReleaseEvent(QMouseEvent * event);
+    void mouseMoveEvent(QMouseEvent * event);
+    void leaveEvent(QEvent * event);
 
-  private:
-    int m_cursorPosition;
+private:
     Timecode m_timecode;
-    void slotMoveCursor( int _value, bool emitSignal );
+    CustomTrackView *m_view;
+    int m_zoneStart;
+    int m_zoneEnd;
+    int m_duration;
+    QColor m_zoneColor;
+    double m_textSpacing;
+    double m_factor;
+    double m_scale;
+    int m_offset;
+    int m_lastSeekPosition;
+    RULER_MOVE m_moveCursor;
+    QMenu *m_contextMenu;
+    QAction *m_editGuide;
+    QAction *m_deleteGuide;
+    int m_clickedGuide;
+    /** Used for zooming through vertical move */
+    QPoint m_clickPoint;
+    int m_rate;
+    int m_startRate;
+    MOUSE_MOVE m_mouseMove;
+    QMenu *m_goMenu;
+    QBrush m_cursorColor;
+
 
-  public slots:
-    void slotNewValue ( int _value, bool emitSignal = false );
-    void slotMoveRuler (int newPos);
+public slots:
+    void slotMoveRuler(int newPos);
+    void slotCursorMoved(int oldpos, int newpos);
+    void updateRuler();
 
+private slots:
+    void slotEditGuide();
+    void slotDeleteGuide();
+    void slotGoToGuide(QAction *act);
 
-  signals:
-    void cursorMoved(int);
+signals:
+    void zoneMoved(int, int);
+    void adjustZoom(int);
+    void mousePosition(int);
 };
 
 #endif