13
0

Quick fix to get trim working again (bahaving oddly during trim right now)

This commit is contained in:
nick_m 2016-06-21 00:50:23 +10:00
parent 32a579ec28
commit 7a6efaaf3d
2 changed files with 10 additions and 4 deletions

View File

@ -1410,12 +1410,17 @@ MidiRegionView::region_resized (const PropertyChange& what_changed)
_region_relative_time_converter.set_origin_b(_region->position());
_region_relative_time_converter_double.set_origin_b(_region->position());
/* reset_width dependent_items() redisplays model */
}
if (what_changed.contains (ARDOUR::Properties::start) ||
what_changed.contains (ARDOUR::Properties::position)) {
_source_relative_time_converter.set_origin_b (_region->position() - _region->start());
}
if (what_changed.contains (ARDOUR::Properties::length)) {
enable_display (true);
}
}
void
@ -1425,7 +1430,7 @@ MidiRegionView::reset_width_dependent_items (double pixel_width)
if (_enable_display) {
redisplay_model();
}
}
for (PatchChanges::iterator x = _patch_changes.begin(); x != _patch_changes.end(); ++x) {
if ((*x)->canvas_item()->width() >= _pixel_width) {
@ -1754,8 +1759,9 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
}
// Update color in case velocity has changed
//ev->set_fill_color(ev->base_color());
//ev->set_outline_color(ev->calculate_outline(ev->base_color(), ev->selected()));
const uint32_t base_col = ev->base_color();
ev->set_fill_color(base_col);
ev->set_outline_color(ev->calculate_outline(base_col, ev->selected()));
if (update_ghost_regions) {
for (std::vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {

View File

@ -107,7 +107,7 @@ MidiRegion::MidiRegion (boost::shared_ptr<const MidiRegion> other, frameoffset_t
, _start_beats (Properties::start_beats, Evoral::Beats())
, _length_beats (Properties::length_beats, other->_length_beats)
{
_start_beats = Evoral::Beats (_session.tempo_map().exact_beat_at_frame (other->_position + offset - other->_start, sub_num) - other->beat());
_start_beats = Evoral::Beats (_session.tempo_map().exact_beat_at_frame ((other->_position + offset), sub_num) - other->beat()) + other->_start_beats;
update_length_beats (sub_num);
register_properties ();