constructed keyframeview and timeruler together inside nodeparamview and connected them
This commit is contained in:
@@ -202,6 +202,12 @@ public:
|
||||
*/
|
||||
void DisconnectAll();
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
* @brief Find a node of a certain type that this Node outputs to
|
||||
*/
|
||||
const T* FindOutputNode() const;
|
||||
|
||||
/**
|
||||
* @brief Convert a pointer to a value that can be sent between NodeParams
|
||||
*/
|
||||
@@ -385,4 +391,29 @@ T* Node::ValueToPtr(const QVariant &ptr)
|
||||
return reinterpret_cast<T*>(ptr.value<quintptr>());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
const Node* FindOutputNodeInternal(const Node* n) {
|
||||
foreach (NodeEdgePtr edge, n->output()->edges()) {
|
||||
Node* connected = edge->input()->parentNode();
|
||||
T* cast_test = dynamic_cast<T*>(connected);
|
||||
|
||||
if (cast_test) {
|
||||
return cast_test;
|
||||
} else {
|
||||
const Node* drill_test = FindOutputNodeInternal<T>(connected);
|
||||
if (drill_test) {
|
||||
return drill_test;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
const T* Node::FindOutputNode() const
|
||||
{
|
||||
return static_cast<const T*>(FindOutputNodeInternal<T>(this));
|
||||
}
|
||||
|
||||
#endif // NODE_H
|
||||
|
||||
@@ -93,12 +93,12 @@ void ViewerOutput::InvalidateCache(const rational &start_range, const rational &
|
||||
SendInvalidateCache(start_range, end_range);
|
||||
}
|
||||
|
||||
const VideoParams &ViewerOutput::video_params()
|
||||
const VideoParams &ViewerOutput::video_params() const
|
||||
{
|
||||
return video_params_;
|
||||
}
|
||||
|
||||
const AudioParams &ViewerOutput::audio_params()
|
||||
const AudioParams &ViewerOutput::audio_params() const
|
||||
{
|
||||
return audio_params_;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
|
||||
virtual void InvalidateCache(const rational &start_range, const rational &end_range, NodeInput *from = nullptr) override;
|
||||
|
||||
const VideoParams& video_params();
|
||||
const AudioParams& audio_params();
|
||||
const VideoParams& video_params() const;
|
||||
const AudioParams& audio_params() const;
|
||||
|
||||
void set_video_params(const VideoParams& video);
|
||||
void set_audio_params(const AudioParams& audio);
|
||||
|
||||
Reference in New Issue
Block a user