Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

virtualnode.h

Go to the documentation of this file.
00001 #ifndef VIRTUALNODE_H
00002 #define VIRTUALNODE_H
00003 
00004 #include "arraylist.h"
00005 #include "auto.inc"
00006 #include "autos.inc"
00007 #include "floatauto.inc"
00008 #include "floatautos.inc"
00009 #include "mwindow.inc"
00010 #include "maxbuffers.h"
00011 #include "patch.h"
00012 #include "plugin.inc"
00013 #include "pluginserver.inc"
00014 #include "track.inc"
00015 #include "transition.inc"
00016 #include "virtualconsole.inc"
00017 
00018 // The virtual node makes up the virtual console.
00019 // It can be either a virtual module or a virtual plugin.
00020 
00021 
00022 class VirtualNode
00023 {
00024 public:
00025         VirtualNode(RenderEngine *renderengine, 
00026                 VirtualConsole *vconsole, 
00027                 Module *real_module, 
00028                 Plugin *real_plugin, 
00029                 Track *track, 
00030                 VirtualNode *parent_node);
00031 
00032         friend class VirtualConsole;
00033 
00034         virtual ~VirtualNode();
00035         void dump(int indent);
00036 
00037 
00038 // expand plugins
00039         int expand(int persistent_plugins, int64_t current_position);
00040 // create convenience pointers to shared memory depending on the data type
00041         virtual int create_buffer_ptrs() {};
00042 // create a node for a module and expand it
00043         int attach_virtual_module(Plugin *plugin, 
00044                 int plugin_number, 
00045                 int duplicate, 
00046                 int64_t current_position);
00047 // create a node for a plugin and expand it
00048         int attach_virtual_plugin(Plugin *plugin, 
00049                 int plugin_number, 
00050                 int duplicate, 
00051                 int64_t current_position);
00052         virtual VirtualNode* create_module(Plugin *real_plugin, 
00053                                                         Module *real_module, 
00054                                                         Track *track) { return 0; };
00055         virtual VirtualNode* create_plugin(Plugin *real_plugin) { return 0; };
00056 
00057 
00058 // Called by read_data to get the previous plugin in a parent node's subnode
00059 // table.
00060         VirtualNode* get_previous_plugin(VirtualNode *current_plugin);
00061 
00062 // subnodes this node owns
00063 // was vplugins
00064         ArrayList<VirtualNode*> subnodes;
00065 // Attachment point in Module if this is a virtual plugin
00066         AttachmentPoint *attachment;
00067 
00068         VirtualConsole *vconsole;
00069 // node which created this node.
00070         VirtualNode *parent_node;
00071 // use these to determine if this node is a plugin or module
00072 // Top level virtual node of module
00073         Module *real_module;
00074 // When this node is a plugin.  Redirected to the shared plugin in expansion.
00075         Plugin *real_plugin;
00076 
00077 
00078         Track *track;
00079         RenderEngine *renderengine;
00080 
00081 // for rendering need to know if the buffer is a master or copy
00082 // These are set in expand()
00083         int input_is_master;
00084         int output_is_master;
00085         int ring_buffers;       // number of buffers for master buffers
00086         int64_t buffer_size;         // number of units in a master segment
00087         int64_t fragment_size;       // number of units in a node segment
00088         int plugin_type;          // type of plugin in case user changes it
00089         int render_count;         // times this plugin has been added to the render list
00090         int waiting_real_plugin;  //  real plugin tests this to see if virtual plugin is waiting on it when sorting
00091 // attachment point needs to know what buffer to put data into from 
00092 // a multichannel plugin
00093         int plugin_buffer_number;
00094 
00095 // Mute automation.
00096 // Return whether the next samples are muted and store the duration
00097 // of the next status in fragment_len
00098         void get_mute_fragment(int64_t input_position,
00099                                 int &mute_constant, 
00100                                 int &fragment_len, 
00101                                 Autos *autos,
00102                                 int direction,
00103                                 int use_nudge);
00104 
00105 // convenience routines for fade automation
00106 /*
00107  *      void get_fade_automation(double &slope,
00108  *              double &intercept,
00109  *              int64_t input_position,
00110  *              int64_t &slope_len,
00111  *              Autos *autos);
00112  * 
00113  *      int init_automation(int &automate, 
00114  *                              double &constant, 
00115  *                              int64_t input_position,
00116  *                              int64_t buffer_len,
00117  *                              Autos *autos,
00118  *                              Auto **before, 
00119  *                              Auto **after);
00120  * 
00121  *      int init_slope(Autos *autos, Auto **before, Auto **after);
00122  *      int get_slope(Autos *autos, int64_t buffer_len, int64_t buffer_position);
00123  *      int advance_slope(Autos *autos);
00124  */
00125 
00126 protected:
00127 
00128 // ======================= plugin automation
00129         FloatAutos *plugin_autos;
00130         FloatAuto *plugin_auto_before, *plugin_auto_after;
00131 
00132 // temporary variables for automation
00133         Auto *current_auto;
00134         double slope_value;
00135         double slope_start;
00136         double slope_end;
00137         double slope_position;
00138         double slope;
00139         double value;
00140 
00141 
00142 private:
00143         int sort_as_module(ArrayList<VirtualNode*>*render_list, int &result, int &total_result);
00144         int sort_as_plugin(ArrayList<VirtualNode*>*render_list, int &result, int &total_result);
00145         int expand_as_module(int duplicate, int64_t current_position);
00146         int expand_as_plugin(int duplicate);
00147         int is_exit;
00148 };
00149 
00150 
00151 
00152 #endif

Generated on Sun Jan 8 13:39:02 2006 for Cinelerra-svn by  doxygen 1.4.4