triggerbox: allow set_region_threaded() to "unset" the region
This commit is contained in:
parent
c6e141aaba
commit
2111cfe557
@ -745,15 +745,21 @@ AudioTrigger::natural_length() const
|
|||||||
int
|
int
|
||||||
AudioTrigger::set_region_threaded (boost::shared_ptr<Region> r)
|
AudioTrigger::set_region_threaded (boost::shared_ptr<Region> r)
|
||||||
{
|
{
|
||||||
using namespace RubberBand;
|
assert (!active());
|
||||||
|
|
||||||
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (r);
|
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (r);
|
||||||
|
|
||||||
if (!ar) {
|
if (r && !ar) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_region_internal (r);
|
set_region_internal (r);
|
||||||
|
|
||||||
|
if (!r) {
|
||||||
|
/* unset */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
load_data (ar);
|
load_data (ar);
|
||||||
determine_tempo ();
|
determine_tempo ();
|
||||||
setup_stretcher ();
|
setup_stretcher ();
|
||||||
|
Loading…
Reference in New Issue
Block a user