- char buf[256];
- LocaleGuard lg;
-
- snprintf (buf, sizeof (buf), "%lf", pulse());
- root->add_property ("pulse", buf);
- snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
- bbt().bars,
- bbt().beats,
- bbt().ticks);
- root->add_property ("bbt", buf);
- snprintf (buf, sizeof (buf), "%lf", beat());
- root->add_property ("beat", buf);
- snprintf (buf, sizeof (buf), "%lf", _note_type);
- 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), "%lf", _divisions_per_bar);
- root->add_property ("divisions-per-bar", buf);
- snprintf (buf, sizeof (buf), "%s", !initial()?"yes":"no");
- root->add_property ("movable", buf);
+
+ MetricSection::add_state_to_node (*root);
+
+ std::string bbt_str;
+ bbt_time_to_string (_bbt, bbt_str);
+ root->set_property ("bbt", bbt_str);
+ root->set_property ("beat", beat());
+ root->set_property ("note-type", _note_type);
+ root->set_property ("divisions-per-bar", _divisions_per_bar);