summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/export_handler.h
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2009-12-27 14:46:23 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2009-12-27 14:46:23 +0000
commitdde0848a984e06cbc1d4117d9cffa75c191f3b39 (patch)
tree11f3a5fe94ac792e753297e16e4e80dd7e296aea /libs/ardour/ardour/export_handler.h
parent35c72a53b4c6bbc61b4b86db9de629e18362b48d (diff)
Re-integrate export-optimization branch.
Export now happens directly to file (unless normalizing is required), and can be easily optimized even further. The Session process connection is still broken during export (as it was before this commit also). git-svn-id: svn://localhost/ardour2/branches/3.0@6401 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/export_handler.h')
-rw-r--r--libs/ardour/ardour/export_handler.h76
1 files changed, 37 insertions, 39 deletions
diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h
index bbf1f7e208..f7f3b863b9 100644
--- a/libs/ardour/ardour/export_handler.h
+++ b/libs/ardour/ardour/export_handler.h
@@ -27,8 +27,8 @@
#include <boost/shared_ptr.hpp>
-#include "ardour/session.h"
#include "ardour/ardour.h"
+#include "ardour/session.h"
#include "ardour/types.h"
namespace ARDOUR
@@ -38,11 +38,11 @@ class ExportTimespan;
class ExportChannelConfiguration;
class ExportFormatSpecification;
class ExportFilename;
-class ExportProcessor;
+class ExportGraphBuilder;
class ExportElementFactory
{
- protected:
+ public:
typedef boost::shared_ptr<ExportTimespan> TimespanPtr;
typedef boost::shared_ptr<ExportChannelConfiguration> ChannelConfigPtr;
typedef boost::shared_ptr<ExportFormatSpecification> FormatPtr;
@@ -70,29 +70,30 @@ class ExportElementFactory
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)
+ : channel_config (channel_config)
+ , format (format)
+ , filename (filename)
+ {}
ChannelConfigPtr channel_config;
FormatPtr format;
FilenamePtr filename;
};
+
+ private:
+
+ /* Stuff for export configs
+ * The multimap maps timespans to file specifications
+ */
typedef std::pair<TimespanPtr, FileSpec> ConfigPair;
typedef std::multimap<TimespanPtr, FileSpec> ConfigMap;
- typedef boost::shared_ptr<ExportProcessor> ProcessorPtr;
+ typedef boost::shared_ptr<ExportGraphBuilder> GraphBuilderPtr;
typedef boost::shared_ptr<ExportStatus> StatusPtr;
private:
@@ -112,16 +113,26 @@ class ExportHandler : public ExportElementFactory
private:
Session & session;
- ProcessorPtr processor;
+ GraphBuilderPtr graph_builder;
StatusPtr export_status;
ConfigMap config_map;
bool realtime;
- PBD::ScopedConnection files_written_connection;
- PBD::ScopedConnection export_read_finished_connection;
- std::list<Glib::ustring> files_written;
- void add_file (const Glib::ustring&);
+ /* Timespan management */
+
+ void start_timespan ();
+ int process_timespan (nframes_t frames);
+ void finish_timespan ();
+
+ typedef std::pair<ConfigMap::iterator, ConfigMap::iterator> TimespanBounds;
+ TimespanPtr current_timespan;
+ TimespanBounds timespan_bounds;
+
+ PBD::ScopedConnection process_connection;
+ sframes_t process_position;
+
+ PBD::ScopedConnection export_read_finished_connection;
/* CD Marker stuff */
@@ -141,13 +152,13 @@ class ExportHandler : public ExportElementFactory
/* Track info */
uint32_t track_number;
- nframes_t track_position;
- nframes_t track_duration;
- nframes_t track_start_frame;
+ sframes_t track_position;
+ sframes_t track_duration;
+ sframes_t track_start_frame;
/* Index info */
uint32_t index_number;
- nframes_t index_position;
+ sframes_t index_position;
};
@@ -162,23 +173,10 @@ class ExportHandler : public ExportElementFactory
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, sframes_t when);
int cue_tracknum;
int cue_indexnum;
-
- /* Timespan management */
-
- void start_timespan ();
- void finish_timespan ();
- void timespan_thread_finished ();
-
- typedef std::pair<ConfigMap::iterator, ConfigMap::iterator> TimespanBounds;
- TimespanPtr current_timespan;
- ConfigMap::iterator current_map_it;
- TimespanBounds timespan_bounds;
- PBD::ScopedConnection channel_config_connection;
-
};
} // namespace ARDOUR