#include "rotor.h" #include "nodes_audio_analysis.h" #include "nodes_maths.h" #include "nodes_drawing.h" #include "nodes_filters.h" #include "nodes_transform.h" using namespace Rotor; using Poco::Logger; Node_factory::Node_factory(){ //for now, statically load prototype map in constructor add_type("time",new Time()); add_type("track_time",new Track_time()); add_type("at_track_time",new At_track_time()); add_type("signal_output",new Signal_output()); add_type("testcard",new Testcard()); add_type("invert",new Invert()); add_type("video_cycler",new Video_cycler()); add_type("signal_colour",new Signal_colour()); add_type("signal_greyscale",new Signal_greyscale()); add_type("image_arithmetic",new Image_arithmetic()); add_type("blend",new Blend()); add_type("mirror",new Mirror()); add_type("monochrome",new Monochrome()); add_type("alpha_merge",new Alpha_merge()); add_type("difference_matte",new Difference_matte()); //nodes_audio_analysis.h add_type("audio_analysis",new Audio_analysis()); add_type("act_segmenter",new Act_segmenter()); //nodes_maths.h add_type("comparison",new Comparison()); //TODO: alias to symbols add_type("arithmetic",new Arithmetic()); //TODO: alias to symbols add_type("bang",new Is_new_integer()); add_type("on_off",new On_off()); add_type("random",new Random()); //nodes_drawing.h add_type("shape",new Shape()); add_type("text",new Text()); add_type("waves",new Waves()); //nodes_filters.h add_type("blur",new Blur()); add_type("vhs",new VHS()); add_type("luma_levels",new Luma_levels()); add_type("echo_trails",new Echo_trails()); add_type("rgb_levels",new RGB_levels()); //nodes_transform.h add_type("transform",new Transform()); add_type("still_image",new Still_image()); //video nodes add_type("video_loader",new Video_loader()); add_type("video_output",new Video_output()); add_type("video_feedback",new Video_feedback()); } bool Signal_input::connect(Node* source) { connection=dynamic_cast(source); if (connection) return true; else return false; } float Signal_input::get(const Time_spec& time){ //gets input and updates variable if (connection){ return (((Signal_node*)connection)->get_output(time)); } else return 0.0f; } bool Image_input::connect(Node* source) { connection=dynamic_cast(source); if (connection) return true; else return false; } Image* Image_input::get(const Frame_spec& time){ //gets input and updates variable if (connection){ return (((Image_node*)connection)->get_output(time)); } else return nullptr; } float Parameter::get(const Time_spec& time){ //gets input and updates variable if (connection){ value = ((Signal_node*)connection)->get_output(time); } return value; }