MistIn processes now automatically add .dtsc to the end of output file, if missing.
This commit is contained in:
parent
eaa26e05ef
commit
8f02ac216f
1 changed files with 6 additions and 2 deletions
|
@ -86,11 +86,15 @@ namespace Mist {
|
||||||
if (!config->getBool("player")){
|
if (!config->getBool("player")){
|
||||||
//check filename for no -
|
//check filename for no -
|
||||||
if (config->getString("output") != "-"){
|
if (config->getString("output") != "-"){
|
||||||
|
std::string filename = config->getString("output");
|
||||||
|
if (filename.size() < 5 || filename.substr(filename.size() - 5) != ".dtsc"){
|
||||||
|
filename += ".dtsc";
|
||||||
|
}
|
||||||
//output to dtsc
|
//output to dtsc
|
||||||
DTSC::Meta newMeta = myMeta;
|
DTSC::Meta newMeta = myMeta;
|
||||||
newMeta.reset();
|
newMeta.reset();
|
||||||
JSON::Value tempVal;
|
JSON::Value tempVal;
|
||||||
std::ofstream file(config->getString("output").c_str());
|
std::ofstream file(filename.c_str());
|
||||||
long long int bpos = 0;
|
long long int bpos = 0;
|
||||||
seek(0);
|
seek(0);
|
||||||
getNext();
|
getNext();
|
||||||
|
@ -105,7 +109,7 @@ namespace Mist {
|
||||||
//close file
|
//close file
|
||||||
file.close();
|
file.close();
|
||||||
//create header
|
//create header
|
||||||
file.open((config->getString("output")+".dtsh").c_str());
|
file.open((filename+".dtsh").c_str());
|
||||||
file << newMeta.toJSON().toNetPacked();
|
file << newMeta.toJSON().toNetPacked();
|
||||||
file.close();
|
file.close();
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Add table
Reference in a new issue