summaryrefslogtreecommitdiff
path: root/libs/ardour/export_profile_manager.cc
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2010-04-02 22:57:02 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2010-04-02 22:57:02 +0000
commit9943e0c6be105f14e4d5ba12508753a9699889de (patch)
treea58b2678365a86cfad34524296e6ecb9ee3e26dd /libs/ardour/export_profile_manager.cc
parente31c2e4dcbaa7bfeb04629ba603016d00a34e0c4 (diff)
Make session and master outs the default timespan and channel config for export
git-svn-id: svn://localhost/ardour2/branches/3.0@6849 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_profile_manager.cc')
-rw-r--r--libs/ardour/export_profile_manager.cc30
1 files changed, 25 insertions, 5 deletions
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc
index 244ec788ae..53e6338a12 100644
--- a/libs/ardour/export_profile_manager.cc
+++ b/libs/ardour/export_profile_manager.cc
@@ -36,6 +36,7 @@
#include "ardour/export_handler.h"
#include "ardour/export_failed.h"
#include "ardour/filename_extensions.h"
+#include "ardour/route.h"
#include "ardour/session.h"
#include "i18n.h"
@@ -221,20 +222,20 @@ ExportProfileManager::load_preset_from_disk (PBD::sys::path const & path)
bool
ExportProfileManager::set_state (XMLNode const & root)
{
- return set_global_state (root) && set_local_state (root);
+ return set_global_state (root) & set_local_state (root);
}
bool
ExportProfileManager::set_global_state (XMLNode const & root)
{
- return init_filenames (root.children ("ExportFilename")) &&
+ return init_filenames (root.children ("ExportFilename")) &
init_formats (root.children ("ExportFormat"));
}
bool
ExportProfileManager::set_local_state (XMLNode const & root)
{
- return init_timespans (root.children ("ExportTimespan")) &&
+ return init_timespans (root.children ("ExportTimespan")) &
init_channel_configs (root.children ("ExportChannelConfiguration"));
}
@@ -326,8 +327,15 @@ ExportProfileManager::init_timespans (XMLNodeList nodes)
}
if (timespans.empty()) {
- TimespanStatePtr timespan (new TimespanState (session_range, selection_range, ranges));
- timespans.push_back (timespan);
+ TimespanStatePtr state (new TimespanState (session_range, selection_range, ranges));
+ timespans.push_back (state);
+
+ // Add session as default selection
+ TimespanPtr timespan = handler->add_timespan();
+ timespan->set_name (session_range->name());
+ timespan->set_range_id ("session");
+ timespan->set_range (session_range->start(), session_range->end());
+ state->timespans->push_back (timespan);
return false;
}
@@ -425,6 +433,18 @@ ExportProfileManager::init_channel_configs (XMLNodeList nodes)
if (nodes.empty()) {
ChannelConfigStatePtr config (new ChannelConfigState (handler->add_channel_config()));
channel_configs.push_back (config);
+
+ // Add master outs as default
+ IO* master_out = session.master_out()->output().get();
+ if (!master_out) { return false; }
+
+ for (uint32_t n = 0; n < master_out->n_ports().n_audio(); ++n) {
+ PortExportChannel * channel = new PortExportChannel ();
+ channel->add_port (master_out->audio (n));
+
+ ExportChannelPtr chan_ptr (channel);
+ config->config->register_channel (chan_ptr);
+ }
return false;
}