X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcwindow.C;h=3a65150df6c586664a0ce807ec5afd63c4edb3e0;hp=cc5a2707cf716e71ee80605f4274d5fdd2cb63b4;hb=502b6f3b6fd04f6b01c6d70dcb81aa304dd0db1c;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd diff --git a/cinelerra-5.1/cinelerra/cwindow.C b/cinelerra-5.1/cinelerra/cwindow.C index cc5a2707..3a65150d 100644 --- a/cinelerra-5.1/cinelerra/cwindow.C +++ b/cinelerra-5.1/cinelerra/cwindow.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "autos.h" @@ -34,6 +34,7 @@ #include "keys.h" #include "edl.h" #include "edlsession.h" +#include "language.h" #include "localsession.h" #include "mainmenu.h" #include "mainsession.h" @@ -65,8 +66,8 @@ CWindow::~CWindow() { if(gui && running()) { gui->set_done(0); - join(); } + join(); delete gui; gui = 0; delete playback_engine; delete playback_cursor; @@ -143,7 +144,7 @@ Track* CWindow::calculate_affected_track() return affected_track; } -Auto* CWindow::calculate_affected_auto(Autos *autos, +Auto* CWindow::calculate_affected_auto(Autos *autos, int create, int *created, int redraw) @@ -214,67 +215,47 @@ void CWindow::calculate_affected_autos(FloatAuto **x_auto, } } - - - +void CWindow::stop_playback(int wait) +{ + playback_engine->stop_playback(wait); +} void CWindow::run() { gui->run_window(); } -void CWindow::update(int position, - int overlays, - int tool_window, - int operation, - int timebar) +void CWindow::update(int dir, int overlays, int tool_window, int operation, int timebar) { - if(position) - { - playback_engine->que->send_command(CURRENT_FRAME, - CHANGE_NONE, - mwindow->edl, - 1); - } + if(dir) + refresh_frame(CHANGE_NONE, dir); gui->lock_window("CWindow::update 2"); - - // Create tool window if(operation) - { gui->set_operation(mwindow->edl->session->cwindow_operation); - } - // Updated by video device. - if(overlays && !position) - { + if(overlays && !dir) gui->canvas->draw_refresh(); - } // Update tool parameters // Never updated by someone else - if(tool_window || position) - { + if(tool_window || dir) gui->update_tool(); - } if(timebar) - { gui->timebar->update(1); - } - if(!mwindow->edl->session->cwindow_scrollbars) - gui->zoom_panel->update(AUTO_ZOOM); - else - gui->zoom_panel->update(mwindow->edl->session->cwindow_zoom); + double zoom = !mwindow->edl->session->cwindow_scrollbars ? + 0 :mwindow->edl->session->cwindow_zoom; + gui->zoom_panel->update(zoom); gui->canvas->update_zoom(mwindow->edl->session->cwindow_xscroll, - mwindow->edl->session->cwindow_yscroll, + mwindow->edl->session->cwindow_yscroll, mwindow->edl->session->cwindow_zoom); - gui->canvas->reposition_window(mwindow->edl, + gui->canvas->reposition_window(mwindow->edl, mwindow->theme->ccanvas_x, mwindow->theme->ccanvas_y, mwindow->theme->ccanvas_w, @@ -295,7 +276,7 @@ int CWindow::update_position(double position) gui->unlock_window(); playback_engine->interrupt_playback(1); - + position = mwindow->edl->align_to_frame(position, 0); position = MAX(0, position); @@ -307,8 +288,16 @@ int CWindow::update_position(double position) return 1; } +void CWindow::refresh_frame(int change_type, EDL *edl, int dir) +{ + mwindow->refresh_mixers(dir); + playback_engine->refresh_frame(change_type, edl, dir); +} - +void CWindow::refresh_frame(int change_type, int dir) +{ + refresh_frame(change_type, mwindow->edl, dir); +} CWindowRemoteHandler:: CWindowRemoteHandler(RemoteControl *remote_control) @@ -325,7 +314,7 @@ CWindowRemoteHandler:: int CWindowRemoteHandler::remote_process_key(RemoteControl *remote_control, int key) { MWindowGUI *mwindow_gui = remote_control->mwindow_gui; - EDL *edl = mwindow_gui->mwindow->edl; + EDL *edl = mwindow_gui->mwindow->edl; if( !edl ) return 0; PlayTransport *transport = mwindow_gui->mbuttons->transport; if( !transport->get_edl() ) return 0; @@ -360,9 +349,11 @@ int CWindowRemoteHandler::remote_process_key(RemoteControl *remote_control, int case 'a': gui->tile_windows(0); return 1; case 'b': gui->tile_windows(1); return 1; case 'c': gui->tile_windows(2); return 1; +#ifdef HAVE_DVB case 'd': mwindow_gui->channel_info->toggle_scan(); return 1; +#endif case 'e': break; case 'f': {