X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fkeyframepopup.C;h=053dd656332e29699665c91ac9c836efd8520014;hb=6fd57106820e676e368399d16b925bdc78d34621;hp=303f599ed1ee5c1abd063acad9ba882963d050f0;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/keyframepopup.C b/cinelerra-5.1/cinelerra/keyframepopup.C index 303f599e..053dd656 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.C +++ b/cinelerra-5.1/cinelerra/keyframepopup.C @@ -19,33 +19,38 @@ * */ +#include "apatchgui.h" +#include "autoconf.h" +#include "autos.h" +#include "bcwindowbase.h" +#include "cpanel.h" +#include "cwindowgui.h" #include "cwindow.h" #include "edl.h" +#include "edlsession.h" +#include "filexml.h" +#include "gwindow.h" +#include "gwindowgui.h" #include "keyframe.h" #include "keyframepopup.h" #include "language.h" +#include "localsession.h" +#include "maincursor.h" +#include "mainmenu.h" #include "mainundo.h" -#include "mwindow.h" #include "mwindowgui.h" -#include "localsession.h" -#include "cwindowgui.h" -#include "cpanel.h" +#include "mwindow.h" #include "patchbay.h" #include "patchgui.h" -#include "apatchgui.h" -#include "vpatchgui.h" #include "track.h" -#include "maincursor.h" -#include "bcwindowbase.h" -#include "filexml.h" -#include "edlsession.h" -#include "autos.h" +#include "vpatchgui.h" KeyframePopup::KeyframePopup(MWindow *mwindow, MWindowGUI *gui) : BC_PopupMenu(0, 0, 0, "", 0) { this->mwindow = mwindow; this->gui = gui; + key_hide = 0; key_show = 0; key_delete = 0; key_copy = 0; @@ -54,6 +59,7 @@ KeyframePopup::KeyframePopup(MWindow *mwindow, MWindowGUI *gui) key_free = 0; key_mbar = 0; key_mode_displayed = false; + key_edit_displayed = false; } KeyframePopup::~KeyframePopup() @@ -65,15 +71,19 @@ KeyframePopup::~KeyframePopup() delete key_free_t; delete key_free; } + if( !key_edit_displayed ) { + delete key_edit; + } } void KeyframePopup::create_objects() { + add_item(key_hide = new KeyframePopupHide(mwindow, this)); add_item(key_show = new KeyframePopupShow(mwindow, this)); add_item(key_delete = new KeyframePopupDelete(mwindow, this)); add_item(key_copy = new KeyframePopupCopy(mwindow, this)); - add_item(key_edit = new KeyframePopupEdit(mwindow, this)); + key_edit = new KeyframePopupEdit(mwindow, this); key_mbar = new BC_MenuItem("-"); key_smooth = new KeyframePopupCurveMode(mwindow, this, FloatAuto::SMOOTH); key_linear = new KeyframePopupCurveMode(mwindow, this, FloatAuto::LINEAR); @@ -119,6 +129,16 @@ void KeyframePopup::handle_curve_mode(Autos *autos, Auto *auto_keyframe) // determines the type of automation node. if floatauto, adds // menu entries showing the curve mode of the node { + deactivate(); + if( !key_edit_displayed && keyframe_plugin ) { + add_item(key_edit); + key_edit_displayed = true; + } + else if( key_edit_displayed && !keyframe_plugin ) { + remove_item(key_edit); + key_edit_displayed = false; + } + if(!key_mode_displayed && autos && autos->get_type() == AUTOMATION_TYPE_FLOAT) { // append additional menu entries showing the curve_mode add_item(key_mbar); @@ -144,6 +164,7 @@ void KeyframePopup::handle_curve_mode(Autos *autos, Auto *auto_keyframe) key_free_t->toggle_mode((FloatAuto*)auto_keyframe); key_free ->toggle_mode((FloatAuto*)auto_keyframe); } + activate(); } KeyframePopupDelete::KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup) @@ -173,6 +194,24 @@ int KeyframePopupDelete::handle_event() return 1; } +KeyframePopupHide::KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup) + : BC_MenuItem(_("Hide keyframe type")) +{ + this->mwindow = mwindow; + this->popup = popup; +} + +KeyframePopupHide::~KeyframePopupHide() +{ +} + +int KeyframePopupHide::handle_event() +{ + if( popup->keyframe_autos ) + mwindow->set_auto_visibility(popup->keyframe_autos, 0); + return 1; +} + KeyframePopupShow::KeyframePopupShow(MWindow *mwindow, KeyframePopup *popup) : BC_MenuItem(_("Show keyframe settings")) { @@ -190,9 +229,8 @@ int KeyframePopupShow::handle_event() { mwindow->update_plugin_guis(); mwindow->show_plugin(popup->keyframe_plugin); - } else - if (popup->keyframe_automation) - { + } + else if( popup->keyframe_automation ) { /* mwindow->cwindow->gui->lock_window(); @@ -421,7 +459,7 @@ const char* KeyframePopupCurveMode::get_labeltext(int mode) case FloatAuto::TFREE: return _("tangent edit"); case FloatAuto::FREE: return _("disjoint edit"); } - return "misconfigured"; + return _("misconfigured"); } @@ -469,4 +507,41 @@ int KeyframePopupEdit::handle_event() } +KeyframeHidePopup::KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui) + : BC_PopupMenu(0, 0, 0, "", 0) +{ + this->mwindow = mwindow; + this->gui = gui; + this->keyframe_autos = 0; +} + +KeyframeHidePopup::~KeyframeHidePopup() +{ +} + +void KeyframeHidePopup::create_objects() +{ + add_item(new KeyframeHideItem(mwindow, this)); +} + +int KeyframeHidePopup::update(Autos *autos) +{ + this->keyframe_autos = autos; + return 0; +} + +KeyframeHideItem::KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup) + : BC_MenuItem(_("Hide keyframe type")) +{ + this->mwindow = mwindow; + this->popup = popup; +} + + +int KeyframeHideItem::handle_event() +{ + if( popup->keyframe_autos ) + mwindow->set_auto_visibility(popup->keyframe_autos, 0); + return 1; +}