mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Allow crossfades from the undo record to be recreated even if their regions are no longer in a playlist.
git-svn-id: svn://localhost/ardour2/branches/3.0@7719 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2221fc139c
commit
e528e5038f
1 changed files with 20 additions and 4 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
#include "ardour/utils.h"
|
#include "ardour/utils.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/source.h"
|
#include "ardour/source.h"
|
||||||
|
#include "ardour/region_factory.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
@ -144,8 +145,17 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode const & node)
|
||||||
|
|
||||||
PBD::ID id (prop->value());
|
PBD::ID id (prop->value());
|
||||||
|
|
||||||
if ((r = playlist.find_region (id)) == 0) {
|
r = playlist.find_region (id);
|
||||||
error << string_compose (_("Crossfade: no \"in\" region %1 found in playlist %2"), id, playlist.name())
|
|
||||||
|
if (!r) {
|
||||||
|
/* the `in' region is not in a playlist, which probably means that this crossfade
|
||||||
|
is in the undo record, so we have to find the region in the global region map.
|
||||||
|
*/
|
||||||
|
r = RegionFactory::region_by_id (id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!r) {
|
||||||
|
error << string_compose (_("Crossfade: no \"in\" region %1 found in playlist %2 nor in region map"), id, playlist.name())
|
||||||
<< endmsg;
|
<< endmsg;
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
@ -161,8 +171,14 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode const & node)
|
||||||
|
|
||||||
PBD::ID id2 (prop->value());
|
PBD::ID id2 (prop->value());
|
||||||
|
|
||||||
if ((r = playlist.find_region (id2)) == 0) {
|
r = playlist.find_region (id2);
|
||||||
error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id2, playlist.name())
|
|
||||||
|
if (!r) {
|
||||||
|
r = RegionFactory::region_by_id (id2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!r) {
|
||||||
|
error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2 nor in region map"), id2, playlist.name())
|
||||||
<< endmsg;
|
<< endmsg;
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue