Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
533f860c
Commit
533f860c
authored
Sep 06, 2010
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TracksView: Removing more ClipHelper occurences.
parent
1cf82527
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
28 deletions
+19
-28
src/Gui/timeline/TracksView.cpp
src/Gui/timeline/TracksView.cpp
+14
-22
src/Gui/timeline/TracksView.h
src/Gui/timeline/TracksView.h
+3
-4
src/Workflow/TrackWorkflow.cpp
src/Workflow/TrackWorkflow.cpp
+1
-1
src/Workflow/TrackWorkflow.h
src/Workflow/TrackWorkflow.h
+1
-1
No files found.
src/Gui/timeline/TracksView.cpp
View file @
533f860c
...
...
@@ -128,8 +128,8 @@ TracksView::addTrack( Workflow::TrackType type )
m_scene
->
invalidate
();
// Redraw the background
connect
(
track
->
trackWorkflow
(),
SIGNAL
(
clipAdded
(
TrackWorkflow
*
,
ClipHelper
*
,
qint64
)
),
this
,
SLOT
(
addMediaItem
(
TrackWorkflow
*
,
ClipHelper
*
,
qint64
)
)
);
connect
(
track
->
trackWorkflow
(),
SIGNAL
(
clipRemoved
(
TrackWorkflow
*
,
ClipHelper
*
)
),
this
,
SLOT
(
removeMediaItem
(
TrackWorkflow
*
,
ClipHelper
*
)
)
);
connect
(
track
->
trackWorkflow
(),
SIGNAL
(
clipRemoved
(
TrackWorkflow
*
,
const
QUuid
&
)
),
this
,
SLOT
(
removeMediaItem
(
TrackWorkflow
*
,
const
QUuid
&
)
)
);
connect
(
track
->
trackWorkflow
(),
SIGNAL
(
clipMoved
(
TrackWorkflow
*
,
const
QUuid
&
,
qint64
)
),
this
,
SLOT
(
moveMediaItem
(
TrackWorkflow
*
,
const
QUuid
&
,
qint64
)
)
);
...
...
@@ -198,27 +198,20 @@ TracksView::clear()
void
TracksView
::
removeClip
(
const
QUuid
&
uuid
)
{
AbstractGraphicsMediaItem
*
item
;
// Get the list of all items in the timeline
QList
<
AbstractGraphics
Media
Item
*>
items
=
media
Items
();
QList
<
AbstractGraphicsItem
*>
items
=
timeline
Items
();
// Iterate over each item to check if their parent's uuid
// is the one we would like to remove.
foreach
(
item
,
items
)
foreach
(
AbstractGraphicsItem
*
item
,
items
)
{
if
(
item
->
clipHelper
()
->
clip
()
->
uuid
()
==
uuid
||
item
->
clipHelper
()
->
clip
()
->
isChild
(
uuid
)
==
true
)
//This is probably useless now
if
(
item
->
uuid
()
==
uuid
)
{
// This item needs to be removed.
// Saving its values
QUuid
itemUuid
=
item
->
uuid
();
// Remove the item from the timeline
removeMediaItem
(
item
->
track
()
->
trackWorkflow
(),
item
->
clipHelper
()
);
removeMediaItem
(
item
->
track
()
->
trackWorkflow
(),
item
->
uuid
()
);
// Removing the item from the backend.
item
->
track
()
->
trackWorkflow
()
->
removeClip
(
item
U
uid
);
item
->
track
()
->
trackWorkflow
()
->
removeClip
(
item
->
u
uid
()
);
}
}
}
...
...
@@ -649,7 +642,7 @@ TracksView::findPosition( AbstractGraphicsItem *item, qint32 track, qint64 time
}
void
TracksView
::
removeMediaItem
(
TrackWorkflow
*
tw
,
ClipHelper
*
ch
)
TracksView
::
removeMediaItem
(
TrackWorkflow
*
tw
,
const
QUuid
&
uuid
)
{
GraphicsTrack
*
track
=
getTrack
(
tw
->
type
(),
tw
->
trackId
()
);
...
...
@@ -661,7 +654,7 @@ TracksView::removeMediaItem( TrackWorkflow *tw, ClipHelper *ch )
{
AbstractGraphicsMediaItem
*
item
=
dynamic_cast
<
AbstractGraphicsMediaItem
*>
(
trackItems
.
at
(
i
)
);
if
(
!
item
||
item
->
uuid
()
!=
ch
->
uuid
()
)
continue
;
if
(
!
item
||
item
->
uuid
()
!=
uuid
)
continue
;
removeMediaItem
(
item
);
}
}
...
...
@@ -1101,18 +1094,17 @@ TracksView::mediaItems( const QPoint &pos )
return
mediaCollisionList
;
}
QList
<
AbstractGraphics
Media
Item
*>
TracksView
::
media
Items
()
QList
<
AbstractGraphicsItem
*>
TracksView
::
timeline
Items
()
{
//TODO optimization needed!
QGraphicsItem
*
item
;
AbstractGraphicsMediaItem
*
ami
;
QList
<
AbstractGraphicsMediaItem
*>
outlist
;
QList
<
AbstractGraphicsItem
*>
outlist
;
QList
<
QGraphicsItem
*>
list
=
items
();
foreach
(
item
,
list
)
{
ami
=
dynamic_cast
<
AbstractGraphics
Media
Item
*>
(
item
);
if
(
ami
)
AbstractGraphicsItem
*
ami
=
dynamic_cast
<
AbstractGraphicsItem
*>
(
item
);
if
(
ami
!=
NULL
)
outlist
.
append
(
ami
);
}
return
outlist
;
...
...
src/Gui/timeline/TracksView.h
View file @
533f860c
...
...
@@ -158,7 +158,7 @@ public:
* \warning Calling this method can be excessively slow!
* \sa mediaItems( const QPoint& pos )
*/
QList
<
AbstractGraphics
Media
Item
*>
media
Items
();
QList
<
AbstractGraphicsItem
*>
timeline
Items
();
/**
* \brief Remove multiple items from the timeline.
* \param items A QList of pointers to AbstractGraphicsMediaItem.
...
...
@@ -218,11 +218,10 @@ public slots:
void
moveMediaItem
(
TrackWorkflow
*
tw
,
const
QUuid
&
uuid
,
qint64
time
);
/**
* \brief Remove an item from the timeline.
* \param tw The targeted TrackWorkflow
* \param uuid The Universally Unique Identifier of the item.
* \param track The current track of the item.
* \param trackType The type of the track (Audio or Video)
*/
void
removeMediaItem
(
TrackWorkflow
*
tw
,
ClipHelper
*
ch
);
void
removeMediaItem
(
TrackWorkflow
*
tw
,
const
QUuid
&
uuid
);
/**
* \brief This is an overloaded method provided for convenience.
* \param item A pointer to AbstractGraphicsMediaItem.
...
...
src/Workflow/TrackWorkflow.cpp
View file @
533f860c
...
...
@@ -400,7 +400,7 @@ Clip* TrackWorkflow::removeClip( const QUuid& id )
stopClipWorkflow
(
cw
);
computeLength
();
cw
->
disconnect
();
emit
clipRemoved
(
this
,
cw
->
getClipHelper
()
);
emit
clipRemoved
(
this
,
cw
->
getClipHelper
()
->
uuid
()
);
delete
cw
;
return
clip
;
}
...
...
src/Workflow/TrackWorkflow.h
View file @
533f860c
...
...
@@ -129,7 +129,7 @@ class TrackWorkflow : public EffectUser
signals:
void
lengthChanged
(
qint64
newLength
);
void
clipAdded
(
TrackWorkflow
*
,
ClipHelper
*
,
qint64
);
void
clipRemoved
(
TrackWorkflow
*
,
ClipHelper
*
);
void
clipRemoved
(
TrackWorkflow
*
,
const
QUuid
&
);
void
clipMoved
(
TrackWorkflow
*
,
const
QUuid
&
,
qint64
);
};
...
...
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