implemented support for trimming transitions
This commit is contained in:
@@ -52,8 +52,8 @@ rational TransitionBlock::in_offset() const
|
||||
return length();
|
||||
}
|
||||
|
||||
// Assume both are connected, in which case the in offset will be <= length
|
||||
return length() / 2 + media_in();
|
||||
// Assume both are connected
|
||||
return length() + media_in();
|
||||
}
|
||||
|
||||
rational TransitionBlock::out_offset() const
|
||||
@@ -68,8 +68,8 @@ rational TransitionBlock::out_offset() const
|
||||
return length();
|
||||
}
|
||||
|
||||
// Assume both are connected, in which case the in offset will be <= length
|
||||
return length() / 2 - media_in();
|
||||
// Assume both are connected
|
||||
return -media_in();
|
||||
}
|
||||
|
||||
Block *TransitionBlock::connected_out_block() const
|
||||
|
||||
@@ -68,6 +68,11 @@ void NodeInputArray::SetSize(int size, bool lock)
|
||||
emit SizeChanged(size);
|
||||
}
|
||||
|
||||
bool NodeInputArray::ContainsSubParameter(NodeInput *input) const
|
||||
{
|
||||
return sub_params_.contains(input);
|
||||
}
|
||||
|
||||
int NodeInputArray::IndexOfSubParameter(NodeInput *input) const
|
||||
{
|
||||
return sub_params_.indexOf(input);
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
void RemoveAt(int index);
|
||||
void SetSize(int size, bool lock = true);
|
||||
|
||||
bool ContainsSubParameter(NodeInput* input) const;
|
||||
int IndexOfSubParameter(NodeInput* input) const;
|
||||
|
||||
NodeInput* First() const;
|
||||
|
||||
@@ -91,10 +91,9 @@ TrackOutput* TrackList::AddTrack()
|
||||
|
||||
track_input_->Append();
|
||||
|
||||
NodeInput* assoc_input = track_input_->At(track_input_->GetSize() - 1);
|
||||
|
||||
// Connect this track directly to this output
|
||||
NodeParam::ConnectEdge(track->output(), assoc_input);
|
||||
NodeParam::ConnectEdge(track->output(),
|
||||
track_input_->At(track_input_->GetSize() - 1));
|
||||
|
||||
// FIXME: Test code only
|
||||
if (track_input_->GetSize() > 1) {
|
||||
@@ -111,7 +110,7 @@ TrackOutput* TrackList::AddTrack()
|
||||
|
||||
if (last_track && last_track->output()->IsConnected()) {
|
||||
foreach (NodeEdgePtr edge, last_track->output()->edges()) {
|
||||
if (edge->input()->parentNode() != track_input_->parentNode()) {
|
||||
if (!track_input_->ContainsSubParameter(edge->input())) {
|
||||
Node* blend = NodeFactory::CreateFromID("org.olivevideoeditor.Olive.alphaoverblend");
|
||||
GetParentGraph()->AddNode(blend);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user