Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 62266f20 authored by Nicolas Carion's avatar Nicolas Carion

move calls to the core that involve mainWindow or a monitor out of timelineModel

parent 40592057
......@@ -283,6 +283,7 @@ template <> struct hash<QString>
}
// The following is a hack that allows to use shared_from_this in the case of a multiple inheritance.
// Credit: https://stackoverflow.com/questions/14939190/boost-shared-from-this-and-multiple-inheritance
template<typename T> struct enable_shared_from_this_virtual;
class enable_shared_from_this_virtual_base : public std::enable_shared_from_this<enable_shared_from_this_virtual_base>
......
......@@ -1552,17 +1552,17 @@ Mlt::Producer *TimelineModel::producer()
return prod;
}
void TimelineModel::checkRefresh(int start, int end) const
void TimelineModel::checkRefresh(int start, int end)
{
int currentPos = tractor()->position();
if (currentPos > start && currentPos < end) {
pCore->requestMonitorRefresh();
emit requestMonitorRefresh();
}
}
void TimelineModel::clearAssetView(int itemId)
{
pCore->clearAssetPanel(itemId);
emit requestClearAssetView(itemId);
}
std::shared_ptr<AssetParameterModel> TimelineModel::getCompositionParameterModel(int compoId) const
......
......@@ -537,11 +537,16 @@ protected:
bool checkConsistency();
/* @brief Refresh project monitor if cursor was inside range */
void checkRefresh(int start, int end) const;
void checkRefresh(int start, int end);
/* @brief Clear effet/composition view */
/* @brief Send signal to require clearing effet/composition view */
void clearAssetView(int itemId);
signals:
/* @brief signal triggered by clearAssetView */
void requestClearAssetView(int);
void requestMonitorRefresh();
protected:
std::unique_ptr<Mlt::Tractor> m_tractor;
......
......@@ -52,6 +52,10 @@ TimelineController::TimelineController(KActionCollection *actionCollection, QObj
void TimelineController::setModel(std::shared_ptr<TimelineItemModel> model)
{
m_model = std::move(model);
connect(m_model.get(), &TimelineItemModel::requestClearAssetView,
[&](int id){pCore->clearAssetPanel(id);});
connect(m_model.get(), &TimelineItemModel::requestMonitorRefresh,
[&](){pCore->requestMonitorRefresh();});
}
std::shared_ptr<TimelineItemModel> TimelineController::getModel() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment