r827: Fix a crash when no audio output device can be opened.
[cinelerra_cv.git] / cinelerra / editpanel.C
blob64fce6515ddbb2109920263d77beb929ce4a066f
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         if(is_mwindow)
271         {
272                 mwindow->gui->unlock_window();
273         }
274         else
275                 subwindow->unlock_window();
277         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
279         if(!is_mwindow)
280                 subwindow->lock_window("EditPanel::prev_label 1");
282         mwindow->gui->lock_window("EditPanel::prev_label 2");
284         mwindow->prev_label();
286         if(!is_mwindow)
287                 mwindow->gui->unlock_window();
290 void EditPanel::next_label()
292         if(is_mwindow)
293         {
294                 mwindow->gui->unlock_window();
295         }
296         else
297                 subwindow->unlock_window();
299         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
301         if(!is_mwindow)
302                 subwindow->lock_window("EditPanel::next_label 1");
304         mwindow->gui->lock_window("EditPanel::next_label 2");
306         mwindow->next_label();
308         if(!is_mwindow)
309                 mwindow->gui->unlock_window();
315 void EditPanel::reposition_buttons(int x, int y)
317         this->x = x; 
318         this->y = y;
319         x1 = x, y1 = y;
321         if(use_editing_mode)
322         {
323                 arrow->reposition_window(x1, y1);
324                 x1 += arrow->get_w();
325                 ibeam->reposition_window(x1, y1);
326                 x1 += ibeam->get_w();
327         }
329         if(use_keyframe)
330         {
331                 keyframe->reposition_window(x1, y1);
332                 x1 += keyframe->get_w();
333                 x1 += mwindow->theme->toggle_margin;
334         }
336         inpoint->reposition_window(x1, y1);
337         x1 += inpoint->get_w();
338         outpoint->reposition_window(x1, y1);
339         x1 += outpoint->get_w();
340         if(use_splice)
341         {
342                 splice->reposition_window(x1, y1);
343                 x1 += splice->get_w();
344         }
345         if(use_overwrite)
346         {
347                 overwrite->reposition_window(x1, y1);
348                 x1 += overwrite->get_w();
349         }
350         if(use_lift)
351         {
352                 lift->reposition_window(x1, y1);
353                 x1 += lift->get_w();
354         }
355         if(use_extract)
356         {
357                 extract->reposition_window(x1, y1);
358                 x1 += extract->get_w();
359         }
360         if(use_toclip)
361         {
362                 clip->reposition_window(x1, y1);
363                 x1 += clip->get_w();
364         }
365         if(use_cut)
366         {
367                 cut->reposition_window(x1, y1);
368                 x1 += cut->get_w();
369         }
370         if(use_copy)
371         {
372                 copy->reposition_window(x1, y1);
373                 x1 += copy->get_w();
374         }
375         if(use_paste)
376         {
377                 paste->reposition_window(x1, y1);
378                 x1 += paste->get_w();
379         }
381         if(use_meters)
382         {
383                 meters->reposition_window(x1, y1);
384                 x1 += meters->get_w();
385         }
387         if(use_labels)
388         {
389                 labelbutton->reposition_window(x1, y1);
390                 x1 += labelbutton->get_w();
391                 prevlabel->reposition_window(x1, y1);
392                 x1 += prevlabel->get_w();
393                 nextlabel->reposition_window(x1, y1);
394                 x1 += nextlabel->get_w();
395         }
397         if(use_fit)
398         {
399                 fit->reposition_window(x1, y1);
400                 x1 += fit->get_w();
401                 fit_autos->reposition_window(x1, y1);
402                 x1 += fit_autos->get_w();
403         }
405         if(use_undo)
406         {
407                 undo->reposition_window(x1, y1);
408                 x1 += undo->get_w();
409                 redo->reposition_window(x1, y1);
410                 x1 += redo->get_w();
411         }
412         
413         mangoto->reposition_window(x1, y1);
414         x1 += mangoto->get_w();
419 int EditPanel::create_objects()
421         create_buttons();
422         return 0;
425 int EditPanel::get_w()
427         return x1 - x;
431 void EditPanel::copy_selection()
433         mwindow->copy();
436 void EditPanel::splice_selection()
440 void EditPanel::overwrite_selection()
444 void EditPanel::set_inpoint()
446         mwindow->set_inpoint(1);
449 void EditPanel::set_outpoint()
451         mwindow->set_outpoint(1);
454 void EditPanel::clear_inpoint()
456         mwindow->delete_inpoint();
459 void EditPanel::clear_outpoint()
461         mwindow->delete_outpoint();
464 void EditPanel::to_clip()
466         mwindow->to_clip();
470 EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
471  : BC_Button(x, y, mwindow->theme->get_image_set("inbutton"))
473         this->mwindow = mwindow;
474         this->panel = panel;
475         set_tooltip(_("In point ( [ )"));
477 EditInPoint::~EditInPoint()
480 int EditInPoint::handle_event()
482         panel->set_inpoint();
483         return 1;
485 int EditInPoint::keypress_event()
487         if(get_keypress() == '[') 
488         {
489                 panel->set_inpoint();
490                 return 1;
491         }
492         return 0;
495 EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
496  : BC_Button(x, y, mwindow->theme->get_image_set("outbutton"))
498         this->mwindow = mwindow;
499         this->panel = panel;
500         set_tooltip(_("Out point ( ] )"));
502 EditOutPoint::~EditOutPoint()
505 int EditOutPoint::handle_event()
507         panel->set_outpoint();
508         return 1;
510 int EditOutPoint::keypress_event()
512         if(get_keypress() == ']') 
513         {
514                 panel->set_outpoint();
515                 return 1;
516         }
517         return 0;
521 EditNextLabel::EditNextLabel(MWindow *mwindow, 
522         EditPanel *panel, 
523         int x, 
524         int y,
525         int is_mwindow)
526  : BC_Button(x, y, mwindow->theme->get_image_set("nextlabel"))
528         this->mwindow = mwindow;
529         this->panel = panel;
530         this->is_mwindow = is_mwindow;
531         set_tooltip(_("Next label ( ctrl -> )"));
533 EditNextLabel::~EditNextLabel()
536 int EditNextLabel::keypress_event()
538         if(get_keypress() == RIGHT && ctrl_down())
539                 return handle_event();
540         return 0;
542 int EditNextLabel::handle_event()
544         panel->next_label();
545         return 1;
548 EditPrevLabel::EditPrevLabel(MWindow *mwindow, 
549         EditPanel *panel, 
550         int x, 
551         int y,
552         int is_mwindow)
553  : BC_Button(x, y, mwindow->theme->get_image_set("prevlabel"))
555         this->mwindow = mwindow;
556         this->panel = panel;
557         this->is_mwindow = is_mwindow;
558         set_tooltip(_("Previous label ( ctrl <- )"));
560 EditPrevLabel::~EditPrevLabel()
563 int EditPrevLabel::keypress_event()
565         if(get_keypress() == LEFT && ctrl_down())
566                 return handle_event();
567         return 0;
569 int EditPrevLabel::handle_event()
571         panel->prev_label();
572         return 1;
575 EditLift::EditLift(MWindow *mwindow, EditPanel *panel, int x, int y)
576  : BC_Button(x, y, mwindow->theme->lift_data)
578         this->mwindow = mwindow;
579         this->panel = panel;
580         set_tooltip(_("Lift"));
582 EditLift::~EditLift()
585 int EditLift::handle_event()
587         return 1;
590 EditOverwrite::EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y)
591  : BC_Button(x, y, mwindow->theme->overwrite_data)
593         this->mwindow = mwindow;
594         this->panel = panel;
595         set_tooltip(_("Overwrite ( b )"));
597 EditOverwrite::~EditOverwrite()
600 int EditOverwrite::handle_event()
602         panel->overwrite_selection();
603         return 1;
605 int EditOverwrite::keypress_event()
607         if(get_keypress() == 'b')
608         {
609                 handle_event();
610                 return 1;
611         }
612         return 0;
615 EditExtract::EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y)
616  : BC_Button(x, y, mwindow->theme->extract_data)
618         this->mwindow = mwindow;
619         this->panel = panel;
620         set_tooltip(_("Extract"));
622 EditExtract::~EditExtract()
625 int EditExtract::handle_event()
627 //      mwindow->extract_selection();
628         return 1;
631 EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
632  : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
634         this->mwindow = mwindow;
635         this->panel = panel;
636         set_tooltip(_("To clip ( i )"));
638 EditToClip::~EditToClip()
641 int EditToClip::handle_event()
643         panel->to_clip();
644         return 1;
647 int EditToClip::keypress_event()
649         if(get_keypress() == 'i')
650         {
651                 handle_event();
652                 return 1;
653         }
654         return 0;
657 EditManualGoto::EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y)
658  : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
660         this->mwindow = mwindow;
661         this->panel = panel;
662         mangoto = new ManualGoto(mwindow, panel->subwindow);
663         set_tooltip(_("Manual goto ( g )"));
665 EditManualGoto::~EditManualGoto()
667         delete mangoto;
669 int EditManualGoto::handle_event()
671         mangoto->open_window();
672         return 1;
675 int EditManualGoto::keypress_event()
677         if(get_keypress() == 'g')
678         {
679                 handle_event();
680                 return 1;
681         }
682         return 0;
686 EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
687  : BC_Button(x, y, mwindow->theme->splice_data)
689         this->mwindow = mwindow;
690         this->panel = panel;
691         set_tooltip(_("Splice ( v )"));
693 EditSplice::~EditSplice()
696 int EditSplice::handle_event()
698         panel->splice_selection();
699         return 1;
701 int EditSplice::keypress_event()
703         if(get_keypress() == 'v')
704         {
705                 handle_event();
706                 return 1;
707         }
708         return 0;
711 EditCut::EditCut(MWindow *mwindow, EditPanel *panel, int x, int y)
712  : BC_Button(x, y, mwindow->theme->get_image_set("cut"))
714         this->mwindow = mwindow;
715         this->panel = panel;
716         set_tooltip(_("Cut ( x )"));
718 EditCut::~EditCut()
721 int EditCut::keypress_event()
723         if(get_keypress() == 'x')
724                 return handle_event();
725         return 0;
728 int EditCut::handle_event()
730         if(!panel->is_mwindow) mwindow->gui->lock_window("EditCut::handle_event");
731         mwindow->cut();
732         if(!panel->is_mwindow) mwindow->gui->unlock_window();
733         return 1;
736 EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
737  : BC_Button(x, y, mwindow->theme->get_image_set("copy"))
739         this->mwindow = mwindow;
740         this->panel = panel;
741         set_tooltip(_("Copy ( c )"));
743 EditCopy::~EditCopy()
747 int EditCopy::keypress_event()
749         if(get_keypress() == 'c')
750                 return handle_event();
751         return 0;
753 int EditCopy::handle_event()
755         panel->copy_selection();
756         return 1;
759 EditAppend::EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y)
760  : BC_Button(x, y, mwindow->theme->append_data)
762         this->mwindow = mwindow;
763         this->panel = panel;
764         set_tooltip(_("Append to end of track"));
766 EditAppend::~EditAppend()
771 int EditAppend::handle_event()
773         return 1;
777 EditInsert::EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y)
778  : BC_Button(x, y, mwindow->theme->insert_data)
780         this->mwindow = mwindow;
781         this->panel = panel;
782         set_tooltip(_("Insert before beginning of track"));
784 EditInsert::~EditInsert()
789 int EditInsert::handle_event()
791         
792         return 1;
796 EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
797  : BC_Button(x, y, mwindow->theme->get_image_set("paste"))
799         this->mwindow = mwindow;
800         this->panel = panel;
801         set_tooltip(_("Paste ( v )"));
803 EditPaste::~EditPaste()
807 int EditPaste::keypress_event()
809         if(get_keypress() == 'v')
810                 return handle_event();
811         return 0;
813 int EditPaste::handle_event()
815         if(!panel->is_mwindow) mwindow->gui->lock_window("EditPaste::handle_event");
816         mwindow->paste();
817         if(!panel->is_mwindow) mwindow->gui->unlock_window();
818         return 1;
823 EditTransition::EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y)
824  : BC_Button(x, y, mwindow->theme->transition_data)
826         this->mwindow = mwindow;
827         this->panel = panel;
828         set_tooltip(_("Set transition"));
830 EditTransition::~EditTransition()
833 int EditTransition::handle_event()
835         return 1;
838 EditPresentation::EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y)
839  : BC_Button(x, y, mwindow->theme->presentation_data)
841         this->mwindow = mwindow;
842         this->panel = panel;
843         set_tooltip(_("Set presentation up to current position"));
845 EditPresentation::~EditPresentation()
848 int EditPresentation::handle_event()
850         return 1;
853 EditUndo::EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y)
854  : BC_Button(x, y, mwindow->theme->get_image_set("undo"))
856         this->mwindow = mwindow;
857         this->panel = panel;
858         set_tooltip(_("Undo ( z )"));
860 EditUndo::~EditUndo()
863 int EditUndo::keypress_event()
865         if(get_keypress() == 'z')
866                 return handle_event();
867         return 0;
869 int EditUndo::handle_event()
871         mwindow->undo_entry(panel->subwindow);
872         return 1;
875 EditRedo::EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y)
876  : BC_Button(x, y, mwindow->theme->get_image_set("redo"))
878         this->mwindow = mwindow;
879         this->panel = panel;
880         set_tooltip(_("Redo ( shift Z )"));
882 EditRedo::~EditRedo()
885 int EditRedo::keypress_event()
887         if(get_keypress() == 'Z')
888                 return handle_event();
889         return 0;
891 int EditRedo::handle_event()
893         mwindow->redo_entry(panel->subwindow);
894         return 1;
901 EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
902  : BC_Button(x, y, mwindow->theme->get_image_set("labelbutton"))
904         this->mwindow = mwindow;
905         this->panel = panel;
906         set_tooltip(_("Toggle label at current position ( l )"));
909 EditLabelbutton::~EditLabelbutton()
912 int EditLabelbutton::keypress_event()
914         if(get_keypress() == 'l')
915                 return handle_event();
916         return 0;
918 int EditLabelbutton::handle_event()
920         panel->toggle_label();
921         return 1;
930 EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
931  : BC_Button(x, y, mwindow->theme->get_image_set("fit"))
933         this->mwindow = mwindow;
934         this->panel = panel;
935         set_tooltip(_("Fit selection to display ( f )"));
937 EditFit::~EditFit()
940 int EditFit::keypress_event()
942         if(!alt_down() && get_keypress() == 'f') 
943         {
944                 handle_event();
945                 return 1;
946         }
947         return 0;
949 int EditFit::handle_event()
951         mwindow->fit_selection();
952         return 1;
963 EditFitAutos::EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y)
964  : BC_Button(x, y, mwindow->theme->get_image_set("fitautos"))
966         this->mwindow = mwindow;
967         this->panel = panel;
968         set_tooltip(_("Fit autos to display ( Alt + f )"));
970 EditFitAutos::~EditFitAutos()
973 int EditFitAutos::keypress_event()
975         if(alt_down() && get_keypress() == 'f') 
976         {
977                 handle_event();
978                 return 1;
979         }
980         return 0;
982 int EditFitAutos::handle_event()
984         mwindow->fit_autos();
985         return 1;
1000 ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
1001  : BC_Toggle(x, 
1002         y, 
1003         mwindow->theme->get_image_set("arrow"),
1004         mwindow->edl->session->editing_mode == EDITING_ARROW,
1005         "",
1006         0,
1007         0,
1008         0)
1010         this->mwindow = mwindow;
1011         this->panel = panel;
1012         set_tooltip(_("Drag and drop editing mode"));
1015 int ArrowButton::handle_event()
1017         update(1);
1018         panel->ibeam->update(0);
1019         mwindow->set_editing_mode(EDITING_ARROW);
1020 // Nothing after this
1021         return 1;
1025 IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
1026  : BC_Toggle(x, 
1027         y, 
1028         mwindow->theme->get_image_set("ibeam"),
1029         mwindow->edl->session->editing_mode == EDITING_IBEAM,
1030         "",
1031         0,
1032         0,
1033         0)
1035         this->mwindow = mwindow;
1036         this->panel = panel;
1037         set_tooltip(_("Cut and paste editing mode"));
1040 int IBeamButton::handle_event()
1042         update(1);
1043         panel->arrow->update(0);
1044         mwindow->set_editing_mode(EDITING_IBEAM);
1045 // Nothing after this
1046         return 1;
1049 KeyFrameButton::KeyFrameButton(MWindow *mwindow, int x, int y)
1050  : BC_Toggle(x, 
1051         y, 
1052         mwindow->theme->get_image_set("autokeyframe"),
1053         mwindow->edl->session->auto_keyframes,
1054         "",
1055         0,
1056         0,
1057         0)
1059         this->mwindow = mwindow;
1060         set_tooltip(_("Generate keyframes while tweeking"));
1063 int KeyFrameButton::handle_event()
1065         mwindow->set_auto_keyframes(get_value());
1066         return 1;