alt transport keys, snap editing, grab focus, inv hilight clr, subtitle fix
authorGood Guy <good1.2guy@gmail.com>
Tue, 3 Oct 2017 21:08:30 +0000 (15:08 -0600)
committerGood Guy <good1.2guy@gmail.com>
Tue, 3 Oct 2017 21:08:30 +0000 (15:08 -0600)
22 files changed:
cinelerra-5.1/cinelerra/appearanceprefs.C
cinelerra-5.1/cinelerra/appearanceprefs.h
cinelerra-5.1/cinelerra/editpanel.C
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/maincursor.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/mwindowmove.C
cinelerra-5.1/cinelerra/playtransport.C
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/cinelerra/proxy.C
cinelerra-5.1/cinelerra/swindow.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/guicast/bcresources.C
cinelerra-5.1/guicast/bcresources.h
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/guicast/bcwindowbase.h
cinelerra-5.1/po/de.po

index a865db1ea5927353570486a86fbbe074eca265f1..46badb85276be26b9a0c7e14bdfdcf0bc6b45558 100644 (file)
@@ -139,6 +139,13 @@ void AppearancePrefs::create_objects()
        add_subwindow(seconds = new TimeFormatSeconds(pwindow, this,
                pwindow->thread->edl->session->time_format == TIME_SECONDS,
                x, y));
+       x = x0;
+       y += 35;
+       add_subwindow(title = new BC_Title(x, y, _("Highlighting Inversion color:")));
+       x += title->get_w() + margin;
+       char hex_color[BCSTRLEN];
+       sprintf(hex_color, "%06x", preferences->highlight_inverse);
+        add_subwindow(new HighlightInverseColor(pwindow, x, y, hex_color));
        y += 35;
 
        UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1);
@@ -156,6 +163,9 @@ void AppearancePrefs::create_objects()
        PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
        add_subwindow(pop_win);
        y1 += pop_win->get_h() + 5;
+       GrabFocusPolicy *grab_input_focus = new GrabFocusPolicy(pwindow, x1, y1);
+       add_subwindow(grab_input_focus);
+       y1 += grab_input_focus->get_h() + 5;
        ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1);
        add_subwindow(focus_activate);
        y1 += focus_activate->get_h() + 5;
@@ -439,6 +449,19 @@ int PopupMenuBtnup::handle_event()
        return 1;
 }
 
+GrabFocusPolicy::GrabFocusPolicy(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, (pwindow->thread->preferences->grab_input_focus) != 0,
+       _("Set Input Focus when window entered"))
+{
+       this->pwindow = pwindow;
+}
+
+int GrabFocusPolicy::handle_event()
+{
+       pwindow->thread->preferences->grab_input_focus = get_value();
+       return 1;
+}
+
 ActivateFocusPolicy::ActivateFocusPolicy(PreferencesWindow *pwindow, int x, int y)
  : BC_CheckBox(x, y, (pwindow->thread->preferences->textbox_focus_policy & CLICK_ACTIVATE) != 0,
        _("Click to activate text focus"))
@@ -484,3 +507,17 @@ int ForwardRenderDisplacement::handle_event()
        return 1;
 }
 
+HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex)
+ : BC_TextBox(x, y, 80, 1, hex)
+{
+       this->pwindow = pwindow;
+}
+
+int HighlightInverseColor::handle_event()
+{
+       int inverse_color = strtoul(get_text(),0,16);
+       inverse_color &= 0xffffff;
+       pwindow->thread->preferences->highlight_inverse = inverse_color;
+       return 1;
+}
+
index 9e0e05ae2f391bec35ac9ca185641ea2bb623466..7fbeeb9259b50f6d40cc0badcb2a682200abf6ec 100644 (file)
@@ -211,6 +211,14 @@ public:
        PreferencesWindow *pwindow;
 };
 
+class GrabFocusPolicy : public BC_CheckBox
+{
+public:
+       GrabFocusPolicy(PreferencesWindow *pwindow, int x, int y);
+       int handle_event();
+       PreferencesWindow *pwindow;
+};
+
 class ActivateFocusPolicy : public BC_CheckBox
 {
 public:
@@ -235,5 +243,12 @@ public:
        PreferencesWindow *pwindow;
 };
 
+class HighlightInverseColor : public BC_TextBox
+{
+public:
+       HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex);
+       int handle_event();
+       PreferencesWindow *pwindow;
+};
 
 #endif
index 8de70d83341aa62c585592fb4d6cc2d5a0e45fc8..df2e7b1ce4b1c58955c5cb3cb694b046df97a1b7 100644 (file)
@@ -339,6 +339,8 @@ void EditPanel::toggle_label()
 void EditPanel::prev_label()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->ctrl_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -355,7 +357,10 @@ void EditPanel::prev_label()
 
        mwindow->gui->lock_window("EditPanel::prev_label 2");
 
-       mwindow->prev_label(shift_down);
+       if( snap )
+               mwindow->snap_left_label();
+       else
+               mwindow->prev_label(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -364,6 +369,8 @@ void EditPanel::prev_label()
 void EditPanel::next_label()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->ctrl_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -380,7 +387,10 @@ void EditPanel::next_label()
 
        mwindow->gui->lock_window("EditPanel::next_label 2");
 
-       mwindow->next_label(shift_down);
+       if( snap )
+               mwindow->snap_right_label();
+       else
+               mwindow->next_label(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -391,6 +401,8 @@ void EditPanel::next_label()
 void EditPanel::prev_edit()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->ctrl_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -407,7 +419,10 @@ void EditPanel::prev_edit()
 
        mwindow->gui->lock_window("EditPanel::prev_edit 2");
 
-       mwindow->prev_edit_handle(shift_down);
+       if( snap )
+               mwindow->snap_left_edit();
+       else
+               mwindow->prev_edit_handle(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -416,6 +431,8 @@ void EditPanel::prev_edit()
 void EditPanel::next_edit()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->ctrl_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -432,7 +449,10 @@ void EditPanel::next_edit()
 
        mwindow->gui->lock_window("EditPanel::next_edit 2");
 
-       mwindow->next_edit_handle(shift_down);
+       if( snap )
+               mwindow->snap_right_edit();
+       else
+               mwindow->next_edit_handle(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -705,7 +725,7 @@ EditNextLabel::~EditNextLabel()
 }
 int EditNextLabel::keypress_event()
 {
-       if(get_keypress() == RIGHT && ctrl_down())
+       if( ctrl_down() && get_keypress() == (!alt_down() ? RIGHT : '>') )
                return handle_event();
        return 0;
 }
@@ -732,7 +752,7 @@ EditPrevLabel::~EditPrevLabel()
 }
 int EditPrevLabel::keypress_event()
 {
-       if(get_keypress() == LEFT && ctrl_down())
+       if( ctrl_down() && get_keypress() == (!alt_down() ? LEFT : '<') )
                return handle_event();
        return 0;
 }
@@ -761,7 +781,7 @@ EditNextEdit::~EditNextEdit()
 }
 int EditNextEdit::keypress_event()
 {
-       if(get_keypress() == RIGHT && alt_down())
+       if( alt_down() && get_keypress() == (!ctrl_down() ? RIGHT : '.') )
                return handle_event();
        return 0;
 }
@@ -788,7 +808,7 @@ EditPrevEdit::~EditPrevEdit()
 }
 int EditPrevEdit::keypress_event()
 {
-       if(get_keypress() == LEFT && alt_down())
+       if( alt_down() && get_keypress() == (!ctrl_down() ? LEFT : ',') )
                return handle_event();
        return 0;
 }
@@ -874,7 +894,7 @@ int EditToClip::handle_event()
 
 int EditToClip::keypress_event()
 {
-       if(get_keypress() == 'i')
+       if(get_keypress() == 'i' && !alt_down())
        {
                handle_event();
                return 1;
@@ -1186,7 +1206,7 @@ EditLabelbutton::~EditLabelbutton()
 }
 int EditLabelbutton::keypress_event()
 {
-       if(get_keypress() == 'l')
+       if(get_keypress() == 'l' && !alt_down())
                return handle_event();
        return 0;
 }
index 5d9ff496238e1f15727fe154c333bf04ae015786..134aa8c9641f0faaa1407cf4e30da16d7c15a1b1 100644 (file)
@@ -1549,3 +1549,51 @@ void EDL::append_vwindow_edl(EDL *edl, int increase_counter)
 }
 
 
