From: Good Guy Date: Wed, 7 Sep 2016 00:27:54 +0000 (-0600) Subject: fix dangling thread svg, reduce mute patch X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=49b1cbd236ac6c593d4fc85ed3f4a6344cbb9279;p=goodguy%2Fhistory.git fix dangling thread svg, reduce mute patch --- diff --git a/cinelerra-5.1/cinelerra/patchgui.C b/cinelerra-5.1/cinelerra/patchgui.C index 51e47ba1..1e31919b 100644 --- a/cinelerra-5.1/cinelerra/patchgui.C +++ b/cinelerra-5.1/cinelerra/patchgui.C @@ -237,29 +237,17 @@ void PatchGUI::toggle_behavior(int type, BC_Toggle *toggle, int *output) { - if(toggle->shift_down()) - { + if(toggle->shift_down()) { + int sense = type != Tracks::MUTE ? 1 : 0; // all selected if nothing previously selected or // if this patch was previously the only one selected - switch( type ) { - case Tracks::MUTE: { // negative logic for normally off - int total_selected = mwindow->edl->tracks->total() - - mwindow->edl->tracks->total_of(type); - int current_output = *output; - int selected = !total_selected || (total_selected == 1 && - !current_output ) ? 0 : 1; - mwindow->edl->tracks->select_all(type, selected); - if( selected ) *output = 0; - break; } - default: { - int total_selected = mwindow->edl->tracks->total_of(type); - int current_output = *output; - int selected = !total_selected || (total_selected == 1 && - current_output ) ? 1 : 0; - mwindow->edl->tracks->select_all(type, selected); - if( !selected ) *output = 1; - break; } - } + int total_type = mwindow->edl->tracks->total_of(type); + int total_selected = sense ? total_type : + mwindow->edl->tracks->total() - total_type; + int selected = !total_selected || (total_selected == 1 && + *output == sense ) ? sense : 1-sense; + mwindow->edl->tracks->select_all(type, selected); + if( selected != sense ) *output = sense; patchbay->drag_operation = type; patchbay->new_status = 1; diff --git a/cinelerra-5.1/plugins/svg/svgwin.C b/cinelerra-5.1/plugins/svg/svgwin.C index bc490771..9b4ec707 100644 --- a/cinelerra-5.1/plugins/svg/svgwin.C +++ b/cinelerra-5.1/plugins/svg/svgwin.C @@ -239,8 +239,8 @@ void EditSvgButton::stop() fifo_buf.action = 3; write(fh_fifo, &fifo_buf, sizeof(fifo_buf)); } - join(); } + join(); } int EditSvgButton::handle_event()