change cv to gg, silence select bug fix, update ffmpeg.opts, update msg+Features5
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mwindowgui.C
index 89ddbccef325bdecc00824de2ec1f23a752159db..2b59a6361279e285891bf262ca0117baca25adf2 100644 (file)
@@ -36,6 +36,7 @@
 #include "edl.h"
 #include "edlsession.h"
 #include "filesystem.h"
+#include "filexml.h"
 #include "keyframepopup.h"
 #include "keys.h"
 #include "language.h"
@@ -1007,6 +1008,7 @@ int MWindowGUI::drag_motion()
 
        if( mwindow->session->current_operation == DRAG_ASSET ||
            mwindow->session->current_operation == DRAG_EDIT ||
+           mwindow->session->current_operation == DRAG_GROUP ||
            mwindow->session->current_operation == DRAG_AEFFECT_COPY ||
            mwindow->session->current_operation == DRAG_VEFFECT_COPY )
         {
@@ -1170,9 +1172,17 @@ int MWindowGUI::keypress_event()
        int result = mbuttons->keypress_event();
        if( result ) return result;
 
-       Track *this_track = 0;
+       Track *this_track = 0, *first_track = 0;
+       int collapse = 0, packed = 0, overwrite = 0, plugins = 0;
+       double position = 0;
 
-       switch(get_keypress()) {
+       switch( get_keypress() ) {
+       case 'A':
+               if( !ctrl_down() || !shift_down() || alt_down() ) break;
+               mwindow->edl->tracks->clear_selected_edits();
+               draw_overlays(1);
+               result = 1;
+               break;
        case 'e':
                mwindow->toggle_editing_mode();
                result = 1;
@@ -1186,27 +1196,58 @@ int MWindowGUI::keypress_event()
                result = 1;
                break;
 
+       case 'C':
+               packed = 1;
        case 'c':
                if( !ctrl_down() || alt_down() ) break;
-               mwindow->selected_to_clipboard();
+               mwindow->selected_edits_to_clipboard(packed);
+               result = 1;
                break;
+       case 'P':
+               plugins = 1;
+       case 'b':
+               overwrite = -1; // fall thru
        case 'v':
                if( !ctrl_down() || alt_down() ) break;
-               mwindow->paste();
+               if( mwindow->session->current_operation == DROP_TARGETING ) {
+                       mwindow->session->current_operation = NO_OPERATION;
+                       mwindow->gui->set_editing_mode(1);
+                       int pane_no = 0;
+                       for( ; pane_no<TOTAL_PANES; ++pane_no  ) {
+                               if( !pane[pane_no] ) continue;
+                               first_track = pane[pane_no]->over_track();
+                               if( first_track ) break;
+                       }
+                       if( first_track ) {
+                               int cursor_x = pane[pane_no]->canvas->get_relative_cursor_x();
+                               position = mwindow->edl->get_cursor_position(cursor_x, pane_no);
+                       }
+               }
+               else
+                       position = mwindow->edl->local_session->get_selectionstart();
+               if( !plugins )
+                       mwindow->paste(position, first_track, 0, overwrite);
+               else
+                       mwindow->paste_clipboard(first_track, position, 1, 0, 1, 1, 1);
+               mwindow->edl->tracks->clear_selected_edits();
+               draw_overlays(1);
+               result = 1;
+               break;
+       case 'M':
+               collapse = 1;
+       case 'm':
+               mwindow->cut_selected_edits(0, collapse);
+               result = 1;
                break;
        case 'z':
+               collapse = 1;
        case 'x':
                if( !ctrl_down() || alt_down() ) break;
-               mwindow->cut_selected_edits(get_keypress()=='x' ? 1 : 0);
-               break;
-       case 'm':
-       case DELETE:
-               if( !ctrl_down() || alt_down() ) break;
-               mwindow->delete_edits(get_keypress()==DELETE ? 1 : 0);
+               mwindow->cut_selected_edits(1, collapse);
+               result = 1;
                break;
 
-       case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8':
+       case '1' ... '8':
                if( !alt_down() || shift_down() ) break;
                if( !mwindow->select_asset(get_keypress()-'1',1) )
                        result = 1;
@@ -1320,18 +1361,7 @@ int MWindowGUI::keypress_event()
                result = 1;
                break;
 
-       case KEY_F1:
-       case KEY_F2:
-       case KEY_F3:
-       case KEY_F4:
-       case KEY_F5:
-       case KEY_F6:
-       case KEY_F7:
-       case KEY_F8:
-       case KEY_F9:
-       case KEY_F10:
-       case KEY_F11:
-       case KEY_F12:
+       case KEY_F1 ... KEY_F12:
                resend_event(mwindow->cwindow->gui);
                return 1;
        }