mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Tempo ramps - fix save/restore of region position_lock_style.
This commit is contained in:
parent
87d49cd6ec
commit
d14c660261
1 changed files with 13 additions and 17 deletions
|
|
@ -1197,9 +1197,8 @@ Region::state ()
|
||||||
/* note: flags are stored by derived classes */
|
/* note: flags are stored by derived classes */
|
||||||
|
|
||||||
if (_position_lock_style != AudioTime) {
|
if (_position_lock_style != AudioTime) {
|
||||||
stringstream str;
|
snprintf (buf, sizeof(buf), "%lf", _beat);
|
||||||
str << _beat;
|
node->add_property ("beat", buf);
|
||||||
node->add_property ("beat", str.str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t n=0; n < _sources.size(); ++n) {
|
for (uint32_t n=0; n < _sources.size(); ++n) {
|
||||||
|
|
@ -1270,20 +1269,6 @@ Region::_set_state (const XMLNode& node, int /*version*/, PropertyChange& what_c
|
||||||
|
|
||||||
if (_position_lock_style == MusicTime) {
|
if (_position_lock_style == MusicTime) {
|
||||||
if ((prop = node.property ("bbt-position")) == 0) {
|
if ((prop = node.property ("bbt-position")) == 0) {
|
||||||
/* missing BBT info, revert to audio time locking */
|
|
||||||
_position_lock_style = AudioTime;
|
|
||||||
} else {
|
|
||||||
if (sscanf (prop->value().c_str(), "%d|%d|%d",
|
|
||||||
&bbt_time.bars,
|
|
||||||
&bbt_time.beats,
|
|
||||||
&bbt_time.ticks) != 3) {
|
|
||||||
_position_lock_style = AudioTime;
|
|
||||||
}
|
|
||||||
_beat = _session.tempo_map().bbt_to_beats (bbt_time);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_position_lock_style == MusicTime) {
|
|
||||||
if ((prop = node.property ("beat")) == 0) {
|
if ((prop = node.property ("beat")) == 0) {
|
||||||
/* missing BBT info, revert to audio time locking */
|
/* missing BBT info, revert to audio time locking */
|
||||||
_position_lock_style = AudioTime;
|
_position_lock_style = AudioTime;
|
||||||
|
|
@ -1292,6 +1277,17 @@ Region::_set_state (const XMLNode& node, int /*version*/, PropertyChange& what_c
|
||||||
_position_lock_style = AudioTime;
|
_position_lock_style = AudioTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (sscanf (prop->value().c_str(), "%d|%d|%d",
|
||||||
|
&bbt_time.bars,
|
||||||
|
&bbt_time.beats,
|
||||||
|
&bbt_time.ticks) != 3) {
|
||||||
|
_position_lock_style = AudioTime;
|
||||||
|
} else {
|
||||||
|
_beat = _session.tempo_map().bbt_to_beats (bbt_time);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fix problems with old sessions corrupted by impossible
|
/* fix problems with old sessions corrupted by impossible
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue