File indexing completed on 2024-12-22 04:36:19
0001 /* 0002 SPDX-FileCopyrightText: 2018 Jean-Baptiste Mardelle <jb@kdenlive.org> 0003 This file is part of Kdenlive. See www.kdenlive.org. 0004 0005 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #pragma once 0009 0010 #include "../../../bpoint.h" 0011 #include "assets/keyframes/model/keyframemonitorhelper.hpp" 0012 #include <QPersistentModelIndex> 0013 #include <QVariant> 0014 0015 class Monitor; 0016 0017 /** @class RotoHelper 0018 @brief \@todo Describe class RotoHelper 0019 @todo Describe class RotoHelper 0020 */ 0021 class RotoHelper : public KeyframeMonitorHelper 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 /** @brief Construct a keyframe list bound to the given effect 0027 @param init_value is the value taken by the param at time 0. 0028 @param model is the asset this parameter belong to 0029 @param index is the index of this parameter in its model 0030 */ 0031 explicit RotoHelper(Monitor *monitor, std::shared_ptr<AssetParameterModel> model, QPersistentModelIndex index, QObject *parent = nullptr); 0032 /** @brief Send signals to the monitor to update the qml overlay. 0033 @param returns : true if the monitor's connection was changed to active. 0034 */ 0035 static QVariant getSpline(const QVariant &value, const QSize frame); 0036 /** @brief Returns a list of spline control points, based on its string definition and frame size 0037 @param value : the spline's string definition 0038 @param frame: the frame size 0039 */ 0040 static QList<BPoint> getPoints(const QVariant &value, const QSize frame); 0041 void refreshParams(int pos) override; 0042 0043 private Q_SLOTS: 0044 void slotUpdateFromMonitorData(const QVariantList &v) override; 0045 };