summaryrefslogtreecommitdiff
path: root/libs/ardour/playlist.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-06-16 00:18:27 +1000
committernick_m <mainsbridge@gmail.com>2016-07-10 02:18:36 +1000
commit94e0a15325278ec26dbeba4990a0e883db859338 (patch)
treee4d97368112f92ba8a66c673b68c68f7a76b025a /libs/ardour/playlist.cc
parent2d5238d87581bc0ff9dcaaa8aad9e255b5d9c370 (diff)
Exact beat - provide audio->music mapping for region split.
- for those not in the know, this series provides a way to remove the temporal distortion introduced when using an audio frame-based gui for music-locked objects. In short, the gui uses an audio frame representation to move objects. It displays the object using frame_at_beat(), quantizing the time value to audio frames. This is fine until the user selects that frame but expects it to be interpreted as a beat. Thus beat_at_frame() would not produce the user-expected beat (temporal quantization error of up to 0.5 audio samples). This is one method of mapping audio time to music time accurately.
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r--libs/ardour/playlist.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 58405e4755..3797f2f0c1 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -1384,12 +1384,12 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
/* XXX: may not be necessary; Region::post_set should do this, I think */
for (RegionList::iterator r = fixup.begin(); r != fixup.end(); ++r) {
- (*r)->recompute_position_from_lock_style ();
+ (*r)->recompute_position_from_lock_style (0);
}
}
void
- Playlist::split (framepos_t at)
+ Playlist::split (framepos_t at, const int32_t& sub_num)
{
RegionWriteLock rlock (this);
RegionList copy (regions.rlist());
@@ -1398,19 +1398,19 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
*/
for (RegionList::iterator r = copy.begin(); r != copy.end(); ++r) {
- _split_region (*r, at);
+ _split_region (*r, at, sub_num);
}
}
void
- Playlist::split_region (boost::shared_ptr<Region> region, framepos_t playlist_position)
+ Playlist::split_region (boost::shared_ptr<Region> region, framepos_t playlist_position, const int32_t& sub_num)
{
RegionWriteLock rl (this);
- _split_region (region, playlist_position);
+ _split_region (region, playlist_position, sub_num);
}
void
- Playlist::_split_region (boost::shared_ptr<Region> region, framepos_t playlist_position)
+ Playlist::_split_region (boost::shared_ptr<Region> region, framepos_t playlist_position, const int32_t& sub_num)
{
if (!region->covers (playlist_position)) {
return;
@@ -1451,7 +1451,7 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
since it supplies that offset to the Region constructor, which
is necessary to get audio region gain envelopes right.
*/
- left = RegionFactory::create (region, 0, plist);
+ left = RegionFactory::create (region, 0, plist, true, sub_num);
}
RegionFactory::region_name (after_name, region->name(), false);
@@ -1466,7 +1466,7 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
plist.add (Properties::layer, region->layer ());
/* same note as above */
- right = RegionFactory::create (region, before, plist);
+ right = RegionFactory::create (region, before, plist, true, sub_num);
}
add_region_internal (left, region->position());