+double EDL::next_edit(double position)
+{
+       Units::fix_double(&position);
+       double new_position = INFINITY;
+
+       double max_rate = get_frame_rate();
+       int sample_rate = get_sample_rate();
+       if( sample_rate > max_rate ) max_rate = sample_rate;
+       double min_movement = max_rate > 0 ? 1. / max_rate : 1e-6;
+
+// Test for edit handles after position
+       for( Track *track=tracks->first; track; track=track->next ) {
+               if( !track->record ) continue;
+               for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                       double edit_end = track->from_units(edit->startproject + edit->length);
+                       Units::fix_double(&edit_end);
+                       if( fabs(edit_end-position) < min_movement ) continue;
+                       if( edit_end > position && edit_end < new_position )
+                               new_position = edit_end;
+               }
+       }
+       return new_position;
+}
+
+double EDL::prev_edit(double position)
+{
+       Units::fix_double(&position);
+       double new_position = -1;
+
+       double max_rate = get_frame_rate();
+       int sample_rate = get_sample_rate();
+       if( sample_rate > max_rate ) max_rate = sample_rate;
+       double min_movement = max_rate > 0 ? 1. / max_rate : 1e-6;
+
+// Test for edit handles before cursor position
+       for( Track *track=tracks->first; track; track=track->next ) {
+               if( !track->record ) continue;
+               for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                       double edit_end = track->from_units(edit->startproject);
+                       Units::fix_double(&edit_end);
+                       if( fabs(edit_end-position) < min_movement ) continue;
+                       if( edit_end < position && edit_end > new_position )
+                               new_position = edit_end;
+               }
+       }
+       return new_position;
+}
+
index 0000e3f730a90164614ceb59b91b677e29b3e613..3b1d22538726dad9422534d3fcc430cd33b8f194 100644 (file)
@@ -132,6 +132,9 @@ public:
 // Add assets from the src to the destination
        void update_assets(EDL *src);
        void optimize();
+// return next/prev edit starting from position
+       double next_edit(double position);
+       double prev_edit(double position);
 // Debug
        int dump(FILE *fp=stdout);
        static int next_id();
index 974cf52c7077a4e94124faf37390479c5ab89d5e..4c3c559053da2ab36d448aaf79948b2d90203d07 100644 (file)
@@ -26,6 +26,7 @@
 #include "maincursor.h"
 #include "mwindow.h"
 #include "mwindowgui.h"
+#include "preferences.h"
 #include "timelinepane.h"
 #include "trackcanvas.h"
 
@@ -132,7 +133,7 @@ void MainCursor::draw(int do_plugintoggles)
 //printf("MainCursor::draw 2\n");
        }
 
-       pane->canvas->set_color(WHITE);
+       pane->canvas->set_color(mwindow->preferences->highlight_inverse);
        pane->canvas->set_inverse();
        pane->canvas->draw_box(pixel1, 0, pixel2 - pixel1 + 1, pane->canvas->get_h());
        pane->canvas->set_opaque();
index 633af24ad9e45ca582c0fe0165518944b978bf75..1aa06bacab9eecb97a2f23c6a231638ff57c69da 100644 (file)
@@ -896,6 +896,7 @@ void MWindow::init_preferences()
        }
        BC_WindowBase::get_resources()->popupmenu_btnup = preferences->popupmenu_btnup;
        BC_WindowBase::get_resources()->textbox_focus_policy = preferences->textbox_focus_policy;
+       BC_WindowBase::get_resources()->grab_input_focus = preferences->grab_input_focus;
 }
 
 void MWindow::clean_indexes()
index 2ada7db3b9ec2ebe55d25d517fd118565ce332e4..e700e71f675f718987e635051a5de43599091225 100644 (file)
@@ -323,6 +323,12 @@ public:
        void copy();
        int copy(double start, double end);
        void cut();
