always create short xfades when adding a region based on capture

git-svn-id: svn://localhost/ardour2/branches/3.0@12443 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-05-24 22:03:19 +00:00
parent f94e66e095
commit 9dae320b12
4 changed files with 37 additions and 15 deletions

View File

@ -222,6 +222,8 @@ public:
uint32_t combine_ops() const { return _combine_ops; }
void set_layer (boost::shared_ptr<Region>, double);
void set_capture_insertion_in_progress (bool yn);
protected:
friend class Session;
@ -286,6 +288,7 @@ public:
bool in_flush;
bool in_partition;
bool _frozen;
bool _capture_insertion_underway;
uint32_t subcnt;
PBD::ID _orig_track_id;
uint32_t _combine_ops;

View File

@ -1476,6 +1476,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
// cerr << _name << ": there are " << capture_info.size() << " capture_info records\n";
_playlist->clear_changes ();
_playlist->set_capture_insertion_in_progress (true);
_playlist->freeze ();
for (buffer_position = c->front()->write_source->last_capture_start_frame(), ci = capture_info.begin(); ci != capture_info.end(); ++ci) {
@ -1514,6 +1515,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
}
_playlist->thaw ();
_playlist->set_capture_insertion_in_progress (false);
_session.add_command (new StatefulDiffCommand (_playlist));
}

View File

@ -314,13 +314,18 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
/* Top's fade-in will cause an implicit fade-out of bottom */
framecnt_t len = 0;
switch (_session.config.get_xfade_model()) {
case FullCrossfade:
len = bottom->last_frame () - top->first_frame ();
break;
case ShortCrossfade:
if (_capture_insertion_underway) {
len = _session.config.get_short_xfade_seconds() * _session.frame_rate();
break;
} else {
switch (_session.config.get_xfade_model()) {
case FullCrossfade:
len = bottom->last_frame () - top->first_frame ();
break;
case ShortCrossfade:
len = _session.config.get_short_xfade_seconds() * _session.frame_rate();
break;
}
}
top->set_fade_in_active (true);
@ -357,13 +362,18 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
/* Top's fade-out will cause an implicit fade-in of bottom */
framecnt_t len = 0;
switch (_session.config.get_xfade_model()) {
case FullCrossfade:
len = top->last_frame () - bottom->first_frame ();
break;
case ShortCrossfade:
if (_capture_insertion_underway) {
len = _session.config.get_short_xfade_seconds() * _session.frame_rate();
break;
} else {
switch (_session.config.get_xfade_model()) {
case FullCrossfade:
len = top->last_frame () - bottom->first_frame ();
break;
case ShortCrossfade:
len = _session.config.get_short_xfade_seconds() * _session.frame_rate();
break;
}
}
top->set_fade_out_active (true);

View File

@ -47,9 +47,9 @@ using namespace ARDOUR;
using namespace PBD;
namespace ARDOUR {
namespace Properties {
PBD::PropertyDescriptor<bool> regions;
}
namespace Properties {
PBD::PropertyDescriptor<bool> regions;
}
}
struct ShowMeTheList {
@ -311,6 +311,7 @@ Playlist::init (bool hide)
in_partition = false;
subcnt = 0;
_frozen = false;
_capture_insertion_underway = false;
_combine_ops = 0;
_session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this));
@ -3108,3 +3109,9 @@ restart:
check_crossfades (*i);
}
}
void
Playlist::set_capture_insertion_in_progress (bool yn)
{
_capture_insertion_underway = yn;
}