Commit 689e351a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2004'

parents 46a67072 80104a2f
Pipeline #17544 passed with stage
in 23 minutes and 59 seconds
......@@ -1921,7 +1921,7 @@ QSize Monitor::profileSize() const
void Monitor::loadQmlScene(MonitorSceneType type, QVariant sceneData)
{
if (m_id == Kdenlive::DvdMonitor || type == m_qmlManager->sceneType()) {
if (m_id == Kdenlive::DvdMonitor || (type == m_qmlManager->sceneType() && sceneData.isNull())) {
return;
}
bool sceneWithEdit = type == MonitorSceneGeometry || type == MonitorSceneCorners || type == MonitorSceneRoto;
......
......@@ -829,16 +829,19 @@ QStringList TimelineFunctions::enableMultitrackView(const std::shared_ptr<Timeli
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
service.reset(service->producer());
QString serviceName = t.get("mlt_service");
int added = t.get_int("internal_added");
if (added == 237 && serviceName != QLatin1String("mix")) {
// remove all compositing transitions
// Disable all compositing transitions
t.set("disable", enable ? "1" : nullptr);
} else if (!enable && added == 200) {
} else if (added == 200) {
field->disconnect_service(t);
t.disconnect_all_producers();
}
} else {
service.reset(service->producer());
}
service.reset(service->producer());
}
if (enable) {
int count = 0;
......
......@@ -435,6 +435,7 @@ void TimelineItemModel::setTrackProperty(int trackId, const QString &name, const
std::shared_ptr<TrackModel> track = getTrackById(trackId);
track->setProperty(name, value);
QVector<int> roles;
bool updateMultiTrack = false;
if (name == QLatin1String("kdenlive:track_name")) {
roles.push_back(NameRole);
} else if (name == QLatin1String("kdenlive:locked_track")) {
......@@ -443,6 +444,7 @@ void TimelineItemModel::setTrackProperty(int trackId, const QString &name, const
roles.push_back(IsDisabledRole);
if (!track->isAudioTrack()) {
pCore->requestMonitorRefresh();
updateMultiTrack = true;
}
} else if (name == QLatin1String("kdenlive:timeline_active")) {
roles.push_back(TrackActiveRole);
......@@ -456,6 +458,9 @@ void TimelineItemModel::setTrackProperty(int trackId, const QString &name, const
if (!roles.isEmpty()) {
QModelIndex ix = makeTrackIndexFromID(trackId);
emit dataChanged(ix, ix, roles);
if (updateMultiTrack) {
emit trackVisibilityChanged();
}
}
}
......
......@@ -109,5 +109,9 @@ public:
protected:
// This is an helper function that finishes a construction of a freshly created TimelineItemModel
static void finishConstruct(const std::shared_ptr<TimelineItemModel> &ptr, const std::shared_ptr<MarkerListModel> &guideModel);
signals:
/** @brief Triggered when a video track visibility changed */
void trackVisibilityChanged();
};
#endif
......@@ -2875,6 +2875,7 @@ void TimelineController::slotMultitrackView(bool enable, bool refresh)
pCore->monitorManager()->projectMonitor()->slotShowEffectScene(enable ? MonitorSplitTrack : MonitorSceneNone, false, QVariant(trackNames));
QObject::disconnect( m_connection );
if (enable) {
connect(m_model.get(), &TimelineItemModel::trackVisibilityChanged, this, &TimelineController::updateMultiTrack, Qt::UniqueConnection);
m_connection = connect(this, &TimelineController::activeTrackChanged, [this]() {
int ix = 0;
auto it = m_model->m_allTracks.cbegin();
......@@ -2891,9 +2892,17 @@ void TimelineController::slotMultitrackView(bool enable, bool refresh)
}
pCore->monitorManager()->projectMonitor()->updateMultiTrackView(ix);
});
} else {
disconnect(m_model.get(), &TimelineItemModel::trackVisibilityChanged, this, &TimelineController::updateMultiTrack);
}
}
void TimelineController::updateMultiTrack()
{
QStringList trackNames = TimelineFunctions::enableMultitrackView(m_model, true, true);
pCore->monitorManager()->projectMonitor()->slotShowEffectScene(MonitorSplitTrack, false, QVariant(trackNames));
}
void TimelineController::activateTrackAndSelect(int trackPosition)
{
int tid = -1;
......
......@@ -541,7 +541,7 @@ public slots:
void invalidateZone(int in, int out);
void checkDuration();
/** @brief Dis / enable multi track view. */
void slotMultitrackView(bool enable, bool refresh = true);
void slotMultitrackView(bool enable = true, bool refresh = true);
/** @brief Activate a video track by its position (0 = topmost). */
void activateTrackAndSelect(int trackPosition);
/** @brief Save timeline selected clips to target folder. */
......@@ -555,6 +555,8 @@ private slots:
void updateClipActions();
void updateVideoTarget();
void updateAudioTarget();
/** @brief Dis / enable multi track view. */
void updateMultiTrack();
public:
/** @brief a list of actions that have to be enabled/disabled depending on the timeline selection */
......
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