X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_channel_configuration.cc;h=90c44abf6440e589767c0f6321ff92924df22b4c;hb=11b02e90ac9b084cd25741b7a6bdc91c59749c16;hp=cc68356d824c8e7419c7b1a018b44c03e9224ab0;hpb=dde0848a984e06cbc1d4117d9cffa75c191f3b39;p=ardour.git diff --git a/libs/ardour/export_channel_configuration.cc b/libs/ardour/export_channel_configuration.cc index cc68356d82..90c44abf64 100644 --- a/libs/ardour/export_channel_configuration.cc +++ b/libs/ardour/export_channel_configuration.cc @@ -20,17 +20,8 @@ #include "ardour/export_channel_configuration.h" -#include "ardour/export_handler.h" -#include "ardour/export_filename.h" -#include "ardour/export_timespan.h" - -#include "ardour/audio_port.h" -#include "ardour/export_failed.h" -#include "ardour/midi_port.h" -#include "ardour/session.h" -#include "ardour/audioengine.h" - #include "pbd/convert.h" +#include "pbd/enumwriter.h" #include "pbd/pthread_utils.h" using namespace PBD; @@ -40,9 +31,10 @@ namespace ARDOUR /* ExportChannelConfiguration */ -ExportChannelConfiguration::ExportChannelConfiguration (Session & session) : - session (session), - split (false) +ExportChannelConfiguration::ExportChannelConfiguration (Session & session) + : session (session) + , split (false) + , region_type (RegionExportChannelFactory::None) { } @@ -53,15 +45,24 @@ ExportChannelConfiguration::get_state () XMLNode * root = new XMLNode ("ExportChannelConfiguration"); XMLNode * channel; - root->add_property ("split", get_split() ? "true" : "false"); - root->add_property ("channels", to_string (get_n_chans(), std::dec)); + root->set_property ("split", get_split()); + root->set_property ("channels", get_n_chans()); + + switch (region_type) { + case RegionExportChannelFactory::None: + // Do nothing + break; + default: + root->set_property ("region-processing", enum_2_string (region_type)); + break; + } uint32_t i = 1; for (ExportChannelConfiguration::ChannelList::const_iterator c_it = channels.begin(); c_it != channels.end(); ++c_it) { channel = root->add_child ("Channel"); if (!channel) { continue; } - channel->add_property ("number", to_string (i, std::dec)); + channel->set_property ("number", i); (*c_it)->get_state (channel); ++i; @@ -73,10 +74,15 @@ ExportChannelConfiguration::get_state () int ExportChannelConfiguration::set_state (const XMLNode & root) { - XMLProperty const * prop; + bool yn; + if (root.get_property ("split", yn)) { + set_split (yn); + } - if ((prop = root.property ("split"))) { - set_split (!prop->value().compare ("true")); + std::string str; + if (root.get_property ("region-processing", str)) { + set_region_processing_type ((RegionExportChannelFactory::Type) + string_2_enum (str, RegionExportChannelFactory::Type)); } XMLNodeList channels = root.children ("Channel"); @@ -99,4 +105,22 @@ ExportChannelConfiguration::all_channels_have_ports () const return true; } +void +ExportChannelConfiguration::configurations_for_files (std::list > & configs) +{ + configs.clear (); + + if (!split) { + configs.push_back (shared_from_this ()); + return; + } + + for (ChannelList::const_iterator it = channels.begin (); it != channels.end (); ++it) { + boost::shared_ptr config (new ExportChannelConfiguration (session)); + config->set_name (_name); + config->register_channel (*it); + configs.push_back (config); + } +} + } // namespace ARDOUR