PreviewWidget.h 2.89 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 26 27
/*****************************************************************************
 * PreviewWidget: Main preview widget
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
 *
 * 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 PREVIEWWIDGET_H
#define PREVIEWWIDGET_H

#include <QWidget>
28
#include "Workflow/MainWorkflow.h"
29
#include "ClipPreviewWidget.h"
30
#include "RenderPreviewWidget.h"
31 32 33 34 35 36 37 38 39 40 41

namespace Ui {
    class PreviewWidget;
}

class   PreviewWidget : public QWidget
{
    Q_OBJECT
    Q_DISABLE_COPY( PreviewWidget )

public:
42
    explicit PreviewWidget( MainWorkflow* mainWorkflow, QWidget* parent = NULL );
43 44
    virtual ~PreviewWidget();

45 46 47 48 49
private:
    void                    initRenderPreview( MainWorkflow* );
    void                    initClipPreview();
    void                    connectPreview( GenericPreviewWidget* target );

50 51
private:
    Ui::PreviewWidget*      m_ui;
52 53 54
    GenericPreviewWidget*   m_clipPreview;
    GenericPreviewWidget*   m_renderPreview;
    GenericPreviewWidget*   m_currentPreviewRenderer;
55 56
    bool                    m_endReached;
    bool                    m_previewStopped;
57 58
    int                     m_currentMode;

59 60
    static const int        renderPreviewMode = 0;
    static const int        clipPreviewMode = 1;
61
    int                     m_sliderPosBackup;
62 63 64 65 66 67 68

protected:
    virtual void    changeEvent( QEvent *e );
    virtual void    dragEnterEvent( QDragEnterEvent* event );
    virtual void    dropEvent( QDropEvent* event );
private slots:
    void            on_pushButtonPlay_clicked();
69
    void            on_pushButtonStop_clicked();
70 71
    void            on_pushButtonNextFrame_clicked();
    void            on_pushButtonPreviousFrame_clicked();
72 73 74 75 76 77
    void            positionChanged( float );
    void            seekSliderPressed();
    void            seekSliderMoved( int value );
    void            seekSliderReleased();
    void            videoPaused();
    void            videoPlaying();
78
    void            videoStopped();
79
    void            endReached();
80 81

    void            changedTab( int );
82 83 84
};

#endif // PREVIEWWIDGET_H