timeline: reimplemented deleting/ripple deleting the in/out region
This commit is contained in:
@@ -150,6 +150,10 @@ public:
|
||||
|
||||
virtual void GoToOut(){}
|
||||
|
||||
virtual void DeleteInToOut(){}
|
||||
|
||||
virtual void RippleDeleteInToOut(){}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief paintEvent
|
||||
|
||||
@@ -689,6 +689,47 @@ void TimelineWidget::Paste(bool insert)
|
||||
Core::instance()->undo_stack()->pushIfHasChildren(command);
|
||||
}
|
||||
|
||||
void TimelineWidget::DeleteInToOut(bool ripple)
|
||||
{
|
||||
if (!GetConnectedNode()
|
||||
|| !GetConnectedTimelinePoints()
|
||||
|| !GetConnectedTimelinePoints()->workarea()->enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QUndoCommand* command = new QUndoCommand();
|
||||
|
||||
foreach (TrackOutput* track, GetConnectedNode()->Tracks()) {
|
||||
if (!track->IsLocked()) {
|
||||
if (ripple) {
|
||||
new TrackRippleRemoveAreaCommand(track,
|
||||
GetConnectedTimelinePoints()->workarea()->in(),
|
||||
GetConnectedTimelinePoints()->workarea()->out(),
|
||||
command);
|
||||
} else {
|
||||
GapBlock* gap = new GapBlock();
|
||||
|
||||
gap->set_length_and_media_out(GetConnectedTimelinePoints()->workarea()->length());
|
||||
|
||||
new NodeAddCommand(static_cast<NodeGraph*>(track->parent()),
|
||||
gap,
|
||||
command);
|
||||
|
||||
new TrackPlaceBlockCommand(GetConnectedNode()->track_list(track->track_type()),
|
||||
track->Index(),
|
||||
gap,
|
||||
GetConnectedTimelinePoints()->workarea()->in(),
|
||||
command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clear workarea after this
|
||||
new WorkareaSetEnabledCommand(GetConnectedTimelinePoints(), false, command);
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
}
|
||||
|
||||
QList<TimelineViewBlockItem *> TimelineWidget::GetSelectedBlocks()
|
||||
{
|
||||
QList<TimelineViewBlockItem *> list;
|
||||
|
||||
@@ -86,6 +86,8 @@ public:
|
||||
|
||||
void Paste(bool insert);
|
||||
|
||||
void DeleteInToOut(bool ripple);
|
||||
|
||||
QList<TimelineViewBlockItem*> GetSelectedBlocks();
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user