X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fexport_graph_builder.h;h=c9671d729bbb6388a9821a6a01ae640a9e2b7a81;hb=11da4a83e499db74e75d5b59973b0e52b0c1277a;hp=979e3632b97fb4f636d9924e007e5199184d0432;hpb=837f8fac2b3193fd181ef80086aa25108414e0f0;p=ardour.git diff --git a/libs/ardour/ardour/export_graph_builder.h b/libs/ardour/ardour/export_graph_builder.h index 979e3632b9..c9671d729b 100644 --- a/libs/ardour/ardour/export_graph_builder.h +++ b/libs/ardour/ardour/export_graph_builder.h @@ -32,6 +32,7 @@ namespace AudioGrapher { class SampleRateConverter; class PeakReader; + class LoudnessReader; class Normalizer; class Analyser; template class Chunker; @@ -67,14 +68,15 @@ class LIBARDOUR_API ExportGraphBuilder ~ExportGraphBuilder (); int process (framecnt_t frames, bool last_cycle); - bool process_normalize (); // returns true when finished - bool will_normalize() { return !normalizers.empty(); } - unsigned get_normalize_cycle_count() const; + bool post_process (); // returns true when finished + bool need_postprocessing () const { return !intermediates.empty(); } + bool realtime() const { return _realtime; } + unsigned get_postprocessing_cycle_count() const; void reset (); void cleanup (bool remove_out_files = false); void set_current_timespan (boost::shared_ptr span); - void add_config (FileSpec const & config); + void add_config (FileSpec const & config, bool rt); void get_analysis_results (AnalysisResults& results); private: @@ -124,8 +126,10 @@ class LIBARDOUR_API ExportGraphBuilder void add_child (FileSpec const & new_config); void remove_children (bool remove_out_files); bool operator== (FileSpec const & other_config) const; + void set_peak (float); private: + typedef boost::shared_ptr > ChunkerPtr; typedef boost::shared_ptr > FloatConverterPtr; typedef boost::shared_ptr > IntConverterPtr; typedef boost::shared_ptr > ShortConverterPtr; @@ -134,6 +138,7 @@ class LIBARDOUR_API ExportGraphBuilder boost::ptr_list children; int data_width; + ChunkerPtr chunker; AnalysisPtr analyser; bool _analyse; // Only one of these should be available at a time @@ -142,41 +147,45 @@ class LIBARDOUR_API ExportGraphBuilder ShortConverterPtr short_converter; }; - class Normalizer { + class Intermediate { public: - Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames); + Intermediate (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames); FloatSinkPtr sink (); void add_child (FileSpec const & new_config); void remove_children (bool remove_out_files); bool operator== (FileSpec const & other_config) const; - unsigned get_normalize_cycle_count() const; + unsigned get_postprocessing_cycle_count() const; /// Returns true when finished bool process (); private: typedef boost::shared_ptr PeakReaderPtr; + typedef boost::shared_ptr LoudnessReaderPtr; typedef boost::shared_ptr NormalizerPtr; typedef boost::shared_ptr > TmpFilePtr; typedef boost::shared_ptr > ThreaderPtr; typedef boost::shared_ptr > BufferPtr; - void start_post_processing(); + void prepare_post_processing (); + void start_post_processing (); ExportGraphBuilder & parent; FileSpec config; framecnt_t max_frames_out; - + bool use_loudness; + bool use_peak; BufferPtr buffer; PeakReaderPtr peak_reader; TmpFilePtr tmp_file; NormalizerPtr normalizer; ThreaderPtr threader; + LoudnessReaderPtr loudness_reader; boost::ptr_list children; - PBD::ScopedConnection post_processing_connection; + PBD::ScopedConnectionList post_processing_connection; }; // sample rate converter @@ -198,7 +207,7 @@ class LIBARDOUR_API ExportGraphBuilder ExportGraphBuilder & parent; FileSpec config; boost::ptr_list children; - boost::ptr_list normalized_children; + boost::ptr_list intermediate_children; SRConverterPtr converter; framecnt_t max_frames_out; }; @@ -254,10 +263,12 @@ class LIBARDOUR_API ExportGraphBuilder framecnt_t process_buffer_frames; - std::list normalizers; + std::list intermediates; AnalysisMap analysis_map; + bool _realtime; + Glib::ThreadPool thread_pool; };