X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcwindowgui.C;h=b4b8008d8c9513d66c613213e5029f8451849218;hp=20eff1207d05532fca714077f2b5c8c4b049bf72;hb=d94bbdeebde4f16a77c388f9f28114b945db41d9;hpb=9d832a1fff11b11aaa1108c460690ed05e2bdc05 diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index 20eff120..b4b8008d 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -296,6 +296,31 @@ int CWindowGUI::resize_event(int w, int h) int CWindowGUI::button_press_event() { + if( current_operation == CWINDOW_NONE && + mwindow->edl != 0 && canvas->get_canvas() && + canvas->get_canvas()->get_cursor_over_window() ) { + switch( get_buttonpress() ) { + case LEFT_BUTTON: + if( !cwindow->playback_engine->is_playing_back ) { + double length = mwindow->edl->tracks->total_playable_length(); + double position = cwindow->playback_engine->get_tracking_position(); + if( position >= length ) transport->goto_start(); + } + return transport->forward_play->handle_event(); + case MIDDLE_BUTTON: + if( !cwindow->playback_engine->is_playing_back ) { + double position = cwindow->playback_engine->get_tracking_position(); + if( position <= 0 ) transport->goto_end(); + } + return transport->reverse_play->handle_event(); + case RIGHT_BUTTON: // activates popup + break; + case WHEEL_UP: + return transport->frame_forward_play->handle_event(); + case WHEEL_DOWN: + return transport->frame_reverse_play->handle_event(); + } + } if(canvas->get_canvas()) return canvas->button_press_event_base(canvas->get_canvas()); return 0; @@ -473,61 +498,63 @@ int CWindowGUI::keypress_event() lock_window("CWindowGUI::keypress_event 4"); break; case LEFT: - if(!ctrl_down()) - { - if (alt_down()) - { - int shift_down = this->shift_down(); - unlock_window(); - mwindow->gui->mbuttons->transport->handle_transport(STOP, 1, 0, 0); - - mwindow->gui->lock_window("CWindowGUI::keypress_event 2"); + if( !ctrl_down() ) { + int alt_down = this->alt_down(); + int shift_down = this->shift_down(); + unlock_window(); + stop_transport(0); + mwindow->gui->lock_window("CWindowGUI::keypress_event 5"); + if( alt_down ) mwindow->prev_edit_handle(shift_down); - mwindow->gui->unlock_window(); - - lock_window("CWindowGUI::keypress_event 1"); - } else - { - unlock_window(); - - mwindow->gui->lock_window("CWindowGUI::keypress_event 3"); mwindow->move_left(); - mwindow->gui->unlock_window(); - - lock_window("CWindowGUI::keypress_event 2"); - } + mwindow->gui->unlock_window(); + lock_window("CWindowGUI::keypress_event 6"); result = 1; } break; - case RIGHT: - if(!ctrl_down()) - { - if (alt_down()) - { - int shift_down = this->shift_down(); - unlock_window(); - mwindow->gui->mbuttons->transport->handle_transport(STOP, 1, 0, 0); - mwindow->gui->lock_window("CWindowGUI::keypress_event 2"); - mwindow->next_edit_handle(shift_down); - mwindow->gui->unlock_window(); + case ',': + if( !ctrl_down() && !alt_down() ) { + unlock_window(); + stop_transport(0); + mwindow->gui->lock_window("CWindowGUI::keypress_event 7"); + mwindow->move_left(); + mwindow->gui->unlock_window(); + lock_window("CWindowGUI::keypress_event 8"); + result = 1; + } + break; - lock_window("CWindowGUI::keypress_event 2"); - } + case RIGHT: + if( !ctrl_down() ) { + int alt_down = this->alt_down(); + int shift_down = this->shift_down(); + unlock_window(); + stop_transport(0); + mwindow->gui->lock_window("CWindowGUI::keypress_event 8"); + if( alt_down ) + mwindow->next_edit_handle(shift_down); else - { - unlock_window(); - - mwindow->gui->lock_window("CWindowGUI::keypress_event 4"); mwindow->move_right(); - mwindow->gui->unlock_window(); + mwindow->gui->unlock_window(); + lock_window("CWindowGUI::keypress_event 9"); + result = 1; + } + break; - lock_window("CWindowGUI::keypress_event 3"); - } + case '.': + if( !ctrl_down() && !alt_down() ) { + unlock_window(); + stop_transport(0); + mwindow->gui->lock_window("CWindowGUI::keypress_event 10"); + mwindow->move_right(); + mwindow->gui->unlock_window(); + lock_window("CWindowGUI::keypress_event 11"); result = 1; } break; + } if(!result) result = transport->keypress_event(); @@ -604,7 +631,7 @@ int CWindowGUI::drag_stop() if(mwindow->session->drag_assets->total) { mwindow->gui->lock_window("CWindowGUI::drag_stop 1"); - mwindow->clear(0, 1); + mwindow->clear(0); mwindow->load_assets(mwindow->session->drag_assets, mwindow->edl->local_session->get_selectionstart(), LOADMODE_PASTE, @@ -619,7 +646,7 @@ int CWindowGUI::drag_stop() if(mwindow->session->drag_clips->total) { mwindow->gui->lock_window("CWindowGUI::drag_stop 2"); - mwindow->clear(0, 1); + mwindow->clear(0); mwindow->paste_edls(mwindow->session->drag_clips, LOADMODE_PASTE, mwindow->session->track_highlighted, @@ -676,6 +703,13 @@ void CWindowGUI::update_meters() } } +void CWindowGUI::stop_transport(const char *lock_msg) +{ + if( lock_msg ) unlock_window(); + mwindow->stop_transport(); + if( lock_msg ) lock_window(lock_msg); +} + CWindowEditing::CWindowEditing(MWindow *mwindow, CWindow *cwindow) : EditPanel(mwindow, @@ -716,13 +750,18 @@ CWrapper(splice_selection) CWrapper(overwrite_selection) CWrapper(set_inpoint) CWrapper(set_outpoint) -CWrapper(clear_inpoint) -CWrapper(clear_outpoint) +CWrapper(unset_inoutpoint) CWrapper(toggle_label) -CWrapper(prev_label) -CWrapper(next_label) -CWrapper(prev_edit) -CWrapper(next_edit) + +#define CWrapper_cut(fn) void CWindowEditing::fn(int cut) { \ + mwindow->gui->lock_window("CWrapper::" #fn); \ + EditPanel::fn(cut); \ + mwindow->gui->unlock_window(); \ +} +CWrapper_cut(prev_label) +CWrapper_cut(next_label) +CWrapper_cut(prev_edit) +CWrapper_cut(next_edit) void CWindowEditing::to_clip() { @@ -829,7 +868,7 @@ int CWindowSlider::handle_event() void CWindowSlider::set_position() { - double new_length = mwindow->edl->tracks->total_playable_length(); + double new_length = mwindow->edl->tracks->total_length(); // if(mwindow->edl->local_session->preview_end <= 0 || // mwindow->edl->local_session->preview_end > new_length) // mwindow->edl->local_session->preview_end = new_length; @@ -3178,10 +3217,7 @@ int CWindowCanvas::cursor_motion_event() gui->unlock_window(); mwindow->restart_brender(); mwindow->sync_parameters(CHANGE_PARAMS); - gui->cwindow->playback_engine->que->send_command(CURRENT_FRAME, - CHANGE_NONE, - mwindow->edl, - 1); + mwindow->cwindow->refresh_frame(CHANGE_NONE); if(!redraw) gui->update_tool(); gui->lock_window("CWindowCanvas::cursor_motion_event 2"); } @@ -3208,7 +3244,8 @@ int CWindowCanvas::button_press_event() gui->y_offset = get_y_offset(mwindow->edl, 0, zoom_y, conformed_w, conformed_h); // Scroll view - if(get_buttonpress() == 2) + if( mwindow->edl->session->cwindow_operation != CWINDOW_PROTECT && + get_buttonpress() == 2 ) { gui->current_operation = CWINDOW_SCROLL; result = 1; @@ -3270,10 +3307,7 @@ int CWindowCanvas::button_press_event() mwindow->restart_brender(); mwindow->sync_parameters(CHANGE_PARAMS); - gui->cwindow->playback_engine->que->send_command(CURRENT_FRAME, - CHANGE_NONE, - mwindow->edl, - 1); + mwindow->cwindow->refresh_frame(CHANGE_NONE); if(!redraw) gui->update_tool(); gui->lock_window("CWindowCanvas::button_press_event 2"); }