1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
28 #include <KRestrictedLine>
29 #include <QDomElement>
32 #include "ui_monitor_ui.h"
39 class MonitorRefresh : public QWidget {
42 MonitorRefresh(QWidget* parent);
43 virtual void paintEvent(QPaintEvent * event);
44 void setRenderer(Render* render);
50 class Overlay : public QLabel {
53 Overlay(QWidget* parent);
54 virtual void paintEvent(QPaintEvent * event);
55 void setOverlayText(const QString &, bool isZone = true);
61 class Monitor : public QWidget {
65 Monitor(QString name, MonitorManager *manager, QWidget *parent = 0);
71 bool isActive() const;
73 void setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL);
74 QDomDocument sceneList();
75 DocClipBase *activeClip();
80 virtual void mousePressEvent(QMouseEvent * event);
81 virtual void mouseReleaseEvent(QMouseEvent * event);
82 virtual void wheelEvent(QWheelEvent * event);
83 virtual void mouseMoveEvent(QMouseEvent *event);
84 virtual QStringList mimeTypes() const;
85 /* virtual void dragMoveEvent(QDragMoveEvent * event);
86 virtual Qt::DropActions supportedDropActions() const;*/
88 // virtual void resizeEvent(QResizeEvent * event);
89 // virtual void paintEvent(QPaintEvent * event);
93 MonitorManager *m_monitorManager;
94 MonitorRefresh *m_monitorRefresh;
103 KRestrictedLine *m_timePos;
104 QAction *m_playAction;
105 QMenu *m_contextMenu;
108 DocClipBase *m_currentClip;
109 QPoint m_DragStartPosition;
112 GenTime getSnapForPos(bool previous);
115 void seekCursor(int pos);
116 void rendererStopped(int pos);
117 void slotExtractCurrentFrame();
118 void slotSetThumbFrame();
119 void slotSetSizeOneToOne();
120 void slotSetSizeOneToTwo();
125 void slotOpenFile(const QString &);
126 void slotSetXml(DocClipBase *clip, const int position = -1);
128 void refreshMonitor(bool visible);
129 void slotSeek(int pos);
132 void activateMonitor();
136 void slotForward(double speed = 0);
137 void slotRewind(double speed = 0);
138 void slotRewindOneFrame(int diff = 1);
139 void slotForwardOneFrame(int diff = 1);
140 void saveSceneList(QString path, QDomElement info = QDomElement());
143 void slotSetZoneStart();
144 void slotSetZoneEnd();
145 void slotZoneStart();
147 void slotZoneMoved(int start, int end);
148 void slotSeekToNextSnap();
149 void slotSeekToPreviousSnap();
150 void adjustRulerSize(int length);
153 void renderPosition(int);
154 void durationChanged(int);
155 void refreshClipThumbnail(const QString &);
156 void adjustMonitorSize();
157 void zoneUpdated(QPoint);
158 void saveZone(Render *, QPoint);