13
0

Scale export-analysis dataset

This commit is contained in:
Robin Gareus 2021-12-24 21:57:20 +01:00
parent 4fa8af3e20
commit 7f3681c7ac
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 6 additions and 4 deletions

View File

@ -456,7 +456,9 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c
max_samples = std::min ((samplecnt_t) 8192 * channels, std::max ((samplecnt_t) 4096 * channels, max_samples));
chunker.reset (new Chunker<Sample> (max_samples));
analyser.reset (new Analyser (config.format->sample_rate(), channels, max_samples,
(samplecnt_t) ceil (duration * config.format->sample_rate () / (double) sample_rate)));
(samplecnt_t) ceil (duration * config.format->sample_rate () / (double) sample_rate),
800 * ui_scale_factor, 200 * ui_scale_factor
));
config.filename->set_channel_config (config.channel_config);
parent.add_analyser (config.filename->get_path (config.format), analyser);

View File

@ -29,7 +29,7 @@ namespace AudioGrapher
class LIBAUDIOGRAPHER_API Analyser : public LoudnessReader
{
public:
Analyser (float sample_rate, unsigned int channels, samplecnt_t bufsize, samplecnt_t n_samples);
Analyser (float sample_rate, unsigned int channels, samplecnt_t bufsize, samplecnt_t n_samples, size_t width = 800, size_t bins = 200);
~Analyser ();
void process (ProcessContext<float> const & c);
ARDOUR::ExportAnalysisPtr result (bool ptr = false);

View File

@ -23,9 +23,9 @@ using namespace AudioGrapher;
const float Analyser::fft_range_db (120); // dB
Analyser::Analyser (float sample_rate, unsigned int channels, samplecnt_t bufsize, samplecnt_t n_samples)
Analyser::Analyser (float sample_rate, unsigned int channels, samplecnt_t bufsize, samplecnt_t n_samples, size_t width, size_t bins)
: LoudnessReader (sample_rate, channels, bufsize)
, _rp (ARDOUR::ExportAnalysisPtr (new ARDOUR::ExportAnalysis))
, _rp (ARDOUR::ExportAnalysisPtr (new ARDOUR::ExportAnalysis (width, bins)))
, _result (*_rp)
, _n_samples (n_samples)
, _pos (0)