1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 23:02:42 +02:00

9545 Commits

Author SHA1 Message Date
Paul Licameli
4a98ba03dd Remove ScrubQueue compensation for Producer overflowing...
... which were meant to fix growth in lag between mouse movement and play head
movement.

Recent rewrites to keep RingBuffer more populated during scrub and seek should
make this unnecessary.
2018-08-26 09:59:35 -04:00
Paul Licameli
8badb0a933 Rewrite the insertion of silences into scrub, combining queue entries 2018-08-26 09:12:53 -04:00
Paul Licameli
9727968b94 move some functions 2018-08-25 20:08:10 -04:00
Paul Licameli
1bf192e5b3 Split ScrubQueue into two queues...
... One still called ScrubQueue, which should become a simple non-queuing
buffer later, communicating scrubbing instructions from the UI or poller
thread to the Audio thread.

The other, downstream of that, supplements the playback RingBuffers with
a correspondence between samples and track times, for use by the PortAudio
thread in updating the last-played position, which is in turn used by the
UI thread to update the display.

In future this queue of times may be used as the sole, general means for
PortAudio thread to update head position, not just a special case for scrubbing.
2018-08-25 20:08:09 -04:00
Paul Licameli
69435c9191 Simplify ScrubQueue to involve only two threads...
... Remove Consumer() and fields used only by it; rename Transformer() as
Consumer().

A bit less contention for the scrub queue mutex, then.
2018-08-25 20:08:09 -04:00
Paul Licameli
81a3a7d339 Use the TimeQueue to communicate play head position updates for scrubbing...
... from the Audio thread to the PortAudio thread;  the old
ScrubQueue::Consumer() function keeps only a vestigial purpose to prevent the
scrub queue from blocking.
2018-08-25 20:08:09 -04:00
Paul Licameli
389ab0c8d0 Fewer calls to RingBuffer::Put in case of trailing zeroes...
... so there is only one update per track of the atomics in RingBuffer in each
pass of the loop in FillBuffers, which will be needed to synchronize RingBuffer
and TimeQueue correctly.
2018-08-25 20:08:09 -04:00
Paul Licameli
84c8aa0fcc Fix some cases where seeking (with mouse) let RingBuffer go empty 2018-08-25 20:08:08 -04:00
Paul Licameli
b2df5e0673 Declare and allocate time value queue 2018-08-25 20:08:08 -04:00
Paul Licameli
e91918042a Don't let the ring buffer empty when seeking past end of track...
... just allow a short stutter padded with silence in that case.
2018-08-25 20:08:08 -04:00
Paul Licameli
67a9823434 split out function AdvancedTrackTime; more caution about termination 2018-08-25 20:08:08 -04:00
Paul Licameli
2806f40ab5 Don't let the RingBuffer run dry when seek-drag is very slow...
... but not stopped.  This may even make the play head back up and re-play a
little bit.
2018-08-25 20:08:08 -04:00
Paul Licameli
5cfbfd364e Set the playback RingBuffer latency appropriately for seeking 2018-08-25 20:08:07 -04:00
Paul Licameli
111d2c8673 Can specify a minimum to maintain in the playback RingBuffer...
... this may be more than the batch size used in ongoing playback.

It is expected that this larger batch size is used only once when priming
the queue before starting play.  But then FillBuffers() may attempt to
refill up to the minimum in case demand is outpacing supply.

Thus the new number defines a "yellow zone" for the queue.
2018-08-25 20:08:07 -04:00
Paul Licameli
06fe9e843e remove some casting 2018-08-25 20:08:07 -04:00
Paul Licameli
45231b8f6a Consume equal amounts from play ring buffers in each callback pass...
... which should be the whole framesPerBuffer normally.

