X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fanalysis_graph.cc;h=e85abba21124e026839278e25976aa6a6ea4fe87;hb=5fcea5833df6f8562126683521f3c2ad6cb9f1e9;hp=a1e8807d57bbef81e32eede3278efdd5d2730188;hpb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;p=ardour.git diff --git a/libs/ardour/analysis_graph.cc b/libs/ardour/analysis_graph.cc index a1e8807d57..e85abba211 100644 --- a/libs/ardour/analysis_graph.cc +++ b/libs/ardour/analysis_graph.cc @@ -21,7 +21,7 @@ #include "ardour/route.h" #include "ardour/session.h" -#include "timecode/time.h" +#include "temporal/time.h" #include "audiographer/process_context.h" #include "audiographer/general/chunker.h" @@ -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 region) interleaver->init (region->n_channels(), _max_chunksize); chunker.reset (new Chunker (_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 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 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, 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, 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, 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 ()));