From 8d958d09fb5a4ba3360df65e58e0807275fe027f Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Mon, 21 Jan 2019 22:48:16 +0100 Subject: [PATCH] Always export absolute audio file path in XML and JSON format Fixes #59 --- CHANGELOG.md | 1 + rhubarb/src/exporters/JsonExporter.cpp | 3 ++- rhubarb/src/exporters/XmlExporter.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b074763..a213908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * **Fixed** a bug that resulted in unwanted mouth movement at beginning of a recording ([issue #53](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/53)). * **Fixed** a bug that garbled special characters in the output file path ([issue #54](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/54)). * **Fixed** a bug that prevented the progress bar from reaching 100% ([issue #48](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/48)). +* **Fixed** file paths in exported XML and JSON files ([issue #59](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/59)). ## Version 1.8.0 diff --git a/rhubarb/src/exporters/JsonExporter.cpp b/rhubarb/src/exporters/JsonExporter.cpp index 208ee9b..1cd3c50 100644 --- a/rhubarb/src/exporters/JsonExporter.cpp +++ b/rhubarb/src/exporters/JsonExporter.cpp @@ -1,6 +1,7 @@ #include "JsonExporter.h" #include "exporterTools.h" #include "tools/stringTools.h" +#include using std::string; @@ -10,7 +11,7 @@ void JsonExporter::exportAnimation(const ExporterInput& input, std::ostream& out // the formatting. outputStream << "{\n"; outputStream << " \"metadata\": {\n"; - outputStream << " \"soundFile\": \"" << escapeJsonString(input.inputFilePath.string()) << "\",\n"; + outputStream << " \"soundFile\": \"" << escapeJsonString(absolute(input.inputFilePath).string()) << "\",\n"; outputStream << " \"duration\": " << formatDuration(input.animation.getRange().getDuration()) << "\n"; outputStream << " },\n"; outputStream << " \"mouthCues\": [\n"; diff --git a/rhubarb/src/exporters/XmlExporter.cpp b/rhubarb/src/exporters/XmlExporter.cpp index 479b401..763f473 100644 --- a/rhubarb/src/exporters/XmlExporter.cpp +++ b/rhubarb/src/exporters/XmlExporter.cpp @@ -3,6 +3,7 @@ #include #include #include "exporterTools.h" +#include using std::string; using boost::property_tree::ptree; @@ -11,7 +12,7 @@ void XmlExporter::exportAnimation(const ExporterInput& input, std::ostream& outp ptree tree; // Add metadata - tree.put("rhubarbResult.metadata.soundFile", input.inputFilePath.string()); + tree.put("rhubarbResult.metadata.soundFile", absolute(input.inputFilePath).string()); tree.put( "rhubarbResult.metadata.duration", formatDuration(input.animation.getRange().getDuration())