+ float projector_x, projector_y, projector_z;
+ int64_t position = get_source_position();
+ get_projector(&projector_x, &projector_y, &projector_z, position);
+ EDL *edl = get_edl();
+ projector_x += edl->session->output_w / 2;
+ projector_y += edl->session->output_h / 2;
+ Track *track = server->plugin ? server->plugin->track : 0;
+ int track_w = track ? track->track_w : edl->session->output_w;
+ int track_h = track ? track->track_h : edl->session->output_h;
+ tx = (ox - projector_x) / projector_z + track_w / 2;
+ ty = (oy - projector_y) / projector_z + track_h / 2;
+}
+
+void PluginClient::track_to_output(float tx, float ty, float &ox, float &oy)
+{
+ float projector_x, projector_y, projector_z;
+ int64_t position = get_source_position();
+ get_projector(&projector_x, &projector_y, &projector_z, position);
+ EDL *edl = get_edl();
+ projector_x += edl->session->output_w / 2;
+ projector_y += edl->session->output_h / 2;
+ Track *track = server->plugin ? server->plugin->track : 0;
+ int track_w = track ? track->track_w : edl->session->output_w;
+ int track_h = track ? track->track_h : edl->session->output_h;
+ ox = (tx - track_w / 2) * projector_z + projector_x;
+ oy = (ty - track_h / 2) * projector_z + projector_y;
+}
+
+
+EDL *PluginClient::get_edl()
+{
+ return server->mwindow ? server->mwindow->edl : server->edl;