timeline: separate markers and workarea

This commit is contained in:
itsmattkc
2022-06-27 23:39:31 -07:00
parent 63f74691a5
commit 079d6beff2
34 changed files with 324 additions and 338 deletions
+7 -7
View File
@@ -638,7 +638,7 @@ void TimelineWidget::PasteInsert()
void TimelineWidget::DeleteInToOut(bool ripple)
{
if (!GetConnectedNode()
|| !GetConnectedNode()->GetTimelinePoints()->workarea()->enabled()) {
|| !GetConnectedNode()->GetWorkArea()->enabled()) {
return;
}
@@ -648,8 +648,8 @@ void TimelineWidget::DeleteInToOut(bool ripple)
command->add_child(new TimelineRippleRemoveAreaCommand(
sequence(),
GetConnectedNode()->GetTimelinePoints()->workarea()->in(),
GetConnectedNode()->GetTimelinePoints()->workarea()->out()));
GetConnectedNode()->GetWorkArea()->in(),
GetConnectedNode()->GetWorkArea()->out()));
} else {
QVector<Track*> unlocked_tracks = sequence()->GetUnlockedTracks();
@@ -657,7 +657,7 @@ void TimelineWidget::DeleteInToOut(bool ripple)
foreach (Track* track, unlocked_tracks) {
GapBlock* gap = new GapBlock();
gap->set_length_and_media_out(GetConnectedNode()->GetTimelinePoints()->workarea()->length());
gap->set_length_and_media_out(GetConnectedNode()->GetWorkArea()->length());
command->add_child(new NodeAddCommand(static_cast<NodeGraph*>(track->parent()),
gap));
@@ -665,17 +665,17 @@ void TimelineWidget::DeleteInToOut(bool ripple)
command->add_child(new TrackPlaceBlockCommand(sequence()->track_list(track->type()),
track->Index(),
gap,
GetConnectedNode()->GetTimelinePoints()->workarea()->in()));
GetConnectedNode()->GetWorkArea()->in()));
}
}
// Clear workarea after this
command->add_child(new WorkareaSetEnabledCommand(GetConnectedNode()->project(),
GetConnectedNode()->GetTimelinePoints(),
GetConnectedNode()->GetWorkArea(),
false));
if (ripple) {
SetTimeAndSignal(GetConnectedNode()->GetTimelinePoints()->workarea()->in());
SetTimeAndSignal(GetConnectedNode()->GetWorkArea()->in());
}
Core::instance()->undo_stack()->push(command);
+1 -1
View File
@@ -231,7 +231,7 @@ void ImportTool::FootageToGhosts(rational ghost_start, const DraggedFootageData
rational footage_duration;
rational ghost_in;
TimelineWorkArea* wk = footage->GetTimelinePoints()->workarea();
TimelineWorkArea* wk = footage->GetWorkArea();
if (wk->enabled()) {
footage_duration = wk->length();
ghost_in = wk->in();
@@ -22,16 +22,15 @@
#define TIMELINEUNDOWORKAREA_H
#include "node/project/project.h"
#include "timeline/timelinepoints.h"
namespace olive {
class WorkareaSetEnabledCommand : public UndoCommand {
public:
WorkareaSetEnabledCommand(Project *project, TimelinePoints* points, bool enabled) :
WorkareaSetEnabledCommand(Project *project, TimelineWorkArea* points, bool enabled) :
project_(project),
points_(points),
old_enabled_(points_->workarea()->enabled()),
old_enabled_(points_->enabled()),
new_enabled_(enabled)
{
}
@@ -44,18 +43,18 @@ public:
protected:
virtual void redo() override
{
points_->workarea()->set_enabled(new_enabled_);
points_->set_enabled(new_enabled_);
}
virtual void undo() override
{
points_->workarea()->set_enabled(old_enabled_);
points_->set_enabled(old_enabled_);
}
private:
Project* project_;
TimelinePoints* points_;
TimelineWorkArea* points_;
bool old_enabled_;
@@ -547,7 +547,7 @@ void TimelineView::DrawBlock(QPainter *painter, bool foreground, Block *block, q
}
}
TimelineMarkerList *marker_list = clip->connected_viewer()->GetTimelinePoints()->markers();
TimelineMarkerList *marker_list = clip->connected_viewer()->GetMarkers();
if (!marker_list->empty()) {
clip_marker_rects_.clear();