summaryrefslogtreecommitdiff
path: root/libs
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
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')
-rw-r--r--libs/ardour/ardour/export_channel_configuration.h2
-rw-r--r--libs/ardour/ardour/export_profile_manager.h5
-rw-r--r--libs/ardour/export_graph_builder.cc1
-rw-r--r--libs/ardour/export_profile_manager.cc51
4 files changed, 39 insertions, 20 deletions
diff --git a/libs/ardour/ardour/export_channel_configuration.h b/libs/ardour/ardour/export_channel_configuration.h
index 932a74328c..d50ec0365d 100644
--- a/libs/ardour/ardour/export_channel_configuration.h
+++ b/libs/ardour/ardour/export_channel_configuration.h
@@ -62,7 +62,7 @@ class ExportChannelConfiguration : public boost::enable_shared_from_this<ExportC
ChannelList const & get_channels () const { return channels; }
bool all_channels_have_ports () const;
- std::string name () const { return _name; }
+ std::string name () const { return _name; }
void set_name (std::string name) { _name = name; }
void set_split (bool value) { split = value; }
diff --git a/libs/ardour/ardour/export_profile_manager.h b/libs/ardour/ardour/export_profile_manager.h
index 67ebe2b316..dc4b6b0060 100644
--- a/libs/ardour/ardour/export_profile_manager.h
+++ b/libs/ardour/ardour/export_profile_manager.h
@@ -55,7 +55,7 @@ class ExportProfileManager
{
public:
- ExportProfileManager (Session & s);
+ ExportProfileManager (Session & s, std::string xml_node_name);
~ExportProfileManager ();
void load_profile ();
@@ -75,6 +75,7 @@ class ExportProfileManager
typedef std::pair<PBD::UUID, PBD::sys::path> FilePair;
typedef std::map<PBD::UUID, PBD::sys::path> FileMap;
+ std::string const xml_node_name;
HandlerPtr handler;
Session & session;
@@ -174,6 +175,8 @@ class ExportProfileManager
typedef std::list<ChannelConfigStatePtr> ChannelConfigStateList;
ChannelConfigStateList const & get_channel_configs () { return check_list (channel_configs); }
+ void clear_channel_configs () { channel_configs.clear(); }
+ ChannelConfigStatePtr add_channel_config ();
private:
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc
index c7a1efebd1..51b4c7042c 100644
--- a/libs/ardour/export_graph_builder.cc
+++ b/libs/ardour/export_graph_builder.cc
@@ -187,6 +187,7 @@ ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::Sndfil
{
unsigned channels = config.channel_config->get_n_chans();
int format = get_real_format (config);
+ config.filename->set_channel_config(config.channel_config);
string filename = config.filename->get_path (config.format);
writer.reset (new AudioGrapher::SndfileWriter<T> (filename, format, channels, config.format->sample_rate(), config.broadcast_info));
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)
{