r955: Fix the Diffkey icon.
[cinelerra_cv.git] / cinelerra / editpanel.C
blob221a8a306bca46642e62ec3ae8eb8a8990fdda80
1 #include "awindow.h"
2 #include "awindowgui.h"
3 #include "bcsignals.h"
4 #include "clipedit.h"
5 #include "cplayback.h"
6 #include "cwindow.h"
7 #include "editpanel.h"
8 #include "edl.h"
9 #include "edlsession.h"
10 #include "filexml.h"
11 #include "keys.h"
12 #include "language.h"
13 #include "localsession.h"
14 #include "mainclock.h"
15 #include "mainundo.h"
16 #include "mbuttons.h"
17 #include "meterpanel.h"
18 #include "mwindow.h"
19 #include "mwindowgui.h"
20 #include "playbackengine.h"
21 #include "theme.h"
22 #include "timebar.h"
23 #include "trackcanvas.h"
24 #include "transportque.h"
25 #include "zoombar.h"
26 #include "manualgoto.h"
30 EditPanel::EditPanel(MWindow *mwindow, 
31         BC_WindowBase *subwindow,
32         int x, 
33         int y, 
34         int editing_mode, 
35         int use_editing_mode,
36         int use_keyframe, 
37         int use_splice,   // Extra buttons
38         int use_overwrite,
39         int use_lift,
40         int use_extract,
41         int use_copy, 
42         int use_paste, 
43         int use_undo,
44         int use_fit,
45         int use_labels,
46         int use_toclip,
47         int use_meters,
48         int is_mwindow,
49         int use_cut)
51         this->editing_mode = editing_mode;
52         this->use_editing_mode = use_editing_mode;
53         this->use_keyframe = use_keyframe;
54         this->use_splice = use_splice;
55         this->use_overwrite = use_overwrite;
56         this->use_lift = 0;
57         this->use_extract = 0;
58         this->use_copy = use_copy;
59         this->use_paste = use_paste;
60         this->use_undo = use_undo;
61         this->mwindow = mwindow;
62         this->subwindow = subwindow;
63         this->use_fit = use_fit;
64         this->use_labels = use_labels;
65         this->use_toclip = use_toclip;
66         this->use_meters = use_meters;
67         this->is_mwindow = is_mwindow;
68         this->use_cut = use_cut;
70         this->x = x;
71         this->y = y;
72         this->meter_panel = 0;
73         arrow = 0;
74         ibeam = 0;
75         keyframe = 0;
76         fit = 0;
77         fit_autos = 0;
80 EditPanel::~EditPanel()
84 void EditPanel::set_meters(MeterPanel *meter_panel)
86         this->meter_panel = meter_panel;
90 void EditPanel::update()
92         int new_editing_mode = mwindow->edl->session->editing_mode;
93         if(arrow) arrow->update(new_editing_mode == EDITING_ARROW);
94         if(ibeam) ibeam->update(new_editing_mode == EDITING_IBEAM);
95         if(keyframe) keyframe->update(mwindow->edl->session->auto_keyframes);
96         subwindow->flush();
99 void EditPanel::delete_buttons()
101         if(use_editing_mode)
102         {
103                 if(arrow) delete arrow;
104                 if(ibeam) delete ibeam;
105         }
106         
107         if(use_keyframe)
108                 delete keyframe;
111         if(inpoint) delete inpoint;
112         if(outpoint) delete outpoint;
113         if(use_copy) delete copy;
114         if(use_splice) delete splice;
115         if(use_overwrite) delete overwrite;
116         if(use_lift) delete lift;
117         if(use_extract) delete extract;
118         if(cut) delete cut;
119         if(copy) delete copy;
120         if(use_paste) delete paste;
122         if(use_labels)
123         {       
124                 delete labelbutton;
125                 delete prevlabel;
126                 delete nextlabel;
127         }
129         if(use_fit) 
130         {
131                 delete fit;
132                 delete fit_autos;
133         }
134         if(use_undo)
135         {
136                 delete undo;
137                 delete redo;
138         }
141 void EditPanel::create_buttons()
143         x1 = x, y1 = y;
146 SET_TRACE
147         if(use_editing_mode)
148         {
149                 subwindow->add_subwindow(arrow = new ArrowButton(mwindow, this, x1, y1));
150                 x1 += arrow->get_w();
151                 subwindow->add_subwindow(ibeam = new IBeamButton(mwindow, this, x1, y1));
152                 x1 += ibeam->get_w();
153         }
155         if(use_keyframe)
156         {
157                 subwindow->add_subwindow(keyframe = new KeyFrameButton(mwindow, x1, y1));
158                 x1 += keyframe->get_w();
159                 x1 += mwindow->theme->toggle_margin;
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                 subwindow->add_subwindow(fit_autos = new EditFitAutos(mwindow, this, x1, y1));
245                 x1 += fit_autos->get_w();
246         }
248         if(use_undo)
249         {
250                 subwindow->add_subwindow(undo = new EditUndo(mwindow, this, x1, y1));
251                 x1 += undo->get_w();
252                 subwindow->add_subwindow(redo = new EditRedo(mwindow, this, x1, y1));
253                 x1 += redo->get_w();
254         }
255         subwindow->add_subwindow(mangoto = new EditManualGoto(mwindow, this, x1, y1));
256         x1 += mangoto->get_w();
258 SET_TRACE
263 void EditPanel::toggle_label()
265         mwindow->toggle_label(is_mwindow);
268 void EditPanel::prev_label()
270         int shift_down = subwindow->shift_down();
271         if(is_mwindow)
272         {
273                 mwindow->gui->unlock_window();
274         }
275         else
276                 subwindow->unlock_window();
278         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1, 0, 0);
280         if(!is_mwindow)
281                 subwindow->lock_window("EditPanel::prev_label 1");
283         mwindow->gui->lock_window("EditPanel::prev_label 2");
285         mwindow->prev_label(shift_down);
287         if(!is_mwindow)
288                 mwindow->gui->unlock_window();
291 void EditPanel::next_label()
293         int shift_down = subwindow->shift_down();
294         if(is_mwindow)
295         {
296                 mwindow->gui->unlock_window();
297         }
298         else
299                 subwindow->unlock_window();
301         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1, 0, 0);
303         if(!is_mwindow)
304                 subwindow->lock_window("EditPanel::next_label 1");
306         mwindow->gui->lock_window("EditPanel::next_label 2");
308         mwindow->next_label(shift_down);
310         if(!is_mwindow)
311                 mwindow->gui->unlock_window();
317 void EditPanel::reposition_buttons(int x, int y)
319         this->x = x; 
320         this->y = y;
321         x1 = x, y1 = y;
323         if(use_editing_mode)
324         {
325                 arrow->reposition_window(x1, y1);
326                 x1 += arrow->get_w();
327                 ibeam->reposition_window(x1, y1);
328                 x1 += ibeam->get_w();
329         }
331         if(use_keyframe)
332         {
333                 keyframe->reposition_window(x1, y1);
334                 x1 += keyframe->get_w();
335                 x1 += mwindow->theme->toggle_margin;
336         }
338         inpoint->reposition_window(x1, y1);
339         x1 += inpoint->get_w();
340         outpoint->reposition_window(x1, y1);
341         x1 += outpoint->get_w();
342         if(use_splice)
343         {
344                 splice->reposition_window(x1, y1);
345                 x1 += splice->get_w();
346         }
347         if(use_overwrite)
348         {
349                 overwrite->reposition_window(x1, y1);
350                 x1 += overwrite->get_w();
351         }
352         if(use_lift)
353         {
354                 lift->reposition_window(x1, y1);
355                 x1 += lift->get_w();
356         }
357         if(use_extract)
358         {
359                 extract->reposition_window(x1, y1);
360                 x1 += extract->get_w();
361         }
362         if(use_toclip)
363         {
364                 clip->reposition_window(x1, y1);
365                 x1 += clip->get_w();
366         }
367         if(use_cut)
368         {
369                 cut->reposition_window(x1, y1);
370                 x1 += cut->get_w();
371         }
372         if(use_copy)
373         {
374                 copy->reposition_window(x1, y1);
375                 x1 += copy->get_w();
376         }
377         if(use_paste)
378         {
379                 paste->reposition_window(x1, y1);
380                 x1 += paste->get_w();
381         }
383         if(use_meters)
384         {
385                 meters->reposition_window(x1, y1);
386                 x1 += meters->get_w();
387         }
389         if(use_labels)
390         {
391                 labelbutton->reposition_window(x1, y1);
392                 x1 += labelbutton->get_w();
393                 prevlabel->reposition_window(x1, y1);
394                 x1 += prevlabel->get_w();
395                 nextlabel->reposition_window(x1, y1);
396                 x1 += nextlabel->get_w();
397         }
399         if(use_fit)
400         {
401                 fit->reposition_window(x1, y1);
402                 x1 += fit->get_w();
403                 fit_autos->reposition_window(x1, y1);
404                 x1 += fit_autos->get_w();
405         }
407         if(use_undo)
408         {
409                 undo->reposition_window(x1, y1);
410                 x1 += undo->get_w();
411                 redo->reposition_window(x1, y1);
412                 x1 += redo->get_w();
413         }
414         
415         mangoto->reposition_window(x1, y1);
416         x1 += mangoto->get_w();
421 int EditPanel::create_objects()
423         create_buttons();
424         return 0;
427 int EditPanel::get_w()
429         return x1 - x;
433 void EditPanel::copy_selection()
435         mwindow->copy();
438 void EditPanel::splice_selection()
442 void EditPanel::overwrite_selection()
446 void EditPanel::set_inpoint()
448         mwindow->set_inpoint(1);
451 void EditPanel::set_outpoint()
453         mwindow->set_outpoint(1);
456 void EditPanel::clear_inpoint()
458         mwindow->delete_inpoint();
461 void EditPanel::clear_outpoint()
463         mwindow->delete_outpoint();
466 void EditPanel::to_clip()
468         mwindow->to_clip();
472 EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
473  : BC_Button(x, y, mwindow->theme->get_image_set("inbutton"))
475         this->mwindow = mwindow;
476         this->panel = panel;
477         set_tooltip(_("In point ( [ )"));
479 EditInPoint::~EditInPoint()
482 int EditInPoint::handle_event()
484         panel->set_inpoint();
485         return 1;
487 int EditInPoint::keypress_event()
489         if(get_keypress() == '[') 
490         {
491                 panel->set_inpoint();
492                 return 1;
493         }
494         return 0;
497 EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
498  : BC_Button(x, y, mwindow->theme->get_image_set("outbutton"))
500         this->mwindow = mwindow;
501         this->panel = panel;
502         set_tooltip(_("Out point ( ] )"));
504 EditOutPoint::~EditOutPoint()
507 int EditOutPoint::handle_event()
509         panel->set_outpoint();
510         return 1;
512 int EditOutPoint::keypress_event()
514         if(get_keypress() == ']') 
515         {
516                 panel->set_outpoint();
517                 return 1;
518         }
519         return 0;
523 EditNextLabel::EditNextLabel(MWindow *mwindow, 
524         EditPanel *panel, 
525         int x, 
526         int y,
527         int is_mwindow)
528  : BC_Button(x, y, mwindow->theme->get_image_set("nextlabel"))
530         this->mwindow = mwindow;
531         this->panel = panel;
532         this->is_mwindow = is_mwindow;
533         set_tooltip(_("Next label ( ctrl -> )"));
535 EditNextLabel::~EditNextLabel()
538 int EditNextLabel::keypress_event()
540         if(get_keypress() == RIGHT && ctrl_down())
541                 return handle_event();
542         return 0;
544 int EditNextLabel::handle_event()
546         panel->next_label();
547         return 1;
550 EditPrevLabel::EditPrevLabel(MWindow *mwindow, 
551         EditPanel *panel, 
552         int x, 
553         int y,
554         int is_mwindow)
555  : BC_Button(x, y, mwindow->theme->get_image_set("prevlabel"))
557         this->mwindow = mwindow;
558         this->panel = panel;
559         this->is_mwindow = is_mwindow;
560         set_tooltip(_("Previous label ( ctrl <- )"));
562 EditPrevLabel::~EditPrevLabel()
565 int EditPrevLabel::keypress_event()
567         if(get_keypress() == LEFT && ctrl_down())
568                 return handle_event();
569         return 0;
571 int EditPrevLabel::handle_event()
573         panel->prev_label();
574         return 1;
577 EditLift::EditLift(MWindow *mwindow, EditPanel *panel, int x, int y)
578  : BC_Button(x, y, mwindow->theme->lift_data)
580         this->mwindow = mwindow;
581         this->panel = panel;
582         set_tooltip(_("Lift"));
584 EditLift::~EditLift()
587 int EditLift::handle_event()
589         return 1;
592 EditOverwrite::EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y)
593  : BC_Button(x, y, mwindow->theme->overwrite_data)
595         this->mwindow = mwindow;
596         this->panel = panel;
597         set_tooltip(_("Overwrite ( b )"));
599 EditOverwrite::~EditOverwrite()
602 int EditOverwrite::handle_event()
604         panel->overwrite_selection();
605         return 1;
607 int EditOverwrite::keypress_event()
609         if(get_keypress() == 'b')
610         {
611                 handle_event();
612                 return 1;
613         }
614         return 0;
617 EditExtract::EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y)
618  : BC_Button(x, y, mwindow->theme->extract_data)
620         this->mwindow = mwindow;
621         this->panel = panel;
622         set_tooltip(_("Extract"));
624 EditExtract::~EditExtract()
627 int EditExtract::handle_event()
629 //      mwindow->extract_selection();
630         return 1;
633 EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
634  : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
636         this->mwindow = mwindow;
637         this->panel = panel;
638         set_tooltip(_("To clip ( i )"));
640 EditToClip::~EditToClip()
643 int EditToClip::handle_event()
645         panel->to_clip();
646         return 1;
649 int EditToClip::keypress_event()
651         if(get_keypress() == 'i')
652         {
653                 handle_event();
654                 return 1;
655         }
656         return 0;
659 EditManualGoto::EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y)
660  : BC_Button(x, y, mwindow->theme->get_image_set("goto"))
662         this->mwindow = mwindow;
663         this->panel = panel;
664         mangoto = new ManualGoto(mwindow, panel->subwindow);
665         set_tooltip(_("Manual goto ( g )"));
667 EditManualGoto::~EditManualGoto()
669         delete mangoto;
671 int EditManualGoto::handle_event()
673         mangoto->open_window();
674         return 1;
677 int EditManualGoto::keypress_event()
679         if(get_keypress() == 'g')
680         {
681                 handle_event();
682                 return 1;
683         }
684         return 0;
688 EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
689  : BC_Button(x, y, mwindow->theme->splice_data)
691         this->mwindow = mwindow;
692         this->panel = panel;
693         set_tooltip(_("Splice ( v )"));
695 EditSplice::~EditSplice()
698 int EditSplice::handle_event()
700         panel->splice_selection();
701         return 1;
703 int EditSplice::keypress_event()
705         if(get_keypress() == 'v')
706         {
707                 handle_event();
708                 return 1;
709         }
710         return 0;
713 EditCut::EditCut(MWindow *mwindow, EditPanel *panel, int x, int y)
714  : BC_Button(x, y, mwindow->theme->get_image_set("cut"))
716         this->mwindow = mwindow;
717         this->panel = panel;
718         set_tooltip(_("Cut ( x )"));
720 EditCut::~EditCut()
723 int EditCut::keypress_event()
725         if(get_keypress() == 'x')
726                 return handle_event();
727         return 0;
730 int EditCut::handle_event()
732         if(!panel->is_mwindow) mwindow->gui->lock_window("EditCut::handle_event");
733         mwindow->cut();
734         if(!panel->is_mwindow) mwindow->gui->unlock_window();
735         return 1;
738 EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
739  : BC_Button(x, y, mwindow->theme->get_image_set("copy"))
741         this->mwindow = mwindow;
742         this->panel = panel;
743         set_tooltip(_("Copy ( c )"));
745 EditCopy::~EditCopy()
749 int EditCopy::keypress_event()
751         if(get_keypress() == 'c')
752                 return handle_event();
753         return 0;
755 int EditCopy::handle_event()
757         panel->copy_selection();
758         return 1;
761 EditAppend::EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y)
762  : BC_Button(x, y, mwindow->theme->append_data)
764         this->mwindow = mwindow;
765         this->panel = panel;
766         set_tooltip(_("Append to end of track"));
768 EditAppend::~EditAppend()
773 int EditAppend::handle_event()
775         return 1;
779 EditInsert::EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y)
780  : BC_Button(x, y, mwindow->theme->insert_data)
782         this->mwindow = mwindow;
783         this->panel = panel;
784         set_tooltip(_("Insert before beginning of track"));
786 EditInsert::~EditInsert()
791 int EditInsert::handle_event()
793         
794         return 1;
798 EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
799  : BC_Button(x, y, mwindow->theme->get_image_set("paste"))
801         this->mwindow = mwindow;
802         this->panel = panel;
803         set_tooltip(_("Paste ( v )"));
805 EditPaste::~EditPaste()
809 int EditPaste::keypress_event()
811         if(get_keypress() == 'v')
812                 return handle_event();
813         return 0;
815 int EditPaste::handle_event()
817         if(!panel->is_mwindow) mwindow->gui->lock_window("EditPaste::handle_event");
818         mwindow->paste();
819         if(!panel->is_mwindow) mwindow->gui->unlock_window();
820         return 1;
825 EditTransition::EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y)
826  : BC_Button(x, y, mwindow->theme->transition_data)
828         this->mwindow = mwindow;
829         this->panel = panel;
830         set_tooltip(_("Set transition"));
832 EditTransition::~EditTransition()
835 int EditTransition::handle_event()
837         return 1;
840 EditPresentation::EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y)
841  : BC_Button(x, y, mwindow->theme->presentation_data)
843         this->mwindow = mwindow;
844         this->panel = panel;
845         set_tooltip(_("Set presentation up to current position"));
847 EditPresentation::~EditPresentation()
850 int EditPresentation::handle_event()
852         return 1;
855 EditUndo::EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y)
856  : BC_Button(x, y, mwindow->theme->get_image_set("undo"))
858         this->mwindow = mwindow;
859         this->panel = panel;
860         set_tooltip(_("Undo ( z )"));
862 EditUndo::~EditUndo()
865 int EditUndo::keypress_event()
867         if(get_keypress() == 'z')
868                 return handle_event();
869         return 0;
871 int EditUndo::handle_event()
873         mwindow->undo_entry(panel->subwindow);
874         return 1;
877 EditRedo::EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y)
878  : BC_Button(x, y, mwindow->theme->get_image_set("redo"))
880         this->mwindow = mwindow;
881         this->panel = panel;
882         set_tooltip(_("Redo ( shift Z )"));
884 EditRedo::~EditRedo()
887 int EditRedo::keypress_event()
889         if(get_keypress() == 'Z')
890                 return handle_event();
891         return 0;
893 int EditRedo::handle_event()
895         mwindow->redo_entry(panel->subwindow);
896         return 1;
903 EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
904  : BC_Button(x, y, mwindow->theme->get_image_set("labelbutton"))
906         this->mwindow = mwindow;
907         this->panel = panel;
908         set_tooltip(_("Toggle label at current position ( l )"));
911 EditLabelbutton::~EditLabelbutton()
914 int EditLabelbutton::keypress_event()
916         if(get_keypress() == 'l')
917                 return handle_event();
918         return 0;
920 int EditLabelbutton::handle_event()
922         panel->toggle_label();
923         return 1;
932 EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
933  : BC_Button(x, y, mwindow->theme->get_image_set("fit"))
935         this->mwindow = mwindow;
936         this->panel = panel;
937         set_tooltip(_("Fit selection to display ( f )"));
939 EditFit::~EditFit()
942 int EditFit::keypress_event()
944         if(!alt_down() && get_keypress() == 'f') 
945         {
946                 handle_event();
947                 return 1;
948         }
949         return 0;
951 int EditFit::handle_event()
953         mwindow->fit_selection();
954         return 1;
965 EditFitAutos::EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y)
966  : BC_Button(x, y, mwindow->theme->get_image_set("fitautos"))
968         this->mwindow = mwindow;
969         this->panel = panel;
970         set_tooltip(_("Fit all autos to display ( Alt + f )"));
972 EditFitAutos::~EditFitAutos()
975 int EditFitAutos::keypress_event()
977         if(!ctrl_down() && alt_down() && get_keypress() == 'f') 
978         {
979                 mwindow->fit_autos(1);
980                 return 1;
981         }
982         if(ctrl_down() && alt_down() && get_keypress() == 'f') 
983         {
984                 mwindow->fit_autos(0);
985                 return 1;
986         }
987         return 0;
989 int EditFitAutos::handle_event()
991         mwindow->fit_autos(1);
992         return 1;
1007 ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
1008  : BC_Toggle(x, 
1009         y, 
1010         mwindow->theme->get_image_set("arrow"),
1011         mwindow->edl->session->editing_mode == EDITING_ARROW,
1012         "",
1013         0,
1014         0,
1015         0)
1017         this->mwindow = mwindow;
1018         this->panel = panel;
1019         set_tooltip(_("Drag and drop editing mode"));
1022 int ArrowButton::handle_event()
1024         update(1);
1025         panel->ibeam->update(0);
1026         mwindow->set_editing_mode(EDITING_ARROW);
1027 // Nothing after this
1028         return 1;
1032 IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
1033  : BC_Toggle(x, 
1034         y, 
1035         mwindow->theme->get_image_set("ibeam"),
1036         mwindow->edl->session->editing_mode == EDITING_IBEAM,
1037         "",
1038         0,
1039         0,
1040         0)
1042         this->mwindow = mwindow;
1043         this->panel = panel;
1044         set_tooltip(_("Cut and paste editing mode"));
1047 int IBeamButton::handle_event()
1049         update(1);
1050         panel->arrow->update(0);
1051         mwindow->set_editing_mode(EDITING_IBEAM);
1052 // Nothing after this
1053         return 1;
1056 KeyFrameButton::KeyFrameButton(MWindow *mwindow, int x, int y)
1057  : BC_Toggle(x, 
1058         y, 
1059         mwindow->theme->get_image_set("autokeyframe"),
1060         mwindow->edl->session->auto_keyframes,
1061         "",
1062         0,
1063         0,
1064         0)
1066         this->mwindow = mwindow;
1067         set_tooltip(_("Generate keyframes while tweeking"));
1070 int KeyFrameButton::handle_event()
1072         mwindow->set_auto_keyframes(get_value());
1073         return 1;