various: greatly simplified job times
Hopefully this doesn't break everything
This commit is contained in:
@@ -53,7 +53,7 @@ QString ClipBlock::Description() const
|
||||
return tr("A time-based node that represents a media source.");
|
||||
}
|
||||
|
||||
void ClipBlock::InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time)
|
||||
void ClipBlock::InvalidateCache(const TimeRange& range, const QString& from, int element)
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
|
||||
@@ -63,10 +63,10 @@ void ClipBlock::InvalidateCache(const TimeRange& range, const QString& from, int
|
||||
rational start = MediaToSequenceTime(range.in());
|
||||
rational end = MediaToSequenceTime(range.out());
|
||||
|
||||
super::InvalidateCache(TimeRange(start, end), from, element, job_time);
|
||||
super::InvalidateCache(TimeRange(start, end), from, element);
|
||||
} else {
|
||||
// Otherwise, pass signal along normally
|
||||
super::InvalidateCache(range, from, element, job_time);
|
||||
super::InvalidateCache(range, from, element);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual QString id() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time) override;
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element) override;
|
||||
|
||||
virtual TimeRange InputTimeAdjustment(const QString& input, int element, const TimeRange& input_time) const override;
|
||||
|
||||
|
||||
+4
-18
@@ -46,7 +46,6 @@ const QString Node::kDefaultOutput = QStringLiteral("output");
|
||||
Node::Node(bool create_default_output) :
|
||||
can_be_deleted_(true),
|
||||
override_color_(-1),
|
||||
last_change_time_(0),
|
||||
folder_(nullptr),
|
||||
operation_stack_(0),
|
||||
cache_result_(false)
|
||||
@@ -263,9 +262,6 @@ void Node::ConnectEdge(const NodeOutput &output, const NodeInput &input)
|
||||
input.node()->input_connections_[input] = output;
|
||||
output.node()->output_connections_.push_back(std::pair<NodeOutput, NodeInput>({output, input}));
|
||||
|
||||
// Update change times
|
||||
input.node()->UpdateLastChangedTime();
|
||||
|
||||
// Call internal events
|
||||
input.node()->InputConnectedEvent(input.input(), input.element(), output);
|
||||
output.node()->OutputConnectedEvent(output.output(), input);
|
||||
@@ -295,9 +291,6 @@ void Node::DisconnectEdge(const NodeOutput &output, const NodeInput &input)
|
||||
OutputConnections& outputs = output.node()->output_connections_;
|
||||
outputs.erase(std::find(outputs.begin(), outputs.end(), std::pair<NodeOutput, NodeInput>({output, input})));
|
||||
|
||||
// Update change times
|
||||
input.node()->UpdateLastChangedTime();
|
||||
|
||||
// Call internal events
|
||||
input.node()->InputDisconnectedEvent(input.input(), input.element(), output);
|
||||
output.node()->OutputDisconnectedEvent(output.output(), input);
|
||||
@@ -1026,12 +1019,12 @@ NodeValueTable Node::Value(const QString& output, NodeValueDatabase &value) cons
|
||||
return value.Merge();
|
||||
}
|
||||
|
||||
void Node::InvalidateCache(const TimeRange &range, const QString &from, int element, qint64 job_time)
|
||||
void Node::InvalidateCache(const TimeRange &range, const QString &from, int element)
|
||||
{
|
||||
Q_UNUSED(from)
|
||||
Q_UNUSED(element)
|
||||
|
||||
SendInvalidateCache(range, job_time);
|
||||
SendInvalidateCache(range);
|
||||
}
|
||||
|
||||
void Node::BeginOperation()
|
||||
@@ -1180,14 +1173,14 @@ Node *Node::CopyNodeInGraph(const Node *node, MultiUndoCommand *command)
|
||||
return copy;
|
||||
}
|
||||
|
||||
void Node::SendInvalidateCache(const TimeRange &range, qint64 job_time)
|
||||
void Node::SendInvalidateCache(const TimeRange &range)
|
||||
{
|
||||
if (GetOperationStack() == 0) {
|
||||
for (const OutputConnection& conn : output_connections_) {
|
||||
// Send clear cache signal to the Node
|
||||
const NodeInput& in = conn.second;
|
||||
|
||||
in.node()->InvalidateCache(range, in.input(), in.element(), job_time);
|
||||
in.node()->InvalidateCache(range, in.input(), in.element());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1826,8 +1819,6 @@ QVariant Node::PtrToValue(void *ptr)
|
||||
|
||||
void Node::ParameterValueChanged(const QString& input, int element, const TimeRange& range)
|
||||
{
|
||||
UpdateLastChangedTime();
|
||||
|
||||
InputValueChangedEvent(input, element);
|
||||
|
||||
emit ValueChanged(NodeInput(this, input, element), range);
|
||||
@@ -2019,11 +2010,6 @@ void Node::SaveImmediate(QXmlStreamWriter *writer, const QString& input, int ele
|
||||
}
|
||||
}
|
||||
|
||||
void Node::UpdateLastChangedTime()
|
||||
{
|
||||
last_change_time_ = QDateTime::currentMSecsSinceEpoch();
|
||||
}
|
||||
|
||||
TimeRange Node::GetRangeAffectedByKeyframe(NodeKeyframe *key) const
|
||||
{
|
||||
const NodeKeyframeTrack& key_track = GetTrackFromKeyframe(key);
|
||||
|
||||
+3
-11
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <QCryptographicHash>
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
#include <QPointF>
|
||||
@@ -631,12 +632,7 @@ public:
|
||||
* the DAG. Even if the time needs to be transformed somehow (e.g. converting media time to sequence time), you can
|
||||
* call this function with transformed time and relay the signal that way.
|
||||
*/
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time);
|
||||
|
||||
void InvalidateCache(const TimeRange& range, const QString& from, int element = -1)
|
||||
{
|
||||
InvalidateCache(range, from, element, last_change_time_);
|
||||
}
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element = -1);
|
||||
|
||||
void InvalidateCache(const TimeRange& range, const NodeInput& from)
|
||||
{
|
||||
@@ -886,7 +882,7 @@ protected:
|
||||
SetInputProperty(id, QStringLiteral("combo_str"), strings);
|
||||
}
|
||||
|
||||
void SendInvalidateCache(const TimeRange &range, qint64 job_time);
|
||||
void SendInvalidateCache(const TimeRange &range);
|
||||
|
||||
/**
|
||||
* @brief Don't send cache invalidation signals if `input` is connected or disconnected
|
||||
@@ -1154,8 +1150,6 @@ private:
|
||||
|
||||
void SaveImmediate(QXmlStreamWriter *writer, const QString &input, int element) const;
|
||||
|
||||
void UpdateLastChangedTime();
|
||||
|
||||
/**
|
||||
* @brief Intelligently determine how what time range is affected by a keyframe
|
||||
*/
|
||||
@@ -1205,8 +1199,6 @@ private:
|
||||
|
||||
OutputConnections output_connections_;
|
||||
|
||||
qint64 last_change_time_;
|
||||
|
||||
QString tooltip_;
|
||||
|
||||
Folder* folder_;
|
||||
|
||||
@@ -431,7 +431,7 @@ QVector<Block *> Track::BlocksAtTimeRange(const TimeRange &range) const
|
||||
return list;
|
||||
}
|
||||
|
||||
void Track::InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time)
|
||||
void Track::InvalidateCache(const TimeRange& range, const QString& from, int element)
|
||||
{
|
||||
if (GetOperationStack() != 0) {
|
||||
return;
|
||||
@@ -455,7 +455,7 @@ void Track::InvalidateCache(const TimeRange& range, const QString& from, int ele
|
||||
preop_track_length_ = track_length_;
|
||||
}
|
||||
|
||||
Node::InvalidateCache(limited, from, element, job_time);
|
||||
Node::InvalidateCache(limited, from, element);
|
||||
}
|
||||
|
||||
void Track::InsertBlockBefore(Block* block, Block* after)
|
||||
|
||||
@@ -286,7 +286,7 @@ public:
|
||||
return blocks_;
|
||||
}
|
||||
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time) override;
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element) override;
|
||||
|
||||
/**
|
||||
* @brief Adds Block `block` at the very beginning of the Sequence before all other clips
|
||||
|
||||
@@ -222,7 +222,7 @@ void ViewerOutput::ShiftCache(const rational &from, const rational &to)
|
||||
ShiftAudioCache(from, to);
|
||||
}
|
||||
|
||||
void ViewerOutput::InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time)
|
||||
void ViewerOutput::InvalidateCache(const TimeRange& range, const QString& from, int element)
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
|
||||
@@ -233,16 +233,16 @@ void ViewerOutput::InvalidateCache(const TimeRange& range, const QString& from,
|
||||
|
||||
if (invalidated_range.in() != invalidated_range.out()) {
|
||||
if (from == kTextureInput || from == kVideoParamsInput) {
|
||||
video_frame_cache_.Invalidate(invalidated_range, job_time);
|
||||
video_frame_cache_.Invalidate(invalidated_range);
|
||||
} else {
|
||||
audio_playback_cache_.Invalidate(invalidated_range, job_time);
|
||||
audio_playback_cache_.Invalidate(invalidated_range);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VerifyLength();
|
||||
|
||||
super::InvalidateCache(range, from, element, job_time);
|
||||
super::InvalidateCache(range, from, element);
|
||||
}
|
||||
|
||||
QVector<QString> ViewerOutput::inputs_for_output(const QString &output) const
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
void ShiftAudioCache(const rational& from, const rational& to);
|
||||
void ShiftCache(const rational& from, const rational& to);
|
||||
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element, qint64 job_time) override;
|
||||
virtual void InvalidateCache(const TimeRange& range, const QString& from, int element) override;
|
||||
|
||||
virtual QVector<QString> inputs_for_output(const QString& output) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user