WorkflowRenderer.h 3.64 KB
Newer Older
1
/*****************************************************************************
2
 * WorkflowRenderer.h: Render the main workflow
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *****************************************************************************
 * 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.
 *****************************************************************************/

23 24
#ifndef WORKFLOWRENDERER_H
#define WORKFLOWRENDERER_H
25

26

27 28
#include <QObject>
#include <QWidget>
29
#include <QStack>
30 31

#include "Workflow/MainWorkflow.h"
32
#include "GenericRenderer.h"
33

34
class   WorkflowRenderer : public GenericRenderer
35 36
{
    Q_OBJECT
37
    Q_DISABLE_COPY( WorkflowRenderer )
38 39

    public:
40 41 42
        enum    Actions
        {
            Pause,
43
            //Unpause,
44
        };
45
        WorkflowRenderer();
46
        ~WorkflowRenderer();
47

48 49 50 51 52
        /**
            \brief          Set the preview position
            \param          newPos : The new position in vlc position (between
                                        0 and 1)
        */
53
        virtual void        setPosition( float newPos );
54
        virtual void        togglePlayPause( bool forcePause );
55
        virtual void        stop();
56 57
        virtual void        nextFrame();
        virtual void        previousFrame();
58

59
        static void*        lock( void* datas );
60
        static void*        lockAudio( void* datas );
61 62
        static void         unlock( void* datas );

63
    private:
64
        void                internalPlayPause( bool forcePause );
65
        void                pauseMainWorkflow();
66
        void                unpauseMainWorkflow();
67
        virtual void        startPreview();
68
        void                checkActions();
69

70
    protected:
71
        MainWorkflow*       m_mainWorkflow;
72
        LibVLCpp::Media*    m_media;
73 74
        bool                m_stopping;

75
    private:
76
<<<<<<< HEAD:src/Renderer/WorkflowRenderer.h
77
        MainWorkflow::OutputBuffers*      m_lastFrame;
78 79 80
=======
        const VideoFrame*   m_lastFrame;
>>>>>>> Merging EffectsEngine with Workflow.:src/Renderer/WorkflowRenderer.h
81 82
        QStack<Actions>     m_actions;
        QReadWriteLock*     m_actionsLock;
83
        bool                m_pauseAsked;
84
        bool                m_unpauseAsked;
85 86
        QMutex*             m_condMutex;
        QWaitCondition*     m_waitCond;
87

88
    public slots:
89 90
        virtual void        setClip( Clip* ){}
        virtual void        setMedia( Media* ) {}
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
91
        void                mediaUnloaded( const QUuid& ) {}
92
        void                timelineCursorChanged( qint64 newFrame );
93

94 95 96 97 98 99
        void                __positionChanged();
        void                __positionChanged( float pos );
        void                __videoPaused();
        void                __videoStopped();
        void                __videoPlaying();
        void                __endReached();
100 101 102 103 104

    private slots:
        void                mainWorkflowPaused();
        void                mainWorkflowUnpaused();

105 106
};

107
#endif // WORKFLOWRENDERER_H