From 837f8fac2b3193fd181ef80086aa25108414e0f0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 10 Feb 2016 21:26:02 +0100 Subject: make post-export analysis optional (default to enabled) --- libs/ardour/ardour/export_format_specification.h | 6 +++++- libs/ardour/ardour/export_graph_builder.h | 1 + libs/ardour/export_format_specification.cc | 3 +++ libs/ardour/export_graph_builder.cc | 15 +++++++++++++-- 4 files changed, 22 insertions(+), 3 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h index 1223fa2d4b..89ce0e5168 100644 --- a/libs/ardour/ardour/export_format_specification.h +++ b/libs/ardour/ardour/export_format_specification.h @@ -99,6 +99,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { void set_with_mp4chaps (bool yn) { _with_mp4chaps = yn; } void set_soundcloud_upload (bool yn) { _soundcloud_upload = yn; } void set_command (std::string command) { _command = command; } + void set_analyse (bool yn) { _analyse = yn; } void set_silence_beginning (AnyTime const & value) { _silence_beginning = value; } void set_silence_end (AnyTime const & value) { _silence_end = value; } @@ -163,6 +164,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { bool soundcloud_upload() const { return _soundcloud_upload; } std::string command() const { return _command; } + bool analyse() const { return _analyse; } bool tag () const { return _tag && supports_tagging; } @@ -214,7 +216,9 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { bool _with_cue; bool _with_mp4chaps; bool _soundcloud_upload; - std::string _command; + + std::string _command; + bool _analyse; /* serialization helpers */ diff --git a/libs/ardour/ardour/export_graph_builder.h b/libs/ardour/ardour/export_graph_builder.h index d14a00997a..979e3632b9 100644 --- a/libs/ardour/ardour/export_graph_builder.h +++ b/libs/ardour/ardour/export_graph_builder.h @@ -135,6 +135,7 @@ class LIBARDOUR_API ExportGraphBuilder int data_width; AnalysisPtr analyser; + bool _analyse; // Only one of these should be available at a time FloatConverterPtr float_converter; IntConverterPtr int_converter; diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc index 5bc10e813c..fd85c322d6 100644 --- a/libs/ardour/export_format_specification.cc +++ b/libs/ardour/export_format_specification.cc @@ -173,6 +173,7 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s) , _with_mp4chaps (false) , _soundcloud_upload (false) , _command ("") + , _analyse (true) { format_ids.insert (F_None); endiannesses.insert (E_FileDefault); @@ -186,6 +187,7 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s, XMLNode const , _silence_beginning (s) , _silence_end (s) , _soundcloud_upload (false) + , _analyse (true) { _silence_beginning.type = Time::Timecode; _silence_end.type = Time::Timecode; @@ -199,6 +201,7 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification , _silence_beginning (other.session) , _silence_end (other.session) , _soundcloud_upload (false) + , _analyse (other._analyse) { if (modify_name) { set_name (other.name() + " (copy)"); diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index 685db817d4..85857f21ef 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -307,7 +307,10 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c unsigned channels = new_config.channel_config->get_n_chans(); analyser.reset (new Analyser (config.format->sample_rate(), channels, max_frames, (framecnt_t) ceil (parent.timespan->get_length () * config.format->sample_rate () / (double) parent.session.nominal_frame_rate ()))); - parent.add_analyser (config.filename->get_path (config.format), analyser); + _analyse = config.format->analyse(); + if (_analyse) { + parent.add_analyser (config.filename->get_path (config.format), analyser); + } if (data_width == 8 || data_width == 16) { short_converter = ShortConverterPtr (new SampleFormatConverter (channels)); @@ -331,7 +334,15 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c ExportGraphBuilder::FloatSinkPtr ExportGraphBuilder::SFC::sink () { - return analyser; + if (_analyse) { + return analyser; + } else if (data_width == 8 || data_width == 16) { + return short_converter; + } else if (data_width == 24 || data_width == 32) { + return int_converter; + } else { + return float_converter; + } } void -- cgit v1.2.3