WebSockets: add version field in manifests and update loader

This commit is contained in:
Luciano Iam 2020-04-12 10:02:07 +02:00 committed by Robin Gareus
parent d709d8b868
commit b66b2858b1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 9 additions and 2 deletions

View File

@ -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 ();

View File

@ -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_

View File

@ -2,4 +2,5 @@
<WebSurface>
<Name value="Mixer Demo"/>
<Description value="Mixer control capabilities demo aimed at developers"/>
<Version value="1.0.0"/>
</WebSurface>

View File

@ -2,4 +2,5 @@
<WebSurface>
<Name value="Transport"/>
<Description value="Provides basic transport control (under construction)"/>
<Version value="1.0.0"/>
</WebSurface>