#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"
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);
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()));
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);
}
}
x += n;
- _frames_read += n;
- Progress (_frames_read, _frames_end);
+ _samples_read += n;
+ Progress (_samples_read, _samples_end);
if (_canceled) {
return;
}
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);
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;
}
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 ()));