~akirad/cinecutie/trunk

« back to all changes in this revision

Viewing changes to cinecutie/attachmentpoint.h

  • Committer: Paolo Rampino
  • Date: 2010-02-17 19:46:21 UTC
  • Revision ID: git-v1:c39ff77ffa6ae08441c12e7d7f54e3897ddde7f1
Initial Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * CINELERRA
 
4
 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
 
5
 * 
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 * 
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 * 
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 * 
 
20
 */
 
21
 
 
22
#ifndef ATTACHMENTPOINT_H
 
23
#define ATTACHMENTPOINT_H
 
24
 
 
25
#include "arraylist.h"
 
26
#include "filexml.inc"
 
27
#include "floatauto.inc"
 
28
#include "floatautos.inc"
 
29
#include "mwindow.inc"
 
30
#include "messages.inc"
 
31
#include "plugin.inc"
 
32
#include "pluginserver.inc"
 
33
#include "renderengine.inc"
 
34
#include "sharedlocation.h"
 
35
#include "vframe.inc"
 
36
#include "virtualnode.inc"
 
37
 
 
38
#include <stdint.h>
 
39
 
 
40
// Attachment points for Modules to attach plugins
 
41
class AttachmentPoint
 
42
{
 
43
public:
 
44
        AttachmentPoint(RenderEngine *renderengine, 
 
45
                Plugin *plugin, 
 
46
                int data_type);
 
47
        virtual ~AttachmentPoint();
 
48
 
 
49
        virtual int reset_parameters();
 
50
// Used by Module::swap_attachments before virtual console expansion.
 
51
// Return 1 if the plugin id is the same
 
52
        int identical(AttachmentPoint *old);
 
53
 
 
54
// Move new_virtual_plugins to virtual_plugins.
 
55
// Called after virtual console expansion.
 
56
        int render_init();
 
57
 
 
58
// Cause plugins to free any resources which are required after stopping
 
59
        void render_stop();
 
60
 
 
61
// Called before every buffer processing
 
62
        void reset_status();
 
63
 
 
64
// Attach a virtual plugin for realtime playback.  Returns the number
 
65
// of the buffer assigned to a multichannel plugin.
 
66
        int attach_virtual_plugin(VirtualNode *virtual_plugin);
 
67
        virtual void delete_buffer_vector() {};
 
68
 
 
69
// return 0 if ready to render
 
70
// check all the virtual plugins for waiting status
 
71
// all virtual plugins attached to this must be waiting for a render
 
72
//      int sort(VirtualNode *virtual_plugin);
 
73
// Called by plugin server to render GUI with data.
 
74
        void render_gui(void *data);
 
75
        void render_gui(void *data, int size);
 
76
        int gui_open();
 
77
        virtual int get_buffer_size() { return 0; };
 
78
 
 
79
// For unshared plugins, virtual plugins to send configuration events to and 
 
80
// read data from.
 
81
// For shared plugins, virtual plugins to allocate buffers for and read 
 
82
// data from.
 
83
        ArrayList<VirtualNode*> virtual_plugins;
 
84
 
 
85
// List for a new virtual console which is transferred to virtual_plugins after
 
86
// virtual console expansion.
 
87
        ArrayList<VirtualNode*> new_virtual_plugins;
 
88
 
 
89
// Plugin servers to do signal processing
 
90
        ArrayList<PluginServer*> plugin_servers;
 
91
 
 
92
// renderengine Plugindb entry
 
93
        PluginServer *plugin_server;
 
94
// Pointer to the plugin object in EDL
 
95
        Plugin *plugin;
 
96
// ID of plugin object in EDL
 
97
        int plugin_id;
 
98
        RenderEngine *renderengine;
 
99
// Current input buffer being loaded.  Determines when the plugin server is run
 
100
//      int current_buffer;
 
101
 
 
102
// Status of last buffer processed.
 
103
// Used in shared multichannel plugin to tell of it's already been processed
 
104
// or needs to be processed again for a different target.
 
105
// start_position is the end of the range if playing in reverse.
 
106
        int64_t start_position;
 
107
        int64_t len;
 
108
        int64_t sample_rate;
 
109
        double frame_rate;
 
110
        int is_processed;
 
111
        int data_type;  
 
112
 
 
113
 
 
114
 
 
115
 
 
116
 
 
117
 
 
118
 
 
119
 
 
120
 
 
121
 
 
122
 
 
123
        int multichannel_shared(int search_new);
 
124
        int singlechannel();
 
125
 
 
126
 
 
127
 
 
128
        int dump();
 
129
 
 
130
};
 
131
 
 
132
#endif