EffectsEngine.h 2.34 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
/*****************************************************************************
 * EffectsEngine.h: Manage the effects plugins.
 *****************************************************************************
 * Copyright (C) 2008-2010 VideoLAN
 *
 * Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.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 EFFECTSENGINE_H
#define EFFECTSENGINE_H

#include "Singleton.hpp"
27
#include "Effect.h"
28 29 30 31 32

namespace Workflow
{
    class   Frame;
}
33

34
class   EffectHelper;
35
class   FilterInstance;
36
class   MixerInstance;
37

38 39 40
class   QTime;
class   QXmlStreamWriter;

41
#include <QObject>
42
#include <QStringList>
43
#include <QHash>
44
#include <QUuid>
45
#include <QMetaType>
46

47 48
class   QSettings;

49
class   EffectsEngine : public QObject, public Singleton<EffectsEngine>
50
{
51 52
    Q_OBJECT

53
    public:
54 55
        typedef QList<EffectHelper*>    EffectList;
        static const quint32            MaxFramesForMixer = 3;
56

57 58 59 60
        Effect*             effect( const QString& name );
        const QStringList&  effects( Effect::Type type ) const;
        bool                loadEffect( const QString& fileName );
        void                loadEffects();
61

62 63 64
    private:
        EffectsEngine();
        ~EffectsEngine();
65
        void        browseDirectory( const QString& path );
66

67
    private:
68
        QHash<QString, Effect*> m_effects;
69
        QList<QStringList>      m_names;
70
        QSettings               *m_cache;
71
        QTime                   *m_time;
72

73
    signals:
74
        void        effectAdded( Effect*, const QString& name, Effect::Type );
75 76 77 78
    friend class    Singleton<EffectsEngine>;
};

#endif // EFFECTSENGINE_H