diff options
| author | Tim Redfern <tim@eclectronics.org> | 2014-01-20 01:59:04 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2014-01-20 01:59:04 +0000 |
| commit | 0dfbf40106d6a6c70d949e1f5bcfa1b33b20a68f (patch) | |
| tree | 99a257b9e35d3eb76948f99a7cb51eed53514b01 /NT/src/graph.h | |
| parent | bd5a1d60ab7e1a930835e239cc0ee7257e9e82ad (diff) | |
member access permissions
Diffstat (limited to 'NT/src/graph.h')
| -rw-r--r-- | NT/src/graph.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/NT/src/graph.h b/NT/src/graph.h index 87be66e..0a20ffe 100644 --- a/NT/src/graph.h +++ b/NT/src/graph.h @@ -1,6 +1,91 @@ #ifndef GRAPH_H #define GRAPH_H +/* +Graph object manages a collection of nodes and provides the interface for rendering frames + + +*/ + #include "rotor.h" +/* +namespace Rotor { + class Graph{ + public: + Graph(){duration=20.0;loaded = false;audio_loaded=false;bitRate=0;outW=640;outH=360;audio_thumb=new Audio_thumbnailer();use_fragmentation=false;analysis_seed=0;Log_name="";}; + Graph(const string& _uid,const string& _desc){ + Graph(); + init(_uid,_desc); + }; + void init(const string& _uid,const string& _desc){ + uid=_uid; + description=_desc; + duration=20.0; + framerate=25.0; + loaded=false; + cancelled=false; + }; + ~Graph(){ clear(); delete audio_thumb;}; + void clear(){ + for (auto n: nodes) { + delete n.second; + } + nodes.clear(); + loaded=false; + } + string uid; //every version of a graph has a UUID, no particular need to actually read its data(?) + //?? is it faster than using strings?? + string description; + std::unordered_map<string,Node*> nodes; + vector<Node*> find_nodes(const string &type); //could be a way of finding a set based on capabilities? + Node* find_node(const string &type); + bool signal_render(xmlIO &XML,const string &node,const double framerate); + bool video_render(const string &output_filename,const double framerate,int start, int end); + bool load(string data,string media_path); + bool loadFile(string &filename,string media_path); + bool parseXml(string media_path); + bool parseJson(string &data,string &media_path); + bool set_resolution(int w,int h); + bool preview(xmlIO &XML,string &node,string &format,int frame,int w,int h); + bool check_audio(string audio,string path); + bool print_features(xmlIO &XML,string &node); + bool load_audio(const string &filename,vector<Audio_processor*> processors); + bool load_video(const string &nodeID,const string &filename);//can be performance or clip + bool set_bitrate(int b){ + if (b>1000){ + bitRate=b; + return true; + } + else return false; + } + bool set_fragmentation(bool f){ + use_fragmentation=f; + return true; + } + bool loaded; + double duration; + double framerate; + const string graphToString(); + xmlIO xml; + bool audio_loaded; + string audio_filename; + bool cancelled; + double progress; + int bitRate; + void set_log_name(string _Log_name){ + Log_name=_Log_name; + } + + Audio_thumbnailer *audio_thumb; + private: + int outW,outH; + bool use_fragmentation; + int analysis_seed; + string Log_name; + + }; +} +*/ + #endif //GRAPH_H |
