block: disable connecting and keyframing speed parameter

We're going to replace keyframing this with a time remap node
because that will be much simpler to implement.

Fixes #1192.
Fixes #1204.
This commit is contained in:
itsmattkc
2021-04-12 10:35:02 +10:00
parent 0afaf0a03d
commit da9cdbd29e
2 changed files with 23 additions and 34 deletions
+2 -9
View File
@@ -50,8 +50,9 @@ Block::Block() :
AddInput(kEnabledInput, NodeValue::kBoolean, true, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
AddInput(kSpeedInput, NodeValue::kFloat, 1.0);
AddInput(kSpeedInput, NodeValue::kFloat, 1.0, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
SetInputProperty(kSpeedInput, QStringLiteral("view"), FloatSlider::kPercentage);
SetInputProperty(kSpeedInput, QStringLiteral("min"), 0.0);
IgnoreHashingFrom(kSpeedInput);
// A block's length must be greater than 0
@@ -126,7 +127,6 @@ rational Block::SequenceToMediaTime(const rational &sequence_time) const
rational local_time = sequence_time;
// FIXME: Doesn't handle reversing
if (IsInputStatic(kSpeedInput)) {
double speed_value = GetStandardValue(kSpeedInput).toDouble();
if (qIsNull(speed_value)) {
@@ -136,9 +136,6 @@ rational Block::SequenceToMediaTime(const rational &sequence_time) const
// Multiply time
local_time = rational::fromDouble(local_time.toDouble() * speed_value);
}
} else {
// FIXME: We'll need to calculate the speed hoo boy
}
return local_time + media_in();
}
@@ -153,9 +150,6 @@ rational Block::MediaToSequenceTime(const rational &media_time) const
rational sequence_time = media_time - media_in();
// FIXME: Doesn't handle reversing
if (IsInputKeyframing(kSpeedInput) || IsInputConnected(kSpeedInput)) {
// FIXME: We'll need to calculate the speed hoo boy
} else {
double speed_value = GetStandardValue(kSpeedInput).toDouble();
if (qIsNull(speed_value)) {
@@ -165,7 +159,6 @@ rational Block::MediaToSequenceTime(const rational &media_time) const
// Multiply time
sequence_time = rational::fromDouble(sequence_time.toDouble() / speed_value);
}
}
return sequence_time;
}
-4
View File
@@ -227,9 +227,6 @@ NodeValueTable RenderProcessor::GenerateBlockTable(const Track *track, const Tim
}
// FIXME: Doesn't handle reversing
if (b->IsInputKeyframing(Block::kSpeedInput) || b->IsInputConnected(Block::kSpeedInput)) {
// FIXME: We'll need to calculate the speed hoo boy
} else {
double speed_value = b->GetStandardValue(Block::kSpeedInput).toDouble();
if (qIsNull(speed_value)) {
@@ -239,7 +236,6 @@ NodeValueTable RenderProcessor::GenerateBlockTable(const Track *track, const Tim
// Multiply time
samples_from_this_block->speed(speed_value);
}
}
int copy_length = qMin(max_dest_sz, samples_from_this_block->sample_count());