comparison src/Main/AIMCopy.cc @ 244:d3968c3149b0

- Support (hopefully) both movie writing and HTK file output.
author tomwalters
date Tue, 26 Oct 2010 00:03:29 +0000
parents af02b6addf7a
children
comparison
equal deleted inserted replaced
243:5a0cd3fb3089 244:d3968c3149b0
157 157
158 bool AIMCopy::Process() { 158 bool AIMCopy::Process() {
159 if (!initialized_) { 159 if (!initialized_) {
160 return false; 160 return false;
161 } 161 }
162 bool tree_initialized = false;
162 for (unsigned int i = 0; i < script_.size(); ++i) { 163 for (unsigned int i = 0; i < script_.size(); ++i) {
163 global_parameters_.SetString("input_filename", script_[i].first.c_str()); 164 global_parameters_.SetString("input_filename", script_[i].first.c_str());
164 global_parameters_.SetString("output_filename_base", script_[i].second.c_str()); 165 global_parameters_.SetString("output_filename_base", script_[i].second.c_str());
165 if (!tree_.Initialize(&global_parameters_)) { 166 if (!tree_initialized) {
166 return false; 167 if (!tree_.Initialize(&global_parameters_)) {
168 return false;
169 }
170 tree_initialized = true;
171 } else {
172 tree_.Reset();
167 } 173 }
168 aimc::LOG_INFO(_T("%s -> %s"), 174 aimc::LOG_INFO(_T("%s -> %s"),
169 script_[i].first.c_str(), 175 script_[i].first.c_str(),
170 script_[i].second.c_str()); 176 script_[i].second.c_str());
171 tree_.Process(); 177 tree_.Process();
172 tree_.Reset(); 178 }
173 } 179 // A final call to Reset() is required to close any open files.
180 global_parameters_.SetString("input_filename", "");
181 global_parameters_.SetString("output_filename_base", "");
182 tree_.Reset();
174 return true; 183 return true;
175 } 184 }
176 185
177 } // namespace aimc 186 } // namespace aimc
178 187