Commit Graph

79 Commits

Author SHA1 Message Date
Robin Gareus
b5587e5e43 NO-OP: clarify internal API, prepare for overwrite queue 2019-02-08 19:33:19 +01:00
Robin Gareus
bea9f5adc3 Remove disk-reader local MIDI vari-speed
Vari-speed is now handled by the engine, on port-level
2019-02-07 21:32:20 +01:00
Robin Gareus
8dda9f4ca8 Prefer AudioBuffer reference over raw buffer
This allows for consistent libardour API usage, in particular Amp.
2019-02-07 15:28:30 +01:00
Robin Gareus
18af4dd55a Prepare dedicated Disk-reader de-click gain-stage
This allows to specify a shorter fade-duration than default
Amp::apply_gain(), also allows to unroll and vectorize the loop
2019-02-07 15:28:25 +01:00
Robin Gareus
1845dff4c8 Implement backwards micro-locates 2019-02-06 20:22:22 +01:00
Robin Gareus
dcd612f8a7 Prepare Disk-reader for bi-directional micro-locates 2019-02-06 19:22:46 +01:00
Robin Gareus
b3fda6236a Optimize buffer zero-filling 2019-02-06 17:02:20 +01:00
Robin Gareus
007c4ffdc0 Towards a new disk-reader ringbuffer
This is mainly a NO-OP, introducing a new PlaybackBuffer type
and preparing for its use.

At this point in time, the buffer is just a power-of-two sized
ringbuffer and the disk-reader's read-logic is still unchanged.

Eventually the read and write sample position that are currently
private to the disk-reader can be migrated to be owned by the buffer.
Also Diskreader::read() positions can be matched to read-position ..
+/- buffer reservation and de-click can read w/o committing the read.
2019-02-05 23:29:31 +01:00
Robin Gareus
df666326f7 Fix insert/remove time duplicate automation move -- #7712
Editor::insert_time(), Editor::remove_time() handle automation
directly because time may be inserted to Routes without playlists
and combined undo-operation with marker, and tempo-changes.

However when the preference "automation_follows_regions" is enabled,
the playlist already moves the automation of region under any region
(possibly overriding future automation).

This resulted in possibly lossy, duplicate automation moves.
2018-12-21 17:33:59 +01:00
Robin Gareus
6fc2804414 Disk I/O: only allocate midi-buffer if needed
This fixes a memory-leak (_midi_buf was allocated in DiskIOProc
but only delete in DiskReader). Also skip midi-refill early on
2018-11-29 02:05:26 +01:00
Paul Davis
22061310c0 add new ::update_interval() method for transport masters, and use in shared ::speed_and_position() implementation 2018-10-04 00:42:14 -04:00
Robin Gareus
301d343e84 Fix mismatched delete/delete[] 2018-07-31 16:54:08 +02:00
Robin Gareus
59029765e8 NO-OP: Rename disk-reader buffer for consistency
This is in preparation to replace the Ringbuffer and avoid over-using
"buf" as variable (it's already used for vectors, as parameter name and
Audiobuffers.
2018-07-09 19:49:18 +02:00
Robin Gareus
dca30c99fc Prepare API for per disk-reader de-click 2018-07-09 17:38:35 +02:00
Robin Gareus
87b2c94759 Separate ChannelInfo for disk reader and writer
This allows to use different types for write and read buffers, in
preparation for a dedicated reader-buffer.
2018-07-09 17:30:38 +02:00
Robin Gareus
cf11764763 Remove unused disk-reader vari-speed 2018-07-09 17:30:38 +02:00
Robin Gareus
249640267c Remove global declick API
De-click will be per disk-reader, latency compensated and buffer-size
independent. Cue-monitoring should not be affected by de-click.
2018-07-09 17:30:38 +02:00
Robin Gareus
00a4ad712c Move Loop Location to Processors
The processors will becomes responsible to know about loop-positions
and map latency-compensated start_sample, end_sample into the loop-range
as needed.
2017-10-31 18:32:26 +01:00
Paul Davis
8a0839f332 remove unused variable 2017-10-26 15:43:31 -04:00
Paul Davis
4250940ad8 switch from std::auto_ptr<> (deprecated) to boost::scoped_ptr<> 2017-10-26 15:43:08 -04:00
Paul Davis
33af0b0d3d optimization for track with zero audio channels should not short-circuit MIDI disk reading 2017-10-26 15:15:05 -04:00
Robin Gareus
e31f5d9998 Clean up State API:
* Processor implement get_state(), classes derived from Processor
  implement protected ::state() -- as documented in processor.h
* likewise for Route, Track: make ::state() a protected interface
* removal of "full_state", use explicit "template_save"
* use RAII/Unwind to skip saving automation-state
2017-10-04 00:54:55 +02:00
Paul Davis
3f48d00081 use new CubicInterpolation API 2017-10-02 12:46:12 -04:00
Paul Davis
7921f6dc4d DiskReader should do nothing at all if there are no channels 2017-10-02 12:44:52 -04:00
Paul Davis
4cc5958960 remove cruft 2017-10-02 12:43:34 -04:00
Robin Gareus
c5a92ef813 Fix MIDI rec-region display
gui_feed_buffer is used for DiskWriter -> GUI notifications.
It was wrongly migrated from MidiDiskstream to DiskReader in 7fb6807
2017-10-01 03:30:02 +02:00
Robin Gareus
93d11d155c Make MIDI disk-reader a bit less buggy :)
* use start/end frame
* differentiate nframes and disk_samples_to_consume
* add global Port::port_offset () when writing data.
* add a note about b0rked vari-speed ..
2017-09-30 23:30:52 +02:00
Robin Gareus
97c637e399 MIDI debugging. 2017-09-30 22:44:44 +02:00
Robin Gareus
61f8e53b7e Disk-reader don't silence buffers when not rolling
Doing so may clear out-of-band data which is injected into the
data-stream.
2017-09-30 05:35:12 +02:00
Robin Gareus
8139becb18 Ongoing work on latency compensation
The general goal is to align transport-sample to be the audible frame
and use that as "anchor" for all processing.

