Compare commits

..

No commits in common. "4339e3c729310b9afdb34c2d31703df132842056" and "be5c64f737f948c7b879ea30815331ebd9af26b1" have entirely different histories.

3 changed files with 13 additions and 30 deletions

View File

@ -1027,20 +1027,13 @@ RegionMotionDrag::collect_ripple_views ()
_editor->get_regionviews_at_or_after (_primary->region()->position(), copy);
TimeAxisView *primary_tav = &_primary->get_time_axis_view();
for (RegionSelection::reverse_iterator i = copy.rbegin(); i != copy.rend(); ++i) {
TimeAxisView *tav = &(*i)->get_time_axis_view();
if (_editor->should_ripple_all() || tav == primary_tav) {
if (!_editor->selection->regions.contains (*i)) {
_views.push_back (DraggingView (*i, this, &(*i)->get_time_axis_view()));
}
if (!_editor->selection->regions.contains (*i)) {
_views.push_back (DraggingView (*i, this, &(*i)->get_time_axis_view()));
}
}
if (_editor->should_ripple_all()) {
_editor->get_markers_to_ripple (_primary->region()->playlist(), _primary->region()->position(), ripple_markers);
}
_editor->get_markers_to_ripple (_primary->region()->playlist(), _primary->region()->position(), ripple_markers);
}
void

View File

@ -9497,7 +9497,6 @@ Editor::do_ripple (boost::shared_ptr<Playlist> target_playlist, timepos_t const
timepos_t
Editor::effective_ripple_mark_start (boost::shared_ptr<Playlist> target_playlist, timepos_t pos)
{
#if 0 /* I do not agree with this behavior - at the very least it ignores regions on *other* tracks and the markers that might be associated with them -Ben */
/* in the target playlist, find the region before the target
* (implicitly given by @param at. Allow all markers that occur between
* the end of the region and @param at to move too. This is
@ -9517,7 +9516,6 @@ Editor::effective_ripple_mark_start (boost::shared_ptr<Playlist> target_playlist
if (last_region_end_before_at < pos) {
pos = last_region_end_before_at.increment();
}
#endif
return pos;
}

View File

@ -1612,10 +1612,18 @@ AudioTrigger::estimate_tempo ()
}
}
/* We don't have too many good choices here. Triggers can fire at any
* time, so there's no special place on the tempo map that we can use
* to get the meter from and thus compute an estimated bar count for
* this region. Our solution for now: just use the first meter.
*/
if (text_tempo < 0) {
breakfastquay::MiniBPM mbpm (_box.session().sample_rate());
mbpm.setBPMRange (metric.tempo().quarter_notes_per_minute () * 0.75, metric.tempo().quarter_notes_per_minute() * 1.5);
_estimated_tempo = mbpm.estimateTempoOfSamples (data[0], data.length);
//cerr << name() << "MiniBPM Estimated: " << _estimated_tempo << " bpm from " << (double) data.length / _box.session().sample_rate() << " seconds\n";
@ -1634,24 +1642,6 @@ AudioTrigger::estimate_tempo ()
/* fractional beatcnt */
double maybe_beats = (seconds / 60.) * _estimated_tempo;
double beatcount = round (maybe_beats);
/* the vast majority of third-party clips are 1,2,4,8, or 16-bar 'beats'.
* Given no other metadata, it makes things 'just work' if we assume 4/4 time signature, and power-of-2 bars (1,2,4,8 or 16)
* TODO: someday we could provide a widget for users who have unlabeled, un-metadata'd, clips that they *know* are 3/4 or 5/4 or 11/4 */
{
double barcount = round (beatcount/4);
if (barcount <= 18) { /* why not 16 here? fuzzy logic allows minibpm to misjudge the clip a bit */
for (int pwr = 0; pwr <= 4; pwr++) {
float bc = pow(2,pwr);
if (barcount <= bc) {
barcount = bc;
break;
}
}
}
beatcount = round(barcount * 4);
}
double est = _estimated_tempo;
_estimated_tempo = beatcount / (seconds/60.);
DEBUG_TRACE (DEBUG::Triggers, string_compose ("given original estimated tempo %1, rounded beatcnt is %2 : resulting in working bpm = %3\n", est, _beatcnt, _estimated_tempo));
@ -1660,6 +1650,8 @@ AudioTrigger::estimate_tempo ()
set_follow_length(Temporal::BBT_Offset( 0, rint(beatcount), 0));
}
/* use initial tempo in map (assumed for now to be the only one */
#if 0
cerr << "estimated tempo: " << _estimated_tempo << endl;
const samplecnt_t one_beat = tm->bbt_duration_at (timepos_t (AudioTime), BBT_Offset (0, 1, 0)).samples();