Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

editpanel.C

Go to the documentation of this file.
00001 #include "awindow.h"
00002 #include "awindowgui.h"
00003 #include "bcsignals.h"
00004 #include "clipedit.h"
00005 #include "cplayback.h"
00006 #include "cwindow.h"
00007 #include "editpanel.h"
00008 #include "edl.h"
00009 #include "edlsession.h"
00010 #include "filexml.h"
00011 #include "keys.h"
00012 #include "language.h"
00013 #include "localsession.h"
00014 #include "mainclock.h"
00015 #include "mainundo.h"
00016 #include "mbuttons.h"
00017 #include "meterpanel.h"
00018 #include "mwindow.h"
00019 #include "mwindowgui.h"
00020 #include "playbackengine.h"
00021 #include "theme.h"
00022 #include "timebar.h"
00023 #include "trackcanvas.h"
00024 #include "transportque.h"
00025 #include "zoombar.h"
00026 #include "manualgoto.h"
00027 
00028 
00029 
00030 EditPanel::EditPanel(MWindow *mwindow, 
00031         BC_WindowBase *subwindow,
00032         int x, 
00033         int y, 
00034         int editing_mode, 
00035         int use_editing_mode,
00036         int use_keyframe, 
00037         int use_splice,   // Extra buttons
00038         int use_overwrite,
00039         int use_lift,
00040         int use_extract,
00041         int use_copy, 
00042         int use_paste, 
00043         int use_undo,
00044         int use_fit,
00045         int use_labels,
00046         int use_toclip,
00047         int use_meters,
00048         int is_mwindow,
00049         int use_cut)
00050 {
00051         this->editing_mode = editing_mode;
00052         this->use_editing_mode = use_editing_mode;
00053         this->use_keyframe = use_keyframe;
00054         this->use_splice = use_splice;
00055         this->use_overwrite = use_overwrite;
00056         this->use_lift = 0;
00057         this->use_extract = 0;
00058         this->use_copy = use_copy;
00059         this->use_paste = use_paste;
00060         this->use_undo = use_undo;
00061         this->mwindow = mwindow;
00062         this->subwindow = subwindow;
00063         this->use_fit = use_fit;
00064         this->use_labels = use_labels;
00065         this->use_toclip = use_toclip;
00066         this->use_meters = use_meters;
00067         this->is_mwindow = is_mwindow;
00068         this->use_cut = use_cut;
00069 
00070         this->x = x;
00071         this->y = y;
00072         this->meter_panel = 0;
00073         arrow = 0;
00074         ibeam = 0;
00075         keyframe = 0;
00076         fit = 0;
00077         fit_autos = 0;
00078 }
00079 
00080 EditPanel::~EditPanel()
00081 {
00082 }
00083 
00084 void EditPanel::set_meters(MeterPanel *meter_panel)
00085 {
00086         this->meter_panel = meter_panel;
00087 }
00088 
00089 
00090 void EditPanel::update()
00091 {
00092         int new_editing_mode = mwindow->edl->session->editing_mode;
00093         if(arrow) arrow->update(new_editing_mode == EDITING_ARROW);
00094         if(ibeam) ibeam->update(new_editing_mode == EDITING_IBEAM);
00095         if(keyframe) keyframe->update(mwindow->edl->session->auto_keyframes);
00096         subwindow->flush();
00097 }
00098 
00099 void EditPanel::delete_buttons()
00100 {
00101         if(use_editing_mode)
00102         {
00103                 if(arrow) delete arrow;
00104                 if(ibeam) delete ibeam;
00105         }
00106         
00107         if(use_keyframe)
00108                 delete keyframe;
00109 
00110 
00111         if(inpoint) delete inpoint;
00112         if(outpoint) delete outpoint;
00113         if(use_copy) delete copy;
00114         if(use_splice) delete splice;
00115         if(use_overwrite) delete overwrite;
00116         if(use_lift) delete lift;
00117         if(use_extract) delete extract;
00118         if(cut) delete cut;
00119         if(copy) delete copy;
00120         if(use_paste) delete paste;
00121 
00122         if(use_labels)
00123         {       
00124                 delete labelbutton;
00125                 delete prevlabel;
00126                 delete nextlabel;
00127         }
00128 
00129         if(use_fit) 
00130         {
00131                 delete fit;
00132                 delete fit_autos;
00133         }
00134         if(use_undo)
00135         {
00136                 delete undo;
00137                 delete redo;
00138         }
00139 }
00140 
00141 void EditPanel::create_buttons()
00142 {
00143         x1 = x, y1 = y;
00144 
00145 
00146 SET_TRACE
00147         if(use_editing_mode)
00148         {
00149                 subwindow->add_subwindow(arrow = new ArrowButton(mwindow, this, x1, y1));
00150                 x1 += arrow->get_w();
00151                 subwindow->add_subwindow(ibeam = new IBeamButton(mwindow, this, x1, y1));
00152                 x1 += ibeam->get_w();
00153         }
00154 
00155         if(use_keyframe)
00156         {
00157                 subwindow->add_subwindow(keyframe = new KeyFrameButton(mwindow, x1, y1));
00158                 x1 += keyframe->get_w();
00159                 x1 += mwindow->theme->toggle_margin;
00160         }
00161 
00162 // Mandatory
00163         subwindow->add_subwindow(inpoint = new EditInPoint(mwindow, this, x1, y1));
00164         x1 += inpoint->get_w();
00165         subwindow->add_subwindow(outpoint = new EditOutPoint(mwindow, this, x1, y1));
00166         x1 += outpoint->get_w();
00167         if(use_splice)
00168         {
00169                 subwindow->add_subwindow(splice = new EditSplice(mwindow, this, x1, y1));
00170                 x1 += splice->get_w();
00171         }
00172         if(use_overwrite)
00173         {
00174                 subwindow->add_subwindow(overwrite = new EditOverwrite(mwindow, this, x1, y1));
00175                 x1 += overwrite->get_w();
00176         }
00177         if(use_lift)
00178         {
00179                 subwindow->add_subwindow(lift = new EditLift(mwindow, this, x1, y1));
00180                 x1 += lift->get_w();
00181         }
00182         if(use_extract)
00183         {
00184                 subwindow->add_subwindow(extract = new EditExtract(mwindow, this, x1, y1));
00185                 x1 += extract->get_w();
00186         }
00187         if(use_toclip)
00188         {
00189                 subwindow->add_subwindow(clip = new EditToClip(mwindow, this, x1, y1));
00190                 x1 += clip->get_w();
00191         }
00192         
00193         if(use_cut)
00194         {
00195                 subwindow->add_subwindow(cut = new EditCut(mwindow, this, x1, y1));
00196                 x1 += cut->get_w();
00197         }
00198         if(use_copy)
00199         {
00200                 subwindow->add_subwindow(copy = new EditCopy(mwindow, this, x1, y1));
00201                 x1 += copy->get_w();
00202         }
00203         if(use_paste)
00204         {
00205                 subwindow->add_subwindow(paste = new EditPaste(mwindow, this, x1, y1));
00206                 x1 += paste->get_w();
00207         }
00208         
00209         if(use_meters)
00210         {
00211                 if(!meter_panel)
00212                 {
00213                         printf("EditPanel::create_objects: meter_panel == 0\n");
00214                 }
00215                 subwindow->add_subwindow(meters = new MeterShow(mwindow, meter_panel, x1, y1));
00216                 x1 += meters->get_w();
00217         }
00218 
00219         if(use_labels)
00220         {
00221                 subwindow->add_subwindow(labelbutton = new EditLabelbutton(mwindow, 
00222                         this, 
00223                         x1, 
00224                         y1));
00225                 x1 += labelbutton->get_w();
00226                 subwindow->add_subwindow(prevlabel = new EditPrevLabel(mwindow, 
00227                         this, 
00228                         x1, 
00229                         y1,
00230                         is_mwindow));
00231                 x1 += prevlabel->get_w();
00232                 subwindow->add_subwindow(nextlabel = new EditNextLabel(mwindow, 
00233                         this, 
00234                         x1, 
00235                         y1,
00236                         is_mwindow));
00237                 x1 += nextlabel->get_w();
00238         }
00239 
00240         if(use_fit)
00241         {
00242                 subwindow->add_subwindow(fit = new EditFit(mwindow, this, x1, y1));
00243                 x1 += fit->get_w();
00244                 subwindow->add_subwindow(fit_autos = new EditFitAutos(mwindow, this, x1, y1));
00245                 x1 += fit_autos->get_w();
00246         }
00247 
00248         if(use_undo)
00249         {
00250                 subwindow->add_subwindow(undo = new EditUndo(mwindow, this, x1, y1));
00251                 x1 += undo->get_w();
00252                 subwindow->add_subwindow(redo = new EditRedo(mwindow, this, x1, y1));
00253                 x1 += redo->get_w();
00254         }
00255         subwindow->add_subwindow(mangoto = new EditManualGoto(mwindow, this, x1, y1));
00256         x1 += mangoto->get_w();
00257 
00258 SET_TRACE
00259 }
00260 
00261 
00262 
00263 void EditPanel::toggle_label()
00264 {
00265         mwindow->toggle_label(is_mwindow);
00266 }
00267 
00268 void EditPanel::prev_label()
00269 {
00270         if(is_mwindow)
00271         {
00272                 mwindow->gui->unlock_window();
00273         }
00274         else
00275                 subwindow->unlock_window();
00276 
00277         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
00278 
00279         if(!is_mwindow)
00280                 subwindow->lock_window("EditPanel::prev_label 1");
00281 
00282         mwindow->gui->lock_window("EditPanel::prev_label 2");
00283 
00284         mwindow->prev_label();
00285 
00286         if(!is_mwindow)
00287                 mwindow->gui->unlock_window();
00288 }
00289 
00290 void EditPanel::next_label()
00291 {
00292         if(is_mwindow)
00293         {
00294                 mwindow->gui->unlock_window();
00295         }
00296         else
00297                 subwindow->unlock_window();
00298 
00299         mwindow->gui->mbuttons->transport->handle_transport(STOP, 1);
00300 
00301         if(!is_mwindow)
00302                 subwindow->lock_window("EditPanel::next_label 1");
00303 
00304         mwindow->gui->lock_window("EditPanel::next_label 2");
00305 
00306         mwindow->next_label();
00307 
00308         if(!is_mwindow)
00309                 mwindow->gui->unlock_window();
00310 }
00311 
00312 
00313 
00314 
00315 void EditPanel::reposition_buttons(int x, int y)
00316 {
00317         this->x = x; 
00318         this->y = y;
00319         x1 = x, y1 = y;
00320 
00321         if(use_editing_mode)
00322         {
00323                 arrow->reposition_window(x1, y1);
00324                 x1 += arrow->get_w();
00325                 ibeam->reposition_window(x1, y1);
00326                 x1 += ibeam->get_w();
00327         }
00328 
00329         if(use_keyframe)
00330         {
00331                 keyframe->reposition_window(x1, y1);
00332                 x1 += keyframe->get_w();
00333                 x1 += mwindow->theme->toggle_margin;
00334         }
00335 
00336         inpoint->reposition_window(x1, y1);
00337         x1 += inpoint->get_w();
00338         outpoint->reposition_window(x1, y1);
00339         x1 += outpoint->get_w();
00340         if(use_splice)
00341         {
00342                 splice->reposition_window(x1, y1);
00343                 x1 += splice->get_w();
00344         }
00345         if(use_overwrite)
00346         {
00347                 overwrite->reposition_window(x1, y1);
00348                 x1 += overwrite->get_w();
00349         }
00350         if(use_lift)
00351         {
00352                 lift->reposition_window(x1, y1);
00353                 x1 += lift->get_w();
00354         }
00355         if(use_extract)
00356         {
00357                 extract->reposition_window(x1, y1);
00358                 x1 += extract->get_w();
00359         }
00360         if(use_toclip)
00361         {
00362                 clip->reposition_window(x1, y1);
00363                 x1 += clip->get_w();
00364         }
00365         if(use_cut)
00366         {
00367                 cut->reposition_window(x1, y1);
00368                 x1 += cut->get_w();
00369         }
00370         if(use_copy)
00371         {
00372                 copy->reposition_window(x1, y1);
00373                 x1 += copy->get_w();
00374         }
00375         if(use_paste)
00376         {
00377                 paste->reposition_window(x1, y1);
00378                 x1 += paste->get_w();
00379         }
00380 
00381         if(use_meters)
00382         {
00383                 meters->reposition_window(x1, y1);
00384                 x1 += meters->get_w();
00385         }
00386 
00387         if(use_labels)
00388         {
00389                 labelbutton->reposition_window(x1, y1);
00390                 x1 += labelbutton->get_w();
00391                 prevlabel->reposition_window(x1, y1);
00392                 x1 += prevlabel->get_w();
00393                 nextlabel->reposition_window(x1, y1);
00394                 x1 += nextlabel->get_w();
00395         }
00396 
00397         if(use_fit)
00398         {
00399                 fit->reposition_window(x1, y1);
00400                 x1 += fit->get_w();
00401                 fit_autos->reposition_window(x1, y1);
00402                 x1 += fit_autos->get_w();
00403         }
00404 
00405         if(use_undo)
00406         {
00407                 undo->reposition_window(x1, y1);
00408                 x1 += undo->get_w();
00409                 redo->reposition_window(x1, y1);
00410                 x1 += redo->get_w();
00411         }
00412         
00413         mangoto->reposition_window(x1, y1);
00414         x1 += mangoto->get_w();
00415 }
00416 
00417 
00418 
00419 int EditPanel::create_objects()
00420 {
00421         create_buttons();
00422         return 0;
00423 }
00424 
00425 int EditPanel::get_w()
00426 {
00427         return x1 - x;
00428 }
00429 
00430 
00431 void EditPanel::copy_selection()
00432 {
00433         mwindow->copy();
00434 }
00435 
00436 void EditPanel::splice_selection()
00437 {
00438 }
00439 
00440 void EditPanel::overwrite_selection()
00441 {
00442 }
00443 
00444 void EditPanel::set_inpoint()
00445 {
00446         mwindow->set_inpoint(1);
00447 }
00448 
00449 void EditPanel::set_outpoint()
00450 {
00451         mwindow->set_outpoint(1);
00452 }
00453 
00454 void EditPanel::clear_inpoint()
00455 {
00456         mwindow->delete_inpoint();
00457 }
00458 
00459 void EditPanel::clear_outpoint()
00460 {
00461         mwindow->delete_outpoint();
00462 }
00463 
00464 void EditPanel::to_clip()
00465 {
00466         mwindow->to_clip();
00467 }
00468 
00469 
00470 EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
00471  : BC_Button(x, y, mwindow->theme->get_image_set("inbutton"))
00472 {
00473         this->mwindow = mwindow;
00474         this->panel = panel;
00475         set_tooltip(_("In point ( [ )"));
00476 }
00477 EditInPoint::~EditInPoint()
00478 {
00479 }
00480 int EditInPoint::handle_event()
00481 {
00482         panel->set_inpoint();
00483         return 1;
00484 }
00485 int EditInPoint::keypress_event()
00486 {
00487         if(get_keypress() == '[') 
00488         {
00489                 panel->set_inpoint();
00490                 return 1;
00491         }
00492         return 0;
00493 }
00494 
00495 EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
00496  : BC_Button(x, y, mwindow->theme->get_image_set("outbutton"))
00497 {
00498         this->mwindow = mwindow;
00499         this->panel = panel;
00500         set_tooltip(_("Out point ( ] )"));
00501 }
00502 EditOutPoint::~EditOutPoint()
00503 {
00504 }
00505 int EditOutPoint::handle_event()
00506 {
00507         panel->set_outpoint();
00508         return 1;
00509 }
00510 int EditOutPoint::keypress_event()
00511 {
00512         if(get_keypress() == ']') 
00513         {
00514                 panel->set_outpoint();
00515                 return 1;
00516         }
00517         return 0;
00518 }
00519 
00520 
00521 EditNextLabel::EditNextLabel(MWindow *mwindow, 
00522         EditPanel *panel, 
00523         int x, 
00524         int y,
00525         int is_mwindow)
00526  : BC_Button(x, y, mwindow->theme->get_image_set("nextlabel"))
00527 {
00528         this->mwindow = mwindow;
00529         this->panel = panel;
00530         this->is_mwindow = is_mwindow;
00531         set_tooltip(_("Next label ( ctrl -> )"));
00532 }
00533 EditNextLabel::~EditNextLabel()
00534 {
00535 }
00536 int EditNextLabel::keypress_event()
00537 {
00538         if(get_keypress() == RIGHT && ctrl_down())
00539                 return handle_event();
00540         return 0;
00541 }
00542 int EditNextLabel::handle_event()
00543 {
00544         panel->next_label();
00545         return 1;
00546 }
00547 
00548 EditPrevLabel::EditPrevLabel(MWindow *mwindow, 
00549         EditPanel *panel, 
00550         int x, 
00551         int y,
00552         int is_mwindow)
00553  : BC_Button(x, y, mwindow->theme->get_image_set("prevlabel"))
00554 {
00555         this->mwindow = mwindow;
00556         this->panel = panel;
00557         this->is_mwindow = is_mwindow;
00558         set_tooltip(_("Previous label ( ctrl <- )"));
00559 }
00560 EditPrevLabel::~EditPrevLabel()
00561 {
00562 }
00563 int EditPrevLabel::keypress_event()
00564 {
00565         if(get_keypress() == LEFT && ctrl_down())
00566                 return handle_event();
00567         return 0;
00568 }
00569 int EditPrevLabel::handle_event()
00570 {
00571         panel->prev_label();
00572         return 1;
00573 }
00574 
00575 EditLift::EditLift(MWindow *mwindow, EditPanel *panel, int x, int y)
00576  : BC_Button(x, y, mwindow->theme->lift_data)
00577 {
00578         this->mwindow = mwindow;
00579         this->panel = panel;
00580         set_tooltip(_("Lift"));
00581 }
00582 EditLift::~EditLift()
00583 {
00584 }
00585 int EditLift::handle_event()
00586 {
00587         return 1;
00588 }
00589 
00590 EditOverwrite::EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y)
00591  : BC_Button(x, y, mwindow->theme->overwrite_data)
00592 {
00593         this->mwindow = mwindow;
00594         this->panel = panel;
00595         set_tooltip(_("Overwrite ( b )"));
00596 }
00597 EditOverwrite::~EditOverwrite()
00598 {
00599 }
00600 int EditOverwrite::handle_event()
00601 {
00602         panel->overwrite_selection();
00603         return 1;
00604 }
00605 int EditOverwrite::keypress_event()
00606 {
00607         if(get_keypress() == 'b')
00608         {
00609                 handle_event();
00610                 return 1;
00611         }
00612         return 0;
00613 }
00614 
00615 EditExtract::EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y)
00616  : BC_Button(x, y, mwindow->theme->extract_data)
00617 {
00618         this->mwindow = mwindow;
00619         this->panel = panel;
00620         set_tooltip(_("Extract"));
00621 }
00622 EditExtract::~EditExtract()
00623 {
00624 }
00625 int EditExtract::handle_event()
00626 {
00627 //      mwindow->extract_selection();
00628         return 1;
00629 }
00630 
00631 EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
00632  : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
00633 {
00634         this->mwindow = mwindow;
00635         this->panel = panel;
00636         set_tooltip(_("To clip ( i )"));
00637 }
00638 EditToClip::~EditToClip()
00639 {
00640 }
00641 int EditToClip::handle_event()
00642 {
00643         panel->to_clip();
00644         return 1;
00645 }
00646 
00647 int EditToClip::keypress_event()
00648 {
00649         if(get_keypress() == 'i')
00650         {
00651                 handle_event();
00652                 return 1;
00653         }
00654         return 0;
00655 }
00656 
00657 EditManualGoto::EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y)
00658  : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
00659 {
00660         this->mwindow = mwindow;
00661         this->panel = panel;
00662         mangoto = new ManualGoto(mwindow, panel->subwindow);
00663         set_tooltip(_("Manual goto ( g )"));
00664 }
00665 EditManualGoto::~EditManualGoto()
00666 {
00667         delete mangoto;
00668 }
00669 int EditManualGoto::handle_event()
00670 {
00671         mangoto->open_window();
00672         return 1;
00673 }
00674 
00675 int EditManualGoto::keypress_event()
00676 {
00677         if(get_keypress() == 'g')
00678         {
00679                 handle_event();
00680                 return 1;
00681         }
00682         return 0;
00683 }
00684 
00685 
00686 EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
00687  : BC_Button(x, y, mwindow->theme->splice_data)
00688 {
00689         this->mwindow = mwindow;
00690         this->panel = panel;
00691         set_tooltip(_("Splice ( v )"));
00692 }
00693 EditSplice::~EditSplice()
00694 {
00695 }
00696 int EditSplice::handle_event()
00697 {
00698         panel->splice_selection();
00699         return 1;
00700 }
00701 int EditSplice::keypress_event()
00702 {
00703         if(get_keypress() == 'v')
00704         {
00705                 handle_event();
00706                 return 1;
00707         }
00708         return 0;
00709 }
00710 
00711 EditCut::EditCut(MWindow *mwindow, EditPanel *panel, int x, int y)
00712  : BC_Button(x, y, mwindow->theme->get_image_set("cut"))
00713 {
00714         this->mwindow = mwindow;
00715         this->panel = panel;
00716         set_tooltip(_("Cut ( x )"));
00717 }
00718 EditCut::~EditCut()
00719 {
00720 }
00721 int EditCut::keypress_event()
00722 {
00723         if(get_keypress() == 'x')
00724                 return handle_event();
00725         return 0;
00726 }
00727 
00728 int EditCut::handle_event()
00729 {
00730         if(!panel->is_mwindow) mwindow->gui->lock_window("EditCut::handle_event");
00731         mwindow->cut();
00732         if(!panel->is_mwindow) mwindow->gui->unlock_window();
00733         return 1;
00734 }
00735 
00736 EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
00737  : BC_Button(x, y, mwindow->theme->get_image_set("copy"))
00738 {
00739         this->mwindow = mwindow;
00740         this->panel = panel;
00741         set_tooltip(_("Copy ( c )"));
00742 }
00743 EditCopy::~EditCopy()
00744 {
00745 }
00746 
00747 int EditCopy::keypress_event()
00748 {
00749         if(get_keypress() == 'c')
00750                 return handle_event();
00751         return 0;
00752 }
00753 int EditCopy::handle_event()
00754 {
00755         panel->copy_selection();
00756         return 1;
00757 }
00758 
00759 EditAppend::EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y)
00760  : BC_Button(x, y, mwindow->theme->append_data)
00761 {
00762         this->mwindow = mwindow;
00763         this->panel = panel;
00764         set_tooltip(_("Append to end of track"));
00765 }
00766 EditAppend::~EditAppend()
00767 {
00768 }
00769 
00770 
00771 int EditAppend::handle_event()
00772 {
00773         return 1;
00774 }
00775 
00776 
00777 EditInsert::EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y)
00778  : BC_Button(x, y, mwindow->theme->insert_data)
00779 {
00780         this->mwindow = mwindow;
00781         this->panel = panel;
00782         set_tooltip(_("Insert before beginning of track"));
00783 }
00784 EditInsert::~EditInsert()
00785 {
00786 }
00787 
00788 
00789 int EditInsert::handle_event()
00790 {
00791         
00792         return 1;
00793 }
00794 
00795 
00796 EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
00797  : BC_Button(x, y, mwindow->theme->get_image_set("paste"))
00798 {
00799         this->mwindow = mwindow;
00800         this->panel = panel;
00801         set_tooltip(_("Paste ( v )"));
00802 }
00803 EditPaste::~EditPaste()
00804 {
00805 }
00806 
00807 int EditPaste::keypress_event()
00808 {
00809         if(get_keypress() == 'v')
00810                 return handle_event();
00811         return 0;
00812 }
00813 int EditPaste::handle_event()
00814 {
00815         if(!panel->is_mwindow) mwindow->gui->lock_window("EditPaste::handle_event");
00816         mwindow->paste();
00817         if(!panel->is_mwindow) mwindow->gui->unlock_window();
00818         return 1;
00819 }
00820 
00821 
00822 
00823 EditTransition::EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y)
00824  : BC_Button(x, y, mwindow->theme->transition_data)
00825 {
00826         this->mwindow = mwindow;
00827         this->panel = panel;
00828         set_tooltip(_("Set transition"));
00829 }
00830 EditTransition::~EditTransition()
00831 {
00832 }
00833 int EditTransition::handle_event()
00834 {
00835         return 1;
00836 }
00837 
00838 EditPresentation::EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y)
00839  : BC_Button(x, y, mwindow->theme->presentation_data)
00840 {
00841         this->mwindow = mwindow;
00842         this->panel = panel;
00843         set_tooltip(_("Set presentation up to current position"));
00844 }
00845 EditPresentation::~EditPresentation()
00846 {
00847 }
00848 int EditPresentation::handle_event()
00849 {
00850         return 1;
00851 }
00852 
00853 EditUndo::EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y)
00854  : BC_Button(x, y, mwindow->theme->get_image_set("undo"))
00855 {
00856         this->mwindow = mwindow;
00857         this->panel = panel;
00858         set_tooltip(_("Undo ( z )"));
00859 }
00860 EditUndo::~EditUndo()
00861 {
00862 }
00863 int EditUndo::keypress_event()
00864 {
00865         if(get_keypress() == 'z')
00866                 return handle_event();
00867         return 0;
00868 }
00869 int EditUndo::handle_event()
00870 {
00871         mwindow->undo_entry(panel->subwindow);
00872         return 1;
00873 }
00874 
00875 EditRedo::EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y)
00876  : BC_Button(x, y, mwindow->theme->get_image_set("redo"))
00877 {
00878         this->mwindow = mwindow;
00879         this->panel = panel;
00880         set_tooltip(_("Redo ( shift Z )"));
00881 }
00882 EditRedo::~EditRedo()
00883 {
00884 }
00885 int EditRedo::keypress_event()
00886 {
00887         if(get_keypress() == 'Z')
00888                 return handle_event();
00889         return 0;
00890 }
00891 int EditRedo::handle_event()
00892 {
00893         mwindow->redo_entry(panel->subwindow);
00894         return 1;
00895 };
00896 
00897 
00898 
00899 
00900 
00901 EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
00902  : BC_Button(x, y, mwindow->theme->get_image_set("labelbutton"))
00903 {
00904         this->mwindow = mwindow;
00905         this->panel = panel;
00906         set_tooltip(_("Toggle label at current position ( l )"));
00907 }
00908 
00909 EditLabelbutton::~EditLabelbutton()
00910 {
00911 }
00912 int EditLabelbutton::keypress_event()
00913 {
00914         if(get_keypress() == 'l')
00915                 return handle_event();
00916         return 0;
00917 }
00918 int EditLabelbutton::handle_event()
00919 {
00920         panel->toggle_label();
00921         return 1;
00922 }
00923 
00924 
00925 
00926 
00927 
00928 
00929 
00930 EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
00931  : BC_Button(x, y, mwindow->theme->get_image_set("fit"))
00932 {
00933         this->mwindow = mwindow;
00934         this->panel = panel;
00935         set_tooltip(_("Fit selection to display ( f )"));
00936 }
00937 EditFit::~EditFit()
00938 {
00939 }
00940 int EditFit::keypress_event()
00941 {
00942         if(!alt_down() && get_keypress() == 'f') 
00943         {
00944                 handle_event();
00945                 return 1;
00946         }
00947         return 0;
00948 }
00949 int EditFit::handle_event()
00950 {
00951         mwindow->fit_selection();
00952         return 1;
00953 }
00954 
00955 
00956 
00957 
00958 
00959 
00960 
00961 
00962 
00963 EditFitAutos::EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y)
00964  : BC_Button(x, y, mwindow->theme->get_image_set("fitautos"))
00965 {
00966         this->mwindow = mwindow;
00967         this->panel = panel;
00968         set_tooltip(_("Fit autos to display ( Alt + f )"));
00969 }
00970 EditFitAutos::~EditFitAutos()
00971 {
00972 }
00973 int EditFitAutos::keypress_event()
00974 {
00975         if(alt_down() && get_keypress() == 'f') 
00976         {
00977                 handle_event();
00978                 return 1;
00979         }
00980         return 0;
00981 }
00982 int EditFitAutos::handle_event()
00983 {
00984         mwindow->fit_autos();
00985         return 1;
00986 }
00987 
00988 
00989 
00990 
00991 
00992 
00993 
00994 
00995 
00996 
00997 
00998 
00999 
01000 ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
01001  : BC_Toggle(x, 
01002         y, 
01003         mwindow->theme->get_image_set("arrow"),
01004         mwindow->edl->session->editing_mode == EDITING_ARROW,
01005         "",
01006         0,
01007         0,
01008         0)
01009 {
01010         this->mwindow = mwindow;
01011         this->panel = panel;
01012         set_tooltip(_("Drag and drop editing mode"));
01013 }
01014 
01015 int ArrowButton::handle_event()
01016 {
01017         update(1);
01018         panel->ibeam->update(0);
01019         mwindow->set_editing_mode(EDITING_ARROW);
01020 // Nothing after this
01021         return 1;
01022 }
01023 
01024 
01025 IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
01026  : BC_Toggle(x, 
01027         y, 
01028         mwindow->theme->get_image_set("ibeam"),
01029         mwindow->edl->session->editing_mode == EDITING_IBEAM,
01030         "",
01031         0,
01032         0,
01033         0)
01034 {
01035         this->mwindow = mwindow;
01036         this->panel = panel;
01037         set_tooltip(_("Cut and paste editing mode"));
01038 }
01039 
01040 int IBeamButton::handle_event()
01041 {
01042         update(1);
01043         panel->arrow->update(0);
01044         mwindow->set_editing_mode(EDITING_IBEAM);
01045 // Nothing after this
01046         return 1;
01047 }
01048 
01049 KeyFrameButton::KeyFrameButton(MWindow *mwindow, int x, int y)
01050  : BC_Toggle(x, 
01051         y, 
01052         mwindow->theme->get_image_set("autokeyframe"),
01053         mwindow->edl->session->auto_keyframes,
01054         "",
01055         0,
01056         0,
01057         0)
01058 {
01059         this->mwindow = mwindow;
01060         set_tooltip(_("Generate keyframes while tweeking"));
01061 }
01062 
01063 int KeyFrameButton::handle_event()
01064 {
01065         mwindow->set_auto_keyframes(get_value());
01066         return 1;
01067 }
01068 
01069 

Generated on Sun Jan 8 13:38:53 2006 for Cinelerra-svn by  doxygen 1.4.4