diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc index 4f332c9bff..b9c2dd5a78 100644 --- a/gtk2_ardour/export_channel_selector.cc +++ b/gtk2_ardour/export_channel_selector.cc @@ -478,6 +478,24 @@ void RegionExportChannelSelector::sync_with_manager () { state = manager->get_channel_configs().front(); + + if (!state) { return; } + + switch (state->config->region_processing_type()) { + case RegionExportChannelFactory::None: + // Do nothing + break; + case RegionExportChannelFactory::Raw: + raw_button.set_active (true); + break; + case RegionExportChannelFactory::Fades: + fades_button.set_active (true); + break; + case RegionExportChannelFactory::Processed: + processed_button.set_active (true); + break; + } + handle_selection (); } @@ -490,17 +508,21 @@ RegionExportChannelSelector::handle_selection () state->config->clear_channels (); + RegionExportChannelFactory::Type type = RegionExportChannelFactory::None; if (raw_button.get_active ()) { - factory.reset (new RegionExportChannelFactory (_session, region, track, RegionExportChannelFactory::Raw)); + type = RegionExportChannelFactory::Raw; } else if (fades_button.get_active ()) { - factory.reset (new RegionExportChannelFactory (_session, region, track, RegionExportChannelFactory::Fades)); + type = RegionExportChannelFactory::Fades; } else if (processed_button.get_active ()) { - factory.reset (new RegionExportChannelFactory(_session, region, track, RegionExportChannelFactory::Processed)); + type = RegionExportChannelFactory::Processed; } else { CriticalSelectionChanged (); return; } + factory.reset (new RegionExportChannelFactory (_session, region, track, type)); + state->config->set_region_processing_type (type); + for (size_t chan = 0; chan < region_chans; ++chan) { state->config->register_channel (factory->create (chan)); } diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index a10bdfc290..6f9682018c 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -93,6 +93,7 @@ class RegionExportChannelFactory { public: enum Type { + None, Raw, Fades, Processed diff --git a/libs/ardour/ardour/export_channel_configuration.h b/libs/ardour/ardour/export_channel_configuration.h index d84638ca85..a950cecc65 100644 --- a/libs/ardour/ardour/export_channel_configuration.h +++ b/libs/ardour/ardour/export_channel_configuration.h @@ -68,6 +68,9 @@ class ExportChannelConfiguration : public boost::enable_shared_from_thisadd_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 +90,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 ()); diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc index 459f878596..6ff73261de 100644 --- a/libs/ardour/export_profile_manager.cc +++ b/libs/ardour/export_profile_manager.cc @@ -90,8 +90,6 @@ ExportProfileManager::ExportProfileManager (Session & s, std::string xml_node_na ExportProfileManager::~ExportProfileManager () { - if (single_range_mode) { return; } - XMLNode * instant_xml (new XMLNode (xml_node_name)); serialize_profile (*instant_xml); session.add_instant_xml (*instant_xml, false);