Tempo ramps - fix messed up meter section state, audio-locked tempos ignore the bbt...
[ardour.git] / libs / ardour / tempo.cc
index 904c845454a5fb33b9f728afa026a77351041da5..9f81f616e4919383da7ac70662ea89b36c35906a 100644 (file)
@@ -500,7 +500,7 @@ MeterSection::MeterSection (const XMLNode& node)
                    &bbt.beats,
                    &bbt.ticks) < 3) {
                error << _("MeterSection XML node has an illegal \"bbt\" value") << endmsg;
-               throw failed_constructor();
+               //throw failed_constructor();
        }
 
        start.second = bbt;
@@ -523,9 +523,8 @@ MeterSection::MeterSection (const XMLNode& node)
                        throw failed_constructor();
                }
        }
-
        if (sscanf (prop->value().c_str(), "%lf", &_divisions_per_bar) != 1 || _divisions_per_bar < 0.0) {
-               error << _("MeterSection XML node has an illegal \"beats-per-bar\" or \"divisions-per-bar\" value") << endmsg;
+               error << _("MeterSection XML node has an illegal \"divisions-per-bar\" value") << endmsg;
                throw failed_constructor();
        }
 
@@ -533,7 +532,6 @@ MeterSection::MeterSection (const XMLNode& node)
                error << _("MeterSection XML node has no \"note-type\" property") << endmsg;
                throw failed_constructor();
        }
-
        if (sscanf (prop->value().c_str(), "%lf", &_note_type) != 1 || _note_type < 0.0) {
                error << _("MeterSection XML node has an illegal \"note-type\" value") << endmsg;
                throw failed_constructor();
@@ -541,7 +539,6 @@ MeterSection::MeterSection (const XMLNode& node)
 
        if ((prop = node.property ("lock-style")) == 0) {
                warning << _("MeterSection XML node has no \"lock-style\" property") << endmsg;
-               //throw failed_constructor();
                set_position_lock_style (PositionLockStyle::MusicTime);
        } else {
                set_position_lock_style (PositionLockStyle (string_2_enum (prop->value(), position_lock_style())));
@@ -570,9 +567,9 @@ MeterSection::get_state() const
        snprintf (buf, sizeof (buf), "%lf", beat());
        root->add_property ("beat", buf);
        snprintf (buf, sizeof (buf), "%f", _note_type);
-       root->add_property ("frame", buf);
-       snprintf (buf, sizeof (buf), "%li", frame());
        root->add_property ("note-type", buf);
+       snprintf (buf, sizeof (buf), "%li", frame());
+       root->add_property ("frame", buf);
        root->add_property ("lock-style", enum_2_string (position_lock_style()));
        snprintf (buf, sizeof (buf), "%f", _divisions_per_bar);
        root->add_property ("divisions-per-bar", buf);