Commit Graph

14 Commits

Author SHA1 Message Date
Paul Licameli e653b4aaf8 Eliminate Experimental.h, configure compile options instead...
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.

The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
2021-04-27 12:40:07 -04:00
Paul Licameli e4eea36d0a Remove old duplicate test for end of MIDI playback...
... which, anyway, had errors introduced into it (realTime mistakenly used as a
duration)
2021-02-06 09:20:30 -05:00
Paul Licameli 4871584cb3 Mixer::WarpOptions constructor for common case 2020-11-30 13:42:35 -05:00
Paul Licameli c84a2d295d Remove portaudio.h and portmixer.h from AudioIOBase.h 2020-06-12 11:39:18 -04:00
David Bailes e0302257c5 Keyboard scrubbing and Play-at-speed: remove initial silence
Currently AudioIoCallback::ScrubState::Get(), inserts a period of silence the first time it's called because at this time Scrubber::ContinueScrubbingPoll() has not been called, and so message.end has not been set to an appropriate value.
In the case of keyboard scrubbing and play-at-speed, the initial speed is already known, so message.end can be set to this value, removing the need for an initial silence.
The start of keyboard scrubbing and play-at-speed are now faster (the latter very much faster).
2020-02-11 15:56:12 +00:00
David Bailes 6b9c8e79cc Bug 1954: Clicks may occur starting/pausing play-at-speed or Scrub
Problem:
On Windows, after 50ms, there is a short period of roughly zero introduced into the output. On Linux, there is also a spike which sounds like a crackle.

In AudioIO::FillBuffers(), Mixer::SetTimesAndSpeed() is called, which sets mT0 and mT1 to a small interval.
In Mixer::MixVariableRates(), all the samples in the interval are used, which means the Resample::Process() is called with last equal to true.
So when Mixer::MixVariableRates() is called again, the resampler is being reused after a call to Process() in which last is true.
It is not stated in the soxr documentation if the resampler will produce valid results in this case, and it's only the scrubbing code which does this.
I think this is the problem, and so the partial fix below avoids this happening.

Partial fix for play-at-speed and keyboard scrubbing:
For these, there is no need to reset the values of mT0 and mT1. (There is no need to allow for the sample position being used to potentially jump around.)
So for these cases, Mixer::SetSpeed() is called, rather than Mixer::SetTimesAndSpeed().
2020-01-15 11:12:40 +00:00
Paul Licameli e08a942ab8 Fix other cause of intermittent timing-dependent crash at shutdown...
... AudioIO holds a weak pointer to its listener so there is no dangling
pointer
2019-06-24 13:32:08 -04:00
Paul Licameli 5627620b78 Remove dependency of AudioIO on Scrubbing.cpp ...
... though the demotion of the constant into AudioIO.h isn't wholly satisfactory
and there is still the scrubbing queue in AudioIO
2019-06-24 12:52:54 -04:00
Henric Jungheim f320612f10 Fix comment typo. 2019-06-11 08:07:19 -07:00
Henric Jungheim 7fbbdb5c5c Add AUDACITY_DLL_API to class AudioIOBase.
Derived classes use it, so the base class needs it to.
This is needed to get mod-nyq-bench to link.
2019-06-11 08:07:14 -07:00
Paul Licameli ccc49f8ccf Abstract virtual AudioIOBase::StopStream...
... so that DeviceManager, DeviceToolbar, and PrefsDialog do not depend directly
on AudioIO.

But no function in the base class for starting streams, which would require
mention of Track types, which we want to avoid.
2019-06-10 21:55:29 -04:00
Paul Licameli 17c04d1749 Separate an abstract base class from MeterPanel...
... to break its cycle with AudioIO
2019-06-10 20:48:38 -04:00
Paul Licameli 51051ee933 Separate AudioIOBase from AudioIO 2019-06-10 20:48:38 -04:00
Paul Licameli 42a4f55ffe Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).

AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.

It won't include StartStream.  It will contain functions to query the
present state of streams, and device capabilities.
2019-06-10 20:48:38 -04:00