X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomruler.h;h=9466e83c34279df172c48f3e6925373be6e3c4e0;hb=4f9bd66f4c236423b440b10ae1e543d162cec0ed;hp=b7ac39782f7b61913efa6d47ec278dc256708f10;hpb=e6f3dd3d92bb9f0196245645d584ecfe02171ac0;p=kdenlive diff --git a/src/customruler.h b/src/customruler.h index b7ac3978..9466e83c 100644 --- a/src/customruler.h +++ b/src/customruler.h @@ -17,6 +17,12 @@ * 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 @@ -26,27 +32,32 @@ #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 QWidget { Q_OBJECT public: - CustomRuler(Timecode tc, CustomTrackView *parent); - void setPixelPerMark(double rate); + CustomRuler(const Timecode &tc, CustomTrackView *parent); + void setPixelPerMark(int rate); static const int comboScale[]; int outPoint() const; int inPoint() const; void setDuration(int d); - void setZone(QPoint p); + void setZone(const QPoint &p); int offset() const; - void updateProjectFps(Timecode t); - + void updateProjectFps(const Timecode &t); + void updateFrameSize(); + void updatePalette(); + protected: - virtual void paintEvent(QPaintEvent * /*e*/); - virtual void wheelEvent(QWheelEvent * e); - virtual void mousePressEvent(QMouseEvent * event); - virtual void mouseMoveEvent(QMouseEvent * event); + 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: Timecode m_timecode; @@ -54,29 +65,40 @@ private: int m_zoneStart; int m_zoneEnd; int m_duration; - QColor m_bgColor; - QColor m_cursorColor; 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 slotMoveRuler(int newPos); void slotCursorMoved(int oldpos, int newpos); + void updateRuler(); private slots: void slotEditGuide(); void slotDeleteGuide(); + void slotGoToGuide(QAction *act); signals: void zoneMoved(int, int); + void adjustZoom(int); + void mousePosition(int); }; #endif