comparison src/Main/AIMCopy_SSI_Features_v3.cc @ 78:41640b18c99c

- AWS
author tomwalters
date Wed, 11 Aug 2010 23:54:37 +0000
parents 0cd20c748308
children 747ba38b4b1b
comparison
equal deleted inserted replaced
77:3dcc10af731d 78:41640b18c99c
69 string data_file; 69 string data_file;
70 string config_file; 70 string config_file;
71 string script_file; 71 string script_file;
72 bool write_data = false; 72 bool write_data = false;
73 bool print_version = false; 73 bool print_version = false;
74 bool load_params = false;
74 75
75 string version_string( 76 string version_string(
76 " AIM-C AIMCopy\n" 77 " AIM-C AIMCopy\n"
77 " (c) 2006-2010, Thomas Walters and Willem van Engen\n" 78 " (c) 2006-2010, Thomas Walters and Willem van Engen\n"
78 " http://www.acoustiscale.org/AIMC/\n" 79 " http://www.acoustiscale.org/AIMC/\n"
105 if (++i >= argc) { 106 if (++i >= argc) {
106 aimc::LOG_ERROR(_T("Configuration file name expected after -C")); 107 aimc::LOG_ERROR(_T("Configuration file name expected after -C"));
107 return(-1); 108 return(-1);
108 } 109 }
109 config_file = argv[i]; 110 config_file = argv[i];
111 load_params = true;
110 continue; 112 continue;
111 } 113 }
112 if (strcmp(argv[i],"-S") == 0) { 114 if (strcmp(argv[i],"-S") == 0) {
113 if (++i >= argc) { 115 if (++i >= argc) {
114 aimc::LOG_ERROR(_T("Script file name expected after -S")); 116 aimc::LOG_ERROR(_T("Script file name expected after -S"));
136 if (print_version) 138 if (print_version)
137 printf("%s", version_string.c_str()); 139 printf("%s", version_string.c_str());
138 140
139 aimc::Parameters params; 141 aimc::Parameters params;
140 142
141 if (!params.Load(config_file.c_str())) { 143 if (load_params) {
142 aimc::LOG_ERROR(_T("Couldn't load parameters from file %s"), 144 if (!params.Load(config_file.c_str())) {
143 config_file.c_str()); 145 aimc::LOG_ERROR(_T("Couldn't load parameters from file %s"),
144 return -1; 146 config_file.c_str());
147 return -1;
148 }
145 } 149 }
146 150
147 vector<pair<string, string> > file_list = aimc::FileList::Load(script_file); 151 vector<pair<string, string> > file_list = aimc::FileList::Load(script_file);
148 if (file_list.size() == 0) { 152 if (file_list.size() == 0) {
149 aimc::LOG_ERROR("No data read from file %s", script_file.c_str()); 153 aimc::LOG_ERROR("No data read from file %s", script_file.c_str());
257 261
258 for (unsigned int i = 0; i < file_list.size(); ++i) { 262 for (unsigned int i = 0; i < file_list.size(); ++i) {
259 // aimc::LOG_INFO(_T("In: %s"), file_list[i].first.c_str()); 263 // aimc::LOG_INFO(_T("In: %s"), file_list[i].first.c_str());
260 aimc::LOG_INFO(_T("Out: %s"), file_list[i].second.c_str()); 264 aimc::LOG_INFO(_T("Out: %s"), file_list[i].second.c_str());
261 265
262 string filename = file_list[i].second + ".slice_1_no_cutoff"; 266 string filename = file_list[i].second + "slice_1_no_cutoff";
263 output_ssi_slice1_no_cutoff.OpenFile(filename.c_str(), 10.0f); 267 output_ssi_slice1_no_cutoff.OpenFile(filename.c_str(), 10.0f);
264 filename = file_list[i].second + ".ssi_profile_no_cutoff"; 268 filename = file_list[i].second + "ssi_profile_no_cutoff";
265 output_ssi_all_no_cutoff.OpenFile(filename.c_str(), 10.0f); 269 output_ssi_all_no_cutoff.OpenFile(filename.c_str(), 10.0f);
266 filename = file_list[i].second + ".slice_1_cutoff"; 270 filename = file_list[i].second + "slice_1_cutoff";
267 output_ssi_slice1_cutoff.OpenFile(filename.c_str(), 10.0f); 271 output_ssi_slice1_cutoff.OpenFile(filename.c_str(), 10.0f);
268 filename = file_list[i].second + ".ssi_profile_cutoff"; 272 filename = file_list[i].second + "ssi_profile_cutoff";
269 output_ssi_all_cutoff.OpenFile(filename.c_str(), 10.0f); 273 output_ssi_all_cutoff.OpenFile(filename.c_str(), 10.0f);
270 filename = file_list[i].second + ".smooth_nap_profile"; 274 filename = file_list[i].second + "smooth_nap_profile";
271 nap_out.OpenFile(filename.c_str(), 10.0f); 275 nap_out.OpenFile(filename.c_str(), 10.0f);
272 276
273 if (input.LoadFile(file_list[i].first.c_str())) { 277 if (input.LoadFile(file_list[i].first.c_str())) {
274 input.Process(); 278 input.Process();
275 } else { 279 } else {