diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-02-25 00:11:49 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-02-25 00:11:49 +0000 |
| commit | 040a227d300033f8a103dc6eb67847286131d9b7 (patch) | |
| tree | 54093eaad6186817d1ee744d3f299f93ea49b475 /src/lib/analyse_audio_job.cc | |
| parent | dcd968d6d64d645816af0efbcd2f928128c95b9f (diff) | |
Some tidying up, add channel selector to Audio dialog.
Diffstat (limited to 'src/lib/analyse_audio_job.cc')
| -rw-r--r-- | src/lib/analyse_audio_job.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 190d2a5d9..fb5f2868f 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -27,13 +27,13 @@ using std::string; using std::max; +using std::cout; using boost::shared_ptr; -int const AnalyseAudioJob::_num_points = 1024; +int const AnalyseAudioJob::_num_points = 128; AnalyseAudioJob::AnalyseAudioJob (shared_ptr<Film> f) : Job (f) - , _done_for_this_point (0) , _done (0) , _samples_per_point (1) { @@ -94,20 +94,16 @@ AnalyseAudioJob::audio (shared_ptr<AudioBuffers> b) _current[j][AudioPoint::RMS] += pow (s, 2); _current[j][AudioPoint::PEAK] = max (_current[j][AudioPoint::PEAK], fabsf (s)); - if (_done_for_this_point == _samples_per_point) { + if ((_done % _samples_per_point) == 0) { _current[j][AudioPoint::RMS] = 20 * log10 (sqrt (_current[j][AudioPoint::RMS] / _samples_per_point)); _current[j][AudioPoint::PEAK] = 20 * log10 (_current[j][AudioPoint::PEAK]); - _analysis->add_point (j, _current[j]); - _done_for_this_point = 0; _current[j] = AudioPoint (); } } - - ++_done_for_this_point; - } - _done += b->frames (); + ++_done; + } } |
