popup menu mods/pref, pactl fix
authorGood Guy <good1.2guy@gmail.com>
Thu, 15 Sep 2016 15:21:42 +0000 (09:21 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 15 Sep 2016 15:21:42 +0000 (09:21 -0600)
27 files changed:
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/awindowgui.h
cinelerra-5.1/cinelerra/canvas.C
cinelerra-5.1/cinelerra/canvas.h
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/interfaceprefs.h
cinelerra-5.1/cinelerra/keyframepopup.C
cinelerra-5.1/cinelerra/keyframepopup.h
cinelerra-5.1/cinelerra/mainmenu.C
cinelerra-5.1/cinelerra/mainmenu.h
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/cinelerra/recordmonitor.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/trackcanvas.h
cinelerra-5.1/configure.ac
cinelerra-5.1/guicast/bcmenu.C
cinelerra-5.1/guicast/bcmenu.h
cinelerra-5.1/guicast/bcmenupopup.C
cinelerra-5.1/guicast/bcmenupopup.h
cinelerra-5.1/guicast/bcpopupmenu.C
cinelerra-5.1/guicast/bcpopupmenu.h
cinelerra-5.1/guicast/bcresources.C
cinelerra-5.1/guicast/bcresources.h

index 0a8fcf26566b8ec8417e9d91f85bff069fae5287..ba047200dc5e3115375624660dc1a63916f9d964 100644 (file)
@@ -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);
index 79b41878cb0bfbc6bc2ffdf64d7f1161791dddf5..a1d2b5e5ea6355699852327b84139ca715810493 100644 (file)
@@ -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;
index 38c5abb735c881c13f67027334d1becd77ce4e2c..e749aa7a22b913a83522a6009c652abd988b7d48 100644 (file)
@@ -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));
index 5230c2281f0e1ffa501984a659977f956c77774a..27336588f67f166125b6a13d64dc86056837da22 100644 (file)
@@ -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() { } ;
index cc3e86507ba4a533f1b0de2b03612e7106a416a3..8df5e9938278be2b48a13465183abd00aadcd92c 100644 (file)
@@ -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, 
index e1d6fe352fd03feec648a27e0cdf142d2cd6a36f..15be9d2e34867a60a20a5d11caf99d6fd1646407 100644 (file)
@@ -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:
index 6d2c7370e751ee0abfe8b749794891a00696244e..053dd656332e29699665c91ac9c836efd8520014 100644 (file)
@@ -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;
 }
 
index 21df4abdc8365878c4a3b23323ff458674595590..bcdd11dc146ba945c935e865670d9b5690d8ca87 100644 (file)
@@ -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;
index fcb79890e6890cd727aa21f2173c082c6a76ac9d..273390537a20bb694601267434f6ce7ac975df5e 100644 (file)
@@ -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; i<curve_menu->total_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;
 }
 
index b88768ebab26d464871cfca9c2c2c39df564fc11..25e20a1a014781a77165f80a0f99e88216dd2f70 100644 (file)
@@ -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
index de49bcf436aeead88135ae27e3e7b18bbc71e465..7e44e5098ff9c5069a0e517576d45738a28f4846 100644 (file)
@@ -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");
index 5a21221303a41196095ef0bf17f5f90d06b70983..7628632ea92e409c6661bddf037a8bd3b386ecb2 100644 (file)
@@ -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
index 1c6d8b70699c0da2f47ed629c1a049ab40ba8668..5922414cc3bc8fa7a959cb7053173e4d3a49b196 100644 (file)
@@ -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_",
index e5cf23fc0dd419f60f3595db1c3871ad89a47169..d2c21fc51a3506577d8f73967ffc17ef90db9e2b 100644 (file)
@@ -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;
 
index 8d8e22c79bc2aafe8e16d177ad1b113c21ccf660..417f41f7aac8828a74ceba703f76fcd1a439b942 100644 (file)
@@ -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);
index 7ea18e1dfb1066acf5e0289b9c30449ef31b1fb9..5ea2f17a4257b77e06b9e699f2dc8431346fceee 100644 (file)
@@ -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;
 }
 
index 1c2c50fc6d36bc8f4fefaa4ae64f7efb839c90c3..5d5b64fe1908dfd8c28208459c82bb06745ff91d 100644 (file)
@@ -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;
index cfa9a9539501d81be4160e0716e8c5b42ff55fa2..69318d67e58db9d05dca00d7588979252f66b26f 100644 (file)
@@ -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,
index 441291d6e66ec6779df0557910eef80cc6d3c412..9f92fca3e070af793b3dd6762a9b82b51899a626 100644 (file)
@@ -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 <X11/Xlib.h>])
 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"
index 0deeec924b0d283f4a7d9a53d00a30f36ce55bb0..5fef708106bb9c2b63b7bce87f5182f9abc99437 100644 (file)
@@ -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()
index a6b7e87c5f314c71381bacf1dc3df1f84fc4f02e..9a528cff16ef3f5aef068bb1df2a787979dea3ce 100644 (file)
@@ -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
index 03068020e204ae572b6766e071f39d1b7623b537..1888e6cfdf514dfe9562bb0c5358dea8cd9a0917 100644 (file)
@@ -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()
index fdc8d0b0fb3d4e296e9df5e356fa5bb663c0e4c7..4145bbed97c9e53dced26af60e17c5196e0ac9b7 100644 (file)
@@ -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);
index d6b4d15eec052d5344cabee197d262920284fca1..0c8281469610f702cd44029b841630e3fad1960f 100644 (file)
@@ -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);
index 182ced28b4871bdb6cdd1e14fbf7a356132df380..1d683835c0d2f0020ae5e2904b0e79d22f6942ee 100644 (file)
@@ -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;
 };
 
 
index 6fc0f5e1bcfb7cc2a2cd813614a70cc00dab634e..fabb3d65e75d7255eea3af2ce30f6983ceae8323 100644 (file)
@@ -607,6 +607,7 @@ BC_Resources::BC_Resources()
 
 
        popupmenu_margin = 10;
+       popupmenu_btnup = 1;
        popupmenu_triangle_margin = 10;
 
        min_menu_w = 0;
index 91199a490bb12a568a7a09142395abd5281f5f99..82a3c3be65ad5e36a3359e20d0f3c6e51111399d 100644 (file)
@@ -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