timelineview is now a true view of the blocks at all times
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "block.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
Block::Block()
|
||||
{
|
||||
previous_input_ = new NodeInput();
|
||||
@@ -37,6 +39,9 @@ Block::Block()
|
||||
texture_output_ = new NodeOutput();
|
||||
texture_output_->set_data_type(NodeParam::kTexture);
|
||||
AddParameter(texture_output_);
|
||||
|
||||
connect(this, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SLOT(BlockOrderChanged(NodeEdgePtr)));
|
||||
connect(this, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SLOT(BlockOrderChanged(NodeEdgePtr)));
|
||||
}
|
||||
|
||||
QString Block::Category()
|
||||
@@ -115,6 +120,14 @@ void Block::RefreshFollowing()
|
||||
}
|
||||
}
|
||||
|
||||
void Block::BlockOrderChanged(NodeEdgePtr edge)
|
||||
{
|
||||
if (edge->input() == previous_input() || edge->input() == next_input()) {
|
||||
// The blocks surrounding this one have changed, we need to Refresh()
|
||||
RefreshFollowing();
|
||||
}
|
||||
}
|
||||
|
||||
NodeOutput *Block::texture_output()
|
||||
{
|
||||
return texture_output_;
|
||||
|
||||
+16
-3
@@ -37,7 +37,8 @@ public:
|
||||
|
||||
enum Type {
|
||||
kClip,
|
||||
kGap
|
||||
kGap,
|
||||
kEnd
|
||||
};
|
||||
|
||||
virtual Type type() = 0;
|
||||
@@ -78,16 +79,24 @@ public slots:
|
||||
* Blocks before it are accurate and up to date. You may need to traverse through the Block list (using previous())
|
||||
* and run Refresh() on all Blocks sequentially.
|
||||
*/
|
||||
void Refresh();
|
||||
virtual void Refresh();
|
||||
|
||||
/**
|
||||
* @brief Calls Refresh() on this block and all blocks connected after it (but not before it)
|
||||
*/
|
||||
void RefreshFollowing();
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when this Block is refreshed
|
||||
*
|
||||
* Can be used as essentially a "changed" signal for UI widgets to know when to update their views
|
||||
*/
|
||||
void Refreshed();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
private:
|
||||
NodeInput* previous_input_;
|
||||
NodeInput* next_input_;
|
||||
NodeOutput* block_output_;
|
||||
@@ -96,6 +105,10 @@ private:
|
||||
|
||||
rational in_point_;
|
||||
rational out_point_;
|
||||
|
||||
private slots:
|
||||
void BlockOrderChanged(NodeEdgePtr edge);
|
||||
|
||||
};
|
||||
|
||||
#endif // BLOCK_H
|
||||
|
||||
Reference in New Issue
Block a user