fix dangling thread svg, reduce mute patch
authorGood Guy <good1.2guy@gmail.com>
Wed, 7 Sep 2016 00:27:54 +0000 (18:27 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 7 Sep 2016 00:27:54 +0000 (18:27 -0600)
cinelerra-5.1/cinelerra/patchgui.C
cinelerra-5.1/plugins/svg/svgwin.C

index 51e47ba19699aac93be332b0de61190529fdc44e..1e31919b3b9699756d01aec7216b920f0d4a47df 100644 (file)
@@ -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;
index bc4907716957d0d041f59c4def0667eb9873b5fb..9b4ec70720b5b8ed125d3d21dd7370c369f20e96 100644 (file)
@@ -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()