comparison trunk/src/Modules/SAI/ModuleSAI.cc @ 280:e55d0c225a57

- Lots of changes to make cpplint happy. It still complains about header guards, but that's pretty much it now.
author tomwalters
date Thu, 18 Feb 2010 21:12:41 +0000
parents 5b8b9ea1218a
children 4b3a43b543dd
comparison
equal deleted inserted replaced
279:f469d936337f 280:e55d0c225a57
67 sai_buffer_length, 67 sai_buffer_length,
68 input.sample_rate())) { 68 input.sample_rate())) {
69 LOG_ERROR("Failed to create output buffer in SAI module"); 69 LOG_ERROR("Failed to create output buffer in SAI module");
70 return false; 70 return false;
71 } 71 }
72 for (int i = 0; i < input.channel_count(); ++i ) { 72 for (int i = 0; i < input.channel_count(); ++i) {
73 output_.set_centre_frequency(i, input.centre_frequency(i)); 73 output_.set_centre_frequency(i, input.centre_frequency(i));
74 } 74 }
75 75
76 // sai_temp_ will be initialized to zero 76 // sai_temp_ will be initialized to zero
77 if (!sai_temp_.Initialize(output_)) { 77 if (!sai_temp_.Initialize(output_)) {
112 active_strobes_.resize(channel_count_); 112 active_strobes_.resize(channel_count_);
113 fire_counter_ = frame_period_samples_ - 1; 113 fire_counter_ = frame_period_samples_ - 1;
114 } 114 }
115 115
116 void ModuleSAI::Process(const SignalBank &input) { 116 void ModuleSAI::Process(const SignalBank &input) {
117
118 // Reset the next strobe times 117 // Reset the next strobe times
119 next_strobes_.clear(); 118 next_strobes_.clear();
120 next_strobes_.resize(output_.channel_count(), 0); 119 next_strobes_.resize(output_.channel_count(), 0);
121 120
122 // Offset the times on the strobes from the previous buffer 121 // Offset the times on the strobes from the previous buffer
211 output_.set_sample(ch, delay, output_.sample(ch, delay) + sig); 210 output_.set_sample(ch, delay, output_.sample(ch, delay) + sig);
212 } 211 }
213 } 212 }
214 213
215 next_strobes_[ch] = next_strobe_index; 214 next_strobes_[ch] = next_strobe_index;
216 215 } // End loop over channels
217 } // End loop over channels
218 216
219 fire_counter_--; 217 fire_counter_--;
220 218
221 // Check to see if we need to output an SAI frame on this sample 219 // Check to see if we need to output an SAI frame on this sample
222 if (fire_counter_ <= 0) { 220 if (fire_counter_ <= 0) {
241 239
242 // Transfer the current time to the output buffer 240 // Transfer the current time to the output buffer
243 output_.set_start_time(input.start_time() + i); 241 output_.set_start_time(input.start_time() + i);
244 PushOutput(); 242 PushOutput();
245 } 243 }
246 } // End loop over samples 244 } // End loop over samples
247 } 245 }
248 246
249 ModuleSAI::~ModuleSAI() { 247 ModuleSAI::~ModuleSAI() {
250 } 248 }
251 } // namespace aimc 249 } // namespace aimc