From: Good Guy Date: Thu, 15 Sep 2016 15:21:42 +0000 (-0600) Subject: popup menu mods/pref, pactl fix X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=6fd57106820e676e368399d16b925bdc78d34621;p=goodguy%2Fhistory.git popup menu mods/pref, pactl fix --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 0a8fcf26..ba047200 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1481,6 +1481,12 @@ int AWindowFolders::selection_changed() { gui->stop_vicon_drawing(); + if(get_button_down() && get_buttonpress() == 3) + { + gui->folderlist_menu->update_titles(); + gui->folderlist_menu->activate_menu(); + } + strcpy(mwindow->edl->session->current_folder, picon->get_text()); //printf("AWindowFolders::selection_changed 1\n"); gui->asset_list->draw_background(); @@ -1492,21 +1498,22 @@ int AWindowFolders::selection_changed() } int AWindowFolders::button_press_event() -{ - return BC_ListBox::button_press_event(); -} - -int AWindowFolders::button_release_event() { int result = 0; - if(get_buttonpress() == 3 && is_event_win() && cursor_inside()) + + result = BC_ListBox::button_press_event(); + + if(!result) { - gui->folderlist_menu->update_titles(); - gui->folderlist_menu->activate_menu(); - result = 1; + if(get_buttonpress() == 3 && is_event_win() && cursor_inside()) + { + gui->folderlist_menu->update_titles(); + gui->folderlist_menu->activate_menu(); + result = 1; + } } - else - result = BC_ListBox::button_release_event(); + + return result; } @@ -1515,6 +1522,7 @@ int AWindowFolders::button_release_event() + AWindowAssets::AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h) : BC_ListBox(x, y, @@ -1542,34 +1550,20 @@ AWindowAssets::~AWindowAssets() } int AWindowAssets::button_press_event() -{ - return BC_ListBox::button_press_event(); -} - -int AWindowAssets::button_release_event() { int result = 0; - if(get_buttonpress() == 3 && is_event_win() && cursor_inside()) { - if( !strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER) || - !strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER) || - !strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER) || - !strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER)) { - BC_ListBox::deactivate_selection(); - gui->assetlist_menu->update_titles(); - gui->assetlist_menu->activate_menu(); - } - else if (!strcasecmp(mwindow->edl->session->current_folder, LABEL_FOLDER)) { - gui->label_menu->update(); - gui->label_menu->activate_menu(); - } - else { - gui->asset_menu->update(); - gui->asset_menu->activate_menu(); - } + + result = BC_ListBox::button_press_event(); + + if(!result && get_buttonpress() == 3 && is_event_win() && cursor_inside()) + { + BC_ListBox::deactivate_selection(); + gui->assetlist_menu->update_titles(); + gui->assetlist_menu->activate_menu(); result = 1; } - else - result = BC_ListBox::button_release_event(); + + return result; } @@ -1601,7 +1595,39 @@ int AWindowAssets::handle_event() int AWindowAssets::selection_changed() { // Show popup window - if( get_button_down() && get_buttonpress() == 1 && get_selection(0, 0) ) { + if(get_button_down() && get_buttonpress() == 3 && get_selection(0, 0)) + { + if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER) || + !strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER) || + !strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER) || + !strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER)) + { + gui->assetlist_menu->update_titles(); + gui->assetlist_menu->activate_menu(); + } + else + if (!strcasecmp(mwindow->edl->session->current_folder, LABEL_FOLDER)) + { + if(((AssetPicon*)get_selection(0, 0))->label) + gui->label_menu->activate_menu(); + } + else + { + if(((AssetPicon*)get_selection(0, 0))->indexable) + gui->asset_menu->update(); + else + if(((AssetPicon*)get_selection(0, 0))->edl) + gui->asset_menu->update(); + + + + gui->asset_menu->activate_menu(); + } + + BC_ListBox::deactivate_selection(); + return 1; + } + else if( get_button_down() && get_buttonpress() == 1 && get_selection(0, 0) ) { VIcon *vicon = 0; if( !gui->vicon_thread->viewing ) { AssetPicon *picon = (AssetPicon*)get_selection(0, 0); diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 79b41878..a1d2b5e5 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -269,7 +269,6 @@ public: int drag_motion_event(); int drag_stop_event(); int button_press_event(); - int button_release_event(); int column_resize_event(); int focus_in_event(); int focus_out_event(); @@ -300,7 +299,6 @@ public: int selection_changed(); int button_press_event(); - int button_release_event(); MWindow *mwindow; AWindowGUI *gui; diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index 38c5abb7..e749aa7a 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -662,12 +662,11 @@ void Canvas::create_objects(EDL *edl) } -int Canvas::button_release_event() +int Canvas::button_press_event() { int result = 0; - BC_WindowBase *cvs = get_canvas(); - if( cvs->is_event_win() && cvs->get_buttonpress() == 3 && cvs->cursor_inside() ) + if(get_canvas()->get_buttonpress() == 3) { if(get_fullscreen()) fullscreen_menu->activate_menu(); @@ -1093,6 +1092,7 @@ CanvasPopup::~CanvasPopup() void CanvasPopup::create_objects() { + add_item(new BC_MenuItem("-")); add_item(new CanvasFullScreenItem(canvas)); add_item(new CanvasPopupSize(canvas, _("Zoom 25%"), 0.25)); add_item(new CanvasPopupSize(canvas, _("Zoom 33%"), 0.33)); diff --git a/cinelerra-5.1/cinelerra/canvas.h b/cinelerra-5.1/cinelerra/canvas.h index 5230c228..27336588 100644 --- a/cinelerra-5.1/cinelerra/canvas.h +++ b/cinelerra-5.1/cinelerra/canvas.h @@ -93,8 +93,8 @@ public: virtual void zoom_auto() {}; virtual int cursor_leave_event() { return 0; }; virtual int cursor_enter_event() { return 0; }; - virtual int button_release_event(); - virtual int button_press_event() { return 0; }; + virtual int button_release_event() { return 0; }; + virtual int button_press_event(); virtual int cursor_motion_event() { return 0; }; virtual void draw_overlays() { }; virtual void toggle_controls() { } ; diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index cc3e8650..8df5e993 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -85,13 +85,13 @@ void InterfacePrefs::create_objects() x = mwindow->theme->preferencesoptions_x; y = mwindow->theme->preferencesoptions_y; - add_subwindow(new BC_Title(x, y, - _("Time Format"), - LARGEFONT, + add_subwindow(new BC_Title(x, y, _("Time Format"), LARGEFONT, + resources->text_default)); + int x1 = get_w()/2; + add_subwindow(new BC_Title(x1, y, _("Flags"), LARGEFONT, resources->text_default)); y += get_text_height(LARGEFONT) + 5; - int y1 = y; add_subwindow(hms = new TimeFormatHMS(pwindow, this, @@ -114,33 +114,35 @@ void InterfacePrefs::create_objects() pwindow->thread->edl->session->time_format == TIME_FRAMES, x, y)); y += 20; - int x1 = x; + int x0 = x; add_subwindow(feet = new TimeFormatFeet(pwindow, this, pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES, - x1, y)); - x1 += feet->get_w() + margin; + x0, y)); + x0 += feet->get_w() + 15; BC_Title *title; - add_subwindow(title = new BC_Title(x1, y, _("Frames per foot:"))); - x1 += title->get_w() + margin; + add_subwindow(title = new BC_Title(x0, y, _("Frames per foot:"))); + x0 += title->get_w() + margin; sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot); add_subwindow(new TimeFormatFeetSetting(pwindow, - x1, y - 5, string)); + x0, y - 5, string)); y += 20; add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, pwindow->thread->edl->session->time_format == TIME_SECONDS, x, y)); y += 35; - x1 = get_w()/2; UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1); add_subwindow(tip_win); y1 += tip_win->get_h() + 5; UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1); add_subwindow(idx_win); - y1 += tip_win->get_h() + 5; + y1 += idx_win->get_h() + 5; UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1); add_subwindow(ver_win); - y1 += idx_win->get_h() + 25; + y1 += ver_win->get_h() + 5; + PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1); + add_subwindow(pop_win); + y1 += pop_win->get_h() + 25; add_subwindow(new BC_Bar(5, y, get_w() - 10)); y += 5; @@ -710,6 +712,19 @@ int UseWarnVersion::handle_event() return 1; } +PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup, + _("Popups activate on button up")) +{ + this->pwindow = pwindow; +} + +int PopupMenuBtnup::handle_event() +{ + pwindow->thread->preferences->popupmenu_btnup = get_value(); + return 1; +} + ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y) : BC_CheckBox(x, diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.h b/cinelerra-5.1/cinelerra/interfaceprefs.h index e1d6fe35..15be9d2e 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.h +++ b/cinelerra-5.1/cinelerra/interfaceprefs.h @@ -44,6 +44,7 @@ class UseTipWindow; class StillImageUseDuration; class StillImageDuration; class KeyframeReticle; +class PopupMenuBtnup; #include "browsebutton.h" #include "deleteallindexes.inc" @@ -318,6 +319,14 @@ public: PreferencesWindow *pwindow; }; +class PopupMenuBtnup : public BC_CheckBox +{ +public: + PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y); + int handle_event(); + PreferencesWindow *pwindow; +}; + class AndroidPIN : public BC_TextBox { public: diff --git a/cinelerra-5.1/cinelerra/keyframepopup.C b/cinelerra-5.1/cinelerra/keyframepopup.C index 6d2c7370..053dd656 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.C +++ b/cinelerra-5.1/cinelerra/keyframepopup.C @@ -50,6 +50,7 @@ KeyframePopup::KeyframePopup(MWindow *mwindow, MWindowGUI *gui) { this->mwindow = mwindow; this->gui = gui; + key_hide = 0; key_show = 0; key_delete = 0; key_copy = 0; @@ -77,6 +78,7 @@ KeyframePopup::~KeyframePopup() 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)); @@ -192,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")) { @@ -501,7 +521,7 @@ KeyframeHidePopup::~KeyframeHidePopup() void KeyframeHidePopup::create_objects() { - add_item(new KeyframePopupHide(mwindow, this)); + add_item(new KeyframeHideItem(mwindow, this)); } int KeyframeHidePopup::update(Autos *autos) @@ -510,61 +530,18 @@ int KeyframeHidePopup::update(Autos *autos) return 0; } -KeyframePopupHide::KeyframePopupHide(MWindow *mwindow, KeyframeHidePopup *popup) +KeyframeHideItem::KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup) : BC_MenuItem(_("Hide keyframe type")) { this->mwindow = mwindow; this->popup = popup; } -int KeyframePopupHide::handle_event() -{ -// Get the array index of the curve - int update_gui = 0; - if(popup->keyframe_autos) - { - if(popup->keyframe_autos->type == Autos::AUTOMATION_TYPE_PLUGIN) - { - mwindow->edl->session->auto_conf->plugins = 0; - update_gui = 1; - } - else - { - Track *track = popup->keyframe_autos->track; - if(track) - { - Automation *automation = track->automation; - if(automation) - { - for(int i = 0; i < AUTOMATION_TOTAL; i++) - { - if(automation->autos[i] == popup->keyframe_autos) - { - mwindow->edl->session->auto_conf->autos[i] = 0; - update_gui = 1; - break; - } - } - } - } - } - } - - if(update_gui) - { - mwindow->gui->update(0, - 1, // 1 for incremental drawing. 2 for full refresh - 0, - 0, - 0, - 0, - 0); - mwindow->gui->mainmenu->update_toggles(1); - mwindow->gui->unlock_window(); - mwindow->gwindow->gui->update_toggles(1); - mwindow->gui->lock_window("KeyframePopupHide::handle_event"); - } +int KeyframeHideItem::handle_event() +{ + if( popup->keyframe_autos ) + mwindow->set_auto_visibility(popup->keyframe_autos, 0); return 1; } diff --git a/cinelerra-5.1/cinelerra/keyframepopup.h b/cinelerra-5.1/cinelerra/keyframepopup.h index 21df4abd..bcdd11dc 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.h +++ b/cinelerra-5.1/cinelerra/keyframepopup.h @@ -56,6 +56,7 @@ public: private: KeyframePopupDelete *key_delete; + KeyframePopupHide *key_hide; KeyframePopupShow *key_show; KeyframePopupCopy *key_copy; KeyframePopupEdit *key_edit; @@ -75,6 +76,17 @@ public: KeyframePopupDelete(MWindow *mwindow, KeyframePopup *popup); ~KeyframePopupDelete(); int handle_event(); + + MWindow *mwindow; + KeyframePopup *popup; +}; + +class KeyframePopupHide : public BC_MenuItem +{ +public: + KeyframePopupHide(MWindow *mwindow, KeyframePopup *popup); + ~KeyframePopupHide(); + int handle_event(); MWindow *mwindow; KeyframePopup *popup; @@ -144,10 +156,10 @@ public: Autos *keyframe_autos; }; -class KeyframePopupHide : public BC_MenuItem +class KeyframeHideItem : public BC_MenuItem { public: - KeyframePopupHide(MWindow *mwindow, KeyframeHidePopup *popup); + KeyframeHideItem(MWindow *mwindow, KeyframeHidePopup *popup); int handle_event(); MWindow *mwindow; diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C index fcb79890..27339053 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.C +++ b/cinelerra-5.1/cinelerra/mainmenu.C @@ -165,10 +165,9 @@ void MainMenu::create_objects() keyframemenu->add_item(new ClearKeyframes(mwindow)); keyframemenu->add_item(new StraightenKeyframes(mwindow)); keyframemenu->add_item(new BendKeyframes(mwindow)); - keyframemenu->add_item(keyframe_curve_type = - new KeyframeCurveType(mwindow, - mwindow->edl->local_session->floatauto_type)); + 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(new BC_MenuItem("-")); keyframemenu->add_item(new CopyDefaultKeyframe(mwindow)); keyframemenu->add_item(new PasteDefaultKeyframe(mwindow)); @@ -732,11 +731,10 @@ int BendKeyframes::handle_event() -KeyframeCurveType::KeyframeCurveType(MWindow *mwindow, int curve_type) +KeyframeCurveType::KeyframeCurveType(MWindow *mwindow) : BC_MenuItem(_("Create curve type...")) { this->mwindow = mwindow; - this->curve_type = curve_type; this->curve_menu = 0; } KeyframeCurveType::~KeyframeCurveType() @@ -745,26 +743,28 @@ KeyframeCurveType::~KeyframeCurveType() void KeyframeCurveType::create_objects() { - curve_menu = new KeyframeCurveTypeMenu(this); - mwindow->gui->add_subwindow(curve_menu); + add_submenu(curve_menu = new KeyframeCurveTypeMenu(this)); for( int i=FloatAuto::SMOOTH; i<=FloatAuto::FREE; ++i ) { - curve_menu->add_item(new KeyframeCurveTypeItem(i)); + KeyframeCurveTypeItem *curve_type_item = new KeyframeCurveTypeItem(i, this); + curve_menu->add_submenuitem(curve_type_item); } } -int KeyframeCurveType::handle_event() +void KeyframeCurveType::update(int curve_type) { for( int i=0; itotal_items(); ++i ) { - KeyframeCurveTypeItem *curve_type_item = - (KeyframeCurveTypeItem *)curve_menu->get_item(i); + KeyframeCurveTypeItem *curve_type_item = (KeyframeCurveTypeItem *)curve_menu->get_item(i); curve_type_item->set_checked(curve_type_item->type == curve_type); } - curve_menu->activate_menu(); +} + +int KeyframeCurveType::handle_event() +{ return 1; } KeyframeCurveTypeMenu::KeyframeCurveTypeMenu(KeyframeCurveType *menu_item) - : BC_PopupMenu(0, 0, 0, "", 0) + : BC_SubMenu() { this->menu_item = menu_item; } @@ -772,10 +772,11 @@ KeyframeCurveTypeMenu::~KeyframeCurveTypeMenu() { } -KeyframeCurveTypeItem::KeyframeCurveTypeItem(int type) +KeyframeCurveTypeItem::KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item) : BC_MenuItem(FloatAuto::curve_name(type)) { this->type = type; + this->main_item = main_item; } KeyframeCurveTypeItem::~KeyframeCurveTypeItem() { @@ -783,9 +784,8 @@ KeyframeCurveTypeItem::~KeyframeCurveTypeItem() int KeyframeCurveTypeItem::handle_event() { - KeyframeCurveType *menu_item = ((KeyframeCurveTypeMenu *)get_popup_menu())->menu_item; - menu_item->curve_type = type; - menu_item->mwindow->set_keyframe_type(type); + main_item->update(type); + main_item->mwindow->set_keyframe_type(type); return 1; } diff --git a/cinelerra-5.1/cinelerra/mainmenu.h b/cinelerra-5.1/cinelerra/mainmenu.h index b88768eb..25e20a1a 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.h +++ b/cinelerra-5.1/cinelerra/mainmenu.h @@ -284,18 +284,18 @@ public: class KeyframeCurveType : public BC_MenuItem { public: - KeyframeCurveType(MWindow *mwindow, int curve_type); + KeyframeCurveType(MWindow *mwindow); ~KeyframeCurveType(); void create_objects(); + void update(int curve_type); int handle_event(); MWindow *mwindow; KeyframeCurveTypeMenu *curve_menu; - int curve_type; }; -class KeyframeCurveTypeMenu : public BC_PopupMenu +class KeyframeCurveTypeMenu : public BC_SubMenu { public: KeyframeCurveTypeMenu(KeyframeCurveType *menu_item); @@ -307,11 +307,13 @@ public: class KeyframeCurveTypeItem : public BC_MenuItem { public: - KeyframeCurveTypeItem(int type); + KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item); ~KeyframeCurveTypeItem(); - int handle_event(); + KeyframeCurveType *main_item; int type; + + int handle_event(); }; class CutDefaultKeyframe : public BC_MenuItem diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index de49bcf4..7e44e509 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -21,6 +21,7 @@ #include "asset.h" #include "assets.h" #include "audioalsa.h" +#include "autos.h" #include "awindowgui.h" #include "awindow.h" #include "batchrender.h" @@ -214,7 +215,6 @@ MWindow::MWindow() restart_status = 0; screens = 1; in_destructor = 0; - warn_version = 1; } @@ -796,6 +796,7 @@ void MWindow::init_preferences() BC_Signals::set_trap_hook(trap_hook, this); BC_Signals::set_catch_segv(preferences->trap_sigsegv); BC_Signals::set_catch_intr(preferences->trap_sigintr); + BC_WindowBase::get_resources()->popupmenu_btnup = preferences->popupmenu_btnup; } void MWindow::clean_indexes() @@ -2220,6 +2221,22 @@ void MWindow::set_auto_keyframes(int value, int lock_mwindow, int lock_cwindow) if(lock_cwindow) cwindow->gui->unlock_window(); } +void MWindow::set_auto_visibility(Autos *autos, int value) +{ + if( autos->type == Autos::AUTOMATION_TYPE_PLUGIN ) + edl->session->auto_conf->plugins = value; + else if( autos->autoidx >= 0 ) + edl->session->auto_conf->autos[autos->autoidx] = value; + else + return; + + gui->update(0, 1, 0, 0, 0, 0, 0); + gui->mainmenu->update_toggles(1); + gui->unlock_window(); + gwindow->gui->update_toggles(1); + gui->lock_window("MWindow::set_auto_visibility"); +} + void MWindow::set_keyframe_type(int mode) { gui->lock_window("MWindow::set_keyframe_type"); diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index 5a212213..7628632e 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -28,6 +28,7 @@ #include "asset.inc" #include "assets.inc" #include "audiodevice.inc" +#include "autos.inc" #include "awindow.inc" #include "batchrender.inc" #include "bcwindowbase.inc" @@ -448,6 +449,7 @@ public: void set_automation_mode(int mode); void set_keyframe_type(int mode); void set_auto_keyframes(int value, int lock_mwindow, int lock_cwindow); + void set_auto_visibility(Autos *autos, int value); void set_labels_follow_edits(int value); // Update the editing mode @@ -669,7 +671,6 @@ public: int restart_status; int screens; int in_destructor; - int warn_version; }; #endif diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index 1c6d8b70..5922414c 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -81,6 +81,7 @@ Preferences::Preferences() ffmpeg_marker_indexes = 1; warn_indexes = 1; warn_version = 1; + popupmenu_btnup = 1; dvd_yuv420p_interlace = 0; // Default brender asset @@ -187,6 +188,7 @@ void Preferences::copy_from(Preferences *that) ffmpeg_marker_indexes = that->ffmpeg_marker_indexes; warn_indexes = that->warn_indexes; warn_version = that->warn_version; + popupmenu_btnup = that->popupmenu_btnup; dvd_yuv420p_interlace = that->dvd_yuv420p_interlace; renderfarm_nodes.remove_all_objects(); renderfarm_ports.remove_all(); @@ -335,6 +337,7 @@ int Preferences::load_defaults(BC_Hash *defaults) ffmpeg_marker_indexes = defaults->get("FFMPEG_MARKER_INDEXES", ffmpeg_marker_indexes); warn_indexes = defaults->get("WARN_INDEXES", warn_indexes); warn_version = defaults->get("WARN_VERSION", warn_version); + popupmenu_btnup = defaults->get("POPUPMENU_BTNUP", popupmenu_btnup); dvd_yuv420p_interlace = defaults->get("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace); use_brender = defaults->get("USE_BRENDER", use_brender); brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment); @@ -437,6 +440,7 @@ int Preferences::save_defaults(BC_Hash *defaults) defaults->update("FFMPEG_MARKER_INDEXES", ffmpeg_marker_indexes); defaults->update("WARN_INDEXES", warn_indexes); defaults->update("WARN_VERSION", warn_version); + defaults->update("POPUPMENU_BTNUP", popupmenu_btnup); defaults->update("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace); brender_asset->save_defaults(defaults, "BRENDER_", diff --git a/cinelerra-5.1/cinelerra/preferences.h b/cinelerra-5.1/cinelerra/preferences.h index e5cf23fc..d2c21fc5 100644 --- a/cinelerra-5.1/cinelerra/preferences.h +++ b/cinelerra-5.1/cinelerra/preferences.h @@ -105,6 +105,8 @@ public: // warning int warn_indexes; int warn_version; +// popup menus activate on button release + int popupmenu_btnup; // use dvd yuv420p interlace format int dvd_yuv420p_interlace; diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 8d8e22c7..417f41f7 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -211,6 +211,7 @@ int PreferencesThread::apply_settings() BC_Signals::set_catch_segv(mwindow->preferences->trap_sigsegv); BC_Signals::set_catch_intr(mwindow->preferences->trap_sigintr); + BC_WindowBase::get_resources()->popupmenu_btnup = mwindow->preferences->popupmenu_btnup; mwindow->reset_android_remote(); mwindow->gui->ffmpeg_toggle->update(mwindow->preferences->ffmpeg_early_probe); diff --git a/cinelerra-5.1/cinelerra/recordmonitor.C b/cinelerra-5.1/cinelerra/recordmonitor.C index 7ea18e1d..5ea2f17a 100644 --- a/cinelerra-5.1/cinelerra/recordmonitor.C +++ b/cinelerra-5.1/cinelerra/recordmonitor.C @@ -437,6 +437,16 @@ int RecordMonitorGUI::button_press_event() { if(mwindow->session->rwindow_fullscreen && canvas && canvas->get_canvas()) return canvas->button_press_event_base(canvas->get_canvas()); + + if( get_buttonpress() == 2 ) { + return 0; + } + else +// Right button + if( get_buttonpress() == 3 ) { + monitor_menu->activate_menu(); + return 1; + } return 0; } @@ -456,10 +466,6 @@ int RecordMonitorGUI::cursor_enter_event() int RecordMonitorGUI::button_release_event() { - if( get_buttonpress() == 3 && cursor_inside() ) { - monitor_menu->activate_menu(); - return 1; - } if( canvas && canvas->get_canvas() ) return canvas->button_release_event(); return 0; @@ -856,9 +862,6 @@ RecordMonitorFullsize::RecordMonitorFullsize(MWindow *mwindow, } int RecordMonitorFullsize::handle_event() { - Record *record = window->record; - record->video_zoom = 1.0; - record->record_gui->set_translation(record->video_x, record->video_y, record->video_zoom); return 1; } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index 1c2c50fc..5d5b64fe 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -4217,11 +4217,7 @@ int TrackCanvas::button_release_event() default: - if( !mwindow->session->current_operation ) { - if( get_buttonpress() == 3 ) - result = do_edit_popup(); - } - else { + if(mwindow->session->current_operation) { // if(mwindow->session->current_operation == SELECT_REGION) { // mwindow->undo->update_undo_after(_("select"), LOAD_SESSION, 0, 0); // } @@ -4392,14 +4388,9 @@ int TrackCanvas::do_plugin_handles(int cursor_x, int TrackCanvas::do_tracks(int cursor_x, int cursor_y, int button_press) -{ - return 0; -} - -int TrackCanvas::do_edit_popup() { int result = 0; - int cursor_y = get_cursor_y(); + // if(!mwindow->edl->session->show_assets) return 0; for(Track *track = mwindow->edl->tracks->first; @@ -4408,7 +4399,8 @@ int TrackCanvas::do_edit_popup() int64_t track_x, track_y, track_w, track_h; track_dimensions(track, track_x, track_y, track_w, track_h); - if( cursor_y >= track_y && cursor_y < track_y + track_h ) { + if(button_press && get_buttonpress() == 3 && + cursor_y >= track_y && cursor_y < track_y + track_h) { gui->edit_menu->update(track, 0); gui->edit_menu->activate_menu(); result = 1; diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index cfa9a953..69318d67 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -307,7 +307,6 @@ public: int do_tracks(int cursor_x, int cursor_y, int button_press); - int do_edit_popup(); int test_resources(int cursor_x, int cursor_y); int do_plugins(int cursor_x, int cursor_y, diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 441291d6..9f92fca3 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -352,6 +352,7 @@ if test "x$FATAL_ERROR" != "x"; then AC_MSG_ERROR("fatal eror.") fi CHECK_PROG(PACTL, [pactl]) +WANT_PACTL=$PROG_PACTL AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include ]) if test "$no_utf" = "yes"; then @@ -662,7 +663,7 @@ AC_SUBST(SYSTEM_LIBS) echo "" for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \ - VIDEO4LINUX2 ESOUND; do + VIDEO4LINUX2 ESOUND PACTL; do eval vv="\$WANT_$v" if test "x$vv" != "xno"; then CFG_CFLAGS+=" -DHAVE_$v" diff --git a/cinelerra-5.1/guicast/bcmenu.C b/cinelerra-5.1/guicast/bcmenu.C index 0deeec92..5fef7081 100644 --- a/cinelerra-5.1/guicast/bcmenu.C +++ b/cinelerra-5.1/guicast/bcmenu.C @@ -76,9 +76,9 @@ int BC_Menu::del_item(BC_MenuItem *item) return 0; } -int BC_Menu::total_menuitems() +int BC_Menu::total_items() { - return menu_popup->total_menuitems(); + return menu_popup->total_items(); } int BC_Menu::dispatch_button_press() diff --git a/cinelerra-5.1/guicast/bcmenu.h b/cinelerra-5.1/guicast/bcmenu.h index a6b7e87c..9a528cff 100644 --- a/cinelerra-5.1/guicast/bcmenu.h +++ b/cinelerra-5.1/guicast/bcmenu.h @@ -51,7 +51,7 @@ public: int add_item(BC_MenuItem* menuitem); // Remove the item ptr and the object int del_item(BC_MenuItem* item=0); - int total_menuitems(); + int total_items(); int set_text(char *text); // Called by BC_Menubar diff --git a/cinelerra-5.1/guicast/bcmenupopup.C b/cinelerra-5.1/guicast/bcmenupopup.C index 03068020..1888e6cf 100644 --- a/cinelerra-5.1/guicast/bcmenupopup.C +++ b/cinelerra-5.1/guicast/bcmenupopup.C @@ -134,9 +134,14 @@ int BC_MenuPopup::del_item(BC_MenuItem *item) return 0; } -int BC_MenuPopup::total_menuitems() +BC_MenuItem *BC_MenuPopup::get_item(int i) { - return menu_items.total; + return menu_items[i]; +} + +int BC_MenuPopup::total_items() +{ + return menu_items.size(); } int BC_MenuPopup::dispatch_button_press() @@ -144,7 +149,7 @@ int BC_MenuPopup::dispatch_button_press() int result = 0; if(popup) { - for(int i = 0; i < menu_items.total && !result; i++) + for(int i = 0; i < menu_items.total && !result && popup; i++) { result = menu_items.values[i]->dispatch_button_press(); } @@ -158,7 +163,7 @@ int BC_MenuPopup::dispatch_button_release() int result = 0, redraw = 0; if(popup) { - for(int i = 0; i < menu_items.total && !result; i++) + for(int i = 0; i < menu_items.total && !result && popup; i++) { result = menu_items.values[i]->dispatch_button_release(redraw); } @@ -423,12 +428,7 @@ BC_Popup* BC_MenuPopup::get_popup() int BC_MenuPopup::cursor_inside() { - if( !popup ) return 0; - int x = popup->get_relative_cursor_x(); - if( x < 0 || x > popup->get_w() ) return 0; - int y = popup->get_relative_cursor_y(); - if( y < 0 || y > popup->get_h() ) return 0; - return 1; + return !popup || !popup->cursor_above() ? 0 : 1; } int BC_MenuPopup::get_w() diff --git a/cinelerra-5.1/guicast/bcmenupopup.h b/cinelerra-5.1/guicast/bcmenupopup.h index fdc8d0b0..4145bbed 100644 --- a/cinelerra-5.1/guicast/bcmenupopup.h +++ b/cinelerra-5.1/guicast/bcmenupopup.h @@ -52,8 +52,9 @@ public: BC_PopupMenu *popup_menu); int add_item(BC_MenuItem *item); int del_item(BC_MenuItem* item); + BC_MenuItem *get_item(int i); + int total_items(); int remove_item(BC_MenuItem* item); - int total_menuitems(); // Deactivates all submenus in a downward progression except for the exclude int deactivate_submenus(BC_MenuPopup *exclude = 0); diff --git a/cinelerra-5.1/guicast/bcpopupmenu.C b/cinelerra-5.1/guicast/bcpopupmenu.C index d6b4d15e..0c828146 100644 --- a/cinelerra-5.1/guicast/bcpopupmenu.C +++ b/cinelerra-5.1/guicast/bcpopupmenu.C @@ -67,6 +67,7 @@ BC_PopupMenu::BC_PopupMenu(int x, this->data = data; this->w_argument = w; status = BUTTON_UP; + pending = 0; } BC_PopupMenu::BC_PopupMenu(int x, @@ -88,6 +89,7 @@ BC_PopupMenu::BC_PopupMenu(int x, this->data = data; this->w_argument = -1; status = BUTTON_UP; + pending = 0; } BC_PopupMenu::~BC_PopupMenu() @@ -220,8 +222,7 @@ int BC_PopupMenu::del_item(BC_MenuItem *item) int BC_PopupMenu::total_items() { - return menu_popup->total_menuitems(); - return 0; + return menu_popup->total_items(); } BC_MenuItem* BC_PopupMenu::get_item(int i) @@ -286,7 +287,16 @@ int BC_PopupMenu::deactivate() int BC_PopupMenu::activate_menu() { - if(!popup_down) + if( !get_button_down() || !BC_WindowBase::get_resources()->popupmenu_btnup ) + return menu_activate(); + pending = 1; + return 0; +} + +int BC_PopupMenu::menu_activate() +{ + pending = 0; + if( !popup_down ) { int x = this->x; int y = this->y; @@ -371,10 +381,10 @@ int BC_PopupMenu::button_press_event() // Scrolling section if (is_event_win() && (get_buttonpress() == 4 || get_buttonpress() == 5) - && menu_popup->total_menuitems() > 1 ) + && menu_popup->total_items() > 1 ) { int theval = -1; - for (int i = 0; i < menu_popup->total_menuitems(); i++) { + for (int i = 0; i < menu_popup->total_items(); i++) { if (!strcmp(menu_popup->menu_items.values[i]->get_text(),get_text())) { theval=i; break; @@ -387,8 +397,8 @@ int BC_PopupMenu::button_press_event() if (theval < 0) theval=0; - if (theval >= menu_popup->total_menuitems()) - theval = menu_popup->total_menuitems() - 1; + if (theval >= menu_popup->total_items()) + theval = menu_popup->total_items() - 1; BC_MenuItem *tmp = menu_popup->menu_items.values[theval]; set_text(tmp->get_text()); @@ -409,6 +419,8 @@ int BC_PopupMenu::button_release_event() { // try the title int result = 0; + if( pending ) + return menu_activate(); if(is_event_win() && use_title) { @@ -423,12 +435,12 @@ int BC_PopupMenu::button_release_event() if( !use_title && status == BUTTON_DN ) { result = 1; } - else if(popup_down) { + else if( popup_down && menu_popup->cursor_inside() ) { // Menu is down so dispatch to popup. result = menu_popup->dispatch_button_release(); } // released outside popup - if( !result && popup_down ) { + if( get_resources()->popupmenu_btnup && !result && popup_down ) { deactivate(); result = 1; } @@ -456,8 +468,10 @@ int BC_PopupMenu::cursor_leave_event() // dispatch to popup if( popup_down ) { - if( !get_button_down() && !menu_popup->cursor_inside() ) + if( !get_button_down() && !menu_popup->cursor_inside() ) { + status = BUTTON_UP; deactivate_menu(); + } menu_popup->dispatch_cursor_leave(); } @@ -497,7 +511,7 @@ int BC_PopupMenu::cursor_motion_event() { if(highlighted) { - if(cursor_inside()) + if(!cursor_inside()) { highlighted = 0; draw_title(1); diff --git a/cinelerra-5.1/guicast/bcpopupmenu.h b/cinelerra-5.1/guicast/bcpopupmenu.h index 182ced28..1d683835 100644 --- a/cinelerra-5.1/guicast/bcpopupmenu.h +++ b/cinelerra-5.1/guicast/bcpopupmenu.h @@ -72,6 +72,7 @@ public: int reposition_window(int x, int y); int deactivate(); int activate_menu(); + int menu_activate(); int deactivate_menu(); int focus_out_event(); int repeat_event(int64_t duration); @@ -100,6 +101,7 @@ private: int button_press_x, button_press_y; int w_argument; int status; + int pending; }; diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index 6fc0f5e1..fabb3d65 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -607,6 +607,7 @@ BC_Resources::BC_Resources() popupmenu_margin = 10; + popupmenu_btnup = 1; popupmenu_triangle_margin = 10; min_menu_w = 0; diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index 91199a49..82a3c3be 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -127,6 +127,8 @@ public: int popup_title_text; // Right and left margin for text not including triangle space. int popupmenu_margin; +// post popup on button release event + int popupmenu_btnup; // Right margin for triangle not including text margin. int popupmenu_triangle_margin; // color for item text