Paul Licameli
b2df5e0673
Declare and allocate time value queue
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
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
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
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
James Crook
0ce83abbfb
Bug 1940 - Clicky play when adjusting Pan or Volume TCP controls
2018-08-24 22:30:20 +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
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
Steve Daulton
11da92d668
Allow capture retries if time since Rescan() < 10s
...
The time since Rescan() of recording device is the important factor,
not the "newness" of the project.
2018-08-13 00:33:38 +01:00
Steve Daulton
835abd9be3
bug 1885 Linux: Allow retries when opening capture
...
On launch, Audacity scanning the sound system causes Pulse to grab
exclusive control of the audio device, causing the device to be
unavailable until Pulse times out and releases it.
If an attempt is made to start recording from the hardware device (hw:)
immediately after launch, PortAudio will time out before the device is
released. In this case we need to retry opening the capture stream.
(This also applies to monitoring).
2018-08-12 19:14:56 +01:00
Steve Daulton
1d22ca5789
Improve error message when capture stream fails
...
Rather than just guessing at the cause of the error, include the actual
error string from PortAudio.
2018-08-12 19:14:56 +01:00
Paul Licameli
3886113b91
More efficiency in TrackTimeUpdate
2018-08-11 20:37:23 -04:00
Paul Licameli
ce1ce688ff
Try to clarify real time / track time distinction in comments...
...
... Rather than the confusing old terminology of "warped" time, meaning the
real time after accounting for time track, though that persists mostly in the
names of variables now mostly used only within PlaybackSchedule.
"Track" time refers to a position in a wave track, as indexed by the time
ruler.
"Real" time is indexed by the other scale of numbers drawn in the time track,
which is drawn on the screen with nonuniform spacing (so "warped" in that
sense), but it corresponds to uniform actual time.
2018-08-11 15:14:18 -04:00
Paul Licameli
6126f2f626
Make a one-time dynamic check that atomic<double> doesn't use mutexes
2018-08-11 00:29:44 -04:00
Paul Licameli
3f1d9ab8c1
P & R recording: change color of pin button, as for play indicator
2018-08-11 00:26:34 -04:00
Paul Licameli
0d9972b3e0
Some member functions of AudioIO can be const
2018-08-10 22:58:33 -04:00
Paul Licameli
f036700b09
Make PlaybackSchedule::mTime atomic and rename some functions...
...
... The variable ought to be atomic because it is read and written by different
threads.
Use local variables to avoid repeated reads of the atomic.
2018-08-10 21:30:14 -04:00
Paul Licameli
8a78ae280c
Factor out a piece of the big callback
2018-08-10 17:33:18 -04:00
Paul Licameli
af81dfa10b
Bug1922: updating play indicator when looping with a time track
2018-08-09 13:18:53 -04:00
Paul Licameli
871bc65c8e
Fix loop play again (error introduced at 46d7804)
2018-08-09 11:39:51 -04:00
Paul Licameli
6f7eaf7746
Fewer calls to GetActiveProject() in AudioIO.cpp
2018-08-08 17:30:43 -04:00
Paul Licameli
2472b128d3
Fix compilation of EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
2018-08-08 17:08:54 -04:00
Paul Licameli
197122c7d5
Collect initialization of playback schedule into a function
2018-08-08 16:36:42 -04:00
Paul Licameli
6e4d11e5af
Fix loop play
2018-08-08 14:26:32 -04:00
Paul Licameli
46d7804cdf
Group some of the fields of AudioIO into PlaybackSchedule
2018-08-08 14:10:21 -04:00
Paul Licameli
175a471261
Remove " == true"
2018-08-08 12:34:47 -04:00
Paul Licameli
fc8783bc74
Put callback in a member function, remove many more gAudioIO->
2018-08-08 12:30:10 -04:00
Paul Licameli
fc497368a5
Remove needless gAudioIO-> in member functions (AudioIO is singleton)
2018-08-08 12:30:10 -04:00
James Crook
f0637eeb85
Bug 1906 - Issues with dynamic Play-at-Speed (Play doesn't pop up)
...
Fixed issue 1, i.e. the play button does not pop up after play at speed completes.
2018-07-21 21:14:30 +01:00
Paul Licameli
2c7ca97095
Reimplement change of color of playhead after pre-roll, more simply
2018-06-11 18:27:18 -04:00
Paul Licameli
77779395c7
Revert "Play head is green during pre-roll, then turns red for real recording"
...
This reverts commit 8e51391b98ad7a98f49c98929a10322dd551391f.
2018-06-11 18:23:56 -04:00
Paul Licameli
8e51391b98
Play head is green during pre-roll, then turns red for real recording
2018-06-09 14:40:09 -04:00
Paul Licameli
c0fb140257
Fix crashes in resampling of capture during recording
2018-06-01 12:53:26 -04:00
Paul Licameli
a0256e935c
Recording options allow crossfade data for start of recording
2018-06-01 04:28:58 -04:00
Paul Licameli
f9cd5595d5
Stop playback of pre-rolled tracks at the right time
2018-06-01 04:28:57 -04:00
Paul Licameli
35c60ac96d
Allow for preRoll in start-stream options
2018-06-01 04:28:55 -04:00
Paul Licameli
20f3f76e2f
Correct limit of record duration when track rate differs from input
2018-06-01 04:28:54 -04:00
Paul Licameli
35a97e09e7
Group arguments to StartStream, and a bit less of #ifdef for MIDI play...
...
... And pull choice of tracks and options out of DoRecord
2018-05-29 00:22:12 -04:00