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
bba5a790
Commit
bba5a790
authored
Jun 26, 2009
by
Hugo Beauzee-Luyssen
Browse files
Solved bugs when moving clips between tracks
parent
fa3301d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Workflow/ClipWorkflow.cpp
View file @
bba5a790
...
...
@@ -210,13 +210,17 @@ Clip* ClipWorkflow::getClip()
void
ClipWorkflow
::
stop
()
{
Q_ASSERT
(
m_mediaPlayer
!=
NULL
);
m_mediaPlayer
->
stop
();
disconnect
(
m_mediaPlayer
,
SIGNAL
(
endReached
()
),
this
,
SLOT
(
clipEndReached
()
)
);
m_mediaPlayer
=
NULL
;
setState
(
Stopped
);
QMutexLocker
lock
(
m_requiredStateLock
);
m_requiredState
=
ClipWorkflow
::
None
;
if
(
m_mediaPlayer
)
{
m_mediaPlayer
->
stop
();
disconnect
(
m_mediaPlayer
,
SIGNAL
(
endReached
()
),
this
,
SLOT
(
clipEndReached
()
)
);
m_mediaPlayer
=
NULL
;
setState
(
Stopped
);
QMutexLocker
lock
(
m_requiredStateLock
);
m_requiredState
=
ClipWorkflow
::
None
;
}
else
qDebug
()
<<
"ClipWorkflow has already been stopped"
;
}
void
ClipWorkflow
::
setPosition
(
float
pos
)
...
...
src/Workflow/MainWorkflow.cpp
View file @
bba5a790
...
...
@@ -64,7 +64,6 @@ void MainWorkflow::addClip( Clip* clip, unsigned int trackId, qint64 start )
Q_ASSERT_X
(
trackId
<
m_trackCount
,
"MainWorkflow::addClip"
,
"The specified trackId isn't valid, for it's higher than the number of tracks"
);
// qDebug() << "MainWorkflow: Adding clip" << clip->getUuid() << "to track" << trackId;
//if the track is deactivated, we need to reactivate it :
if
(
m_tracks
[
trackId
].
deactivated
()
==
true
)
m_tracks
[
trackId
].
activate
();
...
...
@@ -102,9 +101,7 @@ unsigned char* MainWorkflow::getOutput()
if
(
m_tracks
[
i
].
activated
()
==
false
)
continue
;
if
(
(
ret
=
m_tracks
[
i
]
->
getOutput
(
m_currentFrame
)
)
!=
NULL
)
{
break
;
}
}
if
(
ret
==
NULL
)
ret
=
MainWorkflow
::
blackOutput
;
...
...
@@ -198,20 +195,17 @@ void MainWorkflow::clipMoved( QUuid clipUuid, int oldTrack, int newTra
{
Q_ASSERT
(
newTrack
<
m_trackCount
&&
oldTrack
<
m_trackCount
&&
oldTrack
>=
0
&&
newTrack
>=
0
);
//If the frame was stopped, reactivating it, since it can have something to render after
//the clip displacement
if
(
m_tracks
[
newTrack
].
activated
()
==
false
)
m_tracks
[
newTrack
].
activate
();
if
(
oldTrack
==
newTrack
)
{
//And now, just move the clip.
m_tracks
[
newTrack
]
->
moveClip
(
clipUuid
,
startingFrame
);
m_tracks
[
newTrack
].
activate
();
}
else
{
if
(
m_tracks
[
oldTrack
].
activated
()
==
false
)
m_tracks
[
oldTrack
].
activate
();
Clip
*
clip
=
m_tracks
[
oldTrack
]
->
removeClip
(
clipUuid
);
m_tracks
[
newTrack
]
->
addClip
(
clip
,
startingFrame
);
m_tracks
[
oldTrack
].
activate
();
m_tracks
[
newTrack
].
activate
();
}
}
src/Workflow/TrackWorkflow.cpp
View file @
bba5a790
...
...
@@ -190,7 +190,7 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
}
else
{
//
qDebug() << "Unexpected ClipWorkflow::State when stopping :" << cw->getState();
qDebug
()
<<
"Unexpected ClipWorkflow::State when stopping :"
<<
cw
->
getState
();
cw
->
getStateLock
()
->
unlock
();
}
}
...
...
@@ -261,7 +261,9 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
}
//Is it supposed to be stopped ?
else
{
stopClipWorkflow
(
cw
);
}
++
it
;
}
...
...
@@ -304,8 +306,11 @@ Clip* TrackWorkflow::removeClip( const QUuid& id )
if
(
it
.
value
()
->
getClip
()
->
getUuid
()
==
id
)
{
ClipWorkflow
*
cw
=
it
.
value
();
Clip
*
clip
=
cw
->
getClip
();
m_clips
.
erase
(
it
);
return
cw
->
getClip
();
stopClipWorkflow
(
cw
);
delete
cw
;
return
clip
;
}
++
it
;
}
...
...
src/tools/Toggleable.hpp
View file @
bba5a790
...
...
@@ -46,7 +46,7 @@ class Toggleable
}
T
operator
->
()
{
Q_ASSERT_X
(
m_activated
==
true
,
"Toggleable<T>::operator->"
,
"Pointer is deactivated"
);
//
Q_ASSERT_X( m_activated == true, "Toggleable<T>::operator->", "Pointer is deactivated" );
return
m_ptr
;
}
bool
activated
()
const
...
...
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