mwindow->edl->session->tool_window = 1;
gui->composite_panel->operation[CWINDOW_TOOL_WINDOW]->update(1);
}
+ mwindow->edl->session->tool_window = new_gui ? 1 : 0;
update_show_window();
// Signal thread to run next tool GUI
add_subwindow(button = new CWindowCameraCenter(mwindow, this, x1, y));
x1 += button->get_w();
add_subwindow(button = new CWindowCameraRight(mwindow, this, x1, y));
+// additional Buttons to control the curve mode of the "current" keyframe
+ x1 += button->get_w() + 15;
+ add_subwindow(this->t_smooth = new CWindowCurveToggle(Camera_Crv_Smooth, mwindow, this, x1, y));
+ x1 += button->get_w() + 10;
+ add_subwindow(this->t_linear = new CWindowCurveToggle(Camera_Crv_Linear, mwindow, this, x1, y));
y += button->get_h();
x1 = 10;
add_subwindow(button = new CWindowCameraMiddle(mwindow, this, x1, y));
x1 += button->get_w();
add_subwindow(button = new CWindowCameraBottom(mwindow, this, x1, y));
-// additional Buttons to control the curve mode of the "current" keyframe
x1 += button->get_w() + 15;
- add_subwindow(this->t_smooth = new CWindowCurveToggle(Camera_Crv_Smooth, mwindow, this, x1, y));
- x1 += button->get_w();
- add_subwindow(this->t_linear = new CWindowCurveToggle(Camera_Crv_Linear, mwindow, this, x1, y));
+ add_subwindow(this->add_keyframe = new CWindowCameraAddKeyframe(mwindow, this, x1, y));
+ x1 += button->get_w() + 10;
+ add_subwindow(this->reset = new CWindowCameraReset(mwindow, this, x1, y));
// fill in current auto keyframe values, set toggle states.
this->update();
return 1;
}
+CWindowCameraAddKeyframe::CWindowCameraAddKeyframe(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("keyframe_button"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ set_tooltip(_("Add Keyframe: Shift-F11"));
+}
+
+int CWindowCameraAddKeyframe::handle_event()
+{
+ return gui->press(&CWindowCanvas::camera_keyframe);
+}
+
+CWindowCameraReset::CWindowCameraReset(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("reset_button"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ set_tooltip(_("Reset Camera: F11"));
+}
+
+int CWindowCameraReset::handle_event()
+{
+ return gui->press(&CWindowCanvas::reset_camera);
+}
+
CWindowProjectorGUI::CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread)
: CWindowToolGUI(mwindow,
add_subwindow(button = new CWindowProjectorCenter(mwindow, this, x1, y));
x1 += button->get_w();
add_subwindow(button = new CWindowProjectorRight(mwindow, this, x1, y));
+// additional Buttons to control the curve mode of the "current" keyframe
+ x1 += button->get_w() + 15;
+ add_subwindow(this->t_smooth = new CWindowCurveToggle(Projector_Crv_Smooth, mwindow, this, x1, y));
+ x1 += button->get_w() + 10;
+ add_subwindow(this->t_linear = new CWindowCurveToggle(Projector_Crv_Linear, mwindow, this, x1, y));
y += button->get_h();
x1 = 10;
add_subwindow(button = new CWindowProjectorMiddle(mwindow, this, x1, y));
x1 += button->get_w();
add_subwindow(button = new CWindowProjectorBottom(mwindow, this, x1, y));
-
-// additional Buttons to control the curve mode of the "current" keyframe
x1 += button->get_w() + 15;
- add_subwindow(this->t_smooth = new CWindowCurveToggle(Projector_Crv_Smooth, mwindow, this, x1, y));
- x1 += button->get_w();
- add_subwindow(this->t_linear = new CWindowCurveToggle(Projector_Crv_Linear, mwindow, this, x1, y));
+ add_subwindow(this->add_keyframe = new CWindowProjectorAddKeyframe(mwindow, this, x1, y));
+ x1 += button->get_w() + 10;
+ add_subwindow(this->reset = new CWindowProjectorReset(mwindow, this, x1, y));
// fill in current auto keyframe values, set toggle states.
this->update();
return 1;
}
+CWindowProjectorAddKeyframe::CWindowProjectorAddKeyframe(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("keyframe_button"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ set_tooltip(_("Add Keyframe: Shift-F12"));
+}
+
+int CWindowProjectorAddKeyframe::handle_event()
+{
+ return gui->press(&CWindowCanvas::projector_keyframe);
+}
+
+CWindowProjectorReset::CWindowProjectorReset(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("reset_button"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ set_tooltip(_("Reset Projector: F12"));
+}
+
+int CWindowProjectorReset::handle_event()
+{
+ return gui->press(&CWindowCanvas::reset_projector);
+}
+
+int CWindowToolGUI::press(void (CWindowCanvas::*fn)())
+{
+ unlock_window();
+ CWindowGUI *cw_gui = thread->gui;
+ cw_gui->lock_window("CWindowGUI::press");
+ (cw_gui->canvas->*fn)();
+ cw_gui->unlock_window();
+ lock_window("CWindowToolGUI::press");
+ return 1;
+}
CWindowMaskOnTrack::CWindowMaskOnTrack(MWindow *mwindow, CWindowMaskGUI *gui,
int x, int y, int w, const char *text)
{
}
-
-
-
virtual int close_event();
int keypress_event();
int translation_event();
+ int press(void (CWindowCanvas::*fn)());
MWindow *mwindow;
CWindowTool *thread;
public:
CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
~CWindowCameraGUI();
+ void handle_event();
void create_objects();
void update();
-// Update the keyframe from text boxes
- void handle_event();
-// BezierAuto* get_keyframe();
CWindowCoord *x, *y, *z;
-private:
-// Toggles for keyframe curve mode (for camera automation only)
+ CWindowCameraAddKeyframe *add_keyframe;
+ CWindowCameraReset *reset;
CWindowCurveToggle *t_smooth, *t_linear;
};
CWindowCameraGUI *gui;
};
+class CWindowCameraAddKeyframe : public BC_Button
+{
+public:
+ CWindowCameraAddKeyframe(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ int handle_event();
+
+ MWindow *mwindow;
+ CWindowToolGUI *gui;
+};
+
+class CWindowCameraReset : public BC_Button
+{
+public:
+ CWindowCameraReset(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ int handle_event();
+
+ MWindow *mwindow;
+ CWindowToolGUI *gui;
+};
+
+
class CWindowProjectorGUI : public CWindowToolGUI
{
public:
CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
~CWindowProjectorGUI();
+ void handle_event();
void create_objects();
void update();
- void handle_event();
-// BezierAuto* get_keyframe();
+
CWindowCoord *x, *y, *z;
-private:
-// Toggles for keyframe curve mode (projector automation only)
+ CWindowProjectorAddKeyframe *add_keyframe;
+ CWindowProjectorReset *reset;
CWindowCurveToggle *t_smooth, *t_linear;
};
CWindowProjectorGUI *gui;
};
+class CWindowProjectorAddKeyframe : public BC_Button
+{
+public:
+ CWindowProjectorAddKeyframe(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ int handle_event();
+
+ MWindow *mwindow;
+ CWindowToolGUI *gui;
+};
+
+class CWindowProjectorReset : public BC_Button
+{
+public:
+ CWindowProjectorReset(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ int handle_event();
+
+ MWindow *mwindow;
+ CWindowToolGUI *gui;
+};
+
};
-
#endif