Also rename another function used in producing the samples.
2018-08-25 20:08:07 -04:00
Paul Licameli
8a6351d9cd Guarantee cleanup of partial allocation on all error return paths...
... such as when allocating for capture channels fails after that for
playback succeeds
2018-08-25 20:08:06 -04:00
Paul Licameli
3a94acd631 Remove unnecessary variable 2018-08-25 20:08:06 -04:00
Paul Licameli
03678eccba use mRate not sampleRate 2018-08-25 20:08:06 -04:00
Paul Licameli
575e631d49 line lengths 2018-08-25 20:08:06 -04:00
Paul Licameli
8e151aba8d Split out AudioIO::AllocateBuffers 2018-08-25 20:08:05 -04:00
Paul Licameli
eeb5f1ec20 Revert "Fix the hiccup at the start of scrub or play at speed..."
(It didn't really achieve what that commit comment said)

This reverts commit 26f72b110ceb07bc837eec5450084c6f5421ebb7.
2018-08-25 19:42:12 -04:00
James Crook
d79c071d6d Change 'mouse_move' to 'move_mouse'.
Fixing a hyperlink.
2018-08-25 17:41:28 +01:00
James Crook
74d0420b96 Bug 1763 - Clicks on starting/stopping playback.
Does not fix the Loop-Play part.
2018-08-25 17:21:18 +01:00
James Crook
b91300caf0 Bug 1947 - Clicky play when dynamically changing number of playing channels
Rather than 'cut' (i.e. drop, not cut as in 'cut preview') channels immediately, we now only do so
if their last gain was already 0.0.  Instead they micro-fade out.  Later when the channels come back,
their last gain will be 0.0, so they will micro-fade in.

A comment explains that the code would be cleaner if we just computed gains, and not whether to
drop channels.
2018-08-25 13:07:45 +01:00
Steve Daulton
f296f42392 Fix misleading error message
We are testing specifically for a selection in an 'audio' track.
2018-08-25 12:41:29 +01:00
Paul Licameli
ac1017ee1d A preference checkbox for always scrubbing unpinned, does nothing yet 2018-08-24 18:12:25 -04:00
Paul Licameli
c86a46dc99 fix Mac build 2018-08-24 17:59:18 -04:00
James Crook
9012b98eca Init mOldGains
I'd neglected to do this, which can lead to unwanted noise.
2018-08-24 22:51:31 +01:00
James Crook
0ce83abbfb Bug 1940 - Clicky play when adjusting Pan or Volume TCP controls 2018-08-24 22:30:20 +01:00
James Crook
ac5b743dd2 Bug 1944 - Many "scriptables" link to non-existent pages or incorrect target pages 2018-08-24 19:18:04 +01:00
James Crook
66df5786de Make AUD-DO return a cons.
This is simple parsing of the response from AUD-DO.  The first part is the string message, the second 1 or NIL depending on if scripting reported OK or not.  Note that illegal scripting options often don't produce a 'Failed' but are silently substituted with valid ones.
2018-08-24 18:45:09 +01:00
James Crook
9b84deb43b Bug 1946 - Nyquist ;type tool effects crash if returning labels from Nyquist 2018-08-24 16:53:34 +01:00
Steve Daulton
e1ae057806 Disable experimental loudness normalizing 2018-08-22 20:45:50 +01:00
Steve Daulton
4ec1393c27 Error if Nyquist Prompt requires track election 2018-08-21 16:28:59 +01:00
Steve Daulton
94b3bf3c22 Remove superfluous log message 2018-08-21 14:09:56 +01:00
Steve Daulton
b9ec43433e Bug 1934 residual
Allow generate type plug-ins spawned from Nyquist Prompt to create
a new track if none selected.

This commit also fixes preview in generators when there is no selection.
2018-08-21 14:02:48 +01:00
Paul Licameli
06b5d2e945 Bug1932 followup: Times, not sample counts, in scrubbing options...
... because the correct rate is not known where options are constructed
2018-08-20 20:44:10 -04:00
David Bailes
ecb1cbdf3a Play at speed slider: fix page up/down increments
These increments were accidentally changed by the commit: 5e10ec0def1e1b6d2f0729bcb74edd0b95ca1a34

Changed back to original values.
2018-08-20 15:08:32 +01:00
David Bailes
805d7023eb TimeDialog: minor accessibility change
Since the move to wxWidgets 3.1.1, NVDA now reads the name of a wxStaticBox. So in this dialog, there is no longer the need for the accessibility name of the NumericTextCtrl to duplicate the name of the wxStaticBox.
2018-08-20 11:36:15 +01:00
James Crook
0df8c7e3a0 Wording: "Latency compensation" 2018-08-19 21:32:49 +01:00
James Crook
3bb48a21df Bug 1932 - (Residual) Fix stopping behavior with Play-At-Speed.
1. The rate actually used by the sound card now sets the stopping sample number.
2. The tolerance in the 'stop position' is additionally trimmed to 20 samples.
2018-08-19 10:37:43 +01:00
James Crook
aaad7dd08d Bug 1932 - Scrubbing (and Play-at-speed) with WASAPI host (MSW only) or very short buffer preference (on Mac also) is very clicketty 2018-08-18 20:35:18 +01:00
Paul Licameli
26f72b110c Fix the hiccup at the start of scrub or play at speed...
... We need to start the polling of mouse state before starting the audio
stream, and not "nudge" AudioThread, so that AudioThread primes the ring
buffer correctly, not inserting some silence.

This requires yields to timer events in AudioIO::StartStream.
2018-08-16 21:21:44 -04:00
Paul Licameli
6fa5c93b8e Fix typo in comment 2018-08-15 20:20:47 -04:00
Steve Daulton
5be7f7db0b White space changes
The Objective C++ syntax '[[' used in a couple of places (Mac only),
breaks the parser in kdevelop. As suggested by Paul, a space between the
brackets fixes the problem.
Also removed some trailing spaces.
2018-08-15 11:29:12 +01:00
David Bailes
18646a2668 Select Command dialog: minor focus fix
Problem: when the list first becomes focus, no item in the list is the focus.
2018-08-14 13:17:39 +01:00
James Crook
b2feab61a9 TrackPanelHasFocus commands now always available to Macros
Previously running a TrackPanelHasFocus effect from the Macros dialog could fail, because the menu item was disabled (because track panel did not have focus).
2018-08-13 16:52:13 +01:00
Steve Daulton
8eef6dc3ef Fix bug 1938
Nyquist / Adagio variable 'S' should have the value 0.25 in all but
legacy process and analyze effects.
2018-08-13 16:45:21 +01:00
Steve Daulton
0d9cd4b024 Fix bug 1937
';type tool' effects cannot return audio from Nyquist.
2018-08-13 14:28:33 +01:00