Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
87ae7fb4
Commit
87ae7fb4
authored
Sep 13, 2010
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor clips moving
parent
f4cf352c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
33 deletions
+40
-33
src/EffectsEngine/EffectHelper.cpp
src/EffectsEngine/EffectHelper.cpp
+10
-3
src/EffectsEngine/EffectHelper.h
src/EffectsEngine/EffectHelper.h
+5
-3
src/Gui/timeline/AbstractGraphicsItem.h
src/Gui/timeline/AbstractGraphicsItem.h
+3
-3
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
+4
-6
src/Gui/timeline/AbstractGraphicsMediaItem.h
src/Gui/timeline/AbstractGraphicsMediaItem.h
+1
-2
src/Gui/timeline/GraphicsEffectItem.cpp
src/Gui/timeline/GraphicsEffectItem.cpp
+4
-6
src/Gui/timeline/GraphicsEffectItem.h
src/Gui/timeline/GraphicsEffectItem.h
+3
-2
src/Gui/timeline/TracksView.cpp
src/Gui/timeline/TracksView.cpp
+10
-8
No files found.
src/EffectsEngine/EffectHelper.cpp
View file @
87ae7fb4
...
...
@@ -43,15 +43,22 @@ EffectHelper::effectInstance() const
return
m_effectInstance
;
}
const
EffectUser
*
EffectHelper
::
target
()
const
EffectUser
*
EffectHelper
::
target
()
{
return
m_target
;
}
EffectUser
*
EffectHelper
::
oldTarget
()
{
return
m_oldTarget
;
}
void
EffectHelper
::
setTarget
(
const
EffectUser
*
target
)
EffectHelper
::
setTarget
(
EffectUser
*
target
)
{
m_oldTarget
=
m_target
;
m_target
=
target
;
m_begin
=
0
;
if
(
target
!=
NULL
)
...
...
src/EffectsEngine/EffectHelper.h
View file @
87ae7fb4
...
...
@@ -42,12 +42,14 @@ class EffectHelper : public Workflow::Helper
EffectInstance
*
effectInstance
();
const
EffectInstance
*
effectInstance
()
const
;
const
EffectUser
*
target
()
const
;
void
setTarget
(
const
EffectUser
*
target
);
EffectUser
*
target
();
EffectUser
*
oldTarget
();
void
setTarget
(
EffectUser
*
target
);
private:
EffectInstance
*
m_effectInstance
;
const
EffectUser
*
m_target
;
EffectUser
*
m_target
;
EffectUser
*
m_oldTarget
;
};
Q_DECLARE_METATYPE
(
EffectHelper
*
);
...
...
src/Gui/timeline/AbstractGraphicsItem.h
View file @
87ae7fb4
...
...
@@ -29,6 +29,7 @@ class GraphicsTrack;
class
TrackWorkflow
;
class
TracksScene
;
class
TracksView
;
class
EffectUser
;
class
QUuid
;
...
...
@@ -117,8 +118,7 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
virtual
qint64
end
()
const
=
0
;
qint64
width
()
const
;
virtual
void
triggerMove
(
TrackWorkflow
*
oldTrack
,
TrackWorkflow
*
newTrack
,
Workflow
::
Helper
*
helper
,
qint64
pos
)
=
0
;
virtual
void
triggerMove
(
EffectUser
*
target
)
=
0
;
virtual
void
triggerResize
(
TrackWorkflow
*
tw
,
Workflow
::
Helper
*
helper
,
qint64
newBegin
,
qint64
newEnd
,
qint64
pos
)
=
0
;
virtual
Workflow
::
Helper
*
helper
()
=
0
;
...
...
@@ -165,9 +165,9 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
/// This pointer will be set when inserted in the tracksView.
TracksView
*
m_tracksView
;
QColor
m_itemColor
;
TrackWorkflow
*
m_oldTrack
;
private:
TrackWorkflow
*
m_oldTrack
;
qint64
m_width
;
qint64
m_height
;
/// Pointer used to save the address of a linked item.
...
...
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
View file @
87ae7fb4
...
...
@@ -274,14 +274,12 @@ AbstractGraphicsMediaItem::end() const
}
void
AbstractGraphicsMediaItem
::
triggerMove
(
TrackWorkflow
*
oldTrack
,
TrackWorkflow
*
newTrack
,
Workflow
::
Helper
*
helper
,
qint64
pos
)
AbstractGraphicsMediaItem
::
triggerMove
(
EffectUser
*
target
)
{
ClipHelper
*
clipHelper
=
qobject_cast
<
ClipHelper
*>
(
helper
);
if
(
clipHelper
==
NULL
)
TrackWorkflow
*
tw
=
qobject_cast
<
TrackWorkflow
*>
(
target
);
if
(
tw
==
NULL
)
return
;
Commands
::
trigger
(
new
Commands
::
Clip
::
Move
(
oldTrack
,
newTrack
,
clipHelper
,
pos
)
);
Commands
::
trigger
(
new
Commands
::
Clip
::
Move
(
m_oldTrack
,
tw
,
m_clipHelper
,
startPos
()
)
);
}
Workflow
::
Helper
*
...
...
src/Gui/timeline/AbstractGraphicsMediaItem.h
View file @
87ae7fb4
...
...
@@ -57,8 +57,7 @@ public:
virtual
qint64
end
()
const
;
virtual
Workflow
::
Helper
*
helper
();
virtual
void
triggerMove
(
TrackWorkflow
*
oldTrack
,
TrackWorkflow
*
newTrack
,
Workflow
::
Helper
*
helper
,
qint64
pos
);
virtual
void
triggerMove
(
EffectUser
*
target
);
virtual
void
triggerResize
(
TrackWorkflow
*
tw
,
Workflow
::
Helper
*
helper
,
qint64
newBegin
,
qint64
newEnd
,
qint64
pos
);
virtual
qint64
itemHeight
()
const
;
...
...
src/Gui/timeline/GraphicsEffectItem.cpp
View file @
87ae7fb4
...
...
@@ -25,6 +25,7 @@
#include "Commands.h"
#include "EffectHelper.h"
#include "EffectInstance.h"
#include "GraphicsTrack.h"
#include "Timeline.h"
#include "TracksView.h"
#include "TrackWorkflow.h"
...
...
@@ -245,13 +246,10 @@ GraphicsEffectItem::helper()
}
void
GraphicsEffectItem
::
triggerMove
(
TrackWorkflow
*
oldTrack
,
TrackWorkflow
*
newTrack
,
Workflow
::
Helper
*
helper
,
qint64
pos
)
GraphicsEffectItem
::
triggerMove
(
EffectUser
*
target
)
{
EffectHelper
*
eh
=
qobject_cast
<
EffectHelper
*>
(
helper
);
if
(
eh
==
NULL
)
return
;
Commands
::
trigger
(
new
Commands
::
Effect
::
Move
(
eh
,
oldTrack
,
newTrack
,
pos
)
);
Commands
::
trigger
(
new
Commands
::
Effect
::
Move
(
m_effectHelper
,
m_effectHelper
->
oldTarget
(),
target
,
startPos
()
)
);
}
void
...
...
src/Gui/timeline/GraphicsEffectItem.h
View file @
87ae7fb4
...
...
@@ -26,6 +26,8 @@
#include "AbstractGraphicsItem.h"
#include "EffectsEngine.h"
class
EffectUser
;
class
QUuid
;
class
GraphicsEffectItem
:
public
AbstractGraphicsItem
...
...
@@ -48,8 +50,7 @@ class GraphicsEffectItem : public AbstractGraphicsItem
virtual
qint64
maxBegin
()
const
;
virtual
qint64
maxEnd
()
const
;
virtual
Workflow
::
Helper
*
helper
();
virtual
void
triggerMove
(
TrackWorkflow
*
oldTrack
,
TrackWorkflow
*
newTrack
,
Workflow
::
Helper
*
helper
,
qint64
pos
);
virtual
void
triggerMove
(
EffectUser
*
target
);
virtual
void
triggerResize
(
TrackWorkflow
*
tw
,
Workflow
::
Helper
*
helper
,
qint64
newBegin
,
qint64
newEnd
,
qint64
pos
);
virtual
qint64
itemHeight
()
const
;
...
...
src/Gui/timeline/TracksView.cpp
View file @
87ae7fb4
...
...
@@ -229,7 +229,6 @@ TracksView::removeClip( const QUuid& uuid )
void
TracksView
::
addItem
(
TrackWorkflow
*
tw
,
Workflow
::
Helper
*
helper
,
qint64
start
)
{
qDebug
()
<<
"Adding item:"
<<
helper
->
uuid
();
Q_ASSERT
(
helper
);
//If for some reasons the clip was already loaded, don't add it twice.
...
...
@@ -1057,16 +1056,19 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
UndoStack
::
getInstance
()
->
beginMacro
(
"Move clip"
);
m_actionItem
->
triggerMove
(
m_actionItem
->
m_oldTrack
,
m_actionItem
->
track
()
->
trackWorkflow
(),
m_actionItem
->
helper
(),
m_actionItem
->
startPos
()
);
// m_actionItem->triggerMove( m_oldTrack, m_actionItem->track()->trackWorkflow(),
// m_actionItem->helper(), m_actionItem->startPos() );
EffectUser
*
target
=
m_actionItem
->
track
()
->
trackWorkflow
();
// GraphicsEffectItem *effectItem = qobject_cast<GraphicsEffectItem*>( m_actionItem );
// if ( effectItem != NULL )
// {
// }
m_actionItem
->
triggerMove
(
target
);
// Update the linked item too
if
(
m_actionItem
->
groupItem
()
)
{
//CHECK: This used to use m_actionItem and not m_actionItem->groupItem().
m_actionItem
->
groupItem
()
->
triggerMove
(
m_actionItem
->
groupItem
()
->
m_oldTrack
,
m_actionItem
->
groupItem
()
->
track
()
->
trackWorkflow
(),
m_actionItem
->
groupItem
()
->
helper
(),
m_actionItem
->
startPos
()
);
m_actionItem
->
groupItem
()
->
triggerMove
(
m_actionItem
->
groupItem
()
->
track
()
->
trackWorkflow
()
);
m_actionItem
->
groupItem
()
->
m_oldTrack
=
m_actionItem
->
groupItem
()
->
track
()
->
trackWorkflow
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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