+ bool have_periodic_system_messages = false;
+ bool display_periodic_messages = true;
+
+ if (!Config->get_never_display_periodic_midi()) {
+
+ for (MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) {
+ const boost::shared_ptr<const Evoral::MIDIEvent<Evoral::MusicalTime> > mev =
+ boost::static_pointer_cast<const Evoral::MIDIEvent<Evoral::MusicalTime> > (*i);
+
+ if (mev) {
+ if (mev->is_spp() || mev->is_mtc_quarter() || mev->is_mtc_full()) {
+ have_periodic_system_messages = true;
+ break;
+ }
+ }
+ }
+
+ if (have_periodic_system_messages) {
+ double zoom = trackview.editor().get_current_zoom (); // frames per pixel
+
+ /* get an approximate value for the number of samples per video frame */
+
+ double video_frame = trackview.session()->frame_rate() * (1.0/30);
+
+ /* if we are zoomed out beyond than the cutoff (i.e. more
+ * frames per pixel than frames per 4 video frames), don't
+ * show periodic sysex messages.
+ */
+
+ if (zoom > (video_frame*4)) {
+ display_periodic_messages = false;
+ }
+ }
+ } else {
+ display_periodic_messages = false;
+ }
+