# HG changeset patch # User gyorgyf # Date 1329244070 0 # Node ID 82248965fc74a55c02c7ea1355d15368b7318ac5 # Parent fecb53842b3d626aadc947909f47b5a97216f140 fextractor is now a class diff -r fecb53842b3d -r 82248965fc74 runner/BinaryFeatureWriter.cpp --- a/runner/BinaryFeatureWriter.cpp Mon Feb 13 14:16:25 2012 +0000 +++ b/runner/BinaryFeatureWriter.cpp Tue Feb 14 18:27:50 2012 +0000 @@ -62,17 +62,17 @@ ~OutputStream() { if (stream != NULL) {stream->close(); delete stream;} } struct header_t { - int16_t BOM16; // 16-bit BOM (FEFF as in UTF-16) - int32_t BOM32; // 32-bit BOM (human readable: e.g. ABCD) - char major_version; // check for binary compatibility - char minor_version; // changes in txt parts only - char compression; // use of stream compression (e.g. gzip) - char reserved1; // reserved byte - char reserved2; // reserved byte - char float_size; // size of float - char int_size; // size of int - char info[160]; // 160 byte text field - char null; }; // NULL + int16_t BOM16; // 16-bit BOM (FEFF as in UTF-16) + int32_t BOM32; // 32-bit BOM (human readable: e.g. ABCD) + char major_version; // check for binary compatibility + char minor_version; // changes in txt parts only + char compression; // use of stream compression (e.g. gzip) + char reserved1; // reserved byte + char reserved2; // reserved byte + char float_size; // size of float + char int_size; // size of int + char info[160]; // 160 byte text field + char null; }; // NULL bool open(string filename, bool append = true) { @@ -93,7 +93,7 @@ } if (append && !stream->is_open()) { - cerr << "NOTE: Writing new binary output file: " << filename << endl; + cerr << endl << "NOTE: Writing new binary output file: " << filename << endl; delete stream; stream = NULL; return open(filename,false); @@ -310,7 +310,11 @@ bool BinaryFeatureWriter::openBinaryFile() { - return binary->open(outputFile + ".bin"); + if (outputFile.rfind(".") == string::npos) + // if (!QString(outputFile.c_str()).contains(".")) + return binary->open(outputFile + ".bin"); + else + return binary->open(outputFile); } void BinaryFeatureWriter::finish() diff -r fecb53842b3d -r 82248965fc74 sonic-annotator Binary file sonic-annotator has changed