Set new (recorded) MIDI source length to length of entire capture (instead of length from start to last actual recorded event).
Precisely set length_beats of newly captured MIDI regions to source length in beats (no conversion). git-svn-id: svn://localhost/ardour2/branches/3.0@8317 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
fe79c42725
commit
384c418ae0
@ -96,6 +96,8 @@ class MidiSource : virtual public Source, public boost::enable_shared_from_this<
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
bool length_mutable() const { return true; }
|
||||
|
||||
void set_length_beats(double l) { _length_beats = l; }
|
||||
double length_beats() const { return _length_beats; }
|
||||
|
||||
virtual void load_model(bool lock=true, bool force_reload=false) = 0;
|
||||
|
@ -968,6 +968,12 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen
|
||||
|
||||
_write_source->mark_streaming_write_completed ();
|
||||
|
||||
/* set length in beats to entire capture length */
|
||||
|
||||
BeatsFramesConverter converter (_session.tempo_map(), capture_info.front()->start);
|
||||
const double total_capture_beats = converter.from(total_capture);
|
||||
_write_source->set_length_beats(total_capture_beats);
|
||||
|
||||
/* make it not a stub anymore */
|
||||
|
||||
_write_source->unstubify ();
|
||||
|
@ -72,11 +72,8 @@ MidiRegion::register_properties ()
|
||||
/* Basic MidiRegion constructor (many channels) */
|
||||
MidiRegion::MidiRegion (const SourceList& srcs)
|
||||
: Region (srcs)
|
||||
, _length_beats (Properties::length_beats, (Evoral::MusicalTime) 0)
|
||||
, _length_beats (Properties::length_beats, midi_source(0)->length_beats())
|
||||
{
|
||||
_length_beats = midi_source(0)->length_beats();
|
||||
cout << "NEW MIDI REGION LENGTH BEATS: " << _length_beats << endl;
|
||||
|
||||
register_properties ();
|
||||
|
||||
midi_source(0)->ModelChanged.connect_same_thread (_source_connection, boost::bind (&MidiRegion::model_changed, this));
|
||||
|
Loading…
Reference in New Issue
Block a user