VCAManager& vca_manager() { return *_vca_manager; }
+ bool midi_regions_use_bbt_beats () { return _midi_regions_use_bbt_beats; }
+
protected:
friend class AudioEngine;
void set_block_size (pframes_t nframes);
boost::shared_ptr<Route> get_midi_nth_route_by_id (PresentationInfo::order_t n) const;
std::string created_with;
+
+ bool _midi_regions_use_bbt_beats;
};
if (position_lock_style() == AudioTime) {
update_length_beats (0);
}
- }
- _start_pulse = _start_beats.val().to_double() / 4.0;
- _length_pulse = _length_beats.val().to_double() / 4.0;
+ if (_session.midi_regions_use_bbt_beats()) {
+ info << _("Updating midi region start and length beats") << endmsg;
+ TempoMap& map (_session.tempo_map());
+ _start_beats = Evoral::Beats ((map.pulse_at_beat (_beat) - map.pulse_at_beat (_beat - _start_beats.val().to_double())) * 4.0);
+ _length_beats = Evoral::Beats ((map.pulse_at_beat (_beat + _length_beats.val().to_double()) - map.pulse_at_beat (_beat)) * 4.0);
+
+ }
+
+ _start_pulse = _start_beats.val().to_double() / 4.0;
+ _length_pulse = _length_beats.val().to_double() / 4.0;
+ }
return ret;
}
, _midi_ports (0)
, _mmc (0)
, _vca_manager (new VCAManager (*this))
+ , _midi_regions_use_bbt_beats (false)
{
uint32_t sr = 0;
}
}
#endif
+ _midi_regions_use_bbt_beats = false;
_is_new = false;
session_loaded ();
-
BootMessage (_("Session loading complete"));
}
return -1;
}
}
+ } else {
+ XMLNode* child;
+ if ((child = find_named_node (root, "ProgramVersion")) != 0) {
+ if ((prop = child->property ("modified-with")) != 0) {
+ std::string modified_with = prop->value ();
+
+ const double modified_with_version = atof (modified_with.substr ( modified_with.find(" ", 0) + 1, string::npos).c_str());
+ const int modified_with_revision = atoi (modified_with.substr (modified_with.find("-", 0) + 1, string::npos).c_str());
+
+ if (modified_with_version <= 5.3 && !(modified_with_version == 5.3 && modified_with_revision >= 42)) {
+ _midi_regions_use_bbt_beats = true;
+ }
+ }
+ }
}
save_snapshot_name (snapshot_name);