7 #include "floatauto.inc"
8 #include "floatautos.inc"
10 #include "maxbuffers.h"
13 #include "pluginserver.inc"
15 #include "transition.inc"
16 #include "virtualconsole.inc"
18 // The virtual node makes up the virtual console.
19 // It can be either a virtual module or a virtual plugin.
25 VirtualNode(RenderEngine
*renderengine
,
26 VirtualConsole
*vconsole
,
30 VirtualNode
*parent_node
);
32 friend class VirtualConsole
;
34 virtual ~VirtualNode();
35 void dump(int indent
);
39 int expand(int persistent_plugins
, int64_t current_position
);
40 // create convenience pointers to shared memory depending on the data type
41 virtual int create_buffer_ptrs() {};
42 // create a node for a module and expand it
43 int attach_virtual_module(Plugin
*plugin
,
46 int64_t current_position
);
47 // create a node for a plugin and expand it
48 int attach_virtual_plugin(Plugin
*plugin
,
51 int64_t current_position
);
52 virtual VirtualNode
* create_module(Plugin
*real_plugin
,
54 Track
*track
) { return 0; };
55 virtual VirtualNode
* create_plugin(Plugin
*real_plugin
) { return 0; };
58 // Called by read_data to get the previous plugin in a parent node's subnode
60 VirtualNode
* get_previous_plugin(VirtualNode
*current_plugin
);
62 // subnodes this node owns
64 ArrayList
<VirtualNode
*> subnodes
;
65 // Attachment point in Module if this is a virtual plugin
66 AttachmentPoint
*attachment
;
68 VirtualConsole
*vconsole
;
69 // node which created this node.
70 VirtualNode
*parent_node
;
71 // use these to determine if this node is a plugin or module
72 // Top level virtual node of module
74 // When this node is a plugin. Redirected to the shared plugin in expansion.
79 RenderEngine
*renderengine
;
81 // for rendering need to know if the buffer is a master or copy
82 // These are set in expand()
85 int ring_buffers
; // number of buffers for master buffers
86 int64_t buffer_size
; // number of units in a master segment
87 int64_t fragment_size
; // number of units in a node segment
88 int plugin_type
; // type of plugin in case user changes it
89 int render_count
; // times this plugin has been added to the render list
90 int waiting_real_plugin
; // real plugin tests this to see if virtual plugin is waiting on it when sorting
91 // attachment point needs to know what buffer to put data into from
92 // a multichannel plugin
93 int plugin_buffer_number
;
96 // Return whether the next samples are muted and store the duration
97 // of the next status in fragment_len
98 void get_mute_fragment(int64_t input_position
,
105 // convenience routines for fade automation
107 * void get_fade_automation(double &slope,
109 * int64_t input_position,
110 * int64_t &slope_len,
113 * int init_automation(int &automate,
115 * int64_t input_position,
116 * int64_t buffer_len,
121 * int init_slope(Autos *autos, Auto **before, Auto **after);
122 * int get_slope(Autos *autos, int64_t buffer_len, int64_t buffer_position);
123 * int advance_slope(Autos *autos);
128 // ======================= plugin automation
129 FloatAutos
*plugin_autos
;
130 FloatAuto
*plugin_auto_before
, *plugin_auto_after
;
132 // temporary variables for automation
137 double slope_position
;
143 int sort_as_module(ArrayList
<VirtualNode
*>*render_list
, int &result
, int &total_result
);
144 int sort_as_plugin(ArrayList
<VirtualNode
*>*render_list
, int &result
, int &total_result
);
145 int expand_as_module(int duplicate
, int64_t current_position
);
146 int expand_as_plugin(int duplicate
);
156 // c-file-style: "linux"