+       void cut(double start, double end, double new_position=-1);
+// snap off edit from current position to handle/label
+       void snap_left_edit();
+       void snap_right_edit();
+       void snap_left_label();
+       void snap_right_label();
 
 // Calculate aspect ratio from pixel counts
        static int create_aspect_ratio(float &w, float &h, int width, int height);
index 9d1a9dfcca130969e55d69b7a0ed56ebc02e7c63..36b8269bda42d4919ab0d548b09ae2aa5a37f0f9 100644 (file)
@@ -512,11 +512,14 @@ void MWindow::crop_video()
 
 void MWindow::cut()
 {
-       undo->update_undo_before();
-
        double start = edl->local_session->get_selectionstart();
        double end = edl->local_session->get_selectionend();
+       cut(start, end);
+}
 
+void MWindow::cut(double start, double end, double new_position)
+{
+       undo->update_undo_before();
        copy(start, end);
        edl->clear(start, end,
                edl->session->labels_follow_edits,
@@ -527,7 +530,10 @@ void MWindow::cut()
        edl->optimize();
        save_backup();
        undo->update_undo_after(_("cut"), LOAD_EDITS | LOAD_TIMEBAR);
-
+       if( new_position >= 0 ) {
+               edl->local_session->set_selectionstart(new_position);
+               edl->local_session->set_selectionend(new_position);
+       }
        restart_brender();
        update_plugin_guis();
        gui->update(1, 2, 1, 1, 1, 1, 0);
@@ -536,6 +542,42 @@ void MWindow::cut()
                send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
 }
 
+void MWindow::snap_left_edit()
+{
+       double start_pos = edl->local_session->get_selectionstart();
+       double position = edl->prev_edit(start_pos);
+       if( position < start_pos )
+               cut(position, start_pos, position);
+}
+
+void MWindow::snap_right_edit()
+{
+       double end_pos = edl->local_session->get_selectionend();
+       double position = edl->next_edit(end_pos);
+       if( end_pos < position )
+               cut(end_pos, position, end_pos);
+}
+
+void MWindow::snap_left_label()
+{
+       double start_pos = edl->local_session->get_selectionstart();
+       Label *left_label = edl->labels->prev_label(start_pos);
+       if( !left_label ) return;
+       double position = left_label->position;
+       if( position < start_pos )
+               cut(position, start_pos, position);
+}
+
+void MWindow::snap_right_label()
+{
+       double end_pos = edl->local_session->get_selectionend();
+       Label *right_label = edl->labels->next_label(end_pos);
+       if( !right_label ) return;
+       double position = right_label->position;
+       if( end_pos < position )
+               cut(end_pos, position, end_pos);
+}
+
 int MWindow::cut_automation()
 {
        undo->update_undo_before();
index 08a623f8f0a454cdad59e0624b6114cb81e0210c..47bc2f1a201e853cc3f3eba68b5d8254fe2e3758 100644 (file)
@@ -595,13 +595,10 @@ int MWindow::next_label(int shift_down)
                TimelinePane *pane = gui->get_focused_pane();
                if(edl->local_session->get_selectionend(1) >=
                        (double)edl->local_session->view_start[pane->number] *
-                               edl->local_session->zoom_sample /
-                               edl->session->sample_rate +
+                               edl->local_session->zoom_sample / edl->session->sample_rate +
                                pane->canvas->time_visible() ||
                        edl->local_session->get_selectionend(1) < (double)edl->local_session->view_start[pane->number] *
-                               edl->local_session->zoom_sample /
-                               edl->session->sample_rate)
-               {
+                               edl->local_session->zoom_sample / edl->session->sample_rate) {
                        samplemovement((int64_t)(edl->local_session->get_selectionend(1) *
                                edl->session->sample_rate /
                                edl->local_session->zoom_sample -
@@ -650,14 +647,10 @@ int MWindow::prev_label(int shift_down)
                update_plugin_guis();
                TimelinePane *pane = gui->get_focused_pane();
                if(edl->local_session->get_selectionstart(1) >= edl->local_session->view_start[pane->number] *
-                       edl->local_session->zoom_sample /
-                       edl->session->sample_rate +
-                       pane->canvas->time_visible()
-               ||
+                       edl->local_session->zoom_sample / edl->session->sample_rate +
+                       pane->canvas->time_visible() ||
                        edl->local_session->get_selectionstart(1) < edl->local_session->view_start[pane->number] *
-                       edl->local_session->zoom_sample /
-                       edl->session->sample_rate)
-               {
+                       edl->local_session->zoom_sample / edl->session->sample_rate ) {
                        samplemovement((int64_t)(edl->local_session->get_selectionstart(1) *
                                edl->session->sample_rate /
                                edl->local_session->zoom_sample -
@@ -686,40 +679,11 @@ int MWindow::prev_label(int shift_down)
 }
 
 
-
-
-
-
 int MWindow::next_edit_handle(int shift_down)
 {
        double position = edl->local_session->get_selectionend(1);
-       Units::fix_double(&position);
-       double new_position = INFINITY;
-
-       double max_rate = edl->get_frame_rate();
-       int sample_rate = edl->get_sample_rate();
-       if( sample_rate > max_rate ) max_rate = sample_rate;
-       double min_movement = max_rate > 0 ? 1. / max_rate : 1e-6;
-
-// Test for edit handles after cursor position
-       for (Track *track = edl->tracks->first; track; track = track->next)
-       {
-               if (track->record)
-               {
-                       for (Edit *edit = track->edits->first; edit; edit = edit->next)
-                       {
-                               double edit_end = track->from_units(edit->startproject + edit->length);
-                               Units::fix_double(&edit_end);
-                               if( fabs(edit_end-position) < min_movement ) continue;
-                               if (edit_end > position && edit_end < new_position)
-                                       new_position = edit_end;
-                       }
-               }
-       }
-
-       if(new_position != INFINITY)
-       {
-
+       double new_position = edl->next_edit(position);
+       if(new_position != INFINITY) {
                edl->local_session->set_selectionend(new_position);
 //printf("MWindow::next_edit_handle %d\n", shift_down);
                if(!shift_down)
@@ -766,33 +730,9 @@ int MWindow::next_edit_handle(int shift_down)
 int MWindow::prev_edit_handle(int shift_down)
 {
        double position = edl->local_session->get_selectionstart(1);
-       double new_position = -1;
-       Units::fix_double(&position);
-
-       double max_rate = edl->get_frame_rate();
-       int sample_rate = edl->get_sample_rate();
-       if( sample_rate > max_rate ) max_rate = sample_rate;
-       double min_movement = max_rate > 0 ? 1. / max_rate : 1e-6;
-
-// Test for edit handles before cursor position
-       for (Track *track = edl->tracks->first; track; track = track->next)
-       {
-               if (track->record)
-               {
-                       for (Edit *edit = track->edits->first; edit; edit = edit->next)
-                       {
-                               double edit_end = track->from_units(edit->startproject);
-                               Units::fix_double(&edit_end);
-                               if( fabs(edit_end-position) < min_movement ) continue;
-                               if (edit_end < position && edit_end > new_position)
-                                       new_position = edit_end;
-                       }
-               }
-       }
-
-       if(new_position != -1)
-       {
+       double new_position = edl->prev_edit(position);
 
+       if(new_position != -1) {
                edl->local_session->set_selectionstart(new_position);
 //printf("MWindow::next_edit_handle %d\n", shift_down);
                if(!shift_down)
index 7ffb853248bd80adc435f42824330aa8d3e1a657..6fc55d63d376f12fefd1d68dff011764b8344e2f 100644 (file)
@@ -193,12 +193,13 @@ int PlayTransport::keypress_event()
 
        int toggle_audio = subwindow->shift_down() ? 1 : 0;
        int use_inout = subwindow->ctrl_down() ? 1 : 0;
+       int alt_key = subwindow->alt_down() ? 1 : 0;
        int command = -1, prev_command = engine->command->command;
        using_inout = use_inout;
        subwindow->unlock_window();
 
+       result = 0;
        switch( key ) {
-       case 'k':
        case KPINS:     command = STOP;                 break;
        case KPPLUS:    command = FAST_REWIND;          break;
        case KP6:       command = NORMAL_REWIND;        break;
@@ -221,12 +222,38 @@ int PlayTransport::keypress_event()
                        break;
                }
                break;
-       default:
-               result = 0;
+       case 'u': case 'U':
+               if( alt_key ) command = SINGLE_FRAME_REWIND;
+               break;
+       case 'i': case 'I':
+               if( alt_key ) command = SLOW_REWIND;
+               break;
+       case 'o': case 'O':
+               if( alt_key ) command = NORMAL_REWIND;
+               break;
+       case 'p': case 'P':
+               if( alt_key ) command = FAST_REWIND;
+               break;
+       case 'j': case 'J':
+               if( alt_key ) command = SINGLE_FRAME_FWD;
+               break;
+       case 'k': case 'K':
+               if( alt_key ) command = SLOW_FWD;
+               break;
+       case 'l': case 'L':
+               if( alt_key ) command = NORMAL_FWD;
+               break;
+       case ':': case ';':
+               if( alt_key ) command = FAST_FWD;
+               break;
+       case 'm': case 'M':
+               if( alt_key ) command = STOP;
                break;
        }
-       if( command >= 0 )
+       if( command >= 0 ) {
                handle_transport(command, 0, use_inout, 1, toggle_audio);
+               result = 1;
+       }
 
        subwindow->lock_window("PlayTransport::keypress_event 5");
        return result;
index 5fb48ad633a3c5c278a90d4b292cbdec17d6eb8b..ee7c5d180f5a0890ebcf4b295eac09bba9e60a0c 100644 (file)
@@ -84,9 +84,11 @@ Preferences::Preferences()
        warn_version = 1;
        bd_warn_root = 1;
        popupmenu_btnup = 1;
+       grab_input_focus = 1;
        textbox_focus_policy = 0;
        forward_render_displacement = 0;
        dvd_yuv420p_interlace = 0;
+       highlight_inverse = 0xffffff;
 
 // Default brender asset
        brender_asset = new Asset;
@@ -199,9 +201,11 @@ void Preferences::copy_from(Preferences *that)
        warn_version = that->warn_version;
        bd_warn_root = that->bd_warn_root;
        popupmenu_btnup = that->popupmenu_btnup;
+       grab_input_focus = that->grab_input_focus;
        textbox_focus_policy = that->textbox_focus_policy;
        forward_render_displacement = that->forward_render_displacement;
        dvd_yuv420p_interlace = that->dvd_yuv420p_interlace;
+       highlight_inverse = that->highlight_inverse;
        renderfarm_nodes.remove_all_objects();
        renderfarm_ports.remove_all();
        renderfarm_enabled.remove_all();
@@ -353,9 +357,11 @@ int Preferences::load_defaults(BC_Hash *defaults)
        warn_version = defaults->get("WARN_VERSION", warn_version);
        bd_warn_root = defaults->get("BD_WARN_ROOT", bd_warn_root);
        popupmenu_btnup = defaults->get("POPUPMENU_BTNUP", popupmenu_btnup);
+       grab_input_focus = defaults->get("GRAB_FOCUS", grab_input_focus);
        textbox_focus_policy = defaults->get("TEXTBOX_FOCUS_POLICY", textbox_focus_policy);
        forward_render_displacement = defaults->get("FORWARD_RENDER_DISPLACEMENT", forward_render_displacement);
        dvd_yuv420p_interlace = defaults->get("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
+       highlight_inverse = defaults->get("HIGHLIGHT_INVERSE", highlight_inverse);
        use_brender = defaults->get("USE_BRENDER", use_brender);
        brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment);
        cache_size = defaults->get("CACHE_SIZE", cache_size);
@@ -483,9 +489,11 @@ int Preferences::save_defaults(BC_Hash *defaults)
        defaults->update("WARN_VERSION", warn_version);
        defaults->update("BD_WARN_ROOT", bd_warn_root);
        defaults->update("POPUPMENU_BTNUP", popupmenu_btnup);
+       defaults->update("GRAB_FOCUS", grab_input_focus);
        defaults->update("TEXTBOX_FOCUS_POLICY", textbox_focus_policy);
        defaults->update("FORWARD_RENDER_DISPLACEMENT", forward_render_displacement);
        defaults->update("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
+       defaults->update("HIGHLIGHT_INVERSE", highlight_inverse);
        brender_asset->save_defaults(defaults, "BRENDER_", 1, 1, 1, 0, 0);
        defaults->update("USE_BRENDER", use_brender);
        defaults->update("BRENDER_FRAGMENT", brender_fragment);
index 779363a324a55367875cbff1c79df7621b982181..ac0784b53404f884b2981c84138ce0472e82507c 100644 (file)
@@ -110,6 +110,8 @@ public:
        int warn_indexes;
        int warn_version;
        int bd_warn_root;
+// grab input focus on enter notify
+       int grab_input_focus;
 // popup menus activate on button release
        int popupmenu_btnup;
 // textbox focus policy: click, leave
@@ -118,6 +120,8 @@ public:
        int forward_render_displacement;
 // use dvd yuv420p interlace format
        int dvd_yuv420p_interlace;
+// highlight inversion color
+       int highlight_inverse;
 
 // Default positions for channels
        int channel_positions[MAXCHANNELS * MAXCHANNELS];
index b7c46fd5047e7e39c7096afa1726ac5e578295bb..dbda188f782fa605f920ad5f76e8d7dd9b4dd7c0 100644 (file)
@@ -223,6 +223,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;
+       BC_WindowBase::get_resources()->grab_input_focus = mwindow->preferences->grab_input_focus;
        BC_WindowBase::get_resources()->textbox_focus_policy = mwindow->preferences->textbox_focus_policy;
        if( mwindow->preferences->trap_sigsegv || mwindow->preferences->trap_sigintr ) {
                BC_Trace::enable_locks();
index d8ef2420ce41d8d160b5a4eeadb039528c90c2e9..faafc8005f36ab2d533e093fa3ed602c3ebb6bb1 100644 (file)
@@ -51,7 +51,7 @@
 #define MAX_SCALE 16
 
 ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
- : BC_MenuItem(_("Proxy settings..."),  _("Alt-P"), 'p')
+ : BC_MenuItem(_("Proxy settings..."),  _("Alt-r"), 'r')
 {
        this->mwindow = mwindow;
        set_alt();
index 1d33f4b15224e166b8f3293a2c3e649391e8d55a..fd173764f8eab5d61e4d4218c986e0a3af099422 100644 (file)
@@ -356,6 +356,7 @@ void SWindowGUI::set_script_pos(int64_t entry_no, int text_no)
 
 int SWindowGUI::load_selection(int pos, int row)
 {
+       if( pos < 0 || pos >= script.size() ) return 1;
        ScriptLines *texts = script[pos];
        char *rp = texts->get_text_row(row);
        if( !rp || *rp == '=' || *rp == '*' || *rp=='\n' ) return 1;
index e79654d4c9ab82a98f8c4cb2a1c8139f56b4c564..a0ba9f27a4c406391329bb31d50d85c5719ef855 100644 (file)
@@ -1277,7 +1277,7 @@ void TrackCanvas::draw_highlight_rectangle(int x, int y, int w, int h)
        h = MIN(h, get_h() + 20);
        if(w > 0 && h > 0)
        {
-               set_color(WHITE);
+               set_color(mwindow->preferences->highlight_inverse);
                set_inverse();
                //draw_rectangle(x, y, w, h);
                draw_rectangle(x + 1, y + 1, w - 2, h - 2);
@@ -1339,7 +1339,7 @@ void TrackCanvas::draw_highlight_insertion(int x, int y, int w, int h)
        }
        w = MIN(w, get_w() + 20);
        h = MIN(h, get_h() + 20);
-       set_color(WHITE);
+       set_color(mwindow->preferences->highlight_inverse);
        set_inverse();
        draw_rectangle(x, y, w, h);
        draw_rectangle(x + 1, y + 1, w - 2, h - 2);
@@ -4658,6 +4658,7 @@ int TrackCanvas::button_press_event()
        int result = 0;
        int cursor_x, cursor_y;
        int new_cursor;
+       double start_position = mwindow->edl->local_session->get_selectionstart(1);
 
        cursor_x = get_cursor_x();
        cursor_y = get_cursor_y();
@@ -4814,6 +4815,23 @@ int TrackCanvas::button_press_event()
                        gui->flash_canvas(1);
                }
        }
+// if snapping to selection point
+       if( gui->ctrl_down() && gui->alt_down() ) {
+               switch( mwindow->session->current_operation ) {
+               case DRAG_EDITHANDLE1:
+                       mwindow->session->drag_position = start_position;
+                       mwindow->session->current_operation = NO_OPERATION;
+                       drag_scroll = 0;
+                       end_edithandle_selection();
+                       break;
+               case DRAG_PLUGINHANDLE1:
+                       mwindow->session->drag_position = start_position;
+                       mwindow->session->current_operation = NO_OPERATION;
+                       drag_scroll = 0;
+                       end_pluginhandle_selection();
+                       break;
+               }
+       }
        return result;
 }
 
index b51843b11232047a2f229fbd2a9c76b0260da955..e3769675d030ed9eb8f7b113de99c73f2f6d9e9f 100644 (file)
@@ -642,8 +642,7 @@ new_vframes(20,default_medium_7segment,
        menu_item_text = BLACK;
        menu_highlighted_fontcolor = BLACK;
        progress_text = BLACK;
-
-
+       grab_input_focus = 1;
 
        text_default = BLACK;
        highlight_inverse = WHITE ^ BLUE;
index 978425aeb86a7635fc07af00392e752284e6ec0e..1f2037bd1747f6b6531204c4042a4a7d33122767 100644 (file)
@@ -139,7 +139,8 @@ public:
 
 // color for progress text
        int progress_text;
-
+// set focus on enter
+       int grab_input_focus;
 
        int menu_highlighted_fontcolor;
 
index 5909aced83e841ac9b33925f1b2c442b48ee6be9..ec7507683bf04eef3136f014b3e88f169b4564b1 100644 (file)
@@ -296,6 +296,7 @@ int BC_WindowBase::initialize()
        active_menubar = 0;
        active_popup_menu = 0;
        active_subwindow = 0;
+       cursor_entered = 0;
        pixmap = 0;
        bg_pixmap = 0;
        _7segment_pixmaps = 0;
@@ -1325,11 +1326,20 @@ locking_message = event->xclient.message_type;
                break;
 
        case LeaveNotify:
+               if( cursor_entered && event->xcrossing.window == win ) {
+                       cursor_entered = 0;
+               }
                event_win = event->xany.window;
                dispatch_cursor_leave();
                break;
 
        case EnterNotify:
+               if( !cursor_entered && event->xcrossing.window == win ) {
+                       if( !event->xcrossing.focus && get_resources()->grab_input_focus ) {
+                               XSetInputFocus(display, win, RevertToParent, CurrentTime);
+                       }
+                       cursor_entered = 1;
+               }
                event_win = event->xany.window;
                cursor_x = event->xcrossing.x;
                cursor_y = event->xcrossing.y;
index 3029e16ea6440d068061ab96a4b273d55534be47..263fa657c864b978970fc57e1526f30d27e462a3 100644 (file)
@@ -674,6 +674,8 @@ private:
        int video_on;
 // Event handler completion
        int done, done_set, window_running;
+// Enter/Leave notify state
+       int cursor_entered;
 // Return value of event handler
        int return_value;
 // Motion event compression
index 26c6e964492001e820dd66d3a05829147f292336..c882d22310e4d8b96a759016f9ced597b6db2912 100644 (file)
@@ -10453,12 +10453,12 @@ msgstr "proxy"
 msgid "Cinelerra: Proxy settings"
 msgstr "Cinelerra: Proxy-Einstellungen"
 msgid "Use scaler   (FFMPEG only)"
-msgstr "Verwenden scaler   (Nur FFMPEG)"
+msgstr "Scaler verwenden   (Nur FFMPEG)"
 msgid "Original size"
 msgstr "Urspr. größe"
 msgid "New media dimensions: "
-msgstr "Neue medien abmessungen: "
+msgstr "Neue Medienabmessungen. "
 msgid "Auto proxy/scale media loads"
-msgstr "Automatisch proxy/scalieren medien laden"
+msgstr "Automatisch neu geladene Medien skalieren"
 msgid "Creating proxy files..."
 msgstr "Dateien proxy erstelle..."