X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmainmenu.C;h=42e845c9d6bff4e3911236ae690653580eafc424;hb=22c6251d37911a11e322bf7518e6a992ea0bb6c7;hp=f616d26a12819b6bf650ddf79c4ae2c06949d457;hpb=1da768016a2ecba0296b03d75c02879f99a0f582;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C index f616d26a..42e845c9 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.C +++ b/cinelerra-5.1/cinelerra/mainmenu.C @@ -118,8 +118,8 @@ void MainMenu::create_objects() filemenu->add_item(saveas = new SaveAs(mwindow)); save->create_objects(saveas); saveas->set_mainmenu(this); - SaveProject *save_project; - filemenu->add_item(save_project = new SaveProject(mwindow)); + filemenu->add_item(new SaveProject(mwindow)); + filemenu->add_item(new SaveSession(mwindow)); filemenu->add_item(record_menu_item = new RecordMenuItem(mwindow)); #ifdef HAVE_DVB @@ -174,11 +174,13 @@ void MainMenu::create_objects() keyframemenu->add_item(new CopyKeyframes(mwindow)); keyframemenu->add_item(new PasteKeyframes(mwindow)); keyframemenu->add_item(new ClearKeyframes(mwindow)); - keyframemenu->add_item(new StraightenKeyframes(mwindow)); - keyframemenu->add_item(new BendKeyframes(mwindow)); + keyframemenu->add_item(set_auto_curves = new SetAutomationCurveMode(mwindow)); + set_auto_curves->create_objects(); keyframemenu->add_item(keyframe_curve_type = new KeyframeCurveType(mwindow)); keyframe_curve_type->create_objects(); keyframe_curve_type->update(mwindow->edl->local_session->floatauto_type); + keyframemenu->add_item(keyframe_create = new KeyframeCreate(mwindow)); + keyframe_create->create_objects(); keyframemenu->add_item(new BC_MenuItem("-")); keyframemenu->add_item(new CopyDefaultKeyframe(mwindow)); keyframemenu->add_item(new PasteDefaultKeyframe(mwindow)); @@ -209,6 +211,9 @@ void MainMenu::create_objects() trackmenu->add_item(new DeleteFirstTrack(mwindow)); trackmenu->add_item(new DeleteLastTrack(mwindow)); trackmenu->add_item(new ConcatenateTracks(mwindow)); + trackmenu->add_item(new AlignTimecodes(mwindow)); + trackmenu->add_item(new SwapTracksUp(mwindow)); + trackmenu->add_item(new SwapTracksDown(mwindow)); AppendTracks *append_tracks; trackmenu->add_item(append_tracks = new AppendTracks(mwindow)); append_tracks->create_objects(); @@ -729,36 +734,40 @@ int ClearKeyframes::handle_event() } - -StraightenKeyframes::StraightenKeyframes(MWindow *mwindow) - : BC_MenuItem(_("Change to linear")) +SetAutomationCurveItem::SetAutomationCurveItem(SetAutomationCurveMode *set_curve_mode, int id) + : BC_MenuItem(FloatAuto::curve_name(id)) { - this->mwindow = mwindow; + this->set_curve_mode = set_curve_mode; + this->id = id; } -int StraightenKeyframes::handle_event() +int SetAutomationCurveItem::handle_event() { - mwindow->set_automation_mode(FloatAuto::LINEAR); + set_curve_mode->mwindow->set_automation_mode((FloatAuto::t_mode)id); return 1; } +SetAutoCurveModeMenu::SetAutoCurveModeMenu(SetAutomationCurveMode *curve_mode) +: BC_SubMenu() +{ + this->curve_mode = curve_mode; +} - - -BendKeyframes::BendKeyframes(MWindow *mwindow) - : BC_MenuItem(_("Change to smooth")) +SetAutomationCurveMode::SetAutomationCurveMode(MWindow *mwindow) + : BC_MenuItem(_("Set curve modes...")) { this->mwindow = mwindow; + curve_mode_menu = 0; } -int BendKeyframes::handle_event() +void SetAutomationCurveMode::create_objects() { - mwindow->set_automation_mode(FloatAuto::SMOOTH); - return 1; + add_submenu(curve_mode_menu = new SetAutoCurveModeMenu(this)); + for( int id=FloatAuto::SMOOTH; id<=FloatAuto::BUMP; ++id ) + curve_mode_menu->add_item(new SetAutomationCurveItem(this, id)); } - KeyframeCurveType::KeyframeCurveType(MWindow *mwindow) : BC_MenuItem(_("Create curve type...")) { @@ -772,7 +781,7 @@ KeyframeCurveType::~KeyframeCurveType() void KeyframeCurveType::create_objects() { add_submenu(curve_menu = new KeyframeCurveTypeMenu(this)); - for( int i=FloatAuto::SMOOTH; i<=FloatAuto::FREE; ++i ) { + for( int i=FloatAuto::SMOOTH; i<=FloatAuto::BUMP; ++i ) { KeyframeCurveTypeItem *curve_type_item = new KeyframeCurveTypeItem(i, this); curve_menu->add_submenuitem(curve_type_item); } @@ -818,6 +827,63 @@ int KeyframeCurveTypeItem::handle_event() } +KeyframeCreateItem::KeyframeCreateItem(KeyframeCreate *keyframe_create, + const char *text, int mask) + : BC_MenuItem(text) +{ + this->keyframe_create = keyframe_create; + this->mask = mask; +} + +int KeyframeCreateItem::handle_event() +{ + MWindow *mwindow = keyframe_create->mwindow; + int mode = mwindow->edl->local_session->floatauto_type; + int mask = this->mask; + if( !mask ) { // visible + int *autos = mwindow->edl->session->auto_conf->autos; + int modes = (1<>=1, ++i ) { + if( !(modes & 1) ) continue; + if( autos[i] ) mask |= (1<create_keyframes(mask, mode); + return 1; +} + +KeyframeCreateMenu::KeyframeCreateMenu(KeyframeCreate *keyframe_create) +: BC_SubMenu() +{ + this->keyframe_create = keyframe_create; +} + +KeyframeCreate::KeyframeCreate(MWindow *mwindow) + : BC_MenuItem(_("Create keyframes...")) +{ + this->mwindow = mwindow; + keyframe_create_menu = 0; +} + +void KeyframeCreate::create_objects() +{ + add_submenu(keyframe_create_menu = new KeyframeCreateMenu(this)); + keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Visible"), 0)); + keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Fade"), + (1<add_item(new KeyframeCreateItem(this, _("Speed"), + (1<add_item(new KeyframeCreateItem(this, _("Camera XYZ"), + (7<add_item(new KeyframeCreateItem(this, _("Projector XYZ"), + (7<add_item(new KeyframeCreateItem(this, _("Fade+Speed+XYZ"), + (1<session->current_operation == NO_OPERATION ) - mwindow->add_video_track_entry(); + mwindow->add_video_track_entry(1, 0); return 1; } @@ -1290,6 +1356,34 @@ int MoveTracksDown::handle_event() } +SwapTracksUp::SwapTracksUp(MWindow *mwindow) + : BC_MenuItem(_("Swap tracks up"), 0, UP) +{ + this->mwindow = mwindow; + set_shift(); +} + +int SwapTracksUp::handle_event() +{ + if( mwindow->session->current_operation == NO_OPERATION ) + mwindow->swap_tracks_up(); + return 1; +} + +SwapTracksDown::SwapTracksDown(MWindow *mwindow) + : BC_MenuItem(_("Swap tracks down"), 0, DOWN) +{ + set_shift(); this->mwindow = mwindow; +} + +int SwapTracksDown::handle_event() +{ + if( mwindow->session->current_operation == NO_OPERATION ) + mwindow->swap_tracks_down(); + return 1; +} + + ConcatenateTracks::ConcatenateTracks(MWindow *mwindow) @@ -1341,7 +1435,7 @@ AddSubttlTrack::AddSubttlTrack(MWindow *mwindow) int AddSubttlTrack::handle_event() { if( mwindow->session->current_operation == NO_OPERATION ) - mwindow->add_subttl_track_entry(); + mwindow->add_subttl_track_entry(1, 0); return 1; } @@ -1479,10 +1573,11 @@ int ScrubSpeed::handle_event() } SaveSettingsNow::SaveSettingsNow(MWindow *mwindow) - : BC_MenuItem(_("Save settings now"),_("Ctrl-s"),'s') + : BC_MenuItem(_("Save settings now"),_("Ctrl-Shift-S"),'S') { this->mwindow = mwindow; set_ctrl(1); + set_shift(1); } int SaveSettingsNow::handle_event() @@ -1509,7 +1604,9 @@ ShowVWindow::ShowVWindow(MWindow *mwindow) } int ShowVWindow::handle_event() { + mwindow->gui->unlock_window(); mwindow->show_vwindow(); + mwindow->gui->lock_window("ShowVWindow::handle_event"); return 1; } @@ -1521,7 +1618,9 @@ ShowAWindow::ShowAWindow(MWindow *mwindow) } int ShowAWindow::handle_event() { + mwindow->gui->unlock_window(); mwindow->show_awindow(); + mwindow->gui->lock_window("ShowAWindow::handle_event"); return 1; } @@ -1533,7 +1632,9 @@ ShowCWindow::ShowCWindow(MWindow *mwindow) } int ShowCWindow::handle_event() { + mwindow->gui->unlock_window(); mwindow->show_cwindow(); + mwindow->gui->lock_window("ShowCWindow::handle_event"); return 1; } @@ -1548,10 +1649,12 @@ ShowGWindow::ShowGWindow(MWindow *mwindow) int ShowGWindow::handle_event() { if( mwindow->session->current_operation == NO_OPERATION ) { + mwindow->gui->unlock_window(); if( !mwindow->session->show_gwindow ) mwindow->show_gwindow(); else mwindow->hide_gwindow(); + mwindow->gui->lock_window("ShowGWindow::handle_event"); set_checked(mwindow->session->show_gwindow); } return 1; @@ -1566,7 +1669,9 @@ ShowLWindow::ShowLWindow(MWindow *mwindow) } int ShowLWindow::handle_event() { + mwindow->gui->unlock_window(); mwindow->show_lwindow(); + mwindow->gui->lock_window("ShowLWindow::handle_event"); return 1; } @@ -1633,6 +1738,7 @@ void MixerItems::create_objects() mixer_submenu->add_submenuitem(new MixerViewer(this)); mixer_submenu->add_submenuitem(new TileMixers(this)); mixer_submenu->add_submenuitem(new AlignMixers(this)); + mixer_submenu->add_submenuitem(new MixMasters(this)); } int MixerItems::activate_submenu() @@ -1674,7 +1780,9 @@ int MixerItem::handle_event() MWindow *mwindow = mixer_items->mwindow; Mixer *mixer = mwindow->edl->mixers.get_mixer(idx); if( !mixer ) return 0; - ZWindow *zwindow = mwindow->get_mixer(mixer); + ZWindow *zwindow = mwindow->get_mixer(idx); + if( !zwindow ) + zwindow = mwindow->get_mixer(mixer); if( !zwindow->zgui ) { zwindow->set_title(mixer->title); zwindow->start(); @@ -1726,6 +1834,31 @@ int AlignMixers::handle_event() return 1; } +MixMasters::MixMasters(MixerItems *mixer_items) + : MixerItem(mixer_items, _("Mix masters"), "", 0) +{ +} + +int MixMasters::handle_event() +{ + MWindow *mwindow = mixer_items->mwindow; + mwindow->mix_masters(); + return 1; +} + + +AlignTimecodes::AlignTimecodes(MWindow *mwindow) + : BC_MenuItem(_("Align Timecodes")) +{ + this->mwindow = mwindow; +} + +int AlignTimecodes::handle_event() +{ + mwindow->align_timecodes(); + return 1; +} + LoadLayoutItem::LoadLayoutItem(LoadLayout *load_layout, const char *text, int idx, int hotkey) : BC_MenuItem(text, "", hotkey)