X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsmallruler.h;h=5c18ba9d1a8c4dc2f1b4d5d043078b777c4172e4;hb=56aee6aedeeed3efd10ada8fe3c229eddc01ef05;hp=053ce1ea2a3621068a1cfd33307b9c485bb3cfad;hpb=f697b9fd5408e77412f2ee35aa406173630890bf;p=kdenlive diff --git a/src/smallruler.h b/src/smallruler.h index 053ce1ea..5c18ba9d 100644 --- a/src/smallruler.h +++ b/src/smallruler.h @@ -1,30 +1,78 @@ +/*************************************************************************** + * 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 -#include +#include +#include + +#include "monitormanager.h" + -class SmallRuler : public KRuler +class SmallRuler : public QWidget { - Q_OBJECT - - public: - SmallRuler(QWidget *parent=0); - virtual void mousePressEvent ( QMouseEvent * event ); + Q_OBJECT - void setPixelPerMark ( double rate ); +public: + explicit SmallRuler(Monitor *manager, Render *render, QWidget *parent = 0); + void adjustScale(int maximum); + void setZone(int start, int end); + void setZoneStart(); + void setZoneEnd(); + QPoint zone() const; + void setMarkers(const QList < CommentedTime >& list); + void updatePalette(); + void refreshRuler(); - protected: - virtual void paintEvent(QPaintEvent * /*e*/); +protected: + void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *); + void leaveEvent(QEvent * event); + void mousePressEvent(QMouseEvent * event); + void mouseMoveEvent(QMouseEvent * event); + void mouseReleaseEvent(QMouseEvent * event); - private: +private: int m_cursorPosition; + int m_cursorFramePosition; double m_scale; + int m_medium; + int m_small; + int m_maxval; + int m_zoneStart; + int m_zoneEnd; + QColor m_zoneColor; + QList m_markers; + QPixmap m_pixmap; + Monitor *m_monitor; + Render *m_render; + int m_lastSeekPosition; + QBrush m_cursorColor; + void updatePixmap(); - public slots: - void slotNewValue ( int _value ); +public slots: + bool slotNewValue(int value); - signals: - void seekRenderer(int); +signals: + void zoneChanged(QPoint); }; #endif