From b66b2858b127c726d3ed2a5263cc9c51213f3774 Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Sun, 12 Apr 2020 10:02:07 +0200 Subject: [PATCH] WebSockets: add version field in manifests and update loader --- libs/surfaces/websockets/manifest.cc | 5 ++++- libs/surfaces/websockets/manifest.h | 4 +++- share/web_surfaces/builtin/mixer-demo/manifest.xml | 1 + share/web_surfaces/builtin/transport/manifest.xml | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/surfaces/websockets/manifest.cc b/libs/surfaces/websockets/manifest.cc index 85407a231d..92fa57e5b6 100644 --- a/libs/surfaces/websockets/manifest.cc +++ b/libs/surfaces/websockets/manifest.cc @@ -54,10 +54,12 @@ SurfaceManifest::SurfaceManifest (std::string path) _name = value; } else if (name == "Description") { _description = value; + } else if (name == "Version") { + _version = value; } } - if (_name.empty () || _description.empty ()) { + if (_name.empty () || _description.empty () || _version.empty ()) { #ifndef NDEBUG std::cerr << "SurfaceManifest: missing properties in " << xml_path << std::endl; #endif @@ -76,6 +78,7 @@ SurfaceManifest::to_json () << "\"path\":\"" << Glib::path_get_basename (_path) << "\"" << ",\"name\":\"" << _name << "\"" << ",\"description\":\"" << _description << "\"" + << ",\"version\":\"" << _version << "\"" << "}"; return ss.str (); diff --git a/libs/surfaces/websockets/manifest.h b/libs/surfaces/websockets/manifest.h index 5c776639c3..45ecc37f6a 100644 --- a/libs/surfaces/websockets/manifest.h +++ b/libs/surfaces/websockets/manifest.h @@ -24,7 +24,7 @@ class SurfaceManifest { public: - // all ardour control surfaces store presets in xml format + // all ardour control surfaces implement presets using xml format SurfaceManifest (std::string); bool valid () { return _valid; } @@ -32,6 +32,7 @@ public: std::string path () { return _path; } std::string name () { return _name; } std::string description () { return _description; } + std::string version () { return _version; } std::string to_json (); @@ -43,6 +44,7 @@ private: std::string _path; std::string _name; std::string _description; + std::string _version; }; #endif // _ardour_surface_websockets_manifest_h_ diff --git a/share/web_surfaces/builtin/mixer-demo/manifest.xml b/share/web_surfaces/builtin/mixer-demo/manifest.xml index e4a4287d7d..8174629f73 100644 --- a/share/web_surfaces/builtin/mixer-demo/manifest.xml +++ b/share/web_surfaces/builtin/mixer-demo/manifest.xml @@ -2,4 +2,5 @@ + diff --git a/share/web_surfaces/builtin/transport/manifest.xml b/share/web_surfaces/builtin/transport/manifest.xml index ff48533743..b08e5f8374 100644 --- a/share/web_surfaces/builtin/transport/manifest.xml +++ b/share/web_surfaces/builtin/transport/manifest.xml @@ -2,4 +2,5 @@ +