1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-19 17:40:15 +02:00

399 Commits

Author SHA1 Message Date
Paul Licameli
0ab29d21e9 Some naming consistency...
Prefer "MissingAliasFiles" not other permutations of the words
2019-05-17 06:47:53 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli
544d9aa580 Don't use AudacityApp where you only need wxApp...
... I want to have fewer inclusions of AudacityApp.h.  More work on removing
them will happen in the next version.
2019-04-26 11:54:28 -04:00
Paul Licameli
3bc95e610a Remove vacuous write of /GUI/EnvdBRange ...
... but see code comments about the apparent original intent, to update some
other preference instead; which I don't do, thus preserving present behavior
2019-04-05 21:09:57 -04:00
Paul Licameli
3760db9dff Remove wx/wxchar.h from headers 2019-03-29 15:56:54 -04:00
Paul Licameli
5aa08950a5 Internationalize audio and midi device info reports...
... following the substitute, don't concatenate rule in many places.

The end users have commands to generate these reports in menus, so they should
be translated then; however, they are also part of crash reports meant for
developers, so temporarily set English locale for generating those.
2019-03-27 12:29:18 -04:00
Paul Licameli
9569cfddf5 More comments for including Audacity.h; fix one #ifdef in AudioIO.cpp 2019-03-23 14:09:05 -04:00
Paul Licameli
f45300f032 This is only comments, in files where USE_ macros are tested...
... following the comment convention used in the preceding commit.
2019-03-22 12:38:30 -04:00
Paul Licameli
eb94489277 Make EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT compilable 2019-03-20 16:54:14 -04:00
Paul Licameli
906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
1bcb7c20a5 Remove some nested #include from Project.h 2019-03-16 13:09:54 -04:00
David Bailes
b8b2f4380e Bug 2080: Using WASAPI, after recording, playback can fail
The bug:
1. Set Audio host to WASAPI
2. choose recording and playback devices which have different default sample rates in shared mode.
3. Set overdub, and playthrough to off.
4. make a short recording.
5. playback. Fails with error dialog.

Cause of bug:
In AudioIO::GetBestRate, the last returned sample rate is cached. If the function is called again, with the same requested sample rate, then the cached value is returned. So in the above steps, when GetBestRate is called for playback, the sample rate of the recording device is returned.

Fix:
Include in the conditions for returning the cached rate that the values of playing and capturing as the same as in the previous call.
2019-03-15 10:03:46 +00:00
Paul Licameli
50074f2cfe Replace comparisons against "" with empty() 2019-03-14 13:23:41 -04:00
Paul Licameli
2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
James Crook
0eb778631b Bug 2045 - Clicky playback with Play-at-Speed and Scrubbing/Seeking 2018-12-03 21:04:50 +00:00
Paul Licameli
41d0ac1b65 reinterpret_cast not C-style cast. (The cast value is always 0). 2018-11-15 11:20:22 -05:00
James Crook
7f8bfa0ac2 Make microfades into a preference. 2018-11-02 21:58:53 +00:00
James Crook
6a4663e19c Use wxGetUTCTimeMillis in preference to wxGetLocalTimeMillis
For internal time-difference test, it is significantly faster, and does not suffer from daylight-saving time shifts.
2018-10-29 19:59:28 +00:00
Paul Licameli
723cecbeac Mixerboard uses events to detect start and stop of playback 2018-10-27 18:01:08 -04:00
David Bailes
bb7b95023f Bug 2009: Windows+Linux: Intermittent truncation of the end of a recording
Problem: up to about 300ms was intermittently truncated from the end of recording.
The bug was introduced by commit a0256e9.

The fix: in this commit, the line:
the line:
mRecordingSchedule = {}; // free arrays
was added to the lambda in the definition of cleanup at the start of AudioIO::StopStream()

If this line is changed to:
mRecordingSchedule.mCrossfadeData.clear();  // free arrays
then this has been found to fix the bug, and the vector is still cleared.

Clearly, the reinitialization of one or more of the other data members of mRecordingSchedule was causing the bug.
Which of the these reinitializations are the problem, and why is not known, and due to the nature of the problem could well take some time to find out.
2018-10-17 14:31:43 +01:00
James Crook
d693b36bdb Shorten AudioIoCallback::FillOutputBuffers()
Mainly by moving functions to live outside this function.
2018-10-16 13:01:22 +01:00
James Crook
45069794f3 Reduce indentation in AudioIO
Flipped some conditions and used if else-if to reduce the indentation in code.
This makes the code more readable.  No change in functionality.
Also created UpdateTimePositions() and made some bool functions void.

