summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-10-05 23:14:48 +0000
committerDavid Robillard <d@drobilla.net>2008-10-05 23:14:48 +0000
commit6b0d22268b85f7033eb7ddcfe9e50e21b86eec34 (patch)
treef339432b60ee666d47a3bddd59c63b8c3b27a69b /libs/ardour
parent14a40f32f696c0d2b4a51fe762c5038a52079706 (diff)
Normalize XML property name style, preserving old session loading (on load _ will be converted to -).
Still to go: Non-consistent PBD tag names, colours. git-svn-id: svn://localhost/ardour2/branches/3.0@3872 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/audio_playlist_importer.cc2
-rw-r--r--libs/ardour/automation_list.cc6
-rw-r--r--libs/ardour/midi_model.cc2
-rw-r--r--libs/ardour/region.cc2
-rw-r--r--libs/ardour/session_command.cc4
-rw-r--r--libs/ardour/session_state.cc15
6 files changed, 15 insertions, 16 deletions
diff --git a/libs/ardour/audio_playlist_importer.cc b/libs/ardour/audio_playlist_importer.cc
index d6a2b2f9fb..d7b6ea42fc 100644
--- a/libs/ardour/audio_playlist_importer.cc
+++ b/libs/ardour/audio_playlist_importer.cc
@@ -171,7 +171,7 @@ AudioPlaylistImporter::move ()
boost::shared_ptr<Playlist> playlist;
// Update diskstream id
- xml_playlist.property ("orig_diskstream_id")->set_value (diskstream_id.to_s());
+ xml_playlist.property ("orig-diskstream-id")->set_value (diskstream_id.to_s());
// Update region XML in playlist and prepare sources
xml_playlist.remove_nodes("Region");
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index 6e2d959628..68bbd17162 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -227,11 +227,11 @@ AutomationList::state (bool full)
snprintf (buf, sizeof (buf), "%.12g", _default_value);
root->add_property ("default", buf);
snprintf (buf, sizeof (buf), "%.12g", _min_yval);
- root->add_property ("min_yval", buf);
+ root->add_property ("min-yval", buf);
snprintf (buf, sizeof (buf), "%.12g", _max_yval);
- root->add_property ("max_yval", buf);
+ root->add_property ("max-yval", buf);
snprintf (buf, sizeof (buf), "%.12g", _max_xval);
- root->add_property ("max_xval", buf);
+ root->add_property ("max-xval", buf);
root->add_property ("interpolation-style", enum_2_string (_interpolation));
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index 1f23ee9561..539881e51c 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -263,7 +263,7 @@ int MidiModel::DeltaCommand::set_state(const XMLNode& delta_command)
XMLNode& MidiModel::DeltaCommand::get_state()
{
XMLNode *delta_command = new XMLNode(DELTA_COMMAND_ELEMENT);
- delta_command->add_property("midi_source", _model->midi_source()->id().to_s());
+ delta_command->add_property("midi-source", _model->midi_source()->id().to_s());
XMLNode *added_notes = delta_command->add_child(ADDED_NOTES_ELEMENT);
for_each(_added_notes.begin(), _added_notes.end(), sigc::compose(
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 7adc9b80ab..79bdb76aee 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -1098,7 +1098,7 @@ Region::state (bool full_state)
break;
}
- node->add_property ("first_edit", fe);
+ node->add_property ("first-edit", fe);
/* note: flags are stored by derived classes */
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index b696f7d410..bda3475a30 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -54,7 +54,7 @@ Session::memento_command_factory(XMLNode *n)
XMLNode *child = 0;
/* get id */
- id = PBD::ID(n->property("obj_id")->value());
+ id = PBD::ID(n->property("obj-id")->value());
/* get before/after */
@@ -81,7 +81,7 @@ Session::memento_command_factory(XMLNode *n)
}
/* create command */
- string obj_T = n->property ("type_name")->value();
+ string obj_T = n->property ("type-name")->value();
if (obj_T == typeid (AudioRegion).name() || obj_T == typeid (MidiRegion).name() || obj_T == typeid (Region).name()) {
if (regions.count(id)) {
return new MementoCommand<Region>(*regions[id], before, after);
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 3d5e7fb24e..310df3cbed 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -820,7 +820,7 @@ Session::load_state (string snapshot_name)
}
const XMLProperty* prop;
- bool is_old = false;
+ bool is_old = false; // session is _very_ old (pre-2.0)
if ((prop = root.property ("version")) == 0) {
/* no version implies very old version of Ardour */
@@ -3013,22 +3013,21 @@ Session::restore_history (string snapshot_name)
struct timeval tv;
ut->set_name(t->property("name")->value());
- stringstream ss(t->property("tv_sec")->value());
+ stringstream ss(t->property("tv-sec")->value());
ss >> tv.tv_sec;
- ss.str(t->property("tv_usec")->value());
+ ss.str(t->property("tv-usec")->value());
ss >> tv.tv_usec;
ut->set_timestamp(tv);
for (XMLNodeConstIterator child_it = t->children().begin();
- child_it != t->children().end();
- child_it++)
+ child_it != t->children().end(); child_it++)
{
XMLNode *n = *child_it;
Command *c;
if (n->name() == "MementoCommand" ||
- n->name() == "MementoUndoCommand" ||
- n->name() == "MementoRedoCommand") {
+ n->name() == "MementoUndoCommand" ||
+ n->name() == "MementoRedoCommand") {
if ((c = memento_command_factory(n))) {
ut->add_command(c);
@@ -3041,7 +3040,7 @@ Session::restore_history (string snapshot_name)
}
} else if (n->name() == "DeltaCommand") {
- PBD::ID id(n->property("midi_source")->value());
+ PBD::ID id(n->property("midi-source")->value());
boost::shared_ptr<MidiSource> midi_source =
boost::dynamic_pointer_cast<MidiSource, Source>(source_by_id(id));
if(midi_source) {