Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
9711575e
Commit
9711575e
authored
Jul 18, 2009
by
Hugo Beauzee-Luyssen
Browse files
Workflow length is now updated everywhere, for every case.
This fixes issue #30.
parent
7f0a978e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Workflow/MainWorkflow.cpp
View file @
9711575e
...
...
@@ -72,22 +72,28 @@ void MainWorkflow::addClip( Clip* clip, unsigned int trackId, qint64 start )
m_length
=
m_tracks
[
trackId
]
->
getLength
();
}
void
MainWorkflow
::
startRender
()
void
MainWorkflow
::
computeLength
()
{
qint64
maxLength
=
0
;
m_renderStarted
=
true
;
m_currentFrame
=
0
;
emit
frameChanged
(
0
);
for
(
unsigned
int
i
=
0
;
i
<
m_trackCount
;
++
i
)
{
m_tracks
[
i
].
activate
();
if
(
m_tracks
[
i
]
->
getLength
()
>
maxLength
)
maxLength
=
m_tracks
[
i
]
->
getLength
();
}
m_length
=
maxLength
;
}
void
MainWorkflow
::
startRender
()
{
m_renderStarted
=
true
;
m_currentFrame
=
0
;
emit
frameChanged
(
0
);
for
(
unsigned
int
i
=
0
;
i
<
m_trackCount
;
++
i
)
m_tracks
[
i
].
activate
();
computeLength
();
}
unsigned
char
*
MainWorkflow
::
getOutput
()
{
QReadLocker
lock
(
m_renderStartedLock
);
...
...
@@ -217,6 +223,7 @@ void MainWorkflow::clipMoved( QUuid clipUuid, int oldTrack, int newTra
m_tracks
[
oldTrack
].
activate
();
m_tracks
[
newTrack
].
activate
();
}
computeLength
();
}
void
MainWorkflow
::
activateOneFrameOnly
()
...
...
src/Workflow/MainWorkflow.h
View file @
9711575e
...
...
@@ -80,6 +80,10 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
private:
static
MainWorkflow
*
m_instance
;
private:
void
computeLength
();
private:
Toggleable
<
TrackWorkflow
*>*
m_tracks
;
qint64
m_currentFrame
;
...
...
src/Workflow/TrackWorkflow.cpp
View file @
9711575e
...
...
@@ -52,10 +52,8 @@ TrackWorkflow::~TrackWorkflow()
void
TrackWorkflow
::
addClip
(
Clip
*
clip
,
qint64
start
)
{
QWriteLocker
lock
(
m_clipsLock
);
ClipWorkflow
*
cw
=
new
ClipWorkflow
(
clip
);
m_clips
.
insert
(
start
,
cw
);
computeLength
();
addClip
(
cw
,
start
);
}
void
TrackWorkflow
::
addClip
(
ClipWorkflow
*
cw
,
qint64
start
)
...
...
@@ -410,6 +408,7 @@ void TrackWorkflow::moveClip( const QUuid& id, qint64 startingFrame )
m_clips
[
startingFrame
]
=
cw
;
QMutexLocker
lock
(
m_forceRepositionningMutex
);
m_forceRepositionning
=
true
;
computeLength
();
return
;
}
++
it
;
...
...
@@ -434,6 +433,7 @@ Clip* TrackWorkflow::removeClip( const QUuid& id )
m_clips
.
erase
(
it
);
// stopClipWorkflow( cw );
// delete cw;
computeLength
();
return
clip
;
}
++
it
;
...
...
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