rem: cout << "Fixing DC-offset \"" << filename << "\""; cout << " (left: " << kvu_numtostr(dcfix_values[0]); cout << ", right: " << kvu_numtostr(dcfix_values[1]) << ").\n";
add: cout << "Fixing DC-offset \"" << filename << ".\n";
context: int main(int argc, char *argv[]){  struct sigaction es_handler;  es_handler.sa_handler = signal_handler;  sigemptyset(&es_handler.sa_mask);  es_handler.sa_flags = 0;  sigaction(SIGTERM, &es_handler, 0);  sigaction(SIGINT, &es_handler, 0);  sigaction(SIGQUIT, &es_handler, 0);  sigaction(SIGABRT, &es_handler, 0);  COMMAND_LINE cline = COMMAND_LINE (argc, argv);  if (cline.size() < 2) {    print_usage();    return(1);  }  std::string filename;  std::string tempfile;  std::vector<double> dcfix_values;  int chcount = 0;  ECA_CONTROL_INTERFACE eci;  TEMPORARY_FILE_DIRECTORY tempfile_dir_rep;  string tmpdir ("ecatools-");  char* tmp_p = getenv("USER");  if (tmp_p != NULL) {    tmpdir += string(tmp_p);    tempfile_dir_rep.reserve_directory(tmpdir);  }  if (tempfile_dir_rep.is_valid() != true) {    cerr << "---\nError while creating temporary directory \"" << tmpdir << "\". Exiting...\n";    return(0);  }  cline.begin();  cline.next(); // skip the program name  while(cline.end() == false) {    filename = cline.current();    ecatools_fixdc_tempfile = tempfile_dir_rep.create_filename("fixdc-tmp", ".wav");    for(int m = 0;m < ECAFIXDC_PHASE_MAX; m++) {      eci.command("cs-add default");      eci.command("c-add default");      if (m == ECAFIXDC_PHASE_ANALYSIS) {	cout << "Calculating DC-offset for file \"" << filename << "\".\n";	eci.command("ai-add " + filename);	eci.command("ai-list");	if (eci.last_string_list().size() != 1) {	  cerr << eci.last_error() << endl;	  cerr << "---\nError while processing file " << filename << ". Exiting...\n";	  break;	}	eci.command("ai-get-format");	string format = eci.last_string();	cout << "Using audio format -f:" << format << "\n";	eci.command("cs-set-audio-format " +  format);	std::vector<std::string> tokens = kvu_string_to_vector(format, ',');	assert(tokens.size() >= 3);	chcount = atoi(tokens[1].c_str());	dcfix_values.resize(chcount);	cout << "Setting up " << chcount << " separate channels for analysis." << endl;	cout << "Opening temp file \"" << ecatools_fixdc_tempfile << "\".\n";	eci.command("ao-add " + ecatools_fixdc_tempfile);	eci.command("ao-list");	if (eci.last_string_list().size() != 1) {	  cerr << eci.last_error() << endl;	  cerr << "---\nError while processing file " << ecatools_fixdc_tempfile << ". Exiting...\n";	  break;	}	eci.command("cop-add -ezf");	eci.command("cop-list");	if (eci.last_string_list().size() != 1) {	  cerr << eci.last_error() << endl;	  cerr << "---\nError while adding DC-Find (-ezf) chainop. Exiting...\n";	  break;	}      }      else {	// FIXME: list all channels (remember to fix audiofx_misc.cpp dcfix)	cout << "Fixing DC-offset \"" << filename << "\"";	cout << " (left: " << kvu_numtostr(dcfix_values[0]);	cout << ", right: " << kvu_numtostr(dcfix_values[1]) << ").\n";	eci.command("ai-add " + ecatools_fixdc_tempfile);	eci.command("ai-list");	if (eci.last_string_list().size() != 1) {	  cerr << eci.last_error() << endl;	  cerr << "---\nError while processing file " << ecatools_fixdc_tempfile << ". Exiting...\n";	  break;	}	eci.command("ai-get-format");	string format = eci.last_string();	cout << "Using audio format -f:" << format << "\n";	eci.command("cs-set-audio-format " +  format);	eci.command("ao-add " + filename);	eci.command("ao-list");	if (eci.last_string_list().size() != 1) {	  cerr << eci.last_error() << endl;	  cerr << "---\nError while processing file " << filename << ". Exiting...\n";	  break;	}	string dcfixstr;	for(int n = 0; n < chcount; n++) {	  dcfixstr += kvu_numtostr(dcfix_values[n]) + ",";	}	eci.command("cop-add -ezx:" + dcfixstr);	eci.command("cop-list");	if (eci.last_string_list().size() != 1) {	  cerr << eci.last_error() << endl;	  cerr << "---\nError while adding DC-Fix (-ezx) chainop. Exiting...\n";	  break;	}      }      cout << "Starting processing...\n";	      eci.command("cs-connect");      eci.command("cs-connected");      if (eci.last_string() != "default") {	cerr << eci.last_error() << endl;	cerr << "---\nError while processing file " << filename << ". Exiting...\n";	break;      }      else {	// blocks until processing is done	eci.command("run");      }      if (m == ECAFIXDC_PHASE_ANALYSIS) {	assert(static_cast<int>(dcfix_values.size()) >= chcount);	for(int nm = 0; nm < chcount; nm++) {	  eci.command("cop-select 1");	  eci.command("copp-select " + kvu_numtostr(nm + 1));	  eci.command("copp-get");	  dcfix_values[nm] = eci.last_float();	  cout << "DC-offset for channel " << nm + 1 << " is " <<	    dcfix_values[nm] << "." << endl;	}      }      cout << "Processing finished.\n";      eci.command("cs-disconnect");      eci.command("cs-select default");      eci.command("cs-remove");    }    remove(ecatools_fixdc_tempfile.c_str());    cline.next();  }  return(0);}