ClipRenderer.h 2.77 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 28
class   Clip;
class   Media;
class   QUuid;
29

30
#include "GenericRenderer.h"
31 32 33
#include "VLCMediaPlayer.h"

#include <QObject>
geoff's avatar
geoff committed
34

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

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

44
    virtual void            togglePlayPause( bool forcePause );
45
    virtual void            stop();
46 47
    virtual void            nextFrame();
    virtual void            previousFrame();
48
    virtual qint64          getLengthMs() const;
49
    virtual qint64          getCurrentFrame() const;
50
    virtual float           getFps() const;
51
    virtual Media*          getMedia() const;
52

53 54
private:
    void                    startPreview();
55
    void                    setSnapshotVisibility( bool val );
56

geoff's avatar
geoff committed
57
private:
58
    bool                    m_clipLoaded;
59
    LibVLCpp::Media*        m_vlcMedia;
60 61 62
    Media*                  m_selectedMedia;
    qint64                  m_begin;
    qint64                  m_end;
63 64 65 66 67
    /**
     *  \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;
68 69

public slots:
70
    virtual void            setClip( Clip* clip );
71
    virtual void            setMedia( Media* media );
72
    virtual void            mediaUnloaded( const QUuid& );
73
    virtual void            previewWidgetCursorChanged( qint64 newFrame );
74

75
//    void                    __positionChanged();
76
    void                    __timeChanged( qint64 time );
77
    void                    __endReached();
78
    void                    __videoStopped();
geoff's avatar
geoff committed
79 80
};

81
#endif // CLIPRENDERER_H