new variable mMaxFramesOutput used to communicate positional change.
2018-10-16 13:01:22 +01:00
James Crook
d2578b9eaa Remove some duplicated code in AudioIO 2018-10-14 22:45:41 +01:00
James Crook
ffa67d2b1e Split AudioIO into two classes
AudioIO.cpp has nearly 6000 lines and needs to be broken up into separate aspects.
The main point of the new split is to better separate the time critical callback code (that runs in the portaudio thread) from the code that interacts with the disk (that runs in the Audio Thread).
2018-10-13 21:38:35 +01:00
James Crook
555345392e Fix Pa_IsFormatSupported query flood (from Max Maisel)
We ask 17 times for different rates, and for some drivers that is too much of a flood.
Workaround is to use a small delay between requests.
Only happens at start up, so is acceptable to just always do it.
2018-10-12 15:59:27 +01:00
James Crook
60b2dc720e Fix incorrect wxASSERT
Also update comments to explain.
2018-10-12 10:08:31 +01:00
James Crook
494ab4eafe Make AudioIO::Callback() code shorter
Use subroutines, wxClip and cut out some dead code.
2018-10-11 19:58:21 +01:00
James Crook
939b967497 Refactor AudioIO::Callback()
This code had got ridiculously long (for a fast callback function) and needed to be broken up into smaller clearer named functions.
2018-10-11 18:08:42 +01:00
Paul Licameli
4aa990e835 Remove GetLink(ed) in various other places 2018-10-01 13:42:33 -04:00
Paul Licameli
bba16b3b37 Clarify the logic for drop of channels during playback 2018-09-29 12:45:01 -04:00
Paul Licameli
03def8dbaf Bug1967: scrub shouldn't be clicky...
... And this further simplifies the use of the clock.  Rely on the regularity
of spacing between calls to FillBuffers at commit a62cf53
2018-09-09 11:01:01 -04:00
James Crook
ff01d39601 Undo Workaround for Bug 1969
Turned out this was not the correct fix.
2018-09-08 23:17:20 +01:00
James Crook
596feddfe7 Workaround for Bug 1969 - Windows: no monitored sound for 15 secs with software playthrough with default MME host
This is not a proper fix, as we do not fully understand the problem - which is in release builds only.
It may be enough though to get us through to release.
2018-09-08 16:55:34 +01:00
Paul Licameli
544c3b9770 spelling in comments 2018-09-04 23:04:18 -04:00
Paul Licameli
ad6962250b Bug1958: shouldn't crash recording with playthrough 2018-09-03 15:04:24 -04:00
Paul Licameli
1baf12d7bc Bug1960: position of play head during scrub right to left 2018-09-01 09:56:26 -04:00
James Crook
3f7c639c3f Make the 'wait for fade out' latency dependent.
This gives time for the fading out to clear the sound card, OR if
we would wait around too long, just close down the stream without waiting.
2018-09-01 10:24:50 +01:00
Paul Licameli
d050afb658 Scrubbing calculation now needs clock precision greater than sample rate 2018-08-29 15:01:31 -04:00
James Crook
919571e79f Bug 1950 - Pause mutes and stops head progressing, but does not 'pause' audio.
Logic changed to delay pause by one frame, if there is a need to fade out.
So we calculate whether we are already faded out, and if we are pause, otherwise delay the real pause for one frame.
2018-08-29 19:54:11 +01:00
James Crook
b5f9acefa4 Fix some warnings in AudioIO.cpp 2018-08-29 14:00:57 +01:00
David Bailes
a5e9fb9e34 Bug 1949: WASAPI playback stops before the end of the selection
Problem: When using WASAPI on Windows, the last "latency buffer length" of a selection is not played. This is a fairly nasty bug for those relying on playback when making fine adjustments to the position of the cursor, or the start or end of selection.

During playback the "latency buffer length" has no effect on the actual latency of the playback, but the playback cursor is positioned as if the "latency buffer length" did have an effect, that is, it is positioned by this amount after the audio being played.

So an obvious workaround is for the user to set the latency buffer length to zero when using WASAPI. However they then have to remember to change it if they use another audio host.

Fix: The real problem is presumably a portaudio bug, but this fix just hard codes the workaround given above. For playback, when using WASAPI, set the suggested latency to 0, regardless of user setting.
2018-08-29 13:47:32 +01:00
Paul Licameli
85f13b433f Fix Linux build... uniform initialization not implemented right in g++? 2018-08-28 07:36:39 -04:00
Paul Licameli
eae38b0676 Fix Linux build 2018-08-28 06:20:04 -04:00
Paul Licameli
9aad60d12c Make polling loop period slightly shorter than Audio thread loop...
... but we don't need to make it as precise, using steady_clock.

Do this so that the Audio thread doesn't read the same polling message twice,
halting the scrub.  It's all right that it might miss one of the messages
instead.
2018-08-27 17:02:37 -04:00
Paul Licameli
e4e7a814c8 FillBuffers won't quit too early priming the RingBuffer for scrub 2018-08-27 17:02:36 -04:00
Paul Licameli
ba52753ff7 Scrub options don't need starting time 2018-08-27 17:02:36 -04:00
Paul Licameli
9d17d335b7 Poller thread leaves messages, Audio interprets; a buffer not a queue 2018-08-27 16:53:16 -04:00
Paul Licameli
832bcef3a6 Postpone work from ctor of ScrubState to the first call of Update 2018-08-27 16:53:16 -04:00
Paul Licameli
a62cf53161 Make AudioThread wake-ups as uniformly spaced as we can 2018-08-27 16:53:16 -04:00