track add/remove of monitor and/or master busses in mackie support code.
Somehow fails to move master fader to correct position when monitor section is added
This commit is contained in:
parent
6e13b91a35
commit
8bdab38d43
@ -696,6 +696,7 @@ MackieControlProtocol::connect_session_signals()
|
|||||||
{
|
{
|
||||||
// receive routes added
|
// receive routes added
|
||||||
session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_route_added, this, _1), this);
|
session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_route_added, this, _1), this);
|
||||||
|
session->RouteAddedOrRemoved.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_route_added_or_removed, this), this);
|
||||||
// receive record state toggled
|
// receive record state toggled
|
||||||
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_record_state_changed, this), this);
|
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_record_state_changed, this), this);
|
||||||
// receive transport state changed
|
// receive transport state changed
|
||||||
@ -1190,6 +1191,15 @@ void MackieControlProtocol::notify_parameter_changed (std::string const & p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MackieControlProtocol::notify_route_added_or_removed ()
|
||||||
|
{
|
||||||
|
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||||
|
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||||
|
(*s)->master_monitor_may_have_changed ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// RouteList is the set of routes that have just been added
|
// RouteList is the set of routes that have just been added
|
||||||
void
|
void
|
||||||
MackieControlProtocol::notify_route_added (ARDOUR::RouteList & rl)
|
MackieControlProtocol::notify_route_added (ARDOUR::RouteList & rl)
|
||||||
@ -1202,6 +1212,15 @@ MackieControlProtocol::notify_route_added (ARDOUR::RouteList & rl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* special case: single route, and it is the monitor or master out */
|
||||||
|
|
||||||
|
if (rl.size() == 1 && (rl.front()->is_monitor() || rl.front()->is_master())) {
|
||||||
|
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||||
|
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||||
|
(*s)->master_monitor_may_have_changed ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// currently assigned banks are less than the full set of
|
// currently assigned banks are less than the full set of
|
||||||
// strips, so activate the new strip now.
|
// strips, so activate the new strip now.
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@ class MackieControlProtocol
|
|||||||
|
|
||||||
void handle_button_event (Mackie::Surface&, Mackie::Button& button, Mackie::ButtonState);
|
void handle_button_event (Mackie::Surface&, Mackie::Button& button, Mackie::ButtonState);
|
||||||
|
|
||||||
|
void notify_route_added_or_removed ();
|
||||||
void notify_route_added (ARDOUR::RouteList &);
|
void notify_route_added (ARDOUR::RouteList &);
|
||||||
void notify_remote_id_changed();
|
void notify_remote_id_changed();
|
||||||
|
|
||||||
|
@ -363,6 +363,14 @@ Surface::init_strips (uint32_t n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Surface::master_monitor_may_have_changed ()
|
||||||
|
{
|
||||||
|
std::cerr << "MMmhc\n";
|
||||||
|
setup_master ();
|
||||||
|
std::cerr << " done\n";
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Surface::setup_master ()
|
Surface::setup_master ()
|
||||||
{
|
{
|
||||||
@ -373,14 +381,14 @@ Surface::setup_master ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m) {
|
if (!m) {
|
||||||
|
_master_fader->set_control (boost::shared_ptr<AutomationControl>());
|
||||||
|
master_connection.disconnect ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_master_fader) {
|
||||||
_master_fader = dynamic_cast<Fader*> (Fader::factory (*this, _mcp.device_info().strip_cnt(), "master", *groups["master"]));
|
_master_fader = dynamic_cast<Fader*> (Fader::factory (*this, _mcp.device_info().strip_cnt(), "master", *groups["master"]));
|
||||||
|
|
||||||
_master_fader->set_control (m->gain_control());
|
|
||||||
m->gain_control()->Changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&Surface::master_gain_changed, this), ui_context());
|
|
||||||
|
|
||||||
Groups::iterator group_it;
|
Groups::iterator group_it;
|
||||||
group_it = groups.find("master");
|
group_it = groups.find("master");
|
||||||
|
|
||||||
@ -392,9 +400,18 @@ Surface::setup_master ()
|
|||||||
master_button.id,
|
master_button.id,
|
||||||
master_button.label,
|
master_button.label,
|
||||||
*(group_it->second)
|
*(group_it->second)
|
||||||
));
|
));
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("surface %1 Master Fader new button BID %2 id %3\n",
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("surface %1 Master Fader new button BID %2 id %3\n",
|
||||||
number(), Button::MasterFaderTouch, bb->id()));
|
number(), Button::MasterFaderTouch, bb->id()));
|
||||||
|
} else {
|
||||||
|
master_connection.disconnect ();
|
||||||
|
}
|
||||||
|
|
||||||
|
_master_fader->set_control (m->gain_control());
|
||||||
|
m->gain_control()->Changed.connect (master_connection, MISSING_INVALIDATOR, boost::bind (&Surface::master_gain_changed, this), ui_context());
|
||||||
|
_last_master_gain_written = FLT_MAX; /* some essentially impossible value */
|
||||||
|
master_gain_changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -406,6 +423,7 @@ Surface::master_gain_changed ()
|
|||||||
|
|
||||||
boost::shared_ptr<AutomationControl> ac = _master_fader->control();
|
boost::shared_ptr<AutomationControl> ac = _master_fader->control();
|
||||||
if (!ac) {
|
if (!ac) {
|
||||||
|
std::cerr << "no control!\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +434,8 @@ Surface::master_gain_changed ()
|
|||||||
|
|
||||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface::master_gain_changed: updating surface master fader\n");
|
DEBUG_TRACE (DEBUG::MackieControl, "Surface::master_gain_changed: updating surface master fader\n");
|
||||||
|
|
||||||
|
std::cerr << "send " << normalized_position << std::endl;
|
||||||
|
|
||||||
_port->write (_master_fader->set_position (normalized_position));
|
_port->write (_master_fader->set_position (normalized_position));
|
||||||
_last_master_gain_written = normalized_position;
|
_last_master_gain_written = normalized_position;
|
||||||
}
|
}
|
||||||
|
@ -169,6 +169,8 @@ public:
|
|||||||
|
|
||||||
bool connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool);
|
bool connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool);
|
||||||
|
|
||||||
|
void master_monitor_may_have_changed ();
|
||||||
|
|
||||||
XMLNode& get_state ();
|
XMLNode& get_state ();
|
||||||
int set_state (const XMLNode&, int version);
|
int set_state (const XMLNode&, int version);
|
||||||
|
|
||||||
@ -183,6 +185,7 @@ public:
|
|||||||
Mackie::JogWheel* _jog_wheel;
|
Mackie::JogWheel* _jog_wheel;
|
||||||
Fader* _master_fader;
|
Fader* _master_fader;
|
||||||
float _last_master_gain_written;
|
float _last_master_gain_written;
|
||||||
|
PBD::ScopedConnection master_connection;
|
||||||
|
|
||||||
void handle_midi_sysex (MIDI::Parser&, MIDI::byte *, size_t count);
|
void handle_midi_sysex (MIDI::Parser&, MIDI::byte *, size_t count);
|
||||||
MidiByteArray host_connection_query (MidiByteArray& bytes);
|
MidiByteArray host_connection_query (MidiByteArray& bytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user