}
-CWindowMaskName::CWindowMaskName(MWindow *mwindow,
- CWindowToolGUI *gui, int x, int y, const char *text)
+CWindowMaskName::CWindowMaskName(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y, const char *text)
: BC_PopupTextBox(gui, 0, text, x, y, 100, 160)
{
this->mwindow = mwindow;
SubMask *mask;
MaskPoint *point;
//printf("CWindowMaskGUI::update 1\n");
- ((CWindowMaskGUI*)gui)->get_keyframe(track, autos, keyframe, mask, point, 0);
+ gui->get_keyframe(track, autos, keyframe, mask, point, 0);
if( track ) {
int k = get_number();
if( k < 0 ) k = mwindow->edl->session->cwindow_mask;
(MaskAuto*)autos->first : (MaskAuto*)NEXT;
}
#endif
+ int total_buttons = sizeof(gui->mask_buttons)/sizeof(gui->mask_buttons[0]);
+ for( int i=0; i<total_buttons; ++i )
+ gui->mask_buttons[i]->update(i==k ? 1 : 0);
gui->update();
gui->update_preview();
}
}
+CWindowMaskButton::CWindowMaskButton(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y, int no, int v)
+ : BC_CheckBox(x, y, v)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ this->no = no;
+}
+
+CWindowMaskButton::~CWindowMaskButton()
+{
+}
+
+int CWindowMaskButton::handle_event()
+{
+ mwindow->edl->session->cwindow_mask = no;
+ int total_buttons = sizeof(gui->mask_buttons)/sizeof(gui->mask_buttons[0]);
+ for( int i=0; i<total_buttons; ++i )
+ gui->mask_buttons[i]->update(i==no ? 1 : 0);
+ gui->name->update(gui->name->mask_items[no]->get_text());
+ gui->update_preview();
+ return 1;
+}
+
+CWindowMaskThumbler::CWindowMaskThumbler(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y)
+ : BC_Tumbler(x, y)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+CWindowMaskThumbler::~CWindowMaskThumbler()
+{
+}
+
+int CWindowMaskThumbler::handle_up_event()
+{
+ return do_event(1);
+}
+
+int CWindowMaskThumbler::handle_down_event()
+{
+ return do_event(-1);
+}
+
+int CWindowMaskThumbler::do_event(int dir)
+{
+ int k = mwindow->edl->session->cwindow_mask;
+ if( (k+=dir) >= SUBMASKS ) k = 0;
+ else if( k < 0 ) k = SUBMASKS-1;
+ mwindow->edl->session->cwindow_mask = k;
+ int total_buttons = sizeof(gui->mask_buttons)/sizeof(gui->mask_buttons[0]);
+ for( int i=0; i<total_buttons; ++i )
+ gui->mask_buttons[i]->update(i==k ? 1 : 0);
+ gui->name->update(gui->name->mask_items[k]->get_text());
+ gui->update_preview();
+ return 1;
+}
+
+
CWindowMaskDelMask::CWindowMaskDelMask(MWindow *mwindow,
CWindowToolGUI *gui, int x, int y)
: BC_GenericButton(x, y, _("Delete"))
CWindowMaskGUI::CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread)
: CWindowToolGUI(mwindow, thread,
- _(PROGRAM_NAME ": Mask"), 360, 440)
+ _(PROGRAM_NAME ": Mask"), 360, 500)
{
this->mwindow = mwindow;
this->thread = thread;
add_subwindow(clr_mask = new CWindowMaskClrMask(mwindow, this, clr_x, y));
add_subwindow(del_mask = new CWindowMaskDelMask(mwindow, this, del_x, y));
y += name->get_h() + margin;
+
+ int bw = 0, bh = 0;
+ BC_CheckBox::calculate_extents(this, &bw, &bh);
+ int bdx = bw + margin;
+ int x2 = x;
+ for( int i=0; i<SUBMASKS; x2+=bdx, ++i ) {
+ int v = i == mwindow->edl->session->cwindow_mask ? 1 : 0;
+ mask_buttons[i] = new CWindowMaskButton(mwindow, this, x2, y, i, v);
+ add_subwindow(mask_buttons[i]);
+ }
+ x2 += margin;
+ add_subwindow(mask_thumbler = new CWindowMaskThumbler(mwindow, this, x2, y));
+ y += bh + margin;
+ x2 = x;
+ for( int i=0; i<SUBMASKS; x2+=bdx, ++i ) {
+ char text[BCSTRLEN]; sprintf(text, "%d", i);
+ int tx = (bw - get_text_width(MEDIUMFONT, text)) / 2;
+ mask_blabels[i] = new BC_Title(x2+tx, y, text);
+ add_subwindow(mask_blabels[i]);
+ }
+ y += bh + 2*margin;
+
add_subwindow(title = new BC_Title(x, y, _("Fade:")));
fade = new CWindowMaskFade(mwindow, this, x1, y);
fade->create_objects();
- int x2 = x1 + fade->get_w() + 2*margin;
+ x2 = x1 + fade->get_w() + 2*margin;
int w2 = clr_x-2*margin - x2;
add_subwindow(fade_slider = new CWindowMaskFadeSlider(mwindow, this, x2, y, w2));
add_subwindow(gang_fader = new CWindowMaskGangFader(mwindow, this, clr_x, y));
class CWindowCoord : public BC_TumbleTextBox
{
public:
- CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int logincrement);
- CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
+ CWindowCoord(CWindowToolGUI *gui, int x, int y,
+ float value, int logincrement);
+ CWindowCoord(CWindowToolGUI *gui, int x, int y,
+ int value);
// Calls the window's handle_event
int handle_event();
class CWindowCropOK : public BC_GenericButton
{
public:
- CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
// Perform the cropping operation
int handle_event();
int keypress_event();
class CWindowMaskName : public BC_PopupTextBox
{
public:
- CWindowMaskName(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, const char *text);
+ CWindowMaskName(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y, const char *text);
~CWindowMaskName();
MWindow *mwindow;
- CWindowToolGUI *gui;
+ CWindowMaskGUI *gui;
CWindowMaskItems mask_items;
int handle_event();
class CWindowMaskDelMask : public BC_GenericButton
{
public:
- CWindowMaskDelMask(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskDelMask(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowToolGUI *gui;
class CWindowMaskClrMask : public BC_Button
{
public:
- CWindowMaskClrMask(MWindow *mwindow, CWindowMaskGUI *gui, int x, int y);
+ CWindowMaskClrMask(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y);
~CWindowMaskClrMask();
static int calculate_w(MWindow *mwindow);
int handle_event();
CWindowMaskGUI *gui;
};
+class CWindowMaskButton : public BC_CheckBox
+{
+public:
+ CWindowMaskButton(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y, int no, int v);
+ ~CWindowMaskButton();
+
+ int handle_event();
+ MWindow *mwindow;
+ CWindowMaskGUI *gui;
+ int no;
+};
+
+class CWindowMaskThumbler : public BC_Tumbler
+{
+public:
+ CWindowMaskThumbler(MWindow *mwindow, CWindowMaskGUI *gui,
+ int x, int y);
+ ~CWindowMaskThumbler();
+ int handle_up_event();
+ int handle_down_event();
+ int do_event(int dir);
+
+ MWindow *mwindow;
+ CWindowMaskGUI *gui;
+};
+
class CWindowMaskFade : public BC_TumbleTextBox
{
public:
- CWindowMaskFade(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskFade(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskFade();
int update(float v);
int update_value(float v);
class CWindowMaskGangFader : public BC_Toggle
{
public:
- CWindowMaskGangFader(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskGangFader(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskGangFader();
int handle_event();
MWindow *mwindow;
class CWindowMaskAffectedPoint : public BC_TumbleTextBox
{
public:
- CWindowMaskAffectedPoint(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskAffectedPoint(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskAffectedPoint();
int handle_event();
MWindow *mwindow;
class CWindowMaskFocus : public BC_CheckBox
{
public:
- CWindowMaskFocus(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskFocus(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskFocus();
int handle_event();
MWindow *mwindow;
class CWindowMaskDrawMarkers : public BC_CheckBox
{
public:
- CWindowMaskDrawMarkers(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskDrawMarkers(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskDrawMarkers();
int handle_event();
MWindow *mwindow;
class CWindowMaskDrawBoundary : public BC_CheckBox
{
public:
- CWindowMaskDrawBoundary(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskDrawBoundary(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskDrawBoundary();
int handle_event();
MWindow *mwindow;
class CWindowMaskDelPoint : public BC_GenericButton
{
public:
- CWindowMaskDelPoint(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskDelPoint(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
int handle_event();
int keypress_event();
MWindow *mwindow;
class CWindowMaskFeather : public BC_TumbleTextBox
{
public:
- CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskFeather();
int update(float v);
int update_value(float v);
class CWindowMaskGangFeather : public BC_Toggle
{
public:
- CWindowMaskGangFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowMaskGangFeather(MWindow *mwindow, CWindowToolGUI *gui,
+ int x, int y);
~CWindowMaskGangFeather();
int handle_event();
MWindow *mwindow;
class CWindowMaskBeforePlugins : public BC_CheckBox
{
public:
- CWindowMaskBeforePlugins(CWindowToolGUI *gui, int x, int y);
+ CWindowMaskBeforePlugins(CWindowToolGUI *gui,
+ int x, int y);
int handle_event();
CWindowToolGUI *gui;
};
class CWindowDisableOpenGLMasking : public BC_CheckBox
{
public:
- CWindowDisableOpenGLMasking(CWindowToolGUI *gui, int x, int y);
+ CWindowDisableOpenGLMasking(CWindowToolGUI *gui,
+ int x, int y);
int handle_event();
CWindowToolGUI *gui;
};
void update_preview();
CWindowMaskName *name;
+ CWindowMaskButton *mask_buttons[SUBMASKS];
+ CWindowMaskThumbler *mask_thumbler;
+ BC_Title *mask_blabels[SUBMASKS];
CWindowMaskDelMask *del_mask;
CWindowMaskClrMask *clr_mask;
CWindowMaskFade *fade;
class CWindowCameraLeft : public BC_Button
{
public:
- CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
+ CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowCameraGUI *gui;
class CWindowCameraCenter : public BC_Button
{
public:
- CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
+ CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowCameraGUI *gui;
class CWindowCameraRight : public BC_Button
{
public:
- CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
+ CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowCameraGUI *gui;
class CWindowCameraTop : public BC_Button
{
public:
- CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
+ CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowCameraGUI *gui;
class CWindowCameraMiddle : public BC_Button
{
public:
- CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
+ CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowCameraGUI *gui;
class CWindowCameraBottom : public BC_Button
{
public:
- CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
+ CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowCameraGUI *gui;
class CWindowProjectorLeft : public BC_Button
{
public:
- CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
+ CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowProjectorGUI *gui;
class CWindowProjectorCenter : public BC_Button
{
public:
- CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
+ CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowProjectorGUI *gui;
class CWindowProjectorRight : public BC_Button
{
public:
- CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
+ CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowProjectorGUI *gui;
class CWindowProjectorTop : public BC_Button
{
public:
- CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
+ CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowProjectorGUI *gui;
class CWindowProjectorMiddle : public BC_Button
{
public:
- CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
+ CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowProjectorGUI *gui;
class CWindowProjectorBottom : public BC_Button
{
public:
- CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
+ CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui,
+ int x, int y);
int handle_event();
MWindow *mwindow;
CWindowProjectorGUI *gui;