ClipRenderer.h 2.59 KB
Newer Older
Christophe Courtaut's avatar
Christophe Courtaut committed
1
/*****************************************************************************
2
 * ClipRenderer.h: Preview widget
Christophe Courtaut's avatar
Christophe Courtaut committed
3 4 5
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
6
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
Christophe Courtaut's avatar
Christophe Courtaut committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * 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.
 *****************************************************************************/

23 24
#ifndef CLIPRENDERER_H
#define CLIPRENDERER_H
geoff's avatar
geoff committed
25

26 27
#include <QWidget>
#include <QObject>
28

29
#include "VLCMediaPlayer.h"
30
#include "Clip.h"
31
#include "GenericRenderer.h"
geoff's avatar
geoff committed
32

33
class ClipRenderer : public GenericRenderer
34
{
geoff's avatar
geoff committed
35
    Q_OBJECT
36
    Q_DISABLE_COPY( ClipRenderer )
37

geoff's avatar
geoff committed
38
public:
39
    explicit ClipRenderer();
40
    virtual ~ClipRenderer();
geoff's avatar
geoff committed
41

42 43
    virtual void            setPosition( float newPos );
    virtual void            togglePlayPause( bool forcePause );
44
    virtual void            stop();
45 46
    virtual void            nextFrame();
    virtual void            previousFrame();
47

48 49
private:
    void                    startPreview();
50
    void                    setSnapshotVisibility( bool val );
51

geoff's avatar
geoff committed
52
private:
53
    bool                    m_clipLoaded;
54
    LibVLCpp::Media*        m_vlcMedia;
55 56 57
    Media*                  m_selectedMedia;
    qint64                  m_begin;
    qint64                  m_end;
58 59 60 61 62
    /**
     *  \brief  This flags is used to know if a new media has been selected in the
     * library. If so, we must relaunch the render if the play button is clicked again.
     */
    bool                    m_mediaChanged;
63 64

public slots:
65
    virtual void            setClip( Clip* clip );
66
    virtual void            setMedia( Media* media );
67 68
    virtual void            mediaUnloaded( const QUuid& );

69 70 71 72
    void                    __positionChanged();
    void                    __videoPaused();
    void                    __videoPlaying();
    void                    __endReached();
73
    void                    __videoStopped();
geoff's avatar
geoff committed
74 75
};

76
#endif // CLIPRENDERER_H