Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
80104a2f
Commit
80104a2f
authored
Mar 30, 2020
by
Jean-Baptiste Mardelle
Browse files
Multitrack mode: auto refresh when a track visibility changes.
Related to
#231
parent
1a03fe69
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/monitor/monitor.cpp
View file @
80104a2f
...
...
@@ -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
;
...
...
src/timeline2/model/timelinefunctions.cpp
View file @
80104a2f
...
...
@@ -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"
))
{
//
remov
e all compositing transitions
//
Disabl
e 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
;
...
...
src/timeline2/model/timelineitemmodel.cpp
View file @
80104a2f
...
...
@@ -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
();
}
}
}
...
...
src/timeline2/model/timelineitemmodel.hpp
View file @
80104a2f
...
...
@@ -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
src/timeline2/view/timelinecontroller.cpp
View file @
80104a2f
...
...
@@ -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
;
...
...
src/timeline2/view/timelinecontroller.h
View file @
80104a2f
...
...
@@ -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 */
...
...
Eugen Mohr
@emohr
mentioned in issue
#600 (closed)
·
Mar 30, 2020
mentioned in issue
#600 (closed)
mentioned in issue #600
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment