Merge branch 'master' into otio
This commit is contained in:
@@ -55,6 +55,11 @@ TrackOutput::TrackOutput() :
|
||||
track_height_ = kTrackHeightDefault;
|
||||
}
|
||||
|
||||
TrackOutput::~TrackOutput()
|
||||
{
|
||||
DisconnectAll();
|
||||
}
|
||||
|
||||
void TrackOutput::set_track_type(const Timeline::TrackType &track_type)
|
||||
{
|
||||
track_type_ = track_type;
|
||||
@@ -91,15 +96,6 @@ QString TrackOutput::Description() const
|
||||
"a Sequence.");
|
||||
}
|
||||
|
||||
QString TrackOutput::GetTrackName()
|
||||
{
|
||||
if (track_name_.isEmpty()) {
|
||||
return GetDefaultTrackName(track_type_, index_);
|
||||
}
|
||||
|
||||
return track_name_;
|
||||
}
|
||||
|
||||
const double &TrackOutput::GetTrackHeight() const
|
||||
{
|
||||
return track_height_;
|
||||
@@ -435,11 +431,6 @@ void TrackOutput::Hash(QCryptographicHash &hash, const rational &time) const
|
||||
}
|
||||
}
|
||||
|
||||
void TrackOutput::SetTrackName(const QString &name)
|
||||
{
|
||||
track_name_ = name;
|
||||
}
|
||||
|
||||
void TrackOutput::SetMuted(bool e)
|
||||
{
|
||||
muted_input_->set_standard_value(e);
|
||||
@@ -555,7 +546,7 @@ void TrackOutput::BlockConnected(NodeEdgePtr edge)
|
||||
|
||||
void TrackOutput::BlockDisconnected(NodeEdgePtr edge)
|
||||
{
|
||||
Block* b = static_cast<Block*>(edge->output()->parentNode());
|
||||
Block* b = static_cast<Block*>(edge->output_node());
|
||||
|
||||
if (block_cache_.contains(b)) {
|
||||
block_cache_.removeOne(b);
|
||||
|
||||
@@ -36,6 +36,8 @@ class TrackOutput : public Node
|
||||
public:
|
||||
TrackOutput();
|
||||
|
||||
virtual ~TrackOutput() override;
|
||||
|
||||
const Timeline::TrackType& track_type() const;
|
||||
void set_track_type(const Timeline::TrackType& track_type);
|
||||
|
||||
@@ -46,8 +48,6 @@ public:
|
||||
virtual QList<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
QString GetTrackName();
|
||||
|
||||
const double& GetTrackHeight() const;
|
||||
void SetTrackHeight(const double& height);
|
||||
|
||||
@@ -227,8 +227,6 @@ public:
|
||||
static const double kTrackHeightInterval;
|
||||
|
||||
public slots:
|
||||
void SetTrackName(const QString& name);
|
||||
|
||||
void SetMuted(bool e);
|
||||
|
||||
void SetLocked(bool e);
|
||||
@@ -294,8 +292,6 @@ private:
|
||||
|
||||
double track_height_;
|
||||
|
||||
QString track_name_;
|
||||
|
||||
int index_;
|
||||
|
||||
bool locked_;
|
||||
|
||||
@@ -134,7 +134,7 @@ TrackOutput* TrackList::AddTrack()
|
||||
return track;
|
||||
}
|
||||
|
||||
void TrackList::RemoveTrack()
|
||||
void TrackList::RemoveTrack(QObject* new_parent)
|
||||
{
|
||||
if (track_cache_.isEmpty()) {
|
||||
return;
|
||||
@@ -144,7 +144,11 @@ void TrackList::RemoveTrack()
|
||||
|
||||
GetParentGraph()->TakeNode(track);
|
||||
|
||||
delete track;
|
||||
if (!new_parent) {
|
||||
delete track;
|
||||
} else {
|
||||
track->setParent(new_parent);
|
||||
}
|
||||
|
||||
track_input_->RemoveLast();
|
||||
}
|
||||
@@ -184,7 +188,8 @@ void TrackList::TrackConnected(NodeEdgePtr edge)
|
||||
track_cache_.append(connected_track);
|
||||
}
|
||||
|
||||
connected_track->SetIndex(track_index);
|
||||
// Update track indexes in the list (including this track)
|
||||
UpdateTrackIndexesFrom(track_index);
|
||||
}
|
||||
|
||||
connect(connected_track, &TrackOutput::BlockAdded, this, &TrackList::TrackAddedBlock);
|
||||
@@ -220,9 +225,7 @@ void TrackList::TrackDisconnected(NodeEdgePtr edge)
|
||||
track_cache_.removeAt(index_of_track);
|
||||
|
||||
// Update indices for all subsequent tracks
|
||||
for (int i=index_of_track; i<track_cache_.size(); i++) {
|
||||
track_cache_.at(i)->SetIndex(i);
|
||||
}
|
||||
UpdateTrackIndexesFrom(index_of_track);
|
||||
|
||||
// Traverse through Tracks uncaching and disconnecting them
|
||||
emit TrackRemoved(track);
|
||||
@@ -241,6 +244,13 @@ void TrackList::TrackDisconnected(NodeEdgePtr edge)
|
||||
}
|
||||
}
|
||||
|
||||
void TrackList::UpdateTrackIndexesFrom(int index)
|
||||
{
|
||||
for (int i=index; i<track_cache_.size(); i++) {
|
||||
track_cache_.at(i)->SetIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
NodeGraph *TrackList::GetParentGraph() const
|
||||
{
|
||||
return static_cast<NodeGraph*>(parent()->parent());
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
TrackOutput *AddTrack();
|
||||
|
||||
void RemoveTrack();
|
||||
void RemoveTrack(QObject *new_parent);
|
||||
|
||||
const rational& GetTotalLength() const;
|
||||
|
||||
@@ -68,6 +68,8 @@ signals:
|
||||
void TrackHeightChanged(int index, int height);
|
||||
|
||||
private:
|
||||
void UpdateTrackIndexesFrom(int index);
|
||||
|
||||
/**
|
||||
* @brief A cache of connected Tracks
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user