URL
https://opencores.org/ocsvn/sqmusic/sqmusic/trunk
[/] [sqmusic/] [trunk/] [1942/] [log2wav.cc] - Diff between revs 5 and 6
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 5 |
Rev 6 |
Line 18... |
Line 18... |
#include <string.h>
|
#include <string.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <assert.h>
|
#include <assert.h>
|
#include <string.h>
|
#include <string.h>
|
#include <string>
|
#include <string>
|
|
#include <signal.h>
|
|
|
using namespace std;
|
using namespace std;
|
|
|
class Args {
|
class Args {
|
public:
|
public:
|
Line 63... |
Line 64... |
}
|
}
|
if( filename=="-" ) filename=string("/dev/stdin");
|
if( filename=="-" ) filename=string("/dev/stdin");
|
}
|
}
|
};
|
};
|
|
|
|
bool sigint_abort=false;
|
|
|
|
void sigint_handle(int x ) {
|
|
sigint_abort = true;
|
|
}
|
|
|
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
try {
|
try {
|
ifstream fin;
|
ifstream fin;
|
Args ar( argc, argv );
|
Args ar( argc, argv );
|
cout << "Input file " << ar.filename << "\n";
|
cout << "Input file " << ar.filename << "\n";
|
Line 86... |
Line 93... |
fin.getline( buffer, sizeof(buffer) );
|
fin.getline( buffer, sizeof(buffer) );
|
//if( strcmp(buffer,"ncsim> run" )==0) break;
|
//if( strcmp(buffer,"ncsim> run" )==0) break;
|
}
|
}
|
if( fin.eof() ) throw "Data not found";
|
if( fin.eof() ) throw "Data not found";
|
fout.seekp(44);
|
fout.seekp(44);
|
while( !fin.eof() && !fin.bad() && !fin.fail() ) {
|
signal( 2, sigint_handle ); // capture CTRL+C in order to save the
|
|
// WAV header before quiting
|
|
while( !fin.eof() && !fin.bad() && !fin.fail() && !sigint_abort ) {
|
short int value;
|
short int value;
|
fin.getline( buffer, sizeof(buffer) );
|
fin.getline( buffer, sizeof(buffer) );
|
|
|
if( buffer[0]=='S' ) break; // reached line "Simulation complete"
|
if( buffer[0]=='S' ) break; // reached line "Simulation complete"
|
value = atoi( buffer );
|
value = atoi( buffer );
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.