X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feffectstack%2Fcollapsibleeffect.h;h=74fb9de0dfaa4d4beade984ceefc50500a85a0b6;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=87fbc2ece8bb487b59eeb2475c78291b2421168e;hpb=a6fe2eb80506644cb2c44529a780e3cfc9880972;p=kdenlive diff --git a/src/effectstack/collapsibleeffect.h b/src/effectstack/collapsibleeffect.h index 87fbc2ec..74fb9de0 100644 --- a/src/effectstack/collapsibleeffect.h +++ b/src/effectstack/collapsibleeffect.h @@ -21,87 +21,16 @@ #ifndef COLLAPSIBLEEFFECT_H #define COLLAPSIBLEEFFECT_H - -#include "ui_collapsiblewidget_ui.h" - +#include "parametercontainer.h" +#include "abstractcollapsiblewidget.h" #include "timecode.h" -#include "keyframeedit.h" -#include "effectstackedit.h" + #include #include -class QFrame; -class Monitor; -class GeometryWidget; - -struct EffectMetaInfo { - MltVideoProfile profile; - Timecode timecode; - Monitor *monitor; - QPoint frameSize; - bool trackMode; -}; - -class MySpinBox : public QSpinBox -{ - Q_OBJECT - -public: - MySpinBox(QWidget * parent = 0); - -protected: - virtual void focusInEvent(QFocusEvent*); - virtual void focusOutEvent(QFocusEvent*); -}; +class QLabel; -class ParameterContainer : public QObject -{ - Q_OBJECT - -public: - ParameterContainer(QDomElement effect, ItemInfo info, EffectMetaInfo *metaInfo, int index, QWidget * parent = 0); - ~ParameterContainer(); - void updateTimecodeFormat(); - void updateProjectFormat(MltVideoProfile profile, Timecode t); - int index() const; - -private slots: - void slotCollectAllParameters(); - void slotStartFilterJobAction(); - -private: - /** @brief Updates parameter @param name according to new value of dependency. - * @param name Name of the parameter which will be updated - * @param type Type of the parameter which will be updated - * @param value Value of the dependency parameter */ - void meetDependency(const QString& name, QString type, QString value); - wipeInfo getWipeInfo(QString value); - QString getWipeString(wipeInfo info); - - int m_in; - int m_out; - int m_index; - QList m_uiItems; - QMap m_valueItems; - Timecode m_timecode; - KeyframeEdit *m_keyframeEditor; - GeometryWidget *m_geometryWidget; - EffectMetaInfo *m_metaInfo; - QDomElement m_effect; - QVBoxLayout *m_vbox; - -signals: - void parameterChanged(const QDomElement, const QDomElement, int); - void syncEffectsPos(int); - void effectStateChanged(bool); - void checkMonitorPosition(int); - void seekTimeline(int); - void showComments(bool); - /** @brief Start an MLT filter job on this clip. */ - void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties); - -}; /**) * @class CollapsibleEffect @@ -109,36 +38,49 @@ signals: * @author Jean-Baptiste Mardelle */ -class CollapsibleEffect : public QWidget, public Ui::CollapsibleWidget_UI +class CollapsibleEffect : public AbstractCollapsibleWidget { Q_OBJECT public: - CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, int ix, EffectMetaInfo *metaInfo, bool lastEffect, bool isGroup = false, QWidget * parent = 0); + explicit CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, const ItemInfo &info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0); ~CollapsibleEffect(); - static QMap iconCache; - void setupWidget(ItemInfo info, int index, EffectMetaInfo *metaInfo); + QLabel *title; + + void setupWidget(const ItemInfo &info, EffectMetaInfo *metaInfo); void updateTimecodeFormat(); - void setActive(bool activate, bool focused = false); + void setActive(bool activate); + /** @brief Install event filter so that scrolling with mouse wheel does not change parameter value. */ virtual bool eventFilter( QObject * o, QEvent * e ); /** @brief Update effect GUI to reflect parameted changes. */ - void updateWidget(ItemInfo info, int index, QDomElement effect, EffectMetaInfo *metaInfo); + void updateWidget(const ItemInfo &info, const QDomElement &effect, EffectMetaInfo *metaInfo); QDomElement effect() const; - void addGroupEffect(CollapsibleEffect *effect); - int index() const; int groupIndex() const; bool isGroup() const; int effectIndex() const; void setGroupIndex(int ix); - void removeGroup(int ix, QVBoxLayout *layout); + void setGroupName(const QString &groupName); + /** @brief Remove this effect from its group. */ + void removeFromGroup(); QString infoString() const; bool isActive() const; /** @brief Should the wheel event be sent to parent widget for scrolling. */ bool filterWheelEvent; + /** @brief Parent group was collapsed, update. */ + void groupStateChanged(bool collapsed); + /** @brief Show / hide up / down buttons. */ + void adjustButtons(int ix, int max); + /** @brief Returns true of this effect requires an on monitor adjustable effect scene. */ + bool needsMonitorEffectScene() const; + /** @brief Set clip in / out points. */ + void setRange(int inPoint , int outPoint); + /** @brief Import keyframes from a clip's data. */ + void setKeyframes(const QString &data, int maximum); public slots: void slotSyncEffectsPos(int pos); - void slotEnable(bool enable); + void slotDisable(bool disable, bool emitInfo = true); + void slotResetEffect(); private slots: void slotSwitch(); @@ -147,9 +89,13 @@ private slots: void slotEffectUp(); void slotEffectDown(); void slotSaveEffect(); - void slotResetEffect(); void slotCreateGroup(); + void slotCreateRegion(); void slotUnGroup(); + /** @brief A sub effect parameter was changed */ + void slotUpdateRegionEffectParams(const QDomElement /*old*/, const QDomElement /*e*/, int /*ix*/); + /** @brief Dis/enable effect before processing an operation (color picker) */ + void slotDisableEffect(bool disable); private: ParameterContainer *m_paramWidget; @@ -157,47 +103,42 @@ private: QDomElement m_effect; QDomElement m_original_effect; QList m_subEffects; - bool m_lastEffect; - int m_in; - int m_out; - bool m_isGroup; - bool m_active; + bool m_lastEffect; QMenu *m_menu; QPoint m_clickPoint; - int m_index; EffectInfo m_info; - - void updateGroupIndex(int groupIndex); + /** @brief True if this is a region effect, which behaves in a special way, like a group. */ + bool m_regionEffect; + /** @brief The add group action. */ + QAction *m_groupAction; + /** @brief Check if collapsed state changed and inform MLT. */ + void updateCollapsedState(); protected: virtual void mouseDoubleClickEvent ( QMouseEvent * event ); - virtual void mousePressEvent ( QMouseEvent * event ); - virtual void enterEvent( QEvent * event ); - virtual void leaveEvent( QEvent * event ); + virtual void mouseReleaseEvent( QMouseEvent *event ); virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dragLeaveEvent(QDragLeaveEvent *event); virtual void dropEvent(QDropEvent *event); signals: - void parameterChanged(const QDomElement, const QDomElement, int); + void parameterChanged(const QDomElement &, const QDomElement&, int); void syncEffectsPos(int); - void effectStateChanged(bool, int ix = -1); - void deleteEffect(const QDomElement); - void changeEffectPosition(int, bool); + void effectStateChanged(bool, int ix, bool effectNeedsMonitorScene); + void deleteEffect(const QDomElement &); void activateEffect(int); void checkMonitorPosition(int); void seekTimeline(int); /** @brief Start an MLT filter job on this clip. */ - void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties); - /** @brief An effect was saved, trigger effect list reload. */ - void reloadEffects(); + void startFilterJob(const QString &filterName, const QString &filterParams, const QString &consumer, const QString &consumerParams, const QMap &extraParams); /** @brief An effect was reset, trigger param reload. */ void resetEffect(int ix); /** @brief Ask for creation of a group. */ void createGroup(int ix); - void moveEffect(int current_pos, int new_pos, CollapsibleEffect *target); void unGroup(CollapsibleEffect *); - void addEffect(QDomElement e); + void createRegion(int, const KUrl&); + void deleteGroup(const QDomDocument&); + void importClipKeyframes(); };