FaderPort8 details:
authorRobin Gareus <robin@gareus.org>
Sat, 15 Apr 2017 19:20:51 +0000 (21:20 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 15 Apr 2017 19:20:51 +0000 (21:20 +0200)
* make shift buttons equivalent
* 2 x stop: move to session-start
* RTZ: return to zero (not session-start)
* in Pan mode: encoder controls pan-width (w/o shift)

libs/surfaces/faderport8/actions.cc
libs/surfaces/faderport8/faderport8.cc
libs/surfaces/faderport8/faderport8.h

index 0d95b3cdc75c6eeca10e84cd3324ee8cc8015a68..e6ad7fd0624919f4827a6fd1d528ab36170fd5fa 100644 (file)
@@ -118,7 +118,11 @@ FaderPort8::button_play ()
 void
 FaderPort8::button_stop ()
 {
-       transport_stop ();
+       if (session->transport_rolling ()) {
+               transport_stop ();
+       } else {
+               AccessAction ("Transport", "GotoStart");
+       }
 }
 
 void
@@ -205,7 +209,7 @@ FaderPort8::button_varispeed (bool ffw)
                // stop key-repeat
                dynamic_cast<FP8RepeatButton*>(&b_ffw)->stop_repeat();
                dynamic_cast<FP8RepeatButton*>(&b_rew)->stop_repeat();
-               AccessAction ("Transport", "GotoStart");
+               session->request_locate (0, false);
                return;
        }
 
@@ -443,7 +447,7 @@ FaderPort8::button_parameter ()
                                boost::shared_ptr<Stripable> s = first_selected_stripable();
                                if (s) {
                                        boost::shared_ptr<AutomationControl> ac;
-                                       if (shift_mod ()) {
+                                       if (shift_mod () || _ctrls.fader_mode() == ModePan) {
                                                ac = s->pan_width_control ();
                                        } else {
                                                ac = s->pan_azimuth_control ();
@@ -475,7 +479,7 @@ FaderPort8::encoder_parameter (bool neg, int steps)
                                boost::shared_ptr<Stripable> s = first_selected_stripable();
                                if (s) {
                                        boost::shared_ptr<AutomationControl> ac;
-                                       if (shift_mod ()) {
+                                       if (shift_mod () || _ctrls.fader_mode() == ModePan) {
                                                ac = s->pan_width_control ();
                                        } else {
                                                ac = s->pan_azimuth_control ();
index 54bbb655d815ad6c83c23aeec7e7d58afd24cb80..6f9c6db251ad65c94bfb3d7ef786702adb6bc04a 100644 (file)
@@ -94,7 +94,7 @@ FaderPort8::FaderPort8 (Session& s)
        , _parameter_off (0)
        , _blink_onoff (false)
        , _shift_lock (false)
-       , _shift_pressed (false)
+       , _shift_pressed (0)
        , gui (0)
 {
        boost::shared_ptr<ARDOUR::Port> inp;
@@ -296,7 +296,7 @@ FaderPort8::connected ()
        _channel_off = _plugin_off = _parameter_off = 0;
        _blink_onoff = false;
        _shift_lock = false;
-       _shift_pressed = false;
+       _shift_pressed = 0;
 
        start_midi_handling ();
        _ctrls.initialize ();
@@ -495,7 +495,7 @@ FaderPort8::pitchbend_handler (MIDI::Parser &, uint8_t chan, MIDI::pitchbend_t p
        /* fader 0..16368 (0x3ff0 -- 1024 steps) */
        bool handled = _ctrls.midi_fader (chan, pb);
        /* if Shift key is held while moving a fader (group override), don't lock shift. */
-       if (_shift_pressed && handled) {
+       if ((_shift_pressed > 0) && handled) {
                _shift_connection.disconnect ();
                _shift_lock = false;
        }
@@ -528,7 +528,10 @@ FaderPort8::note_on_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
 
        /* special case shift */
        if (tb->note_number == 0x06 || tb->note_number == 0x46) {
-               _shift_pressed = true;
+               _shift_pressed |= (tb->note_number == 0x06) ? 1 : 2;
+               if (_shift_pressed == 3) {
+                       return;
+               }
                _shift_connection.disconnect ();
                if (_shift_lock) {
                        _shift_lock = false;
@@ -565,7 +568,10 @@ FaderPort8::note_off_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
 
        /* special case shift */
        if (tb->note_number == 0x06 || tb->note_number == 0x46) {
-               _shift_pressed = false;
+               _shift_pressed &= (tb->note_number == 0x06) ? 2 : 1;
+               if (_shift_pressed > 0) {
+                       return;
+               }
                if (_shift_lock) {
                        return;
                }
@@ -580,7 +586,7 @@ FaderPort8::note_off_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
 
        bool handled = _ctrls.midi_event (tb->note_number, tb->velocity);
        /* if Shift key is held while activating an action, don't lock shift. */
-       if (_shift_pressed && handled) {
+       if ((_shift_pressed > 0) && handled) {
                _shift_connection.disconnect ();
                _shift_lock = false;
        }
@@ -1439,10 +1445,11 @@ FaderPort8::notify_stripable_property_changed (boost::weak_ptr<Stripable> ws, co
        if (what_changed.contains (Properties::name)) {
                switch (_ctrls.fader_mode ()) {
                        case ModeSend:
-                               _ctrls.strip(id).set_text_line (0, s->name());
+                               _ctrls.strip(id).set_text_line (3, s->name(), true);
+                               break;
                        case ModeTrack:
                        case ModePan:
-                               _ctrls.strip(id).set_text_line (3, s->name(), true);
+                               _ctrls.strip(id).set_text_line (0, s->name());
                                break;
                        case ModePlugins:
                                assert (0);
index d4ab0c7ccc2270a111fabf827a1fc3d922b19c1c..e258612bcc51bcea224b5593aca5eba7aa2f1c1a 100644 (file)
@@ -207,9 +207,9 @@ private:
        /* shift key */
        sigc::connection _shift_connection;
        bool _shift_lock;
-       bool _shift_pressed;
+       int _shift_pressed;
        bool shift_timeout () { _shift_lock = true; return false; }
-       bool shift_mod () const { return _shift_lock | _shift_pressed; }
+       bool shift_mod () const { return _shift_lock || (_shift_pressed > 0); }
 
        /* GUI */
        void build_gui ();