summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-25 04:09:15 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:17 +1000
commit533e5c40697e34af467b309849119596992f0f69 (patch)
treeb4abe43870d7d8057dd91dac4f5384199eddc99c /libs
parent2a8104f2f8e8fc7c800fd35c788c48eca09d6fdc (diff)
Rwbi ramps - midi regions resize when tempo map changed.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/midi_region.h2
-rw-r--r--libs/ardour/ardour/region.h2
-rw-r--r--libs/ardour/midi_region.cc12
-rw-r--r--libs/ardour/region.cc11
4 files changed, 18 insertions, 9 deletions
diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h
index 81f490f51c..b952c90f82 100644
--- a/libs/ardour/ardour/midi_region.h
+++ b/libs/ardour/ardour/midi_region.h
@@ -140,7 +140,7 @@ class LIBARDOUR_API MidiRegion : public Region
void model_automation_state_changed (Evoral::Parameter const &);
void set_start_beats_from_start_frames ();
- void update_after_tempo_map_change ();
+ void update_after_tempo_map_change (bool send_change = true);
std::set<Evoral::Parameter> _filtered_parameters; ///< parameters that we ask our source not to return when reading
PBD::ScopedConnection _model_connection;
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 383bc6675d..29f4244dff 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -209,7 +209,7 @@ class LIBARDOUR_API Region
void set_position (framepos_t);
void set_initial_position (framepos_t);
void special_set_position (framepos_t);
- virtual void update_after_tempo_map_change ();
+ virtual void update_after_tempo_map_change (bool send_change = true);
void nudge_position (frameoffset_t);
bool at_natural_position () const;
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index 6a9e1cd762..7bb5bc7c06 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -196,14 +196,20 @@ MidiRegion::set_length_internal (framecnt_t len)
}
void
-MidiRegion::update_after_tempo_map_change ()
+MidiRegion::update_after_tempo_map_change (bool /* send */)
{
- Region::update_after_tempo_map_change ();
+ Region::update_after_tempo_map_change (false);
/* _position has now been updated for the new tempo map */
_start = _position - _session.tempo_map().framepos_minus_beats (_position, _start_beats);
+ _length = _session.tempo_map().framepos_plus_beats (_position, _length_beats) - _position;
- send_change (Properties::start);
+ PropertyChange s_and_l;
+ s_and_l.add (Properties::start);
+ s_and_l.add (Properties::length);
+ s_and_l.add (Properties::position);
+
+ send_change (s_and_l);
}
void
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 0ae709d99e..1b9793313d 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -546,21 +546,24 @@ Region::set_position_lock_style (PositionLockStyle ps)
}
void
-Region::update_after_tempo_map_change ()
+Region::update_after_tempo_map_change (bool send)
{
boost::shared_ptr<Playlist> pl (playlist());
if (!pl || _position_lock_style != MusicTime) {
return;
}
- TempoMap& map (_session.tempo_map());
- framepos_t pos = map.frame_at_beat (_beat);
+
+ const framepos_t pos = _session.tempo_map().frame_at_beat (_beat);
set_position_internal (pos, false);
/* do this even if the position is the same. this helps out
a GUI that has moved its representation already.
*/
- send_change (Properties::position);
+
+ if (send) {
+ send_change (Properties::position);
+ }
}
void