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

414 Commits

Author SHA1 Message Date
Paul Licameli
4f940c855d New files for ProjectWindow 2019-06-03 01:43:26 -04:00
Paul Licameli
fee5582826 New files for ProjectManager 2019-06-03 01:21:12 -04:00
Paul Licameli
850628275b AudioIO.cpp does not depend on ProjectAudioIO.h and GetActiveProject 2019-06-03 01:18:11 -04:00
Paul Licameli
e5cf2165d1 New files for ProjectAudioIO 2019-06-03 01:18:08 -04:00
Paul Licameli
1f4202c878 New attached structure ProjectAudioIO handles tokens and meters 2019-06-03 01:15:47 -04:00
Paul Licameli
96b749f232 Fix Linux assertion violation when closing Preferences 2019-05-30 17:37:44 -04:00
Paul Licameli
82663892dc Accessors to get the project window...
... as a preparation for splitting up class AudacityProject.

Use ProjectWindow as an alias for AudacityProject, and fetch it from the
project with a static member function, where certain of its services are used;
pretending they are not the same class.

Use global accessor functions to get wxFrame from the project where only
wxFrame's member functions are needed, so there will be less dependency on
ProjectWindow when it becomes a distinct class.
2019-05-28 23:18:13 -04:00
Paul Licameli
02afcbca8c Redo TP_UpdateStatusMessage...
... Rename it as SetStatus; make it part of AudacityProject not
TrackPanelListener; and use a roundabout event signalling to cause the timer
restart.

Because SetStatus will be one of very few things left in AudacityProject, but
the timer handling will be part of another class decoupled from it.

And TrackPanelListener won't really be needed: TrackPanel will not need to
pretend it doesn't know what an AudacityProject is.
2019-05-28 19:36:47 -04:00
Paul Licameli
ad0580c3de fix assertions on Linux because of 1ed9338 2019-05-27 19:45:57 -04:00
Paul Licameli
3416b5bad6 Toolbars accessed by static Get() functions, not through AudacityProject 2019-05-24 16:08:29 -04:00
Paul Licameli
2f0a76ed10 static Scrubber::Get()...
... not member functions of AudacityProject
2019-05-23 16:01:10 -04:00
Paul Licameli
dccb716f39 enum PlayMode tells whether there's cut preview; out of Project.h 2019-05-20 21:38:12 -04:00
Paul Licameli
f86403378b Move AudacityMessageBox to its own files...
... breaking cycles among low-level files introduced by 273ba9f
2019-05-20 14:48:36 -04:00
Paul Licameli
519a988467 RecordingPrefs.cpp does not depend on AudioIO.cpp...
... freeing it from dependency cycles, but no others
2019-05-18 20:29:25 -04:00
Paul Licameli
a047fa6e7a Missing alias file tracking out of AudacityApp, into new files...
... which reduces the need for including AudacityApp.h
2019-05-17 16:28:50 -04:00
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