shift-click MotionFeedback widgets to reset to default, and monitor section SiP cut...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 19 Mar 2010 21:40:23 +0000 (21:40 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 19 Mar 2010 21:40:23 +0000 (21:40 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6778 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/monitor_section.cc
gtk2_ardour/monitor_section.h
libs/gtkmm2ext/gtkmm2ext/motionfeedback.h
libs/gtkmm2ext/motionfeedback.cc

index 5f779c6422a6441478e522e56b4be49a277f6b2a..32a0247e99c1ef25983c167b1a3a42b2f724d468 100644 (file)
@@ -62,7 +62,7 @@ MonitorSection::MonitorSection (Session* s)
         , dim_control (0)
         , solo_boost_adjustment (1.0, 1.0, 2.0, 0.01, 0.1) 
         , solo_boost_control (0)
-        , solo_cut_adjustment (0.0, 0.0, 1.0, 0.01, 0.1) 
+        , solo_cut_adjustment (0.0, 0.0, 1.0, 0.01, 0.1)
         , solo_cut_control (0)
         , solo_in_place_button (solo_model_group, _("SiP"))
         , afl_button (solo_model_group, _("AFL"))
@@ -164,7 +164,7 @@ MonitorSection::MonitorSection (Session* s)
         /* Solo (SiP) cut */
 
         solo_cut_control = new VolumeController (little_knob_pixbuf, &solo_cut_adjustment, false, 30, 30);
-        // solo_cut_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MonitorSection::solo_cut_changed));
+        solo_cut_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MonitorSection::solo_cut_changed));
 
         spin_label = manage (new Label (_("SiP Cut")));
         spin_packer = manage (new VBox);
@@ -865,3 +865,9 @@ MonitorSection::cancel_solo (GdkEventButton* ev)
 
         return true;
 }
+
+void
+MonitorSection::solo_cut_changed ()
+{
+        Config->set_solo_mute_gain (slider_position_to_gain (solo_cut_adjustment.get_value()));
+}
index 8af84988f14ce609c43c0243a8127671ee44c5b6..ca6b546f3f98787f055b3288d25901aa03d4a51c 100644 (file)
@@ -116,4 +116,5 @@ class MonitorSection : public RouteUI
 
         void solo_blink (bool);
         bool cancel_solo (GdkEventButton*);
+        void solo_cut_changed ();
 };
index 23ad122d85a1f964283e327debc260c98bfae5aa..a3a06d39d33b85c2159d1be4af686df1a5e8bb2f 100644 (file)
@@ -84,12 +84,13 @@ class MotionFeedback : public Gtk::VBox
        Gtk::SpinButton*   value;
        Gtk::Adjustment*   adjustment;
        Glib::RefPtr<Gdk::Pixbuf> pixbuf;
-       
-       gfloat step_inc;
-       gfloat page_inc;
+
+        double default_value;
+       double  step_inc;
+       double page_inc;
        bool   grab_is_fine;
-       gdouble grabbed_y;
-       gdouble grabbed_x;
+       double grabbed_y;
+       double grabbed_x;
        bool i_own_my_adjustment;
         int subwidth;
         int subheight;
index 8cdaac067c613535876a58b06c774fa710c02a14..19ce16d8158a9b2b698995fa040ef5689d82b92f 100644 (file)
@@ -54,6 +54,8 @@ MotionFeedback::MotionFeedback (Glib::RefPtr<Gdk::Pixbuf> pix,
            set_adjustment (adj);
        }
 
+        default_value = adjustment->get_value();
+
         HBox* hpacker = manage (new HBox);
         hpacker->pack_start (pixwin, true, false);
         hpacker->show ();
@@ -168,6 +170,11 @@ MotionFeedback::pixwin_button_release_event (GdkEventButton *ev)
                                        (GTK_WIDGET(pixwin.gobj()));
                        }
                }
+                if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
+                        /* shift click back to the default */
+                        adjustment->set_value (default_value);
+                        return true;
+                }
                break;
                
        case 3: