Commit Graph

17 Commits

Author SHA1 Message Date
Paul Licameli e6e96de0fd Replace most inclusions of MemoryX.h with <memory> ...
... Most often it was needed for a custom definition of std::make_unique, but
we build C++14 now.
2021-06-02 07:08:19 -04:00
Paul Licameli 8c04ed3990 Settings objects used in AudioIOBase...
... Giving many examples of use of Settings objects.  Many other rewrites like
this should be made to eliminate as many direct uses of gPrefs as we can.

Don't rely on long distance coincidences of literals for paths or defaults.

For each of several paths like /AudioIO/Host, all uses of that path are replaced
with use of a global Settings object defined in one place, in AudioIOBase.  The
object also gives the benefit of caching the last-read or written value.

Other users of those preferences must then include "AudioIOBase.h" to make the
dependency explicit at compile time.

It should be checked that no other mentions of those paths remain in the source,
and that there was no unintended change in default values.

This also inverts dependency of AudioIOBase on RecordingPrefs, which is GUI for
changing some of these settings.
2021-05-17 08:46:08 -04:00
Paul Licameli 7302fc584f Move RecordingSchedule, PlaybackSchedule to new files 2021-05-14 16:26:29 -04:00
Paul Licameli 9a66255013 Move AudioIOBase::mPlaybackSchedule up into AudioIoCallback 2021-05-14 16:25:41 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
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
Yuri Chornoivan d1ada5f08c Fix minor typos 2020-04-11 10:06:24 +01:00
Paul Licameli 61abb87a77 Reviewed all i18n-hint comments...
... Moved many misplaced ones, which msgfmt would not have extracted into
audacity.pot.

Duplicated some of them, to appear with related but distinct msgids.

Added a few new comments.

Deleted one that was no longer needed in ProjectManager.cpp.
2020-04-05 09:00:00 -04:00
David Bailes 55e44cdc83 Playback cursor jitter when scrubbing backwards
Currently the jitter in the playback cursor is worse when scrubbing backwards than forwards.

Fix:
In AudioIOBase::PlaybackSchedule::AdvancedTrackTime()
in the line:
time += realElapsed * speed;
realElapsed is negative when scrubbing backwards, so need fabs(speed) rather than just speed.
2020-02-11 15:41:08 +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 dc0723f629 Rewrite dump of audio and MIDI device data in AudioIOBase.cpp 2019-12-26 22:07:06 -05: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 758e9813f1 Move MeterPanelBase to new files...
... which frees AudioIOBase, QualityPrefs, and ProjectAudioIO from cycles
2019-06-10 20:48:39 -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