for MCP devices that don't handshake, turn them on as soon as we call ::connectivity_established() so that _active == true, and we will actually write to them

git-svn-id: svn://localhost/ardour2/branches/3.0@14165 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2013-03-06 20:15:28 +00:00
parent 95c86bec2d
commit 8f091de64b
5 changed files with 27 additions and 17 deletions

View File

@ -178,6 +178,12 @@ MackieControlProtocol::midi_connectivity_established ()
for (Surfaces::const_iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
(*si)->say_hello ();
}
if (_device_info.no_handshake()) {
for (Surfaces::const_iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
(*si)->turn_it_on ();
}
}
}
// go to the previous track.
@ -532,21 +538,23 @@ MackieControlProtocol::update_surfaces()
void
MackieControlProtocol::initialize()
{
Glib::Threads::Mutex::Lock lm (surfaces_lock);
if (surfaces.empty()) {
return;
{
Glib::Threads::Mutex::Lock lm (surfaces_lock);
if (surfaces.empty()) {
return;
}
if (!surfaces.front()->active ()) {
return;
}
// sometimes the jog wheel is a pot
if (_device_info.has_jog_wheel()) {
surfaces.front()->blank_jog_ring ();
}
}
if (!surfaces.front()->active ()) {
return;
}
// sometimes the jog wheel is a pot
if (_device_info.has_jog_wheel()) {
surfaces.front()->blank_jog_ring ();
}
// update global buttons and displays
notify_record_state_changed();

View File

@ -297,12 +297,11 @@ Strip::notify_gain_changed (bool force_update)
control = _fader;
}
boost::shared_ptr<AutomationControl> ac = _route->gain_control();
float gain_coefficient = ac->get_value();
float normalized_position = ac->internal_to_interface (gain_coefficient);
if (force_update || normalized_position != _last_gain_position_written) {
if (_surface->mcp().flip_mode()) {

View File

@ -698,6 +698,8 @@ Surface::write (const MidiByteArray& data)
{
if (_active) {
_port->write (data);
} else {
DEBUG_TRACE (DEBUG::MackieControl, "surface not active, write ignored\n");
}
}

View File

@ -146,7 +146,8 @@ public:
void next_jog_mode ();
void set_jog_mode (Mackie::JogWheel::Mode);
void notify_metering_state_changed();
void notify_metering_state_changed();
void turn_it_on ();
protected:
@ -170,7 +171,6 @@ public:
void init_strips (uint32_t n);
void setup_master ();
void master_gain_changed ();
void turn_it_on ();
};
}

View File

@ -112,6 +112,7 @@ int
SurfacePort::write (const MidiByteArray & mba)
{
if (mba.empty()) {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("port %1 asked to write an empty MBA\n", output_port().name()));
return 0;
}