GraphicsMovieItem.h 2.32 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
36
37
class GraphicsMovieItem : public AbstractGraphicsMediaItem
{
    Q_OBJECT
public:
38
    enum { Type = UserType + 1 };
39
    GraphicsMovieItem( Clip* clip );
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
    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(); }
    virtual QRectF boundingRect() const;
    virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );

    void setWidth( int width );
    void setHeight( int height );
    Clip* clip() const;
    void    setClip( Clip* clip );
    //void setAudioSpectrum( QVector<float*> spectrum );
    void paintAudioSpectrum( QPainter* painter );
55
56

private:
57
58
59
60
61
62
    void                updateTitle();
    Clip*               m_clip;
    int                 m_width;
    int                 m_height;
    QVector<float*>     m_audioSpectrum;
    QGraphicsTextItem*  m_movieTitle;
63
64
65
};

#endif // GRAPHICSMOVIEITEM_H