+ if (_send_pos) {
+ if (_pos->speed == 0.0f) {
+ send_position_event (llrint (_pos->midi_beats), 0, nframes);
+ } else if (_pos->speed == 1.0f) {
+ send_stop_event (0, nframes);
+
+ if (_pos->frame == 0) {
+ send_start_event (0, nframes);
+ } else {
+ send_position_event (llrint (_pos->midi_beats), 0, nframes);
+ send_continue_event (0, nframes);
+ }
+ } else {
+ /* Varispeed not supported */
+ }
+
+ _send_pos = false;
+ }
+
+
+ if (_send_state) {
+ if (_pos->speed == 1.0f) {
+ if (_session->get_play_loop()) {
+ assert(_session->locations()->auto_loop_location());
+
+ if (_pos->frame == _session->locations()->auto_loop_location()->start()) {
+ send_start_event (0, nframes);
+ } else {
+ send_continue_event (0, nframes);
+ }
+
+ } else if (_pos->frame == 0) {
+ send_start_event (0, nframes);
+ } else {
+ send_continue_event (0, nframes);
+ }
+
+ // send_midi_clock_event (0);
+
+ } else if (_pos->speed == 0.0f) {
+ send_stop_event (0, nframes);
+ send_position_event (llrint (_pos->midi_beats), 0, nframes);
+ }
+
+ _send_state = false;
+ }
+
+ if (_session->transport_speed() != 1.0f) {
+ /* no varispeed support and nothing to do after this if stopped */