changeset 64:82248965fc74

fextractor is now a class
author gyorgyf
date Tue, 14 Feb 2012 18:27:50 +0000
parents fecb53842b3d
children b2f70a775ddc
files runner/BinaryFeatureWriter.cpp sonic-annotator
diffstat 2 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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()
Binary file sonic-annotator has changed