GraphicsMovieItem.h 2.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*****************************************************************************
 * GraphicsMovieItem.h: Represent a movie graphically in the timeline
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Ludovic Fauvet <etix@l0cal.com>
 *
 * 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 GRAPHICSMOVIEITEM_H
#define GRAPHICSMOVIEITEM_H

26
#include <QFontMetrics>
27
#include "AbstractGraphicsMediaItem.h"
28
#include "Clip.h"
29
#include "TracksView.h"
30

31
32
33
#define Z_SELECTED 4
#define Z_NOT_SELECTED 3

34
35
#define ROUNDED_RECT_RADIUS 5

36
37
38
39
class GraphicsMovieItem : public AbstractGraphicsMediaItem
{
    Q_OBJECT
public:
40
    enum { Type = UserType + 1 };
41
    GraphicsMovieItem( Clip* clip );
42
43
44
45
46
47
    virtual ~GraphicsMovieItem();

    virtual int type() const { return Type; }
    virtual bool expandable() const { return false; }
    virtual bool moveable() const { return true; }
    virtual const QUuid& uuid() const { return m_clip->getUuid(); }
48
    virtual MainWorkflow::TrackType mediaType() const;
49
50
    virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );

51
    virtual Clip* clip() const;
52

53
protected:
54
55
    void                paintRect( QPainter* painter, const QStyleOptionGraphicsItem* option );
    void                paintTitle( QPainter* painter, const QStyleOptionGraphicsItem* option );
56
57
    virtual void        hoverEnterEvent( QGraphicsSceneHoverEvent* event );
    virtual void        hoverLeaveEvent( QGraphicsSceneHoverEvent* event );
Ludovic Fauvet's avatar
Ludovic Fauvet committed
58
    virtual void        hoverMoveEvent( QGraphicsSceneHoverEvent* event );
59
60
    virtual void        mousePressEvent( QGraphicsSceneMouseEvent* event );
    virtual void        mouseReleaseEvent( QGraphicsSceneMouseEvent* event );
61
62

private:
63
    bool                resizeZone( const QPointF& position );
64
    Clip*               m_clip;
65
66
67

signals:
    void                split( GraphicsMovieItem* self, qint64 frame );
68
69
70
};

#endif // GRAPHICSMOVIEITEM_H