Store Region export state in instant.xml (fixes #3935)

git-svn-id: svn://localhost/ardour2/branches/3.0@11376 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sakari Bergen 2012-01-28 15:05:53 +00:00
parent aaf418bd6f
commit ab8cea1d7c
6 changed files with 57 additions and 8 deletions

View file

@ -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));
}