+EditClick2Play::EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("playpatch_data"),
+ !panel->is_vwindow() ?
+ mwindow->edl->session->cwindow_click2play :
+ mwindow->edl->session->vwindow_click2play)
+{
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("Click to play (p)"));
+}
+int EditClick2Play::handle_event()
+{
+ int value = get_value();
+ if( !panel->is_vwindow() )
+ mwindow->edl->session->cwindow_click2play = value;
+ else
+ mwindow->edl->session->vwindow_click2play = value;
+ return 1;
+}
+int EditClick2Play::keypress_event()
+{
+ int key = get_keypress();
+ if( key == 'p' && !ctrl_down() && !shift_down() && !alt_down() ) {
+ int value = get_value() ? 0 : 1;
+ update(value);
+ if( !panel->is_vwindow() )
+ mwindow->edl->session->cwindow_click2play = value;
+ else
+ mwindow->edl->session->vwindow_click2play = value;
+ return 1;
+ }
+ return 0;
+}
+
+