FP8: Fix Mixbus solo-state and indicate implicit solo (blink)
This commit is contained in:
parent
9a0a2a29b5
commit
601604972c
@ -307,6 +307,9 @@ void
|
||||
FaderPort8::button_solo_clear ()
|
||||
{
|
||||
bool soloing = session->soloing() || session->listening();
|
||||
#ifdef MIXBUS
|
||||
soloing |= session->mixbus_soloed();
|
||||
#endif
|
||||
if (soloing) {
|
||||
StripableList all;
|
||||
session->get_stripables (all);
|
||||
@ -314,9 +317,9 @@ FaderPort8::button_solo_clear ()
|
||||
if ((*i)->is_master() || (*i)->is_auditioner() || (*i)->is_monitor()) {
|
||||
continue;
|
||||
}
|
||||
boost::shared_ptr<AutomationControl> ac = (*i)->solo_control();
|
||||
if (ac && ac->get_value () > 0) {
|
||||
_solo_state.push_back (boost::weak_ptr<AutomationControl>(ac));
|
||||
boost::shared_ptr<SoloControl> sc = (*i)->solo_control();
|
||||
if (sc && sc->self_soloed ()) {
|
||||
_solo_state.push_back (boost::weak_ptr<AutomationControl>(sc));
|
||||
}
|
||||
}
|
||||
AccessAction ("Main", "cancel-solo");
|
||||
|
@ -187,6 +187,9 @@ void
|
||||
FaderPort8::notify_solo_changed ()
|
||||
{
|
||||
bool soloing = session->soloing() || session->listening();
|
||||
#ifdef MIXBUS
|
||||
soloing |= session->mixbus_soloed();
|
||||
#endif
|
||||
_ctrls.button (FP8Controls::BtnSoloClear).set_active (soloing);
|
||||
#ifdef FP8_MUTESOLO_UNDO
|
||||
if (soloing) {
|
||||
|
@ -106,20 +106,22 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void ignore_release () {
|
||||
virtual void ignore_release () {
|
||||
if (_pressed) {
|
||||
_ignore_release = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool blinking () const { return _blinking; }
|
||||
|
||||
void set_blinking (bool yes) {
|
||||
if (yes && !_blinking) {
|
||||
_blinking = true;
|
||||
_base.BlinkIt.connect_same_thread (_blink_connection, boost::bind (&FP8ButtonBase::blink, this, _1));
|
||||
} else if (!yes && _blinking) {
|
||||
_blink_connection.disconnect ();
|
||||
blink (true);
|
||||
_blinking = false;
|
||||
blink (true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -360,14 +362,12 @@ private:
|
||||
// short press: activate in press, deactivate on release,
|
||||
// long press + hold, activate on press, de-activate directly on release
|
||||
// e.g. mute/solo press + hold => changed()
|
||||
class FP8MomentaryButton : public FP8ButtonInterface
|
||||
class FP8MomentaryButton : public FP8ButtonBase
|
||||
{
|
||||
public:
|
||||
FP8MomentaryButton (FP8Base& b, uint8_t id)
|
||||
: _base (b)
|
||||
: FP8ButtonBase (b)
|
||||
, _midi_id (id)
|
||||
, _pressed (false)
|
||||
, _active (false)
|
||||
{}
|
||||
|
||||
~FP8MomentaryButton () {
|
||||
@ -391,6 +391,8 @@ public:
|
||||
_hold_connection.disconnect ();
|
||||
}
|
||||
|
||||
void ignore_release () { }
|
||||
|
||||
bool midi_event (bool a)
|
||||
{
|
||||
if (a == _pressed) {
|
||||
@ -423,12 +425,18 @@ public:
|
||||
}
|
||||
|
||||
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
|
||||
bool _pressed;
|
||||
bool _momentaty;
|
||||
bool _was_active_on_press;
|
||||
bool _active;
|
||||
|
||||
private:
|
||||
bool hold_timeout ()
|
||||
|
@ -91,6 +91,7 @@ FP8Strip::initialize ()
|
||||
* ie from FaderPort8::connected()
|
||||
*/
|
||||
_solo.set_active (false);
|
||||
_solo.set_blinking (false);
|
||||
_mute.set_active (false);
|
||||
|
||||
/* reset momentary button state */
|
||||
@ -414,8 +415,16 @@ void
|
||||
FP8Strip::notify_solo_changed ()
|
||||
{
|
||||
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 {
|
||||
_solo.set_blinking (false);
|
||||
_solo.set_active (false);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user