int ColorWindow::handle_event()
{
+ unlock_window();
thread->handle_new_color(rgb888(), alpha8());
+ lock_window("ColorWindow::handle_event");
return 1;
}
}
-CWindowMaskSmooth::CWindowMaskSmooth(MWindow *mwindow,
- CWindowMaskGUI *gui, int x, int y)
- : BC_GenericButton(x, y, _("Smooth"))
+CWindowMaskSmoothButton::CWindowMaskSmoothButton(MWindow *mwindow, CWindowMaskGUI *gui,
+ const char *tip, int type, int on, int x, int y, const char *images)
+ : BC_Button(x, y, mwindow->theme->get_image_set(images))
{
this->mwindow = mwindow;
this->gui = gui;
- set_tooltip(_("Smooth boundary"));
-}
-int CWindowMaskSmooth::handle_event()
-{
- return gui->smooth_mask(0);
+ this->type = type;
+ this->on = on;
+ set_tooltip(tip);
}
-CWindowMaskGangSmooth::CWindowMaskGangSmooth(MWindow *mwindow,
- CWindowMaskGUI *gui, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("gangpatch_data"))
+int CWindowMaskSmoothButton::handle_event()
{
- this->mwindow = mwindow;
- this->gui = gui;
- set_tooltip(_("Smooth All"));
-}
-int CWindowMaskGangSmooth::handle_event()
-{
- return gui->smooth_mask(1);
+ return gui->smooth_mask(type, on);
}
CWindowMaskBeforePlugins::CWindowMaskBeforePlugins(CWindowMaskGUI *gui, int x, int y)
- : BC_CheckBox(x,
- y,
- 1,
- _("Apply mask before plugins"))
+ : BC_CheckBox(x, y, 1, _("Apply mask before plugins"))
{
this->gui = gui;
}
add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Mask Points")));
y += title_bar->get_h() + margin;
+ x1 = x + 60;
add_subwindow(title = new BC_Title(x, y, _("Point:")));
active_point = new CWindowMaskAffectedPoint(mwindow, this, x1, y);
active_point->create_objects();
+ int x3 = x1 + active_point->get_w() + 4*margin;
+// typ=0, this mask, this point
+ add_subwindow(mask_pnt_linear = new CWindowMaskSmoothButton(mwindow, this,
+ _("sharp point"), 0, 0, x3, y, "mask_pnt_linear_images"));
+ int x4 = x3 + mask_pnt_linear->get_w() + 2*margin;
+ add_subwindow(mask_pnt_smooth = new CWindowMaskSmoothButton(mwindow, this,
+ _("smooth point"), 0, 1, x4, y, "mask_pnt_smooth_images"));
add_subwindow(del_point = new CWindowMaskDelPoint(mwindow, this, del_x, y));
y += active_point->get_h() + margin;
add_subwindow(title = new BC_Title(x, y, "X:"));
this->x = new CWindowCoord(this, x1, y, (float)0.0);
this->x->create_objects();
+// typ>0, this mask, all points
+ add_subwindow(mask_crv_linear = new CWindowMaskSmoothButton(mwindow, this,
+ _("sharp curve"), 1, 0, x3, y, "mask_crv_linear_images"));
+ add_subwindow(mask_crv_smooth = new CWindowMaskSmoothButton(mwindow, this,
+ _("smooth curve"), 1, 1, x4, y, "mask_crv_smooth_images"));
add_subwindow(draw_markers = new CWindowMaskDrawMarkers(mwindow, this, del_x, y));
y += this->x->get_h() + margin;
add_subwindow(title = new BC_Title(x, y, "Y:"));
this->y = new CWindowCoord(this, x1, y, (float)0.0);
this->y->create_objects();
+// typ<0, all masks, all points
+ add_subwindow(mask_all_linear = new CWindowMaskSmoothButton(mwindow, this,
+ _("sharp all"), -1, 0, x3, y, "mask_all_linear_images"));
+ add_subwindow(mask_all_smooth = new CWindowMaskSmoothButton(mwindow, this,
+ _("smooth all"), -1, 1, x4, y, "mask_all_smooth_images"));
add_subwindow(draw_boundary = new CWindowMaskDrawBoundary(mwindow, this, del_x, y));
y += this->y->get_h() + 2*margin;
add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Pivot Point")));
float cy = mwindow->edl->session->output_h / 2.f;
focus_y = new CWindowCoord(this, x1, y, cy);
focus_y->create_objects();
- add_subwindow(smooth = new CWindowMaskSmooth(mwindow, this, del_x, y));
- add_subwindow(gang_smooth = new CWindowMaskGangSmooth(mwindow, this, clr_x, y));
y += focus_x->get_h() + 2*margin;
BC_Bar *bar;
add_subwindow(bar = new BC_Bar(x, y, get_w()-2*x));
}
}
-int CWindowMaskGUI::smooth_mask(int gang)
+// typ=0, this mask, this point
+// typ>0, this mask, all points
+// typ<0, all masks, all points
+// dxy= on? pt[+1]-pt[-1] : dxy=0
+int CWindowMaskGUI::smooth_mask(int typ, int on)
{
MaskAutos *autos;
MaskAuto *keyframe;
keyframe = &temp_keyframe;
#endif
int k = mwindow->edl->session->cwindow_mask;
- int n = gang ? keyframe->masks.size() : k+1;
- for( int j=gang? 0 : k; j<n; ++j ) {
+ int n = typ>=0 ? k+1 : keyframe->masks.size();
+ for( int j=typ<0? 0 : k; j<n; ++j ) {
SubMask *sub_mask = keyframe->get_submask(j);
ArrayList<MaskPoint*> &points = sub_mask->points;
int psz = points.size();
if( psz < 3 ) continue;
- for( int i=0; i<psz; ++i ) {
+ int l = mwindow->cwindow->gui->affected_point;
+ int m = typ ? psz : l+1;
+ for( int i=typ<0? 0 : l; i<m; ++i ) {
int i0 = i-1, i1 = i+1;
if( i0 < 0 ) i0 = psz-1;
if( i1 >= psz ) i1 = 0;
MaskPoint *p0 = points[i0];
MaskPoint *p = points[i];
MaskPoint *p1 = points[i1];
- float dx = p1->x - p0->x, dy = p1->y - p0->y;
+ float dx = !on ? 0 : p1->x - p0->x;
+ float dy = !on ? 0 : p1->y - p0->y;
p->control_x1 = -dx/4; p->control_y1 = -dy/4;
p->control_x2 = dx/4; p->control_y2 = dy/4;
}
CWindowMaskGUI *gui;
};
-class CWindowMaskSmooth : public BC_GenericButton
+class CWindowMaskSmoothButton : public BC_Button
{
public:
- CWindowMaskSmooth(MWindow *mwindow, CWindowMaskGUI *gui,
- int x, int y);
- int handle_event();
- MWindow *mwindow;
- CWindowMaskGUI *gui;
-};
-
-class CWindowMaskGangSmooth : public BC_Button
-{
-public:
- CWindowMaskGangSmooth(MWindow *mwindow, CWindowMaskGUI *gui,
- int x, int y);
+ CWindowMaskSmoothButton(MWindow *mwindow, CWindowMaskGUI *gui,
+ const char *tip, int type, int on, int x, int y, const char *images);
int handle_event();
MWindow *mwindow;
CWindowMaskGUI *gui;
+ int type, on;
};
class CWindowMaskAffectedPoint : public BC_TumbleTextBox
void handle_event();
void set_focused(int v, float cx, float cy);
void update_buttons(MaskAuto *keyframe, int k);
- int smooth_mask(int gang);
+ int smooth_mask(int typ, int on);
void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
SubMask* &mask, MaskPoint* &point, int create_it);
CWindowMaskGangFader *gang_fader;
CWindowMaskAffectedPoint *active_point;
CWindowMaskDelPoint *del_point;
+ CWindowMaskSmoothButton *mask_pnt_linear, *mask_pnt_smooth;
+ CWindowMaskSmoothButton *mask_crv_linear, *mask_crv_smooth;
+ CWindowMaskSmoothButton *mask_all_linear, *mask_all_smooth;
CWindowCoord *x, *y;
CWindowMaskFocus *focus;
int focused;
CWindowMaskGangFocus *gang_focus;
- CWindowMaskSmooth *smooth;
- CWindowMaskGangSmooth *gang_smooth;
CWindowMaskHelp *help;
int helped, help_y, help_h;
CWindowMaskDrawMarkers *draw_markers;
int GWindowColorButton::handle_new_color(int color, int alpha)
{
this->color = color;
- color_thread->update_lock->unlock();
return 1;
}
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",
"generic_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
new_toggle("loadmode_new.png",
"loadmode_up.png",
"loadmode_hi.png",
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",
"generic_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->bar_data = new_image("bar", "bar.png");
//clock font
"bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",
"new_bigbutton_hi.png",
"new_bigbutton_dn.png",
"new_ok_images");
- new_button(
- "reset.png",
- "reset_up.png",
- "reset_dn.png",
- "reset_hi.png",
- "reset_button");
+ new_button( "reset.png",
+ "reset_up.png",
+ "reset_dn.png",
+ "reset_hi.png",
+ "reset_button");
resources->cancel_images = new_button(
"cancel.png",
"filebox_bigbutton_up.png",
"new_bigbutton_hi.png",
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
resources->bar_data = new_image("bar", "bar.png");
resources->check = new_image("check", "check.png");
resources->min_menu_w = 96;
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",
"new_bigbutton_hi.png",
"new_bigbutton_dn.png",
"new_cancel_images");
+
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
// Clock - is not used (AFAIK). See also clock color.
// resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
// "0.png",
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",
"new_bigbutton_dn.png",
"new_cancel_images");
+ new_button("mask_pnt_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_linear_images");
+ new_button("mask_crv_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_linear_images");
+ new_button("mask_all_linear.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_linear_images");
+
+ new_button("mask_pnt_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_pnt_smooth_images");
+ new_button("mask_crv_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_crv_smooth_images");
+ new_button("mask_all_smooth.png",
+ "mask_button_up.png",
+ "mask_button_hi.png",
+ "mask_button_dn.png",
+ "mask_all_smooth_images");
+
resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
"0.png",
"1.png",