r105: This commit was manufactured by cvs2svn to create tag
[cinelerra_cv/mob.git] / hvirtual / cinelerra / editpanel.C
blob80edbf97b77c8b24db1e6f6482277122ea1c4b2a
1 #include "awindow.h"
2 #include "awindowgui.h"
3 #include "clipedit.h"
4 #include "cplayback.h"
5 #include "cwindow.h"
6 #include "editpanel.h"
7 #include "edl.h"
8 #include "edlsession.h"
9 #include "filexml.h"
10 #include "keys.h"
11 #include "localsession.h"
12 #include "mainclock.h"
13 #include "mainundo.h"
14 #include "mbuttons.h"
15 #include "meterpanel.h"
16 #include "mwindow.h"
17 #include "mwindowgui.h"
18 #include "playbackengine.h"
19 #include "theme.h"
20 #include "timebar.h"
21 #include "trackcanvas.h"
22 #include "transportque.h"
23 #include "zoombar.h"
25 #include <libintl.h>
26 #define _(String) gettext(String)
27 #define gettext_noop(String) String
28 #define N_(String) gettext_noop (String)
31 EditPanel::EditPanel(MWindow *mwindow, 
32         BC_WindowBase *subwindow,
33         int x, 
34         int y, 
35         int editing_mode, 
36         int use_editing_mode,
37         int use_keyframe, 
38         int use_splice,   // Extra buttons
39         int use_overwrite,
40         int use_lift,
41         int use_extract,
42         int use_copy, 
43         int use_paste, 
44         int use_undo,
45         int use_fit,
46         int use_labels,
47         int use_toclip,
48         int use_meters,
49         int is_mwindow,
50         int use_cut)
52         this->editing_mode = editing_mode;
53         this->use_editing_mode = use_editing_mode;
54         this->use_keyframe = use_keyframe;
55         this->use_splice = use_splice;
56         this->use_overwrite = use_overwrite;
57         this->use_lift = 0;
58         this->use_extract = 0;
59         this->use_copy = use_copy;
60         this->use_paste = use_paste;
61         this->use_undo = use_undo;
62         this->mwindow = mwindow;
63         this->subwindow = subwindow;
64         this->use_fit = use_fit;
65         this->use_labels = use_labels;
66         this->use_toclip = use_toclip;
67         this->use_meters = use_meters;
68         this->is_mwindow = is_mwindow;
69         this->use_cut = use_cut;
71         this->x = x;
72         this->y = y;
73         this->meter_panel = 0;
74         arrow = 0;
75         ibeam = 0;
76         keyframe = 0;
79 EditPanel::~EditPanel()
83 void EditPanel::set_meters(MeterPanel *meter_panel)
85         this->meter_panel = meter_panel;
89 void EditPanel::update()
91         int new_editing_mode = mwindow->edl->session->editing_mode;
92         if(arrow) arrow->update(new_editing_mode == EDITING_ARROW);
93         if(ibeam) ibeam->update(new_editing_mode == EDITING_IBEAM);
94         if(keyframe) keyframe->update(mwindow->edl->session->auto_keyframes);
95         subwindow->flush();
98 void EditPanel::delete_buttons()
100         if(use_editing_mode)
101         {
102                 if(arrow) delete arrow;
103                 if(ibeam) delete ibeam;
104         }
105         
106         if(use_keyframe)
107                 delete keyframe;
110 //      if(editing_mode == EDITING_ARROW)
111 //      {
112                 if(inpoint) delete inpoint;
113                 if(outpoint) delete outpoint;
114 //              delete delinpoint;
115 //              delete deloutpoint;
116                 if(use_copy) delete copy;
117                 if(use_splice) delete splice;
118                 if(use_overwrite) delete overwrite;
119                 if(use_lift) delete lift;
120                 if(use_extract) delete extract;
121 //      }
122 //      else
123 //      {
124                 if(cut) delete cut;
125                 if(copy) delete copy;
126                 if(use_paste) delete paste;
127 //      }
129         if(use_labels)
130         {       
131                 delete labelbutton;
132                 delete prevlabel;
133                 delete nextlabel;
134         }
136         if(use_fit) delete fit;
137         if(use_undo)
138         {
139                 delete undo;
140                 delete redo;
141         }
144 void EditPanel::create_buttons()
146         x1 = x, y1 = y;
148         if(use_editing_mode)
149         {
150                 subwindow->add_subwindow(arrow = new ArrowButton(mwindow, this, x1, y1));
151                 x1 += arrow->get_w();
152                 subwindow->add_subwindow(ibeam = new IBeamButton(mwindow, this, x1, y1));
153                 x1 += ibeam->get_w();
154         }
156         if(use_keyframe)
157         {
158                 subwindow->add_subwindow(keyframe = new KeyFrameButton(mwindow, x1, y1));
159                 x1 += keyframe->get_w();
160         }
162 // Mandatory
163         subwindow->add_subwindow(inpoint = new EditInPoint(mwindow, this, x1, y1));
164         x1 += inpoint->get_w();
165         subwindow->add_subwindow(outpoint = new EditOutPoint(mwindow, this, x1, y1));
166         x1 += outpoint->get_w();
167         if(use_splice)
168         {
169                 subwindow->add_subwindow(splice = new EditSplice(mwindow, this, x1, y1));
170                 x1 += splice->get_w();
171         }
172         if(use_overwrite)
173         {
174                 subwindow->add_subwindow(overwrite = new EditOverwrite(mwindow, this, x1, y1));
175                 x1 += overwrite->get_w();
176         }
177         if(use_lift)
178         {
179                 subwindow->add_subwindow(lift = new EditLift(mwindow, this, x1, y1));
180                 x1 += lift->get_w();
181         }
182         if(use_extract)
183         {
184                 subwindow->add_subwindow(extract = new EditExtract(mwindow, this, x1, y1));
185                 x1 += extract->get_w();
186         }
187         if(use_toclip)
188         {
189                 subwindow->add_subwindow(clip = new EditToClip(mwindow, this, x1, y1));
190                 x1 += clip->get_w();
191         }
192         
193         if(use_cut)
194         {
195                 subwindow->add_subwindow(cut = new EditCut(mwindow, this, x1, y1));
196                 x1 += cut->get_w();
197         }
198         if(use_copy)
199         {
200                 subwindow->add_subwindow(copy = new EditCopy(mwindow, this, x1, y1));
201                 x1 += copy->get_w();
202         }
203         if(use_paste)
204         {
205                 subwindow->add_subwindow(paste = new EditPaste(mwindow, this, x1, y1));
206                 x1 += paste->get_w();
207         }
208         
209         if(use_meters)
210         {
211                 if(!meter_panel)
212                 {
213                         printf("EditPanel::create_objects: meter_panel == 0\n");
214                 }
215                 subwindow->add_subwindow(meters = new MeterShow(mwindow, meter_panel, x1, y1));
216                 x1 += meters->get_w();
217         }
219         if(use_labels)
220         {
221                 subwindow->add_subwindow(labelbutton = new EditLabelbutton(mwindow, 
222                         this, 
223                         x1, 
224                         y1));
225                 x1 += labelbutton->get_w();
226                 subwindow->add_subwindow(prevlabel = new EditPrevLabel(mwindow, 
227                         this, 
228                         x1, 
229                         y1,
230                         is_mwindow));
231                 x1 += prevlabel->get_w();
232                 subwindow->add_subwindow(nextlabel = new EditNextLabel(mwindow, 
233                         this, 
234                         x1, 
235                         y1,
236                         is_mwindow));
237                 x1 += nextlabel->get_w();
238         }
240         if(use_fit)
241         {
242                 subwindow->add_subwindow(fit = new EditFit(mwindow, this, x1, y1));
243                 x1 += fit->get_w();
244         }
246         if(use_undo)
247         {
248                 subwindow->add_subwindow(undo = new EditUndo(mwindow, this, x1, y1));
249                 x1 += undo->get_w();
250                 subwindow->add_subwindow(redo = new EditRedo(mwindow, this, x1, y1));
251                 x1 += redo->get_w();
252         }
257 void EditPanel::toggle_label()
259         mwindow->toggle_label(is_mwindow);
262 void EditPanel::prev_label()
264         if(is_mwindow)
265         {
266                 mwindow->gui->unlock_window();
267         }
268         else
269                 subwindow->unlock_window();
271         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
273         if(!is_mwindow)
274                 subwindow->lock_window();
276         mwindow->gui->lock_window();
278         mwindow->prev_label();
280         if(!is_mwindow)
281                 mwindow->gui->unlock_window();
284 void EditPanel::next_label()
286         if(is_mwindow)
287         {
288                 mwindow->gui->unlock_window();
289         }
290         else
291                 subwindow->unlock_window();
293         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
295         if(!is_mwindow)
296                 subwindow->lock_window();
298         mwindow->gui->lock_window();
300         mwindow->next_label();
302         if(!is_mwindow)
303                 mwindow->gui->unlock_window();
309 void EditPanel::reposition_buttons(int x, int y)
311         this->x = x; 
312         this->y = y;
313         x1 = x, y1 = y;
315         if(use_editing_mode)
316         {
317                 arrow->reposition_window(x1, y1);
318                 x1 += arrow->get_w();
319                 ibeam->reposition_window(x1, y1);
320                 x1 += ibeam->get_w();
321         }
323         if(use_keyframe)
324         {
325                 keyframe->reposition_window(x1, y1);
326                 x1 += keyframe->get_w();
327         }
329         inpoint->reposition_window(x1, y1);
330         x1 += inpoint->get_w();
331         outpoint->reposition_window(x1, y1);
332         x1 += outpoint->get_w();
333         if(use_splice)
334         {
335                 splice->reposition_window(x1, y1);
336                 x1 += splice->get_w();
337         }
338         if(use_overwrite)
339         {
340                 overwrite->reposition_window(x1, y1);
341                 x1 += overwrite->get_w();
342         }
343         if(use_lift)
344         {
345                 lift->reposition_window(x1, y1);
346                 x1 += lift->get_w();
347         }
348         if(use_extract)
349         {
350                 extract->reposition_window(x1, y1);
351                 x1 += extract->get_w();
352         }
353         if(use_toclip)
354         {
355                 clip->reposition_window(x1, y1);
356                 x1 += clip->get_w();
357         }
358         if(use_cut)
359         {
360                 cut->reposition_window(x1, y1);
361                 x1 += cut->get_w();
362         }
363         if(use_copy)
364         {
365                 copy->reposition_window(x1, y1);
366                 x1 += copy->get_w();
367         }
368         if(use_paste)
369         {
370                 paste->reposition_window(x1, y1);
371                 x1 += paste->get_w();
372         }
374         if(use_meters)
375         {
376                 meters->reposition_window(x1, y1);
377                 x1 += meters->get_w();
378         }
380         if(use_labels)
381         {
382                 labelbutton->reposition_window(x1, y1);
383                 x1 += labelbutton->get_w();
384                 prevlabel->reposition_window(x1, y1);
385                 x1 += prevlabel->get_w();
386                 nextlabel->reposition_window(x1, y1);
387                 x1 += nextlabel->get_w();
388         }
390         if(use_fit)
391         {
392                 fit->reposition_window(x1, y1);
393                 x1 += fit->get_w();
394         }
396         if(use_undo)
397         {
398                 undo->reposition_window(x1, y1);
399                 x1 += undo->get_w();
400                 redo->reposition_window(x1, y1);
401                 x1 += redo->get_w();
402         }
407 int EditPanel::create_objects()
409         create_buttons();
410         return 0;
413 int EditPanel::get_w()
415         return x1 - x;
419 void EditPanel::copy_selection()
421         mwindow->copy();
424 void EditPanel::splice_selection()
428 void EditPanel::overwrite_selection()
432 void EditPanel::set_inpoint()
434         mwindow->set_inpoint(1);
437 void EditPanel::set_outpoint()
439         mwindow->set_outpoint(1);
442 void EditPanel::clear_inpoint()
444         mwindow->delete_inpoint();
447 void EditPanel::clear_outpoint()
449         mwindow->delete_outpoint();
452 void EditPanel::to_clip()
454         mwindow->to_clip();
458 EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
459  : BC_Button(x, y, mwindow->theme->in_data)
461         this->mwindow = mwindow;
462         this->panel = panel;
463         set_tooltip(_("In point ( [ )"));
465 EditInPoint::~EditInPoint()
468 int EditInPoint::handle_event()
470         panel->set_inpoint();
471         return 1;
473 int EditInPoint::keypress_event()
475         if(get_keypress() == '[') 
476         {
477                 panel->set_inpoint();
478                 return 1;
479         }
480         return 0;
483 EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
484  : BC_Button(x, y, mwindow->theme->out_data)
486         this->mwindow = mwindow;
487         this->panel = panel;
488         set_tooltip(_("Out point ( ] )"));
490 EditOutPoint::~EditOutPoint()
493 int EditOutPoint::handle_event()
495         panel->set_outpoint();
496         return 1;
498 int EditOutPoint::keypress_event()
500         if(get_keypress() == ']') 
501         {
502                 panel->set_outpoint();
503                 return 1;
504         }
505         return 0;
508 EditDelInPoint::EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
509  : BC_Button(x, y, mwindow->theme->indelete_data)
511         this->mwindow = mwindow;
512         this->panel = panel;
513         set_tooltip(_("Delete in point"));
515 EditDelInPoint::~EditDelInPoint()
518 int EditDelInPoint::handle_event()
520         panel->clear_inpoint();
521         return 1;
523 int EditDelInPoint::keypress_event()
525         if(get_keypress() == '{')
526         {
527                 panel->clear_inpoint();
528                 return 1;
529         }
530         return 0;
533 EditDelOutPoint::EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
534  : BC_Button(x, y, mwindow->theme->outdelete_data)
536         this->mwindow = mwindow;
537         this->panel = panel;
538         set_tooltip(_("Delete out point"));
540 EditDelOutPoint::~EditDelOutPoint()
543 int EditDelOutPoint::handle_event()
545         panel->clear_outpoint();
546         return 1;
548 int EditDelOutPoint::keypress_event()
550         if(get_keypress() == '}') 
551         {
552                 panel->clear_outpoint();
553                 return 1;
554         }
555         return 0;
558 EditNextLabel::EditNextLabel(MWindow *mwindow, 
559         EditPanel *panel, 
560         int x, 
561         int y,
562         int is_mwindow)
563  : BC_Button(x, y, mwindow->theme->nextlabel_data)
565         this->mwindow = mwindow;
566         this->panel = panel;
567         this->is_mwindow = is_mwindow;
568         set_tooltip(_("Next label ( ctrl -> )"));
570 EditNextLabel::~EditNextLabel()
573 int EditNextLabel::keypress_event()
575         if(get_keypress() == RIGHT && ctrl_down())
576                 return handle_event();
577         return 0;
579 int EditNextLabel::handle_event()
581         panel->next_label();
582         return 1;
585 EditPrevLabel::EditPrevLabel(MWindow *mwindow, 
586         EditPanel *panel, 
587         int x, 
588         int y,
589         int is_mwindow)
590  : BC_Button(x, y, mwindow->theme->prevlabel_data)
592         this->mwindow = mwindow;
593         this->panel = panel;
594         this->is_mwindow = is_mwindow;
595         set_tooltip(_("Previous label ( ctrl <- )"));
597 EditPrevLabel::~EditPrevLabel()
600 int EditPrevLabel::keypress_event()
602         if(get_keypress() == LEFT && ctrl_down())
603                 return handle_event();
604         return 0;
606 int EditPrevLabel::handle_event()
608         panel->prev_label();
609         return 1;
612 EditLift::EditLift(MWindow *mwindow, EditPanel *panel, int x, int y)
613  : BC_Button(x, y, mwindow->theme->lift_data)
615         this->mwindow = mwindow;
616         this->panel = panel;
617         set_tooltip(_("Lift"));
619 EditLift::~EditLift()
622 int EditLift::handle_event()
624         return 1;
627 EditOverwrite::EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y)
628  : BC_Button(x, y, mwindow->theme->overwrite_data)
630         this->mwindow = mwindow;
631         this->panel = panel;
632         set_tooltip(_("Overwrite ( b )"));
634 EditOverwrite::~EditOverwrite()
637 int EditOverwrite::handle_event()
639         panel->overwrite_selection();
640         return 1;
642 int EditOverwrite::keypress_event()
644         if(get_keypress() == 'b')
645         {
646                 handle_event();
647                 return 1;
648         }
649         return 0;
652 EditExtract::EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y)
653  : BC_Button(x, y, mwindow->theme->extract_data)
655         this->mwindow = mwindow;
656         this->panel = panel;
657         set_tooltip(_("Extract"));
659 EditExtract::~EditExtract()
662 int EditExtract::handle_event()
664 //      mwindow->extract_selection();
665         return 1;
668 EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
669  : BC_Button(x, y, mwindow->theme->toclip_data)
671         this->mwindow = mwindow;
672         this->panel = panel;
673         set_tooltip(_("To clip"));
675 EditToClip::~EditToClip()
678 int EditToClip::handle_event()
680         panel->to_clip();
681         return 1;
684 EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
685  : BC_Button(x, y, mwindow->theme->splice_data)
687         this->mwindow = mwindow;
688         this->panel = panel;
689         set_tooltip(_("Splice ( v )"));
691 EditSplice::~EditSplice()
694 int EditSplice::handle_event()
696         panel->splice_selection();
697         return 1;
699 int EditSplice::keypress_event()
701         if(get_keypress() == 'v')
702         {
703                 handle_event();
704                 return 1;
705         }
706         return 0;
709 EditCut::EditCut(MWindow *mwindow, EditPanel *panel, int x, int y)
710  : BC_Button(x, y, mwindow->theme->cut_data)
712         this->mwindow = mwindow;
713         this->panel = panel;
714         set_tooltip(_("Cut ( x )"));
716 EditCut::~EditCut()
719 int EditCut::keypress_event()
721         if(get_keypress() == 'x')
722                 return handle_event();
723         return 0;
726 int EditCut::handle_event()
728         if(!panel->is_mwindow) mwindow->gui->lock_window();
729         mwindow->cut();
730         if(!panel->is_mwindow) mwindow->gui->unlock_window();
731         return 1;
734 EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
735  : BC_Button(x, y, mwindow->theme->copy_data)
737         this->mwindow = mwindow;
738         this->panel = panel;
739         set_tooltip(_("Copy ( c )"));
741 EditCopy::~EditCopy()
745 int EditCopy::keypress_event()
747         if(get_keypress() == 'c')
748                 return handle_event();
749         return 0;
751 int EditCopy::handle_event()
753         panel->copy_selection();
754         return 1;
757 EditAppend::EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y)
758  : BC_Button(x, y, mwindow->theme->append_data)
760         this->mwindow = mwindow;
761         this->panel = panel;
762         set_tooltip(_("Append to end of track"));
764 EditAppend::~EditAppend()
769 int EditAppend::handle_event()
771         return 1;
775 EditInsert::EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y)
776  : BC_Button(x, y, mwindow->theme->insert_data)
778         this->mwindow = mwindow;
779         this->panel = panel;
780         set_tooltip(_("Insert before beginning of track"));
782 EditInsert::~EditInsert()
787 int EditInsert::handle_event()
789         
790         return 1;
794 EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
795  : BC_Button(x, y, mwindow->theme->paste_data)
797         this->mwindow = mwindow;
798         this->panel = panel;
799         set_tooltip(_("Paste ( v )"));
801 EditPaste::~EditPaste()
805 int EditPaste::keypress_event()
807         if(get_keypress() == 'v')
808                 return handle_event();
809         return 0;
811 int EditPaste::handle_event()
813         if(!panel->is_mwindow) mwindow->gui->lock_window();
814         mwindow->paste();
815         if(!panel->is_mwindow) mwindow->gui->unlock_window();
816         return 1;
821 EditTransition::EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y)
822  : BC_Button(x, y, mwindow->theme->transition_data)
824         this->mwindow = mwindow;
825         this->panel = panel;
826         set_tooltip(_("Set transition"));
828 EditTransition::~EditTransition()
831 int EditTransition::handle_event()
833         return 1;
836 EditPresentation::EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y)
837  : BC_Button(x, y, mwindow->theme->presentation_data)
839         this->mwindow = mwindow;
840         this->panel = panel;
841         set_tooltip(_("Set presentation up to current position"));
843 EditPresentation::~EditPresentation()
846 int EditPresentation::handle_event()
848         return 1;
851 EditUndo::EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y)
852  : BC_Button(x, y, mwindow->theme->undo_data)
854         this->mwindow = mwindow;
855         this->panel = panel;
856         set_tooltip(_("Undo ( z )"));
858 EditUndo::~EditUndo()
861 int EditUndo::keypress_event()
863         if(get_keypress() == 'z')
864                 return handle_event();
865         return 0;
867 int EditUndo::handle_event()
869         mwindow->undo_entry(panel->is_mwindow);
870         return 1;
873 EditRedo::EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y)
874  : BC_Button(x, y, mwindow->theme->redo_data)
876         this->mwindow = mwindow;
877         this->panel = panel;
878         set_tooltip(_("Redo ( shift Z )"));
880 EditRedo::~EditRedo()
883 int EditRedo::keypress_event()
885         if(get_keypress() == 'Z')
886                 return handle_event();
887         return 0;
889 int EditRedo::handle_event()
891         mwindow->redo_entry(panel->is_mwindow);
892         return 1;
899 EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
900  : BC_Button(x, y, mwindow->theme->labelbutton_data)
902         this->mwindow = mwindow;
903         this->panel = panel;
904         set_tooltip(_("Toggle label at current position ( l )"));
907 EditLabelbutton::~EditLabelbutton()
910 int EditLabelbutton::keypress_event()
912         if(get_keypress() == 'l')
913                 return handle_event();
914         return 0;
916 int EditLabelbutton::handle_event()
918         panel->toggle_label();
919         return 1;
928 EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
929  : BC_Button(x, y, mwindow->theme->fit_data)
931         this->mwindow = mwindow;
932         this->panel = panel;
933         set_tooltip(_("Fit selection to display ( f )"));
935 EditFit::~EditFit()
938 int EditFit::keypress_event()
940         if(get_keypress() == 'f' || get_keypress() == 'F') 
941         {
942                 handle_event();
943                 return 1;
944         }
945         return 0;
947 int EditFit::handle_event()
949         mwindow->fit_selection();
950         return 1;
954 ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
955  : BC_Toggle(x, 
956         y, 
957         mwindow->theme->arrow_data,
958         mwindow->edl->session->editing_mode == EDITING_ARROW,
959         "",
960         0,
961         0,
962         0)
964         this->mwindow = mwindow;
965         this->panel = panel;
966         set_tooltip(_("Drag and drop editing mode"));
969 int ArrowButton::handle_event()
971         update(1);
972         panel->ibeam->update(0);
973         mwindow->set_editing_mode(EDITING_ARROW);
974 // Nothing after this
975         return 1;
979 IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
980  : BC_Toggle(x, 
981         y, 
982         mwindow->theme->ibeam_data,
983         mwindow->edl->session->editing_mode == EDITING_IBEAM,
984         "",
985         0,
986         0,
987         0)
989         this->mwindow = mwindow;
990         this->panel = panel;
991         set_tooltip(_("Cut and paste editing mode"));
994 int IBeamButton::handle_event()
996         update(1);
997         panel->arrow->update(0);
998         mwindow->set_editing_mode(EDITING_IBEAM);
999 // Nothing after this
1000         return 1;
1003 KeyFrameButton::KeyFrameButton(MWindow *mwindow, int x, int y)
1004  : BC_Toggle(x, 
1005         y, 
1006         mwindow->theme->autokeyframe_data,
1007         mwindow->edl->session->auto_keyframes,
1008         "",
1009         0,
1010         0,
1011         0)
1013         this->mwindow = mwindow;
1014         set_tooltip(_("Generate keyframes while tweeking"));
1017 int KeyFrameButton::handle_event()
1019         mwindow->set_auto_keyframes(get_value());
1020         return 1;