added basic razor tool

This commit is contained in:
itsmattkc
2019-08-23 12:12:13 +10:00
parent 44dfacfa7a
commit 9439494c10
9 changed files with 175 additions and 11 deletions
+16
View File
@@ -64,6 +64,7 @@ void TimelineOutput::AttachTimeline(TimelinePanel *timeline)
//disconnect(view, SIGNAL(RequestInsertBlockAtIndex(Block*, int)), this, SLOT(InsertBlockAtIndex(Block*, int)));
disconnect(view, SIGNAL(RequestPlaceBlock(Block*, rational, int)), this, SLOT(PlaceBlock(Block*, rational, int)));
disconnect(view, SIGNAL(RequestReplaceBlock(Block*, Block*, int)), this, SLOT(ReplaceBlock(Block*, Block*, int)));
disconnect(view, SIGNAL(RequestSplitAtTime(rational, int)), this, SLOT(SplitAtTime(rational, int)));
// Remove existing UI objects from TimelinePanel
attached_timeline_->Clear();
@@ -86,6 +87,7 @@ void TimelineOutput::AttachTimeline(TimelinePanel *timeline)
//connect(view, SIGNAL(RequestInsertBlockAtIndex(Block*, int)), this, SLOT(InsertBlockAtIndex(Block*, int)));
connect(view, SIGNAL(RequestPlaceBlock(Block*, rational, int)), this, SLOT(PlaceBlock(Block*, rational, int)));
connect(view, SIGNAL(RequestReplaceBlock(Block*, Block*, int)), this, SLOT(ReplaceBlock(Block*, Block*, int)));
connect(view, SIGNAL(RequestSplitAtTime(rational, int)), this, SLOT(SplitAtTime(rational, int)));
}
}
@@ -255,3 +257,17 @@ void TimelineOutput::ReplaceBlock(Block *old, Block *replace, int track)
{
track_cache_.at(track)->ReplaceBlock(old, replace);
}
void TimelineOutput::SplitAtTime(rational time, int track)
{
if (track >= track_cache_.size()) {
return;
}
track_cache_.at(track)->SplitAtTime(time);
}
void TimelineOutput::ResizeBlock(Block *block, rational new_length)
{
block->set_length(new_length);
}
+10
View File
@@ -112,6 +112,16 @@ private slots:
*/
void ReplaceBlock(Block* old, Block* replace, int track);
/**
* @brief Forwards a SplitAtTime signal to the appropriate track
*/
void SplitAtTime(rational time, int track);
/**
* @brief Resizes a Block
*/
void ResizeBlock(Block* block, rational new_length);
};
#endif // TIMELINEOUTPUT_H