, _locked_to_meter (false)
, _clamped (false)
{
- LocaleGuard lg;
-
_legacy_bbt = BBT_Time (0, 0, 0);
BBT_Time bbt;
}
TempoSection::Type old_type;
- if (!node.get_property ("tempo-type", old_type)) {
+ if (node.get_property ("tempo-type", old_type)) {
/* sessions with a tempo-type node contain no end-beats-per-minute.
if the legacy node indicates a constant tempo, simply fill this in with the
start tempo. otherwise we need the next neighbour to know what it will be.
TempoSection::get_state() const
{
XMLNode *root = new XMLNode (xml_state_node_name);
- LocaleGuard lg;
MetricSection::add_state_to_node (*root);
MeterSection::MeterSection (const XMLNode& node, const framecnt_t sample_rate)
: MetricSection (0.0, 0, MusicTime, false, sample_rate), Meter (TempoMap::default_meter())
{
- LocaleGuard lg;
pair<double, BBT_Time> start;
start.first = 0.0;
MeterSection::get_state() const
{
XMLNode *root = new XMLNode (xml_state_node_name);
- LocaleGuard lg;
MetricSection::add_state_to_node (*root);
{
Glib::Threads::RWLock::ReaderLock lm (lock);
- return pulse_at_tempo_locked (_metrics, tempo) * 4.0;;
+ return pulse_at_tempo_locked (_metrics, tempo) * 4.0;
}
/** Returns the whole-note pulse corresponding to the supplied BBT (meter-based) beat.
return can_solve;
}
+
+/** Returns the frame position of the musical position zero */
+framepos_t
+TempoMap::music_origin ()
+{
+ Glib::Threads::RWLock::ReaderLock lm (lock);
+
+ return first_tempo().frame();
+}
+
/** Returns the exact bbt-based beat corresponding to the bar, beat or quarter note subdivision nearest to
* the supplied frame, possibly returning a negative value.
*
if (bar_mod == 0) {
while (pos >= 0 && pos < upper) {
pos = frame_at_minute (minute_at_beat_locked (_metrics, cnt));
- const TempoSection tempo = tempo_section_at_minute_locked (_metrics, minute_at_frame (pos));
const MeterSection meter = meter_section_at_minute_locked (_metrics, minute_at_frame (pos));
const BBT_Time bbt = bbt_at_beat_locked (_metrics, cnt);
+ const double qn = pulse_at_beat_locked (_metrics, cnt) * 4.0;
- points.push_back (BBTPoint (meter, tempo_at_minute_locked (_metrics, minute_at_frame (pos)), pos, bbt.bars, bbt.beats, tempo.c()));
+ points.push_back (BBTPoint (meter, tempo_at_minute_locked (_metrics, minute_at_frame (pos)), pos, bbt.bars, bbt.beats, qn));
++cnt;
}
} else {
while (pos >= 0 && pos < upper) {
pos = frame_at_minute (minute_at_bbt_locked (_metrics, bbt));
- const TempoSection tempo = tempo_section_at_minute_locked (_metrics, minute_at_frame (pos));
const MeterSection meter = meter_section_at_minute_locked (_metrics, minute_at_frame (pos));
- points.push_back (BBTPoint (meter, tempo_at_minute_locked (_metrics, minute_at_frame (pos)), pos, bbt.bars, bbt.beats, tempo.c()));
+ const double qn = pulse_at_bbt_locked (_metrics, bbt) * 4.0;
+
+ points.push_back (BBTPoint (meter, tempo_at_minute_locked (_metrics, minute_at_frame (pos)), pos, bbt.bars, bbt.beats, qn));
bbt.bars += bar_mod;
}
}