diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 8b83a9ca70..ec6a6463b7 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1369,6 +1369,13 @@ Editor::temporal_zoom (gdouble fpu) } nfpu = fpu; + + // Imposing an arbitrary limit to zoom out as too much zoom out produces + // segfaults for lack of memory. If somebody decides this is not high enough I + // believe it can be raisen to higher values but some limit must be in place. + if (nfpu > 8e+08) { + nfpu = 8e+08; + } new_page_size = (framepos_t) floor (_canvas_width * nfpu); half_page_size = new_page_size / 2; diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 8dd2eb32a3..b13314fdc4 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -473,7 +473,7 @@ MackieControlProtocol::update_global_led (int id, LedState ls) { boost::shared_ptr surface = surfaces.front(); - if (!surface->type() == mcu) { + if (surface->type() != mcu) { return; } @@ -734,7 +734,8 @@ MackieControlProtocol::format_bbt_timecode (framepos_t now_frame) os << setw(3) << setfill('0') << bbt_time.bars; os << setw(2) << setfill('0') << bbt_time.beats; - os << setw(2) << setfill('0') << bbt_time.ticks / 1000; + os << ' '; + os << setw(1) << setfill('0') << bbt_time.ticks / 1000; os << setw(3) << setfill('0') << bbt_time.ticks % 1000; return os.str(); @@ -750,10 +751,12 @@ MackieControlProtocol::format_timecode_timecode (framepos_t now_frame) // digits: 888/88/88/888 // Timecode mode: Hours/Minutes/Seconds/Frames ostringstream os; - os << setw(3) << setfill('0') << timecode.hours; + os << ' '; + os << setw(2) << setfill('0') << timecode.hours; os << setw(2) << setfill('0') << timecode.minutes; os << setw(2) << setfill('0') << timecode.seconds; - os << setw(3) << setfill('0') << timecode.frames; + os << ' '; + os << setw(2) << setfill('0') << timecode.frames; return os.str(); } @@ -767,7 +770,7 @@ MackieControlProtocol::update_timecode_display() boost::shared_ptr surface = surfaces.front(); - if (surface->type() != mcu || !_device_info.has_timecode_display()) { + if (surface->type() != mcu || !_device_info.has_timecode_display() || !surface->active ()) { return; } diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 6fb94cba93..a63f4757e7 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -515,6 +515,15 @@ Surface::turn_it_on () (*s)->notify_all (); } update_view_mode_display (); + if (_mcp.device_info ().has_master_fader ()) { + master_gain_changed (); + } + + if (_mcp.device_info ().has_global_controls ()) { + _mcp.update_global_button (Button::Read, _mcp.metering_active ()); + _mcp.update_global_button (Button::Stop, _mcp.get_session ().transport_stopped ()); + _mcp.update_global_button (Button::Play, (_mcp.get_session ().transport_speed () == 1.0f)); + } } } @@ -578,7 +587,7 @@ Surface::zero_all () } if (_mcp.device_info().has_two_character_display()) { - show_two_char_display (string (2, ' '), string (2, '.')); + show_two_char_display (string (2, '0'), string (2, ' ')); } if (_mcp.device_info().has_master_fader ()) { @@ -717,18 +726,18 @@ Surface::display_timecode (const std::string & timecode, const std::string & las while (local_timecode.length() < 10) { local_timecode += " "; } - - // find the suffix of local_timecode that differs from last_timecode - std::pair pp = mismatch (last_timecode.begin(), last_timecode.end(), local_timecode.begin()); - int position = 0x40; - - // translate characters. These are sent in reverse order of display - // hence the reverse iterators - string::reverse_iterator rend = reverse_iterator (pp.second); - for (string::reverse_iterator it = local_timecode.rbegin(); it != rend; ++it) { - MidiByteArray retval (2, 0xb0, position++); - retval << translate_seven_segment (*it); + // translate characters. + // Only the characters that actually changed are sent. + int position = 0x3f; + int i; + for (i = local_timecode.length () - 1; i >= 0; i--) { + position++; + if (local_timecode[i] == last_timecode[i]) { + continue; + } + MidiByteArray retval (2, 0xb0, position); + retval << translate_seven_segment (local_timecode[i]); _port->write (retval); } }