'libs/evoral' - cast the returned pointers from malloc() / g_ptr_array_index() etc...
[ardour.git] / libs / ardour / export_channel_configuration.cc
index eb3b2838c64e68cf3bd117d873359f9fbf5db444..77b56272d69ea1a4df986583ce012b1eb00528d0 100644 (file)
 
 #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)
 {
 
 }
@@ -56,6 +48,15 @@ ExportChannelConfiguration::get_state ()
        root->add_property ("split", get_split() ? "true" : "false");
        root->add_property ("channels", to_string (get_n_chans(), std::dec));
 
+       switch (region_type) {
+       case RegionExportChannelFactory::None:
+               // Do nothing
+               break;
+       default:
+               root->add_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");
@@ -79,6 +80,11 @@ ExportChannelConfiguration::set_state (const XMLNode & root)
                set_split (!prop->value().compare ("true"));
        }
 
+       if ((prop = root.property ("region-processing"))) {
+               set_region_processing_type ((RegionExportChannelFactory::Type)
+                       string_2_enum (prop->value(), RegionExportChannelFactory::Type));
+       }
+
        XMLNodeList channels = root.children ("Channel");
        for (XMLNodeList::iterator it = channels.begin(); it != channels.end(); ++it) {
                ExportChannelPtr channel (new PortExportChannel ());
@@ -103,12 +109,12 @@ void
 ExportChannelConfiguration::configurations_for_files (std::list<boost::shared_ptr<ExportChannelConfiguration> > & 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<ExportChannelConfiguration> config (new ExportChannelConfiguration (session));
                config->set_name (_name);