#ifndef GRAPH_H #define GRAPH_H /* Graph object manages a collection of nodes and provides the interface for rendering frames */ #include "rotor.h" #include "factory.h" #include "Poco/File.h" #include "Poco/FileStream.h" #include "Poco/CountingStream.h" #include "Poco/StreamCopier.h" namespace Rotor { class Graph{ public: Graph(){init();}; Graph(const std::string& _uid,const std::string& _desc){ init(_uid,_desc); }; void init(const std::string& _uid="",const std::string& _desc=""){ uid=_uid; description=_desc; loaded=false; audio_loaded=false; cancelled=false; //audio_thumb=new Audio_thumbnailer(); Log_name=""; }; ~Graph(){ clear(); //delete audio_thumb; }; void clear(){ for (auto n: nodes) { delete n.second; } nodes.clear(); loaded=false; } std::string uid; std::string description; std::unordered_map nodes; std::vector find_nodes(const std::string &type); Node* find_node(const std::string &type); Json::Value signal_render(const std::string &node,const double framerate); bool video_render(const std::string &output_filename,const double framerate,int start, int end); bool load_file(std::string filename,std::string media_path); bool parse_json(std::string &data,std::string &media_path); Json::Value preview(std::string &node ,std::string &format,int frame,int w,int h); bool check_audio (std::string audio ,std::string path); Json::Value print_features (std::string &node); //bool load_audio(const std::string &filename, std::vector processors); bool load_video(const std::string &node_id,const std::string &filename); bool loaded; bool audio_loaded; std::string audio_filename; bool cancelled; double progress; void set_log_name (std::string _Log_name){ Log_name=_Log_name; } //Audio_thumbnailer *audio_thumb; private: int analysis_seed; std::string Log_name; }; } #endif //GRAPH_H