removed data storage from input/output parameters
These will be held in the renderer structure from now on, not in the nodes themselves. The nodes will serve more as a blueprint.
This commit is contained in:
@@ -225,25 +225,6 @@ void NodeInput::set_value_at_time(const rational &time, const QVariant &value)
|
||||
emit ValueChanged(signal_vc_range.in(), signal_vc_range.out());
|
||||
}
|
||||
|
||||
const QVariant &NodeInput::value()
|
||||
{
|
||||
return stored_value_;
|
||||
}
|
||||
|
||||
void NodeInput::set_stored_value(const QVariant &value)
|
||||
{
|
||||
stored_value_ = value;
|
||||
}
|
||||
|
||||
QVariant NodeInput::get_realtime_value_of_connected_output()
|
||||
{
|
||||
if (get_connected_output() == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return get_connected_output()->get_realtime_value();
|
||||
}
|
||||
|
||||
bool NodeInput::is_keyframing()
|
||||
{
|
||||
return keyframing_;
|
||||
|
||||
@@ -76,11 +76,6 @@ public:
|
||||
*/
|
||||
Node* get_connected_node();
|
||||
|
||||
/**
|
||||
* @brief Get currently stored value
|
||||
*/
|
||||
const QVariant& value();
|
||||
|
||||
/**
|
||||
* @brief Calculate what the stored value should be at a certain time
|
||||
*/
|
||||
@@ -91,13 +86,6 @@ public:
|
||||
*/
|
||||
void set_value_at_time(const rational& time, const QVariant& value);
|
||||
|
||||
/**
|
||||
* @brief Set the value at a given time
|
||||
*/
|
||||
void set_stored_value(const QVariant& value);
|
||||
|
||||
QVariant get_realtime_value_of_connected_output();
|
||||
|
||||
/**
|
||||
* @brief Return whether keyframing is enabled on this input or not
|
||||
*/
|
||||
@@ -182,11 +170,6 @@ private:
|
||||
*/
|
||||
QVariant maximum_;
|
||||
|
||||
/**
|
||||
* @brief Internal stored value
|
||||
*/
|
||||
QVariant stored_value_;
|
||||
|
||||
};
|
||||
|
||||
#endif // NODEINPUT_H
|
||||
|
||||
@@ -31,63 +31,3 @@ NodeParam::Type NodeOutput::type()
|
||||
{
|
||||
return kOutput;
|
||||
}
|
||||
|
||||
QVariant NodeOutput::get_realtime_value()
|
||||
{
|
||||
QVariant v = parentNode()->Value(this);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
bool NodeOutput::has_cached_value(const TimeRange &time)
|
||||
{
|
||||
cache_lock_.lock();
|
||||
|
||||
bool contains = cached_values_.contains(time);
|
||||
|
||||
cache_lock_.unlock();
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
QVariant NodeOutput::get_cached_value(const TimeRange &time)
|
||||
{
|
||||
cache_lock_.lock();
|
||||
|
||||
QVariant val = cached_values_.value(time);
|
||||
|
||||
cache_lock_.unlock();
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void NodeOutput::cache_value(const TimeRange &time, const QVariant &value)
|
||||
{
|
||||
cache_lock_.lock();
|
||||
cached_values_.insert(time, value);
|
||||
cache_lock_.unlock();
|
||||
}
|
||||
|
||||
void NodeOutput::drop_cached_values()
|
||||
{
|
||||
cache_lock_.lock();
|
||||
cached_values_.clear();
|
||||
cache_lock_.unlock();
|
||||
}
|
||||
|
||||
void NodeOutput::drop_cached_values_overlapping(const TimeRange &time)
|
||||
{
|
||||
cache_lock_.lock();
|
||||
|
||||
QHash<TimeRange, QVariant>::iterator i = cached_values_.begin();
|
||||
|
||||
while (i != cached_values_.end()) {
|
||||
if (i.key().OverlapsWith(time)) {
|
||||
i = cached_values_.erase(i);
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
cache_lock_.unlock();
|
||||
}
|
||||
|
||||
@@ -40,18 +40,7 @@ public:
|
||||
*/
|
||||
virtual Type type() override;
|
||||
|
||||
QVariant get_realtime_value();
|
||||
|
||||
bool has_cached_value(const TimeRange& time);
|
||||
QVariant get_cached_value(const TimeRange& time);
|
||||
void cache_value(const TimeRange& time, const QVariant& value);
|
||||
void drop_cached_values();
|
||||
void drop_cached_values_overlapping(const TimeRange& time);
|
||||
|
||||
private:
|
||||
QHash<TimeRange, QVariant> cached_values_;
|
||||
|
||||
QMutex cache_lock_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user