X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomruler.h;h=9b3aa020c2bf55fea40efa9a6857beb03017851e;hb=76b841800707bca883291039fb7a278a845efe92;hp=ad468c8c12f5a1f6b5344ab38494dc1729bbfc0c;hpb=a3b0f8cf7943bcea39e8d9404c16094e574cf62c;p=kdenlive diff --git a/src/customruler.h b/src/customruler.h index ad468c8c..9b3aa020 100644 --- a/src/customruler.h +++ b/src/customruler.h @@ -1,32 +1,73 @@ +/*************************************************************************** + * 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 CUSTOMRULER_H #define CUSTOMRULER_H -#include +#include + +#include "customtrackview.h" +#include "timecode.h" -#include +enum RULER_MOVE { RULER_CURSOR = 0, RULER_START = 1, RULER_MIDDLE = 2, RULER_END = 3 }; -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(Timecode tc, CustomTrackView *parent); + void setPixelPerMark(double rate); static const int comboScale[]; - protected: + int outPoint() const; + int inPoint() const; + void setDuration(int d); + void setZone(QPoint p); + int offset() const; + +protected: virtual void paintEvent(QPaintEvent * /*e*/); + virtual void wheelEvent(QWheelEvent * e); + virtual void mousePressEvent(QMouseEvent * event); + virtual void mouseMoveEvent(QMouseEvent * event); - private: - int m_cursorPosition; +private: Timecode m_timecode; + CustomTrackView *m_view; + int m_zoneStart; + int m_zoneEnd; + int m_duration; + QColor m_bgColor; + QColor m_zoneColor; + double m_textSpacing; + double m_factor; + double m_scale; + int m_offset; + RULER_MOVE m_moveCursor; + QMenu *m_contextMenu; - public slots: - void slotNewValue ( int _value ); +public slots: + void slotMoveRuler(int newPos); + void slotCursorMoved(int oldpos, int newpos); - signals: - void cursorMoved(int); +signals: + void zoneMoved(int, int); }; #endif