From 84b52741889e1afee840d7c24009cc139244ce74 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sat, 20 Jun 2020 20:11:07 -0600 Subject: [PATCH] re/open mixer window fixes --- cinelerra-5.1/cinelerra/mainmenu.C | 4 +++- cinelerra-5.1/cinelerra/mwindow.C | 14 ++++++++++++++ cinelerra-5.1/cinelerra/mwindow.h | 1 + cinelerra-5.1/cinelerra/track.C | 2 +- cinelerra-5.1/cinelerra/zwindow.C | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C index f616d26a..6fc329b6 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.C +++ b/cinelerra-5.1/cinelerra/mainmenu.C @@ -1674,7 +1674,9 @@ int MixerItem::handle_event() MWindow *mwindow = mixer_items->mwindow; Mixer *mixer = mwindow->edl->mixers.get_mixer(idx); if( !mixer ) return 0; - ZWindow *zwindow = mwindow->get_mixer(mixer); + ZWindow *zwindow = mwindow->get_mixer(idx); + if( !zwindow ) + zwindow = mwindow->get_mixer(mixer); if( !zwindow->zgui ) { zwindow->set_title(mixer->title); zwindow->start(); diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 0fe6752f..7f502d10 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1210,6 +1210,20 @@ ZWindow *MWindow::get_mixer(Mixer *&mixer) return zwindow; } +ZWindow *MWindow::get_mixer(int idx) +{ + ZWindow *zwindow = 0; + zwindows_lock->lock("MWindow::get_mixer"); + for( int i=0; !zwindow && irunning() ) continue; + if( zwdw->idx != idx ) continue; + zwindow = zwindows[i]; + } + zwindows_lock->unlock(); + return zwindow; +} + void MWindow::close_mixer(ZWindow *zwindow) { zwindows_lock->lock("MWindow::close_mixer 0"); diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index c7076099..13544431 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -274,6 +274,7 @@ public: void close_mixers(int result=1); void open_mixers(); ZWindow *get_mixer(Mixer *&mixer); + ZWindow *get_mixer(int idx); void close_mixer(ZWindow *zwindow); int mixer_track_active(Track *track); void update_mixer_tracks(); diff --git a/cinelerra-5.1/cinelerra/track.C b/cinelerra-5.1/cinelerra/track.C index 7a01982f..af7b6cdb 100644 --- a/cinelerra-5.1/cinelerra/track.C +++ b/cinelerra-5.1/cinelerra/track.C @@ -1853,7 +1853,7 @@ void Track::set_camera(float x, float y, float z) int Track::index_in(Mixer *mixer) { - if( !mixer || mixer_id ) return -1; + if( !mixer || mixer_id < 0 ) return -1; int k = mixer->mixer_ids.size(); while( --k >= 0 && mixer_id != mixer->mixer_ids[k] ); return k; diff --git a/cinelerra-5.1/cinelerra/zwindow.C b/cinelerra-5.1/cinelerra/zwindow.C index da28e013..37dd6feb 100644 --- a/cinelerra-5.1/cinelerra/zwindow.C +++ b/cinelerra-5.1/cinelerra/zwindow.C @@ -174,6 +174,7 @@ void Mixer::copy_from(Mixer &that) mixer_ids.remove_all(); strncpy(title, that.title, sizeof(title)); title[sizeof(title)-1] = 0; + show = that.show; x = that.x; y = that.y; w = that.w; h = that.h; for( int i=0; i