X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowgui.C;h=7cdd58f72b5711af5df8a0c385d3429fcf36dab2;hp=70c4808a959ea8b8c25a72b13fc6abb471ef0227;hb=61298e645e43da02c939e9512949f0b183542d58;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 70c4808a..7cdd58f7 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -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" @@ -65,6 +66,7 @@ #include "swindow.h" #include "theme.h" #include "trackcanvas.h" +#include "trackpopup.h" #include "trackscroll.h" #include "tracks.h" #include "transitionpopup.h" @@ -116,6 +118,7 @@ MWindowGUI::MWindowGUI(MWindow *mwindow) statusbar = 0; zoombar = 0; mainclock = 0; + track_menu = 0; edit_menu = 0; plugin_menu = 0; keyframe_menu = 0; @@ -336,6 +339,9 @@ void MWindowGUI::create_objects() // cursor->create_objects(); + if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__); + add_subwindow(track_menu = new TrackPopup(mwindow, this)); + track_menu->create_objects(); if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__); add_subwindow(edit_menu = new EditPopup(mwindow, this)); edit_menu->create_objects(); @@ -698,28 +704,17 @@ void MWindowGUI::draw_indexes(Indexable *indexable) } } -void MWindowGUI::draw_canvas(int mode /* = 0 */, int hide_cursor /* = 1 */) +void MWindowGUI::draw_canvas(int redraw, int hide_cursor) { - if(mode != IGNORE_THREAD) - { - resource_thread->stop_draw(1); - } - + resource_thread->stop_draw(0); - for(int i = 0; i < TOTAL_PANES; i++) - { - if(pane[i]) - { + int mode = redraw ? FORCE_REDRAW : NORMAL_DRAW; + for(int i = 0; i < TOTAL_PANES; i++) { + if( pane[i] ) pane[i]->canvas->draw(mode, hide_cursor); - } - } - - - if(mode != IGNORE_THREAD) - { - resource_thread->start_draw(); } + resource_thread->start_draw(); } void MWindowGUI::flash_canvas(int flush) @@ -801,7 +796,7 @@ void MWindowGUI::update_scrollbars(int flush) { if(pane[i]) { - pane[i]->update(1, 0, 0, 0); + pane[i]->update(1, NO_DRAW, 0, 0); } } if(flush) this->flush(); @@ -877,10 +872,8 @@ void MWindowGUI::update(int scrollbars, mwindow->edl->tracks->update_y_pixels(mwindow->theme); - if(do_canvas && do_canvas != IGNORE_THREAD) - { + if( do_canvas != NO_DRAW && do_canvas != IGNORE_THREAD ) resource_thread->stop_draw(1); - } for(int i = 0; i < TOTAL_PANES; i++) { @@ -890,10 +883,8 @@ void MWindowGUI::update(int scrollbars, patchbay); } - if(do_canvas && do_canvas != IGNORE_THREAD) - { + if( do_canvas != NO_DRAW && do_canvas != IGNORE_THREAD ) resource_thread->start_draw(); - } // if(scrollbars) this->get_scrollbars(0); // if(timebar) this->timebar->update(0); @@ -923,8 +914,7 @@ void MWindowGUI::update(int scrollbars, // Can't age if the cache called this to draw missing picons // or the GUI is updating the status of the draw toggle. - if(do_canvas != FORCE_REDRAW && do_canvas != IGNORE_THREAD) - { + if( do_canvas != FORCE_REDRAW && do_canvas != IGNORE_THREAD ) { unlock_window(); mwindow->age_caches(); lock_window("MWindowGUI::update"); @@ -942,9 +932,9 @@ int MWindowGUI::visible(int64_t x1, int64_t x2, int64_t view_x1, int64_t view_x2 } -void MWindowGUI::show_message(const char *message, int color) +void MWindowGUI::show_message(const char *message, int msg_color, int bar_color) { - statusbar->show_message(message, color); + statusbar->show_message(message, msg_color, bar_color); } void MWindowGUI::update_default_message() @@ -1018,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 ) { @@ -1181,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; @@ -1197,8 +1196,58 @@ int MWindowGUI::keypress_event() result = 1; break; - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': + case 'C': + packed = 1; + case 'c': + if( !ctrl_down() || alt_down() ) break; + 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; + 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_noover_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(1, collapse); + result = 1; + break; + + case '1' ... '8': if( !alt_down() || shift_down() ) break; if( !mwindow->select_asset(get_keypress()-'1',1) ) result = 1; @@ -1304,7 +1353,7 @@ int MWindowGUI::keypress_event() if( !selected && this_track ) this_track->record = 1; } - update(0, 1, 0, 0, 1, 0, 1); + update(0, NORMAL_DRAW, 0, 0, 1, 0, 1); unlock_window(); mwindow->cwindow->update(0, 1, 1); lock_window("MWindowGUI::keypress_event 3"); @@ -1312,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; } @@ -1842,7 +1880,7 @@ void MWindowGUI::delete_y_pane(int cursor_y) void MWindowGUI::stop_pane_drag() { dragging_pane = 0; - resource_thread->stop_draw(1); + resource_thread->stop_draw(0); if(x_pane_drag) { @@ -2310,7 +2348,7 @@ void MWindowGUI::stop_transport(const char *lock_msg) { if( !mbuttons->transport->is_stopped() ) { if( lock_msg ) unlock_window(); - mbuttons->transport->handle_transport(STOP, 1, 0, 0); + mbuttons->transport->handle_transport(STOP, 1); if( lock_msg ) lock_window(lock_msg); } } @@ -2420,10 +2458,12 @@ ProxyToggle::~ProxyToggle() int ProxyToggle::handle_event() { int disabled = get_value(); + mwindow->gui->unlock_window(); if( disabled ) mwindow->disable_proxy(); else mwindow->enable_proxy(); + mwindow->gui->lock_window("ProxyToggle::handle_event"); set_tooltip(!disabled ? _("Disable proxy") : _("Enable proxy")); return 1; }