+CWindowMaskAffectedPoint::CWindowMaskAffectedPoint(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_TumbleTextBox(gui,
+ (int64_t)mwindow->cwindow->gui->affected_point,
+ (int64_t)0, INT64_MAX, x, y, 100)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+CWindowMaskAffectedPoint::~CWindowMaskAffectedPoint()
+{
+}
+
+int CWindowMaskAffectedPoint::handle_event()
+{
+ int total_points = 0;
+ int affected_point = atol(get_text());
+ Track *track = mwindow->cwindow->calculate_affected_track();
+ if(track) {
+ MaskAutos *autos = (MaskAutos*)track->automation->autos[AUTOMATION_MASK];
+ MaskAuto *keyframe = (MaskAuto*)mwindow->cwindow->calculate_affected_auto(autos, 0);
+ if( keyframe ) {
+ SubMask *mask = keyframe->get_submask(mwindow->edl->session->cwindow_mask);
+ total_points = mask->points.size();
+ }
+ }
+ int active_point = affected_point;
+ if( affected_point >= total_points )
+ affected_point = total_points - 1;
+ else if( affected_point < 0 )
+ affected_point = 0;
+ if( active_point != affected_point )
+ update((int64_t)affected_point);
+ mwindow->cwindow->gui->affected_point = affected_point;
+ gui->update();
+ gui->update_preview();
+ return 1;
+}
+
+