summaryrefslogtreecommitdiff
path: root/libs/ardour/export_profile_manager.cc
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2011-01-06 16:55:19 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2011-01-06 16:55:19 +0000
commit8e35583358e7df6f0f950463612740b2a8cdffb1 (patch)
treef576a405fd8717b0fa50543cfd35bd760e8c4cd1 /libs/ardour/export_profile_manager.cc
parent9a400114bb2a79d503be6c6b6f95cd1572c95927 (diff)
Add stem export dialog and make all different export dialogs save their config to a different node in instant.xml
git-svn-id: svn://localhost/ardour2/branches/3.0@8465 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_profile_manager.cc')
-rw-r--r--libs/ardour/export_profile_manager.cc51
1 files changed, 33 insertions, 18 deletions
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc
index 24ccd102a0..65b74103ae 100644
--- a/libs/ardour/export_profile_manager.cc
+++ b/libs/ardour/export_profile_manager.cc
@@ -49,15 +49,16 @@ using namespace PBD;
namespace ARDOUR
{
-ExportProfileManager::ExportProfileManager (Session & s) :
- handler (s.get_export_handler()),
- session (s),
+ExportProfileManager::ExportProfileManager (Session & s, std::string xml_node_name)
+ : xml_node_name (xml_node_name)
+ , handler (s.get_export_handler())
+ , session (s)
- session_range (new Location (s)),
- ranges (new LocationList ()),
- single_range_mode (false),
+ , session_range (new Location (s))
+ , ranges (new LocationList ())
+ , single_range_mode (false)
- format_list (new FormatList ())
+ , format_list (new FormatList ())
{
/* Initialize path variables */
@@ -68,13 +69,13 @@ ExportProfileManager::ExportProfileManager (Session & s) :
search_path += ardour_search_path().add_subdirectory_to_paths("export");
- sys::path sys_export = ardour_module_directory();
- sys_export /= "export";
-
+ sys::path sys_export = ardour_module_directory();
+ sys_export /= "export";
+
search_path += sys_export;
- info << string_compose (_("Searching for export formats in %1"), search_path.to_string()) << endmsg;
- cerr << string_compose (_("Searching for export formats in %1"), search_path.to_string()) << endl;
+ info << string_compose (_("Searching for export formats in %1"), search_path.to_string()) << endmsg;
+ cerr << string_compose (_("Searching for export formats in %1"), search_path.to_string()) << endl;
/* create export config directory if necessary */
@@ -98,7 +99,7 @@ ExportProfileManager::~ExportProfileManager ()
{
if (single_range_mode) { return; }
- XMLNode * instant_xml (new XMLNode ("ExportProfile"));
+ XMLNode * instant_xml (new XMLNode (xml_node_name));
serialize_profile (*instant_xml);
session.add_instant_xml (*instant_xml, false);
}
@@ -106,11 +107,11 @@ ExportProfileManager::~ExportProfileManager ()
void
ExportProfileManager::load_profile ()
{
- XMLNode * instant_node = session.instant_xml ("ExportProfile");
+ XMLNode * instant_node = session.instant_xml (xml_node_name);
if (instant_node) {
set_state (*instant_node);
} else {
- XMLNode empty_node ("ExportProfile");
+ XMLNode empty_node (xml_node_name);
set_state (empty_node);
}
}
@@ -118,17 +119,19 @@ ExportProfileManager::load_profile ()
void
ExportProfileManager::prepare_for_export ()
{
- ChannelConfigPtr channel_config = channel_configs.front()->config;
TimespanListPtr ts_list = timespans.front()->timespans;
FormatStateList::const_iterator format_it;
FilenameStateList::const_iterator filename_it;
+ // For each timespan
for (TimespanList::iterator ts_it = ts_list->begin(); ts_it != ts_list->end(); ++ts_it) {
+ // ..., each format-filename pair
for (format_it = formats.begin(), filename_it = filenames.begin();
format_it != formats.end() && filename_it != filenames.end();
++format_it, ++filename_it) {
+ FilenamePtr filename = (*filename_it)->filename;
// filename->include_timespan = (ts_list->size() > 1); Disabled for now...
boost::shared_ptr<BroadcastInfo> b;
@@ -136,8 +139,12 @@ ExportProfileManager::prepare_for_export ()
b.reset (new BroadcastInfo);
b->set_from_session (session, (*ts_it)->get_start());
}
-
- handler->add_export_config (*ts_it, channel_config, (*format_it)->format, (*filename_it)->filename, b);
+
+ // ...and each channel config
+ filename->include_channel_config = (channel_configs.size() > 1);
+ for(ChannelConfigStateList::iterator cc_it = channel_configs.begin(); cc_it != channel_configs.end(); ++cc_it) {
+ handler->add_export_config (*ts_it, (*cc_it)->config, (*format_it)->format, filename, b);
+ }
}
}
}
@@ -440,6 +447,14 @@ ExportProfileManager::update_ranges () {
}
}
+ExportProfileManager::ChannelConfigStatePtr
+ExportProfileManager::add_channel_config ()
+{
+ ChannelConfigStatePtr ptr(new ChannelConfigState(handler->add_channel_config()));
+ channel_configs.push_back(ptr);
+ return ptr;
+}
+
bool
ExportProfileManager::init_channel_configs (XMLNodeList nodes)
{