repair default keyframe load, tweak init default histogram threshold
[goodguy/history.git] / cinelerra-5.1 / cinelerra / zwindow.C
index f3ba30f265e368f4308d87ba4f8992f965ad7339..3c340844cb70734a2ccf039a2783f9606db3629a 100644 (file)
@@ -73,7 +73,7 @@ void Mixers::del_mixer(int idx)
 void Mixer::set_title(const char *tp)
 {
        if( tp == title ) return;
-       strncpy(title, tp, sizeof(title));
+       strncpy(title, !tp ? "" : tp, sizeof(title));
        title[sizeof(title)-1] = 0;
 }
 
@@ -185,6 +185,7 @@ ZWindow::ZWindow(MWindow *mwindow)
        idx = -1;
        edl = 0;
        highlighted = 0;
+       destroy = 1;
        title[0] = 0;
        zgui = 0;
 }
@@ -206,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)
 {
@@ -218,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()
@@ -247,17 +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);
-       else tp = title;
-       Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
-       if( mixer ) mixer->set_title(title);
+       *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);
 }