diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 12:39:17 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 12:39:17 -0400 |
commit | 30b087ab3d28f1585987fa3f6ae006562ae192e3 (patch) | |
tree | 620ae0250b5d77f90a18f8c2b83be61e4fe7b0b5 /libs/ardour/analysis_graph.cc | |
parent | cb956e3e480716a3efd280a5287bdd7bee1cedc5 (diff) |
globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
Diffstat (limited to 'libs/ardour/analysis_graph.cc')
-rw-r--r-- | libs/ardour/analysis_graph.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libs/ardour/analysis_graph.cc b/libs/ardour/analysis_graph.cc index a1e8807d57..fe5b1c9a3b 100644 --- a/libs/ardour/analysis_graph.cc +++ b/libs/ardour/analysis_graph.cc @@ -37,8 +37,8 @@ using namespace AudioGrapher; AnalysisGraph::AnalysisGraph (Session *s) : _session (s) , _max_chunksize (8192) - , _frames_read (0) - , _frames_end (0) + , _samples_read (0) + , _samples_end (0) , _canceled (false) { _buf = (Sample *) malloc(sizeof(Sample) * _max_chunksize); @@ -60,7 +60,7 @@ AnalysisGraph::analyze_region (boost::shared_ptr<AudioRegion> region) interleaver->init (region->n_channels(), _max_chunksize); chunker.reset (new Chunker<Sample> (_max_chunksize)); analyser.reset (new Analyser ( - _session->nominal_frame_rate(), + _session->nominal_sample_rate(), region->n_channels(), _max_chunksize, region->length())); @@ -68,11 +68,11 @@ AnalysisGraph::analyze_region (boost::shared_ptr<AudioRegion> region) interleaver->add_output(chunker); chunker->add_output (analyser); - framecnt_t x = 0; - framecnt_t length = region->length(); + samplecnt_t x = 0; + samplecnt_t length = region->length(); while (x < length) { - framecnt_t chunk = std::min (_max_chunksize, length - x); - framecnt_t n = 0; + samplecnt_t chunk = std::min (_max_chunksize, length - x); + samplecnt_t n = 0; for (unsigned int channel = 0; channel < region->n_channels(); ++channel) { memset (_buf, 0, chunk * sizeof (Sample)); n = region->read_at (_buf, _mixbuf, _gainbuf, region->position() + x, chunk, channel); @@ -88,8 +88,8 @@ AnalysisGraph::analyze_region (boost::shared_ptr<AudioRegion> region) } } x += n; - _frames_read += n; - Progress (_frames_read, _frames_end); + _samples_read += n; + Progress (_samples_read, _samples_end); if (_canceled) { return; } @@ -112,10 +112,10 @@ AnalysisGraph::analyze_range (boost::shared_ptr<Route> route, boost::shared_ptr< interleaver->add_output(chunker); chunker->add_output (analyser); - framecnt_t x = 0; + samplecnt_t x = 0; while (x < j->length()) { - framecnt_t chunk = std::min (_max_chunksize, (*j).length() - x); - framecnt_t n = 0; + samplecnt_t chunk = std::min (_max_chunksize, (*j).length() - x); + samplecnt_t n = 0; for (uint32_t channel = 0; channel < n_audio; ++channel) { n = pl->read (_buf, _mixbuf, _gainbuf, (*j).start + x, chunk, channel); @@ -126,8 +126,8 @@ AnalysisGraph::analyze_range (boost::shared_ptr<Route> route, boost::shared_ptr< interleaver->input (channel)->process (context); } x += n; - _frames_read += n; - Progress (_frames_read, _frames_end); + _samples_read += n; + Progress (_samples_read, _samples_end); if (_canceled) { return; } @@ -136,11 +136,11 @@ AnalysisGraph::analyze_range (boost::shared_ptr<Route> route, boost::shared_ptr< std::string name = string_compose (_("%1 (%2..%3)"), route->name(), Timecode::timecode_format_sampletime ( (*j).start, - _session->nominal_frame_rate(), + _session->nominal_sample_rate(), 100, false), Timecode::timecode_format_sampletime ( (*j).start + (*j).length(), - _session->nominal_frame_rate(), + _session->nominal_sample_rate(), 100, false) ); _results.insert (std::make_pair (name, analyser->result ())); |