transport_sample cannot become negative (00:00:00:00 is the first audible
frame).

Internally transport pre-rolls (read-ahead) before the transport starts
to move. This allows inputs and disk to prefill the pipeline.

When starting to roll, the session counts down a global "remaning preroll"
counter, which is the worst-latency from in-to-out.
Each route in turn will start processing at its own output-latency.

Route::process_output_buffers() - which does the actual processing
incl disk i/o - begins by offsetting the "current sample" by the
route's process-latency and decrements the offset for each latent
processor.  At the end of the function the output will be aligned
and match  transport-sample - downstream-playback-latency (if any).

PS. This commit is a first step only: transport looping & vari-speed have
not yet been implemented/updated.
2017-09-29 05:03:48 +02:00
Robin Gareus
d98f87d542 No more disk-reader roll-delay
It was not working in sdio/6.0-pre anyway and with upcoming changes to
latency compensation the concept of per disk[stream/reader] will go away.
2017-09-29 05:03:48 +02:00
Robin Gareus
4e5423b348 fix clang compilation (include header ordering)
"i18n.h" needs to be included last, after types have been defined or
clang bails out:
"call to function 'operator<<' is not visible in the template definition"
2017-09-21 19:38:13 +02:00
Paul Davis
7d559de3d0 fix boolean logic for roll_delay vs. disk_samples_to_consume 2017-09-19 21:39:46 -04:00
Paul Davis
0a4b9ffba5 do not advance DiskReader's idea of playback_sample while waiting for _roll_delay to expire 2017-09-19 21:38:59 -04:00
Paul Davis
bda2e9738f clearer catastrophic error message, rather than assert() 2017-09-19 21:38:59 -04:00
Paul Davis
48d11000e5 attempt to fix roll delay logic by moving it into DiskReader (the only place it matters) 2017-09-19 18:53:27 -04:00
Paul Davis
ebf6856579 Revert "remove unusued roll_delay member of DiskReader"
This reverts commit 92c2e06eb72950f91ca943a5219e2caeaeecda9f.
2017-09-19 11:15:22 -04:00
Paul Davis
e44ae422eb remove unusued roll_delay member of DiskReader 2017-09-19 11:15:22 -04:00
Paul Davis
30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Paul Davis
d3404f3684 fix logic error that prevent input monitoring during slave wait states 2017-09-18 11:40:53 -04:00
Paul Davis
2212403431 don't attempt MIDI playback if there are no MIDI buffers provided for processing 2017-09-18 11:40:53 -04:00
Paul Davis
9d423bb12c remove debug output 2017-09-18 11:40:53 -04:00
Paul Davis
e9dd575ca5 remove all code related to "silent roll" concept. some debug output added 2017-09-18 11:40:53 -04:00
Paul Davis
13d44c4d76 move disk_{writer,reader} into Route to allow for simple, sensible implementation of DiskIOPoint 2017-09-18 11:40:53 -04:00
Paul Davis
9da08b5f19 use const 2017-09-18 11:40:53 -04:00
Paul Davis
2c0b35fbb1 remove unused + commented line 2017-09-18 11:40:53 -04:00
Paul Davis
29d2754c9a subtle change to _need_butler logic to ensure correct result in mixed-type contexts 2017-09-18 11:40:53 -04:00
Paul Davis
59be854f79 reinstate use of a MidiTrack's MIDI filter when reading from disk 2017-09-18 11:40:53 -04:00
Paul Davis
ece52d3278 move _file_frame from DiskIOProcessor into DiskReader (only place where it is needed); split into by-type array to deal with different rate of audio & MIDI i/o 2017-09-18 11:40:53 -04:00
Paul Davis
9885f04fe6 tweaks to disk io point mechanisms 2017-09-18 11:40:53 -04:00