only allow splitting clips

This commit is contained in:
itsmattkc
2020-01-07 19:04:24 +11:00
parent a616aaa182
commit d9572fa4e5
5 changed files with 5 additions and 10 deletions
+1 -1
View File
@@ -362,7 +362,7 @@ void TimelineWidget::SplitAtPlayhead()
foreach (TrackOutput* track, timeline_node_->Tracks()) {
Block* b = track->BlockContainingTime(playhead_time);
if (b) {
if (b && b->type() == Block::kClip) {
bool selected = false;
// See if this block is selected
+1
View File
@@ -67,6 +67,7 @@ void TimelineWidget::RazorTool::MouseRelease(TimelineViewMouseEvent *event)
// Ensure there's a valid block here
if (block_at_time
&& block_at_time->type() == Block::kClip
&& !blocks_to_split.contains(block_at_time)) {
blocks_to_split.append(block_at_time);
+1 -1
View File
@@ -351,7 +351,7 @@ BlockSplitCommand::BlockSplitCommand(TrackOutput* track, Block *block, rational
old_length_(block->length()),
point_(point)
{
Q_ASSERT(point > block_->in() && point < block_->out());
Q_ASSERT(point > block_->in() && point < block_->out() && block_->type() == Block::kClip);
// Ensures that this block is deleted if this action is undone
new_block_ = static_cast<Block*>(block_->copy());