X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fzwindow.C;h=3c340844cb70734a2ccf039a2783f9606db3629a;hp=29a28a1b22a52ba78162b5201622b0154c1f61f0;hb=2e48b660e37eb5c661264d601211e16cb6cd6e89;hpb=0513350234a8dcd08e5a0117d5121724ef7b76b6 diff --git a/cinelerra-5.1/cinelerra/zwindow.C b/cinelerra-5.1/cinelerra/zwindow.C index 29a28a1b..3c340844 100644 --- a/cinelerra-5.1/cinelerra/zwindow.C +++ b/cinelerra-5.1/cinelerra/zwindow.C @@ -72,7 +72,8 @@ void Mixers::del_mixer(int idx) void Mixer::set_title(const char *tp) { - strncpy(title, tp, sizeof(title)); + if( tp == title ) return; + strncpy(title, !tp ? "" : tp, sizeof(title)); title[sizeof(title)-1] = 0; } @@ -184,6 +185,7 @@ ZWindow::ZWindow(MWindow *mwindow) idx = -1; edl = 0; highlighted = 0; + destroy = 1; title[0] = 0; zgui = 0; } @@ -205,6 +207,9 @@ BC_Window* ZWindow::new_gui() void ZWindow::handle_done_event(int result) { + if( destroy ) + mwindow->del_mixer(this); + idx = -1; } void ZWindow::handle_close_event(int result) { @@ -217,15 +222,20 @@ void ZWindow::change_source(EDL *edl) this->edl->remove_user(); this->edl = edl; if( edl != 0 ) { - zgui->playback_engine->que->send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1); + zgui->playback_engine->refresh_frame(CHANGE_ALL, edl); } } +void ZWindow::stop_playback(int wait) +{ + zgui->playback_engine->stop_playback(wait); +} + void ZWindow::issue_command(int command, int wait_tracking, - int use_inout, int update_refresh, int toggle_audio) + int use_inout, int update_refresh, int toggle_audio, int loop_play) { zgui->playback_engine->issue_command(edl, command, - wait_tracking, use_inout, update_refresh, toggle_audio); + wait_tracking, use_inout, update_refresh, toggle_audio, loop_play); } void ZWindow::update_mixer_ids() @@ -246,16 +256,18 @@ void ZWindow::update_mixer_ids() void ZWindow::set_title(const char *tp) { + Mixer *mixer = mwindow->edl->mixers.get_mixer(idx); + if( mixer ) mixer->set_title(tp); char *cp = title, *ep = cp + sizeof(title)-1; cp += snprintf(title, ep-cp, _("Mixer %d"), idx); if( tp ) cp += snprintf(cp, ep-cp, ": %s", tp); - Mixer *mixer = mwindow->edl->mixers.get_mixer(idx); - if( mixer && tp != mixer->title ) mixer->set_title(tp); + *cp = 0; } void ZWindow::reposition(int x, int y, int w, int h) { Mixer *mixer = mwindow->edl->mixers.get_mixer(idx); - if( mixer ) mixer->reposition(x, y, w, h); + if( !mixer ) return; + mixer->reposition(x, y, w, h); }