some strategic documentation
[ardour.git] / libs / ardour / ardour / export_graph_builder.h
index 5dc6cd7ac2d770f01f4abae5b60d36bfe306f205..0a9912e43ef3feb06ae6ee6221665a8de027fd38 100644 (file)
@@ -22,6 +22,7 @@
 #define __ardour_export_graph_builder_h__
 
 #include "ardour/export_handler.h"
+#include "ardour/export_analysis.h"
 
 #include "audiographer/utils/identity_vertex.h"
 
@@ -32,6 +33,7 @@ namespace AudioGrapher {
        class SampleRateConverter;
        class PeakReader;
        class Normalizer;
+       class Analyser;
        template <typename T> class Chunker;
        template <typename T> class SampleFormatConverter;
        template <typename T> class Interleaver;
@@ -55,7 +57,9 @@ class LIBARDOUR_API ExportGraphBuilder
 
        typedef boost::shared_ptr<AudioGrapher::Sink<Sample> > FloatSinkPtr;
        typedef boost::shared_ptr<AudioGrapher::IdentityVertex<Sample> > IdentityVertexPtr;
+       typedef boost::shared_ptr<AudioGrapher::Analyser> AnalysisPtr;
        typedef std::map<ExportChannelPtr,  IdentityVertexPtr> ChannelMap;
+       typedef std::map<std::string, AnalysisPtr> AnalysisMap;
 
   public:
 
@@ -71,11 +75,16 @@ class LIBARDOUR_API ExportGraphBuilder
        void cleanup (bool remove_out_files = false);
        void set_current_timespan (boost::shared_ptr<ExportTimespan> span);
        void add_config (FileSpec const & config);
+       void get_analysis_results (AnalysisResults& results);
 
   private:
 
+       void add_analyser (const std::string& fn, AnalysisPtr ap) {
+               analysis_map.insert (std::make_pair (fn, ap));
+       }
+
        void add_split_config (FileSpec const & config);
-    
+
        class Encoder {
             public:
                template <typename T> boost::shared_ptr<AudioGrapher::Sink<T> > init (FileSpec const & new_config);
@@ -99,7 +108,7 @@ class LIBARDOUR_API ExportGraphBuilder
                PBD::ScopedConnection  copy_files_connection;
 
                std::string writer_filename;
-        
+
                // Only one of these should be available at a time
                FloatWriterPtr float_writer;
                IntWriterPtr   int_writer;
@@ -115,8 +124,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<AudioGrapher::Chunker<float> > ChunkerPtr;
                typedef boost::shared_ptr<AudioGrapher::SampleFormatConverter<Sample> > FloatConverterPtr;
                typedef boost::shared_ptr<AudioGrapher::SampleFormatConverter<int> >   IntConverterPtr;
                typedef boost::shared_ptr<AudioGrapher::SampleFormatConverter<short> > ShortConverterPtr;
@@ -125,6 +136,9 @@ class LIBARDOUR_API ExportGraphBuilder
                boost::ptr_list<Encoder> children;
                int                data_width;
 
+               ChunkerPtr      chunker;
+               AnalysisPtr     analyser;
+               bool            _analyse;
                // Only one of these should be available at a time
                FloatConverterPtr float_converter;
                IntConverterPtr int_converter;
@@ -175,7 +189,7 @@ class LIBARDOUR_API ExportGraphBuilder
                FloatSinkPtr sink ();
                void add_child (FileSpec const & new_config);
                void remove_children (bool remove_out_files);
-        
+
                bool operator== (FileSpec const & other_config) const;
 
                                                private:
@@ -245,6 +259,8 @@ class LIBARDOUR_API ExportGraphBuilder
 
        std::list<Normalizer *> normalizers;
 
+       AnalysisMap analysis_map;
+
        Glib::ThreadPool thread_pool;
 };