3 #include "edlsession.h"
5 #include "localsession.h"
8 #include "pluginclient.h"
9 #include "pluginserver.h"
10 #include "preferences.h"
11 #include "transportque.inc"
15 PluginClient::PluginClient(PluginServer *server)
18 this->server = server;
21 PluginClient::~PluginClient()
25 int PluginClient::reset()
32 realtime_priority = 0;
35 total_out_buffers = 0;
39 direction = PLAY_FORWARD;
44 // For realtime plugins initialize buffers
45 int PluginClient::plugin_init_realtime(int realtime_priority,
50 // Get parameters for all
51 master_gui_on = get_gui_status();
55 // get parameters depending on video or audio
56 init_realtime_parameters();
58 smp = server->preferences->processors - 1;
60 this->realtime_priority = realtime_priority;
62 this->total_in_buffers = this->total_out_buffers = total_in_buffers;
64 this->out_buffer_size = this->in_buffer_size = buffer_size;
69 int PluginClient::plugin_start_loop(int64_t start,
74 this->source_start = start;
75 this->total_len = end - start;
78 this->in_buffer_size = this->out_buffer_size = buffer_size;
79 this->total_in_buffers = this->total_out_buffers = total_buffers;
84 int PluginClient::plugin_process_loop()
86 return process_loop();
89 int PluginClient::plugin_stop_loop()
94 MainProgressBar* PluginClient::start_progress(char *string, int64_t length)
96 return server->start_progress(string, length);
101 int PluginClient::plugin_get_parameters()
103 int result = get_parameters();
107 // ========================= main loop
109 int PluginClient::is_multichannel() { return 0; }
110 int PluginClient::is_synthesis() { return 0; }
111 int PluginClient::is_realtime() { return 0; }
112 int PluginClient::is_fileio() { return 0; }
113 int PluginClient::delete_buffer_ptrs() { return 0; }
114 char* PluginClient::plugin_title() { return _("Untitled"); }
115 VFrame* PluginClient::new_picon() { return 0; }
116 Theme* PluginClient::new_theme() { return 0; }
121 Theme* PluginClient::get_theme()
123 return server->get_theme();
128 int PluginClient::is_audio() { return 0; }
129 int PluginClient::is_video() { return 0; }
130 int PluginClient::is_theme() { return 0; }
131 int PluginClient::uses_gui() { return 1; }
132 int PluginClient::is_transition() { return 0; }
133 int PluginClient::load_defaults() { return 0; }
134 int PluginClient::save_defaults() { return 0; }
135 int PluginClient::show_gui() { return 0; }
136 int PluginClient::set_string() { return 0; }
137 int PluginClient::get_parameters() { return 0; }
138 int PluginClient::get_samplerate() { return get_project_samplerate(); }
139 double PluginClient::get_framerate() { return get_project_framerate(); }
140 int PluginClient::init_realtime_parameters() { return 0; }
141 int PluginClient::delete_nonrealtime_parameters() { return 0; }
142 int PluginClient::start_loop() { return 0; };
143 int PluginClient::process_loop() { return 0; };
144 int PluginClient::stop_loop() { return 0; };
146 void PluginClient::set_interactive()
151 int64_t PluginClient::get_in_buffers(int64_t recommended_size)
153 return recommended_size;
156 int64_t PluginClient::get_out_buffers(int64_t recommended_size)
158 return recommended_size;
161 int PluginClient::get_gui_status()
163 return server->get_gui_status();
166 int PluginClient::start_plugin()
168 printf(_("No processing defined for this plugin.\n"));
172 // close event from client side
173 void PluginClient::client_side_close()
175 // Last command executed
176 server->client_side_close();
179 int PluginClient::stop_gui_client()
181 if(!client_gui_on) return 0;
186 int PluginClient::get_project_samplerate()
188 return server->get_project_samplerate();
191 double PluginClient::get_project_framerate()
193 return server->get_project_framerate();
197 void PluginClient::update_display_title()
199 server->generate_display_title(gui_string);
203 char* PluginClient::get_gui_string()
209 char* PluginClient::get_path()
214 int PluginClient::set_string_client(char *string)
216 strcpy(gui_string, string);
222 int PluginClient::get_interpolation_type()
224 return server->get_interpolation_type();
228 float PluginClient::get_red()
231 return server->mwindow->edl->local_session->red;
234 return server->edl->local_session->red;
239 float PluginClient::get_green()
242 return server->mwindow->edl->local_session->green;
245 return server->edl->local_session->green;
250 float PluginClient::get_blue()
253 return server->mwindow->edl->local_session->blue;
256 return server->edl->local_session->blue;
263 int64_t PluginClient::get_source_position()
265 return source_position;
268 int64_t PluginClient::get_source_start()
273 int64_t PluginClient::get_total_len()
278 int PluginClient::get_direction()
284 int64_t PluginClient::local_to_edl(int64_t position)
289 int64_t PluginClient::edl_to_local(int64_t position)
294 int PluginClient::get_use_opengl()
296 return server->get_use_opengl();
299 int PluginClient::get_total_buffers()
301 return total_in_buffers;
304 int PluginClient::get_buffer_size()
306 return in_buffer_size;
309 int PluginClient::get_project_smp()
314 char* PluginClient::get_defaultdir()
320 int PluginClient::send_hide_gui()
322 // Stop the GUI server and delete GUI messages
327 int PluginClient::send_configure_change()
329 KeyFrame* keyframe = server->get_keyframe();
332 server->mwindow->undo->update_undo("tweek", LOAD_AUTOMATION, this);
333 server->sync_parameters();
338 KeyFrame* PluginClient::get_prev_keyframe(int64_t position, int is_local)
340 if(is_local) position = local_to_edl(position);
341 return server->get_prev_keyframe(position);
344 KeyFrame* PluginClient::get_next_keyframe(int64_t position, int is_local)
346 if(is_local) position = local_to_edl(position);
347 return server->get_next_keyframe(position);
350 void PluginClient::get_camera(float *x, float *y, float *z, int64_t position)
352 server->get_camera(x, y, z, position, direction);
355 void PluginClient::get_projector(float *x, float *y, float *z, int64_t position)
357 server->get_projector(x, y, z, position, direction);
361 EDLSession* PluginClient::get_edlsession()
364 return server->edl->session;
368 int PluginClient::gui_open()
370 return server->gui_open();