diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-30 14:10:37 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-30 14:10:37 +0000 |
commit | 1de6e1a626a8aad8a3fee8ea4508645c3272896d (patch) | |
tree | bd10ee59b02be45cc728f99ee7a909e63e4450d2 /libs/ardour/diskstream.cc | |
parent | 60dc0ef48f0b4d56faf5b80242d85549e0791628 (diff) |
work to make destructive recording actually do something vaguely close to correct
git-svn-id: svn://localhost/trunk/ardour2@305 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/diskstream.cc')
-rw-r--r-- | libs/ardour/diskstream.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 09f9fcdd9d..154e085858 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -614,6 +614,13 @@ DiskStream::check_record_status (jack_nframes_t transport_frame, jack_nframes_t } + if (_flags & Recordable) { + cerr << "START RECORD @ " << capture_start_frame << " = " << capture_start_frame * sizeof (Sample) << endl; + for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) { + (*chan).write_source->mark_capture_start (capture_start_frame); + } + } + } else if (!record_enabled() || !can_record) { /* stop recording */ @@ -1060,11 +1067,8 @@ DiskStream::seek (jack_nframes_t frame, bool complete_refill) for (n = 0, chan = channels.begin(); chan != channels.end(); ++chan, ++n) { (*chan).playback_buf->reset (); (*chan).capture_buf->reset (); - if (destructive()) { - DestructiveFileSource* dfs = dynamic_cast<DestructiveFileSource*> ((*chan).write_source); - if (dfs) { - dfs->seek (frame); - } + if ((*chan).write_source) { + (*chan).write_source->seek (frame); } } @@ -1616,7 +1620,7 @@ DiskStream::transport_stopped (struct tm& when, time_t twhen, bool abort_capture */ try { - region = new AudioRegion (srcs, 0, total_capture, + region = new AudioRegion (srcs, channels[0].write_source->last_capture_start_frame(), total_capture, region_name_from_path (channels[0].write_source->name()), 0, AudioRegion::Flag (AudioRegion::DefaultFlags|AudioRegion::Automatic|AudioRegion::WholeFile)); @@ -1635,7 +1639,7 @@ DiskStream::transport_stopped (struct tm& when, time_t twhen, bool abort_capture _session.add_undo (_playlist->get_memento()); _playlist->freeze (); - for (buffer_position = 0, ci = capture_info.begin(); ci != capture_info.end(); ++ci) { + for (buffer_position = channels[0].write_source->last_capture_start_frame(), ci = capture_info.begin(); ci != capture_info.end(); ++ci) { string region_name; _session.region_name (region_name, _name, false); @@ -1683,6 +1687,13 @@ DiskStream::finish_capture (bool rec_monitors_input) { was_recording = false; + if (_flags & Recordable) { + cerr << "STOP CAPTURE\n"; + for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) { + (*chan).write_source->mark_capture_end (); + } + } + if (capture_captured == 0) { return; } |