various: implemented multiple project support

This required various changes to various parts of the infrastructure (mostly
using paths to finding the "root project" of any given object throughout).
Now theoretically infinite projects can be opened and accounted for at any
given time.
This commit is contained in:
itsmattkc
2020-04-18 01:50:47 +10:00
parent 77c0db55a5
commit f73c41d3fa
48 changed files with 824 additions and 224 deletions
@@ -20,6 +20,9 @@
#include "nodeparamviewundo.h"
#include "node/node.h"
#include "project/item/sequence/sequence.h"
OLIVE_NAMESPACE_ENTER
NodeParamSetKeyframingCommand::NodeParamSetKeyframingCommand(NodeInput *input, bool setting, QUndoCommand *parent) :
@@ -30,6 +33,11 @@ NodeParamSetKeyframingCommand::NodeParamSetKeyframingCommand(NodeInput *input, b
Q_ASSERT(setting != input_->is_keyframing());
}
Project *NodeParamSetKeyframingCommand::GetRelevantProject() const
{
return static_cast<Sequence*>(input_->parentNode()->parent())->project();
}
void NodeParamSetKeyframingCommand::redo_internal()
{
input_->set_is_keyframing(setting_);
@@ -57,6 +65,11 @@ NodeParamSetKeyframeValueCommand::NodeParamSetKeyframeValueCommand(NodeKeyframeP
}
Project *NodeParamSetKeyframeValueCommand::GetRelevantProject() const
{
return static_cast<Sequence*>(key_->parent()->parentNode()->parent())->project();
}
void NodeParamSetKeyframeValueCommand::redo_internal()
{
key_->set_value(new_value_);
@@ -83,6 +96,11 @@ NodeParamInsertKeyframeCommand::NodeParamInsertKeyframeCommand(NodeInput *input,
{
}
Project *NodeParamInsertKeyframeCommand::GetRelevantProject() const
{
return static_cast<Sequence*>(input_->parentNode()->parent())->project();
}
void NodeParamInsertKeyframeCommand::redo_internal()
{
if (!done_) {
@@ -103,6 +121,11 @@ NodeParamRemoveKeyframeCommand::NodeParamRemoveKeyframeCommand(NodeInput *input,
{
}
Project *NodeParamRemoveKeyframeCommand::GetRelevantProject() const
{
return static_cast<Sequence*>(input_->parentNode()->parent())->project();
}
void NodeParamRemoveKeyframeCommand::redo_internal()
{
input_->remove_keyframe(keyframe_);
@@ -129,6 +152,11 @@ NodeParamSetKeyframeTimeCommand::NodeParamSetKeyframeTimeCommand(NodeKeyframePtr
{
}
Project *NodeParamSetKeyframeTimeCommand::GetRelevantProject() const
{
return static_cast<Sequence*>(key_->parent()->parentNode()->parent())->project();
}
void NodeParamSetKeyframeTimeCommand::redo_internal()
{
key_->set_time(new_time_);
@@ -157,6 +185,11 @@ NodeParamSetStandardValueCommand::NodeParamSetStandardValueCommand(NodeInput *in
{
}
Project *NodeParamSetStandardValueCommand::GetRelevantProject() const
{
return static_cast<Sequence*>(input_->parentNode()->parent())->project();
}
void NodeParamSetStandardValueCommand::redo_internal()
{
input_->set_standard_value(new_value_, track_);