File indexing completed on 2024-05-19 04:54:22

0001 /*
0002     SPDX-FileCopyrightText: 2017 Nicolas Carion
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #pragma once
0007 
0008 #include "abstracteffectitem.hpp"
0009 #include "abstractmodel/treeitem.hpp"
0010 
0011 class EffectStackModel;
0012 /** @brief This represents a group of effects of the effectstack
0013  */
0014 class EffectGroupModel : public AbstractEffectItem
0015 {
0016 
0017 public:
0018     /** @brief This construct an effect of the given id
0019        @param is a ptr to the model this item belongs to. This is required to send update signals
0020      */
0021     static std::shared_ptr<EffectGroupModel> construct(const QString &name, std::shared_ptr<AbstractTreeModel> stack, bool isRoot = false);
0022 
0023     /** @brief Return true if the effect applies only to audio */
0024     bool isAudio() const override;
0025     bool isUnique() const override;
0026 
0027     /** @brief This function plants the effect into the given service in last position
0028      */
0029     void plant(const std::weak_ptr<Mlt::Service> &service) override;
0030     void plantClone(const std::weak_ptr<Mlt::Service> &service) override;
0031     /** @brief This function unplants (removes) the effect from the given service
0032      */
0033     void unplant(const std::weak_ptr<Mlt::Service> &service) override;
0034     void unplantClone(const std::weak_ptr<Mlt::Service> &service) override;
0035 
0036 protected:
0037     EffectGroupModel(const QList<QVariant> &data, QString name, const std::shared_ptr<AbstractTreeModel> &stack, bool isRoot = false);
0038 
0039     void updateEnable(bool updateTimeline = true) override;
0040 
0041     QString m_name;
0042 };