X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fexport_handler.h;h=dbc8213eed3c134dbf8f988939b8e6c24e26b5d4;hb=e5c607123588b318f28022488d74790fc1b7bebe;hp=c9450704082913f94fe82c9d71934ff66bdc1fbb;hpb=3b89d9eaa03406a5e03648f47734211f09b89d62;p=ardour.git diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h index c945070408..dbc8213eed 100644 --- a/libs/ardour/ardour/export_handler.h +++ b/libs/ardour/ardour/export_handler.h @@ -28,8 +28,12 @@ #include #include "ardour/ardour.h" -#include "ardour/types.h" #include "ardour/session.h" +#include "ardour/types.h" + +namespace AudioGrapher { + class BroadcastInfo; +} namespace ARDOUR { @@ -38,11 +42,12 @@ class ExportTimespan; class ExportChannelConfiguration; class ExportFormatSpecification; class ExportFilename; -class ExportProcessor; +class ExportGraphBuilder; + class ExportElementFactory { - protected: + public: typedef boost::shared_ptr TimespanPtr; typedef boost::shared_ptr ChannelConfigPtr; typedef boost::shared_ptr FormatPtr; @@ -68,31 +73,34 @@ class ExportElementFactory Session & session; }; -class ExportHandler : public ExportElementFactory, public sigc::trackable +class ExportHandler : public ExportElementFactory { - private: - - /* Stuff for export configs - * The multimap maps timespans to file specifications - */ - + public: struct FileSpec { - - FileSpec (ChannelConfigPtr channel_config, FormatPtr format, FilenamePtr filename) : - channel_config (channel_config), - format (format), - filename (filename) - {} - + FileSpec() {} + FileSpec (ChannelConfigPtr channel_config, FormatPtr format, FilenamePtr filename, boost::shared_ptr broadcast_info) + : channel_config (channel_config) + , format (format) + , filename (filename) + , broadcast_info (broadcast_info) + {} + ChannelConfigPtr channel_config; FormatPtr format; FilenamePtr filename; + boost::shared_ptr broadcast_info; }; + private: + + /* Stuff for export configs + * The multimap maps timespans to file specifications + */ + typedef std::pair ConfigPair; typedef std::multimap ConfigMap; - - typedef boost::shared_ptr ProcessorPtr; + + typedef boost::shared_ptr GraphBuilderPtr; typedef boost::shared_ptr StatusPtr; private: @@ -102,81 +110,82 @@ class ExportHandler : public ExportElementFactory, public sigc::trackable friend boost::shared_ptr Session::get_export_handler(); ExportHandler (Session & session); - + public: ~ExportHandler (); - bool add_export_config (TimespanPtr timespan, ChannelConfigPtr channel_config, FormatPtr format, FilenamePtr filename); + bool add_export_config (TimespanPtr timespan, ChannelConfigPtr channel_config, FormatPtr format, FilenamePtr filename, boost::shared_ptr broadcast_info); void do_export (bool rt = false); private: + int process (framecnt_t frames); + Session & session; - ProcessorPtr processor; + GraphBuilderPtr graph_builder; StatusPtr export_status; ConfigMap config_map; - + bool realtime; + bool normalizing; + + /* Timespan management */ + + void start_timespan (); + int process_timespan (framecnt_t frames); + int process_normalize (); + void finish_timespan (); + + typedef std::pair TimespanBounds; + TimespanPtr current_timespan; + TimespanBounds timespan_bounds; - sigc::connection files_written_connection; - std::list files_written; - + PBD::ScopedConnection process_connection; + framepos_t process_position; + /* CD Marker stuff */ - + struct CDMarkerStatus { CDMarkerStatus (std::string out_file, TimespanPtr timespan, FormatPtr format, std::string filename) : - out (out_file.c_str()), timespan (timespan), format (format), filename (filename), + out (out_file.c_str()), timespan (timespan), format (format), filename (filename), marker(0), track_number (1), track_position (0), track_duration (0), track_start_frame (0), index_number (1), index_position (0) {} - + /* General info */ std::ofstream out; TimespanPtr timespan; FormatPtr format; std::string filename; Location * marker; - + /* Track info */ uint32_t track_number; - nframes_t track_position; - nframes_t track_duration; - nframes_t track_start_frame; - + framepos_t track_position; + framepos_t track_duration; + framepos_t track_start_frame; + /* Index info */ uint32_t index_number; - nframes_t index_position; + framepos_t index_position; }; - - + + void export_cd_marker_file (TimespanPtr timespan, FormatPtr file_format, std::string filename, CDMarkerFormat format); - + void write_cue_header (CDMarkerStatus & status); void write_toc_header (CDMarkerStatus & status); - + void write_track_info_cue (CDMarkerStatus & status); void write_track_info_toc (CDMarkerStatus & status); void write_index_info_cue (CDMarkerStatus & status); void write_index_info_toc (CDMarkerStatus & status); - - void frames_to_cd_frames_string (char* buf, nframes_t when); - + + void frames_to_cd_frames_string (char* buf, framepos_t when); + int cue_tracknum; int cue_indexnum; - - /* Timespan management */ - - void start_timespan (); - void finish_timespan (); - void timespan_thread_finished (); - - typedef std::pair TimespanBounds; - TimespanPtr current_timespan; - ConfigMap::iterator current_map_it; - TimespanBounds timespan_bounds; - sigc::connection channel_config_connection; - }; } // namespace ARDOUR