Added Total count of source in Session mix info

This commit is contained in:
Bruno Herbelin
2022-04-09 14:46:09 +02:00
parent dd55f41264
commit edffcf8902
2 changed files with 7 additions and 2 deletions

View File

@@ -64,8 +64,12 @@ SessionInformation SessionCreator::info(const std::string& filename)
const XMLElement *header = doc.FirstChildElement(APP_NAME); const XMLElement *header = doc.FirstChildElement(APP_NAME);
if (header != nullptr) { if (header != nullptr) {
int s = header->IntAttribute("size"); uint s = header->UnsignedAttribute("size");
ret.description = std::to_string( s ) + " source" + ( s > 1 ? "s\n" : "\n"); ret.description = std::to_string( s ) + " source" + ( s > 1 ? "s" : "");
uint t = header->UnsignedAttribute("total");
if (t>s)
ret.description += " (" + std::to_string(t) + " in total)";
ret.description += "\n";
const char *att_string = header->Attribute("resolution"); const char *att_string = header->Attribute("resolution");
if (att_string) if (att_string)
ret.description += std::string( att_string ) + "\n"; ret.description += std::string( att_string ) + "\n";

View File

@@ -61,6 +61,7 @@ bool SessionVisitor::saveSession(const std::string& filename, Session *session)
rootnode->SetAttribute("major", XML_VERSION_MAJOR); rootnode->SetAttribute("major", XML_VERSION_MAJOR);
rootnode->SetAttribute("minor", XML_VERSION_MINOR); rootnode->SetAttribute("minor", XML_VERSION_MINOR);
rootnode->SetAttribute("size", session->size()); rootnode->SetAttribute("size", session->size());
rootnode->SetAttribute("total", session->numSources());
rootnode->SetAttribute("date", SystemToolkit::date_time_string().c_str()); rootnode->SetAttribute("date", SystemToolkit::date_time_string().c_str());
rootnode->SetAttribute("resolution", session->frame()->info().c_str()); rootnode->SetAttribute("resolution", session->frame()->info().c_str());
xmlDoc.InsertEndChild(rootnode); xmlDoc.InsertEndChild(rootnode);