13
0

FP8: Fix Mixbus solo-state and indicate implicit solo (blink)

This commit is contained in:
Robin Gareus 2017-07-19 01:52:14 +02:00
parent 9a0a2a29b5
commit 601604972c
4 changed files with 36 additions and 13 deletions

View File

@ -307,6 +307,9 @@ void
FaderPort8::button_solo_clear () FaderPort8::button_solo_clear ()
{ {
bool soloing = session->soloing() || session->listening(); bool soloing = session->soloing() || session->listening();
#ifdef MIXBUS
soloing |= session->mixbus_soloed();
#endif
if (soloing) { if (soloing) {
StripableList all; StripableList all;
session->get_stripables (all); session->get_stripables (all);
@ -314,9 +317,9 @@ FaderPort8::button_solo_clear ()
if ((*i)->is_master() || (*i)->is_auditioner() || (*i)->is_monitor()) { if ((*i)->is_master() || (*i)->is_auditioner() || (*i)->is_monitor()) {
continue; continue;
} }
boost::shared_ptr<AutomationControl> ac = (*i)->solo_control(); boost::shared_ptr<SoloControl> sc = (*i)->solo_control();
if (ac && ac->get_value () > 0) { if (sc && sc->self_soloed ()) {
_solo_state.push_back (boost::weak_ptr<AutomationControl>(ac)); _solo_state.push_back (boost::weak_ptr<AutomationControl>(sc));
} }
} }
AccessAction ("Main", "cancel-solo"); AccessAction ("Main", "cancel-solo");

View File

@ -187,6 +187,9 @@ void
FaderPort8::notify_solo_changed () FaderPort8::notify_solo_changed ()
{ {
bool soloing = session->soloing() || session->listening(); bool soloing = session->soloing() || session->listening();
#ifdef MIXBUS
soloing |= session->mixbus_soloed();
#endif
_ctrls.button (FP8Controls::BtnSoloClear).set_active (soloing); _ctrls.button (FP8Controls::BtnSoloClear).set_active (soloing);
#ifdef FP8_MUTESOLO_UNDO #ifdef FP8_MUTESOLO_UNDO
if (soloing) { if (soloing) {

View File

@ -106,20 +106,22 @@ public:
return true; return true;
} }
void ignore_release () { virtual void ignore_release () {
if (_pressed) { if (_pressed) {
_ignore_release = true; _ignore_release = true;
} }
} }
bool blinking () const { return _blinking; }
void set_blinking (bool yes) { void set_blinking (bool yes) {
if (yes && !_blinking) { if (yes && !_blinking) {
_blinking = true; _blinking = true;
_base.BlinkIt.connect_same_thread (_blink_connection, boost::bind (&FP8ButtonBase::blink, this, _1)); _base.BlinkIt.connect_same_thread (_blink_connection, boost::bind (&FP8ButtonBase::blink, this, _1));
} else if (!yes && _blinking) { } else if (!yes && _blinking) {
_blink_connection.disconnect (); _blink_connection.disconnect ();
blink (true);
_blinking = false; _blinking = false;
blink (true);
} }
} }
@ -360,14 +362,12 @@ private:
// short press: activate in press, deactivate on release, // short press: activate in press, deactivate on release,
// long press + hold, activate on press, de-activate directly on release // long press + hold, activate on press, de-activate directly on release
// e.g. mute/solo press + hold => changed() // e.g. mute/solo press + hold => changed()
class FP8MomentaryButton : public FP8ButtonInterface class FP8MomentaryButton : public FP8ButtonBase
{ {
public: public:
FP8MomentaryButton (FP8Base& b, uint8_t id) FP8MomentaryButton (FP8Base& b, uint8_t id)
: _base (b) : FP8ButtonBase (b)
, _midi_id (id) , _midi_id (id)
, _pressed (false)
, _active (false)
{} {}
~FP8MomentaryButton () { ~FP8MomentaryButton () {
@ -391,6 +391,8 @@ public:
_hold_connection.disconnect (); _hold_connection.disconnect ();
} }
void ignore_release () { }
bool midi_event (bool a) bool midi_event (bool a)
{ {
if (a == _pressed) { if (a == _pressed) {
@ -423,12 +425,18 @@ public:
} }
protected: protected:
FP8Base& _base; void blink (bool onoff)
{
if (!blinking ()) {
_base.tx_midi3 (0x90, _midi_id, _active ? 0x7f : 0x00);
return;
}
_base.tx_midi3 (0x90, _midi_id, onoff ? 0x7f : 0x00);
}
uint8_t _midi_id; // MIDI-note uint8_t _midi_id; // MIDI-note
bool _pressed;
bool _momentaty; bool _momentaty;
bool _was_active_on_press; bool _was_active_on_press;
bool _active;
private: private:
bool hold_timeout () bool hold_timeout ()

View File

@ -91,6 +91,7 @@ FP8Strip::initialize ()
* ie from FaderPort8::connected() * ie from FaderPort8::connected()
*/ */
_solo.set_active (false); _solo.set_active (false);
_solo.set_blinking (false);
_mute.set_active (false); _mute.set_active (false);
/* reset momentary button state */ /* reset momentary button state */
@ -414,8 +415,16 @@ void
FP8Strip::notify_solo_changed () FP8Strip::notify_solo_changed ()
{ {
if (_solo_ctrl) { if (_solo_ctrl) {
_solo.set_active (_solo_ctrl->get_value () > 0); boost::shared_ptr<SoloControl> sc = boost::dynamic_pointer_cast<SoloControl> (_solo_ctrl);
if (sc) {
_solo.set_blinking (sc->soloed_by_others () && !sc->self_soloed ());
_solo.set_active (sc->self_soloed ());
} else {
_solo.set_blinking (false);
_solo.set_active (_solo_ctrl->get_value () > 0);
}
} else { } else {
_solo.set_blinking (false);
_solo.set_active (false); _solo.set_active (false);
} }
} }