diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-20 18:15:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-20 18:15:44 +0100 |
commit | bbe62da55a5fb06ba39e02c9671a94ab6e24bb08 (patch) | |
tree | 2290d3d13883bceeb900404dc772d1fd2f62128f /libs/ardour/session_state.cc | |
parent | de2612f7b47cc2181c1dacd3b5a40eb504e8912c (diff) |
Extract program version that a session was created with
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 04f6470582..ee86a40e09 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -4428,10 +4428,11 @@ Session::rename (const std::string& new_name) } int -Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFormat& data_format) +Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& created_version) { bool found_sr = false; bool found_data_format = false; + created_version = ""; if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) { return -1; @@ -4468,6 +4469,13 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo node = node->children; while (node != NULL) { + if (!strcmp((const char*) node->name, "ProgramVersion")) { + xmlChar* val = xmlGetProp (node, (const xmlChar*)"created-with"); + if (val) { + created_version = string ((const char*)val); + } + xmlFree (val); + } if (strcmp((const char*) node->name, "Config")) { node = node->next; continue; |