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
43 MonitorRefresh(QWidget* parent);
44 virtual void paintEvent(QPaintEvent * event);
45 void setRenderer(Render* render);
51 class Overlay : public QLabel
55 Overlay(QWidget* parent);
56 virtual void paintEvent(QPaintEvent * event);
57 void setOverlayText(const QString &, bool isZone = true);
63 class Monitor : public QWidget
68 Monitor(QString name, MonitorManager *manager, QWidget *parent = 0);
74 bool isActive() const;
76 void setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL);
77 const QString sceneList();
78 DocClipBase *activeClip();
83 virtual void mousePressEvent(QMouseEvent * event);
84 virtual void mouseReleaseEvent(QMouseEvent * event);
85 virtual void wheelEvent(QWheelEvent * event);
86 virtual void mouseMoveEvent(QMouseEvent *event);
87 virtual QStringList mimeTypes() const;
88 /* virtual void dragMoveEvent(QDragMoveEvent * event);
89 virtual Qt::DropActions supportedDropActions() const;*/
91 // virtual void resizeEvent(QResizeEvent * event);
92 // virtual void paintEvent(QPaintEvent * event);
96 MonitorManager *m_monitorManager;
97 MonitorRefresh *m_monitorRefresh;
106 KRestrictedLine *m_timePos;
107 QAction *m_playAction;
108 QMenu *m_contextMenu;
111 DocClipBase *m_currentClip;
112 QPoint m_DragStartPosition;
115 GenTime getSnapForPos(bool previous);
118 void seekCursor(int pos);
119 void rendererStopped(int pos);
120 void slotExtractCurrentFrame();
121 void slotSetThumbFrame();
122 void slotSetSizeOneToOne();
123 void slotSetSizeOneToTwo();
126 void setClipZone(QPoint pos);
127 void slotSwitchMonitorInfo(bool show);
130 void slotOpenFile(const QString &);
131 void slotSetXml(DocClipBase *clip, const int position = -1);
133 void refreshMonitor(bool visible);
134 void slotSeek(int pos);
137 void activateMonitor();
141 void slotForward(double speed = 0);
142 void slotRewind(double speed = 0);
143 void slotRewindOneFrame(int diff = 1);
144 void slotForwardOneFrame(int diff = 1);
145 void saveSceneList(QString path, QDomElement info = QDomElement());
148 void slotSetZoneStart();
149 void slotSetZoneEnd();
150 void slotZoneStart();
152 void slotZoneMoved(int start, int end);
153 void slotSeekToNextSnap();
154 void slotSeekToPreviousSnap();
155 void adjustRulerSize(int length);
158 void renderPosition(int);
159 void durationChanged(int);
160 void refreshClipThumbnail(const QString &);
161 void adjustMonitorSize();
162 void zoneUpdated(QPoint);
163 void saveZone(Render *, QPoint);