summaryrefslogtreecommitdiff
path: root/libs/ardour/export_channel_configuration.cc
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2008-09-28 11:11:38 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2008-09-28 11:11:38 +0000
commit6b50ba341da426805ce3c92609c0fa12c52b67ac (patch)
tree4ed20d3699613da5a952b09b7e9ef47ceb6b8610 /libs/ardour/export_channel_configuration.cc
parent909995338c970e9f8f7a51886502640527f2061e (diff)
* Improved export error handling, streamlined ExportFailed
* Cleaned out export related visibility in Session, and simpified Session <--> export component communication in general * Removed export_status.h header dependency from session.h * Added check for libsndfile FLAC and Ogg Vorbis compatibility * Added ExportFileFactory, leading in cleaner code in ExportProcessor, and better extensibility for possible future non-libsndfile formats git-svn-id: svn://localhost/ardour2/branches/3.0@3818 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_channel_configuration.cc')
-rw-r--r--libs/ardour/export_channel_configuration.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/libs/ardour/export_channel_configuration.cc b/libs/ardour/export_channel_configuration.cc
index 97b05c2f1e..e6eb84be06 100644
--- a/libs/ardour/export_channel_configuration.cc
+++ b/libs/ardour/export_channel_configuration.cc
@@ -57,10 +57,10 @@ ExportChannel::read_ports (float * data, nframes_t frames) const
/* ExportChannelConfiguration */
-ExportChannelConfiguration::ExportChannelConfiguration (ExportStatus & status, Session & session) :
+ExportChannelConfiguration::ExportChannelConfiguration (Session & session) :
session (session),
writer_thread (*this),
- status (status),
+ status (session.get_export_status ()),
files_written (false),
split (false)
{
@@ -143,7 +143,7 @@ ExportChannelConfiguration::write_files (boost::shared_ptr<ExportProcessor> new_
files_written = true;
if (!timespan) {
- throw ExportFailed (_("Export failed due to a programming error"), _("No timespan registered to channel configuration when requesting files to be written"));
+ throw ExportFailed (X_("Programming error: No timespan registered to channel configuration when requesting files to be written"));
}
/* Take a local copy of the processor to be used in the thread that is created below */
@@ -175,7 +175,7 @@ ExportChannelConfiguration::write_file ()
uint32_t channel;
do {
- if (status.aborted()) { break; }
+ if (status->aborted()) { break; }
channel = 0;
for (ChannelList::iterator it = channels.begin(); it != channels.end(); ++it) {
@@ -194,7 +194,7 @@ ExportChannelConfiguration::write_file ()
}
progress += frames_read;
- status.progress = (float) progress / timespan_length;
+ status->progress = (float) progress / timespan_length;
} while (processor->process (file_buffer, frames_read) > 0);
@@ -211,14 +211,18 @@ ExportChannelConfiguration::_write_files (void *arg)
// cc can be trated like 'this'
WriterThread & cc (*((WriterThread *) arg));
- for (FileConfigList::iterator it = cc->file_configs.begin(); it != cc->file_configs.end(); ++it) {
- if (cc->status.aborted()) {
- break;
+ try {
+ for (FileConfigList::iterator it = cc->file_configs.begin(); it != cc->file_configs.end(); ++it) {
+ if (cc->status->aborted()) {
+ break;
+ }
+ cc->processor->prepare (it->first, it->second, cc->channels.size(), cc->split, cc->timespan->get_start());
+ cc->write_file (); // Writes tempfile
+ cc->processor->prepare_post_processors ();
+ cc->processor->write_files();
}
- cc->processor->prepare (it->first, it->second, cc->channels.size(), cc->split, cc->timespan->get_start());
- cc->write_file (); // Writes tempfile
- cc->processor->prepare_post_processors ();
- cc->processor->write_files();
+ } catch (ExportFailed & e) {
+ cc->status->abort (true);
}
cc.running = false;