Fix recording MIDI
- Fix API call to add region(midi_region) -- set count to "1" - Forward DataRecorded() signal - remove botched merge/rebase"a4a87f56
accidentally brought back code from old-destructive API which was removed inaf103cf3
and08c13007
There is no per track NonLayered record mode anymore, it's session global. - set can_record correctly to not accidentally clear last capture sources for cont'd recording (toggle track's rec-arm)
This commit is contained in:
parent
0431ed3d3e
commit
05ab7a46b5
@ -50,7 +50,7 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
|
||||
Recordable = 0x1,
|
||||
Hidden = 0x2,
|
||||
Destructive = 0x4,
|
||||
NonLayered = 0x8
|
||||
NonLayered = 0x8 // deprecated (kept only for enum compat)
|
||||
};
|
||||
|
||||
static const std::string state_node_name;
|
||||
@ -77,7 +77,6 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
|
||||
|
||||
bool hidden() const { return _flags & Hidden; }
|
||||
bool recordable() const { return _flags & Recordable; }
|
||||
bool non_layered() const { return _flags & NonLayered; }
|
||||
|
||||
virtual void non_realtime_locate (samplepos_t);
|
||||
|
||||
|
@ -97,9 +97,6 @@ public:
|
||||
virtual void set_record_safe (bool yn);
|
||||
|
||||
bool destructive() const { return _flags & Destructive; }
|
||||
int set_destructive (bool yn);
|
||||
int set_non_layered (bool yn);
|
||||
bool can_become_destructive (bool& requires_bounce) const;
|
||||
|
||||
/** @return Start position of currently-running capture (in session samples) */
|
||||
samplepos_t current_capture_start() const { return capture_start_sample; }
|
||||
|
@ -161,6 +161,8 @@ private:
|
||||
void track_input_active (IOChange, void*);
|
||||
void map_input_active (bool);
|
||||
|
||||
void data_recorded (boost::weak_ptr<MidiSource> src);
|
||||
|
||||
/** Update automation controls to reflect any changes in buffers. */
|
||||
void update_controls (BufferSet const& bufs);
|
||||
void restore_controls ();
|
||||
|
@ -64,48 +64,6 @@ AudioTrack::~AudioTrack ()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XXX_OLD_DESTRUCTIVE_API_XXX
|
||||
int
|
||||
AudioTrack::set_mode (TrackMode m)
|
||||
{
|
||||
if (m != _mode) {
|
||||
|
||||
if (!Profile->get_trx() && _diskstream->set_destructive (m == Destructive)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
_diskstream->set_non_layered (m == NonLayered);
|
||||
_mode = m;
|
||||
|
||||
TrackModeChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
AudioTrack::can_use_mode (TrackMode m, bool& bounce_required)
|
||||
{
|
||||
switch (m) {
|
||||
case NonLayered:
|
||||
case Normal:
|
||||
bounce_required = false;
|
||||
return true;
|
||||
|
||||
case Destructive:
|
||||
if (Profile->get_trx()) {
|
||||
return false;
|
||||
} else {
|
||||
return _diskstream->can_become_destructive (bounce_required);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
AudioTrack::set_state (const XMLNode& node, int version)
|
||||
{
|
||||
|
@ -359,7 +359,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
||||
bool re = record_enabled ();
|
||||
bool punch_in = _session.config.get_punch_in () && _session.locations()->auto_punch_location ();
|
||||
bool can_record = _session.actively_recording ();
|
||||
can_record |= _session.get_record_enabled () && punch_in && _session.transport_sample () <= _session.locations()->auto_punch_location ()->start ();
|
||||
can_record |= speed != 0 && _session.get_record_enabled () && punch_in && _session.transport_sample () <= _session.locations()->auto_punch_location ()->start ();
|
||||
|
||||
_need_butler = false;
|
||||
|
||||
@ -1371,14 +1371,8 @@ DiskWriter::use_destructive_playlist ()
|
||||
assert((*chan)->write_source);
|
||||
(*chan)->write_source->set_allow_remove_if_empty (false);
|
||||
|
||||
/* this might be false if we switched modes, so force it */
|
||||
|
||||
#ifdef XXX_OLD_DESTRUCTIVE_API_XXX
|
||||
(*chan)->write_source->set_destructive (true);
|
||||
#else
|
||||
// should be set when creating the source or loading the state
|
||||
assert ((*chan)->write_source->destructive());
|
||||
#endif
|
||||
}
|
||||
|
||||
/* the source list will never be reset for a destructive track */
|
||||
|
@ -98,9 +98,17 @@ MidiTrack::init ()
|
||||
_disk_writer->set_note_mode (_note_mode);
|
||||
_disk_reader->reset_tracker ();
|
||||
|
||||
_disk_writer->DataRecorded.connect_same_thread (*this, boost::bind (&MidiTrack::data_recorded, this, _1));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
MidiTrack::data_recorded (boost::weak_ptr<MidiSource> src)
|
||||
{
|
||||
DataRecorded (src); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
bool
|
||||
MidiTrack::can_be_record_safe ()
|
||||
{
|
||||
|
@ -91,8 +91,6 @@ Track::init ()
|
||||
|
||||
if (_mode == Destructive && !Profile->get_trx()) {
|
||||
dflags = DiskIOProcessor::Flag (dflags | DiskIOProcessor::Destructive);
|
||||
} else if (_mode == NonLayered){
|
||||
dflags = DiskIOProcessor::Flag(dflags | DiskIOProcessor::NonLayered);
|
||||
}
|
||||
|
||||
_disk_reader.reset (new DiskReader (_session, name(), dflags));
|
||||
@ -1035,9 +1033,9 @@ Track::use_captured_midi_sources (SourceList& srcs, CaptureInfos const & capture
|
||||
continue; /* XXX is this OK? */
|
||||
}
|
||||
|
||||
// cerr << "add new region, buffer position = " << buffer_position << " @ " << (*ci)->start << endl;
|
||||
cerr << "add new region, len = " << (*ci)->samples << " @ " << (*ci)->start << endl;
|
||||
|
||||
pl->add_region (midi_region, (*ci)->start + preroll_off, _disk_writer->non_layered());
|
||||
pl->add_region (midi_region, (*ci)->start + preroll_off, 1, _session.config.get_layered_record_mode ());
|
||||
}
|
||||
|
||||
pl->thaw ();
|
||||
@ -1139,7 +1137,7 @@ Track::use_captured_audio_sources (SourceList& srcs, CaptureInfos const & captur
|
||||
continue; /* XXX is this OK? */
|
||||
}
|
||||
|
||||
pl->add_region (region, (*ci)->start + preroll_off, 1, _disk_writer->non_layered());
|
||||
pl->add_region (region, (*ci)->start + preroll_off, 1, _session.config.get_layered_record_mode());
|
||||
pl->set_layer (region, DBL_MAX);
|
||||
|
||||
buffer_position += (*ci)->samples;
|
||||
|
Loading…
Reference in New Issue
Block a user