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

278 Commits

Author SHA1 Message Date
James Crook
636e137ee8
Merge pull request #257 from Polynomial-C/no_midi
Fix --without-midi build
2018-02-22 17:26:56 +00:00
Paul Licameli
8be1e8fdad Remove wxArray(Int|Long|Double) except where wxWidgets fns need it 2018-02-21 19:33:31 -05:00
Paul Licameli
2fbe04eda0 Replace more Connect with Bind; needed redeclaration of custom events 2018-02-21 19:30:40 -05:00
Paul Licameli
12983e1685 Use wxWeakRef to avoid dangling pointer 2018-02-21 19:25:04 -05:00
Paul Licameli
c0f2782695 Fix interaction of recording and undo...
... in case you also do things, concurrent with the recording, that affect the
undo stack, either by pushing it (such as by changing the gain on one of the
playing tracks, or making a label) or by "Modifying state" without a new undo
item (such as when you change its size or mute or solo).
2018-02-21 19:21:00 -05:00
Paul Licameli
57ce726a25 Rename Meter as MeterPanel, and some DOxygen 2018-02-21 17:50:28 -05:00
Matt Whitlock
e1f0e974d0
Fix --without-midi build
See downstream bug: https://bugs.gentoo.org/637110
2018-02-21 12:19:19 +01:00
Paul Licameli
f78a418df8 An alpha-only toggle command for extra dropout detection; default off 2018-01-17 20:35:56 -05:00
Paul Licameli
81b22a2b2b Reimplement the insertion of zeroes at drop-outs...
... and correct for latency only when there is at least one playback track
2018-01-17 12:56:35 -05:00
Paul Licameli
e066c4f38d Insert zeroes only if dropout detection is enabled 2018-01-16 14:28:07 -05:00
Paul Licameli
130e55cdf5 Use WarningDialog for drop-outs, and change the wording 2018-01-16 13:56:44 -05:00
Paul Licameli
b0690a2a5c Disable part of the drop-out detection...
... The part that checks the previously unused statusFlags argument of
audacityAudioCallback can make zero-length labels.  I did provoke this into
happening repeatably on macOS using a debug build, zero buffer length in device
preferences, and a busy CPU running other programs, within just two minutes of
recording.

But close zooming in on the label, and listening, revealed nothing obviously
wrong, no click in the playback.  So I consider that a false positive.

But the part of the drop-out detection that would make nonzero length
labels, because the other AudioThread is lagging in its writes to disk --
this part remains.  Yet I have not yet provoked this into happening.
2018-01-15 19:33:54 -05:00
Paul Licameli
d2749068f1 Allow reporting of drop-outs to be turned off by Recording prefs...
... Just in case it turns out to make some false positives.
2018-01-15 18:48:44 -05:00
Paul Licameli
9777d3e880 Alert user to drop-outs during recording...
1) When the program detects this, insert zeroes into the recording to keep the
other good parts synchronized.

2) When recording stops, a message box alerts the user, and a label track is
added showing the lost parts, labelled with consecutive numbers.

3) A menu item visible in alpha builds only is added to Tools, to simulate
recording errors at random times and test the reporting feature.
2018-01-15 14:48:39 -05:00
Paul Licameli
950898dcb9 Revert "Bug 1823: Better interaction of undo and record..."
This reverts commit 1e8aba968da56374d74fb5589caa56caf5fe1283, reversing
changes made to 6e75ae58ac56d9c94af5a4ce97951f627808473a.
2018-01-14 21:27:41 -05:00
Paul Licameli
91f5446eb1 Fix interaction of recording and undo...
... in case you also do things, concurrent with the recording, that affect the
undo stack, either by pushing it (such as by changing the gain on one of the
playing tracks, or making a label) or by "Modifying state" without a new undo
item (such as when you change its size or mute or solo).
2018-01-14 19:33:39 -05:00
Paul Licameli
8e0cffb7f2 Simplify GuardedCall and default its return type to void 2018-01-13 01:32:41 -05:00
Paul Licameli
c975de8c5e More use of shared_ptr to Track, for safety...
... This even makes it possible to remove the prohibition of undo and redo
during transport, not that we want to though.  Playback and recording will
continue, using track objects that might not be in the current project.
2018-01-10 20:05:11 -05:00
Paul Licameli
e8b875ff81 Define AudacityMessageDialog wrapper around wxMessageDialog...
... Prohibiting use of the default caption which is unlocalized.  (But we
didn't use it in fact anywhere.)
2018-01-01 17:50:03 -05:00
Paul Licameli
ccb4bbac33 Translate "Message" as default title of message box...
... This required a sweeping change of all calls to wxMessageBox!  But it seems
safe to me, despite the great number of touched files.
2018-01-01 17:50:02 -05:00
Paul Licameli
4d978bcefb Use wxPrintf not printf 2017-12-16 11:54:32 -05:00
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
James Crook
a49f14ad02 doxygen. Class list completed for letter 'A'. 2017-11-09 18:32:29 +00:00
Paul Licameli
9694279804 Guard against crash when stopping a stream...
... caused by remembering a NULL pointer to active project when starting a
stream.

Hard to reproduce, but reported by David Bailes.  We suspect that both the
closing of another project window, and changes of focused application, are
necessary to reproduce the problem.
2017-10-17 06:17:06 -04:00
Paul Licameli
ce649cf851 Re-enabling the separate MIDI thread, and comments about that 2017-09-24 02:29:02 -04:00
Paul Licameli
d6657df045 Roger Dannenberg's explanatory comments for new MidiTime function 2017-09-24 02:29:02 -04:00
Paul Licameli
51296237da Roger's timing correction for Alsa; I unified with non-Alsa case...
... Write only one variable in audacityAudioCallback, to be read (maybe in
another thread) by AudioIO::MidiTime().

The non-Alsa case behaves essentially as before:  it wasn't broken, so it
isn't fixed, though it is rearranged.
2017-09-24 02:29:02 -04:00
Paul Licameli
2b84262314 Roger's SystemTime() for use later, fixed to compile on all...
... Why not simply PaUtil_GetTime() or Pt_Time() ?
2017-09-24 02:29:01 -04:00
Paul Licameli
7c67133ff7 Roger's changed FillMidiBuffers loop test (seems harmless, all OSs) 2017-09-24 02:29:01 -04:00
Paul Licameli
b38bacfafa Remove my USE_TIME_INFO conditional compilation... will fix otherwise 2017-09-24 02:29:01 -04:00
Paul Licameli
857a7ca737 Roger Dannenberg's fix for MIDI notes-off, applied to Linux only...
... but then, always:  It's a problem in portmidi which uses ALSA always, no
matter what the chosen portaudio host is.
2017-09-24 02:29:01 -04:00
Paul Licameli
a971dd5bb4 Detect whether ALSA is the portaudio host (possible only on Linux) 2017-09-24 02:29:01 -04:00
Paul Licameli
428f543677 ALL OSs: fix race starting play, which inserted leading zero samples 2017-09-24 02:29:01 -04:00
Paul Licameli
02403c1237 Bug1746: Playing Note & Wave at once should stop at end of selection 2017-09-20 14:13:12 -04:00
Paul Licameli
954a974422 Changed the conditional compilation for alpha/beta/release...
... In particular, don't put the extra information in MIDI device info for Beta

But still link to the Alpha manual.
2017-09-11 00:10:22 -04:00
Paul Licameli
c11e3d1511 Make effects of 582e574 conditionally compiled...
... It was only "mostly harmless" on Windows and Mac.

Now where is my towel?
2017-08-29 18:42:18 -04:00
Paul Licameli
6f8b37a921 An experiment, not enabled, to reduce jitter in ALSA MIDI playback...
... Change to #define REALTIME_ALSA_THREAD near the top to enable it.
2017-08-29 16:25:55 -04:00
Paul Licameli
75bdde3003 To synch better, just don't use a separate thread for MIDI! ...
... I am not sure that this will solve all problems of jittery play, but I do
think this will solve the problem of a rush of slightly late notes at start of
play.
2017-08-27 10:53:05 -04:00
Paul Licameli
582e574ab8 A not-harmful change to MIDI timing for Windows and Mac...
... and hoping it is positively helpful for Linux.

In AudioIO::MidiTime(), compute one of the terms by different means.

Use PaStreamInfo::outputLatency.

Do not use the difference of PaStreamCallbackTimeInfo::outputBufferDacTime
and PaStreamCallbackTimeInfo::currentTime.

Which debugging shows is very nearly the same value for Windows and Mac.

But we suspect the PaStreamCallbackTimeInfo fields are not correctly reported
on Linux.
2017-08-27 03:26:44 -04:00
Paul Licameli
4a0a7efd84 Fix MIDI timestamp calculations when you loop AND have time track...
... At least it fixes the gross problem; but there seems to be a small
accumulation of error still each time around the loop, that I don't understand
yet.
2017-08-24 19:48:45 -04:00
Paul Licameli
85b2f80545 Correct mMidiOutputComplete, though it doesn't matter...
... Used to be, it became true too soon when play started after time 0, so
AudioIO::IsStreamActive() might become false too soon -- except that now there
is always a portaudio stream when there is a midi stream, so that didn't happen.

Mistake was to add mT0 to MidiTime(), which already has mT0 for its origin.

This error would affect nothing if you just let play to the end without trying
a keystroke command.  The error might have been enabling the wrong commands.
2017-08-24 19:47:08 -04:00
Paul Licameli
47eaf526a6 Bug1714, more: better calculation of MidiTime...
... after I reflected more on the explanation of it in the long comment at top.

Brings back the use of PaUtil_GetTime() but now calls it also in the audio IO
callback, so we can correct the unspecified origin of times supplied to the
audio IO callback to agree with the PaUtilGetTime() clock.

Thus the Midi time calculation is again based on the clock time of the other
thread that calls MidiTime, making it a few milliseconds more accurate, while
avoiding subtraction of two times based on widely different origins, which
made the big numbers that overlowed and caused Bug1714 to happen.
2017-08-17 23:25:01 -04:00
James Crook
296ba29a78 Bug 96 - "Latency problem" warning when audio is pushed behind zero occurs for both tracks of a stereo pair 2017-08-16 15:50:48 +01:00
Paul Licameli
f2ee945da0 Bug1714, partial fix for silent, freezing Midi play on ALSA...
Don't assume Pa_GetStreamTimePaStreamCallbackTimeInfo origin is time-of-day.

portaudio.h says you should not, and in fact it was not.

The report is that this gets us some play, but there are still freezes.
2017-08-13 15:12:48 -04:00
James Crook
7a5bbbcce8 Bug 388 - Mac: Recording Preferences has an unsupported "Hardware Playthrough" option 2017-08-05 15:46:23 +01:00
James Crook
dddac6e47d Bug 1707 - MIDI Loop Play misses first few notes on looping.
The problem was that Audacity did not refill its buffers until the note-off of the last note played.  That was (in the James Bond case) 2.9s after the end of the loop.  The fix was to not add note off events after mT1 and instead use gAllNotesOff.
2017-08-03 14:34:54 +01:00
Paul Licameli
07ea0ae03f Workaround for GarageBand as synth not respecting notes-off message 2017-07-25 14:56:02 -04:00
Paul Licameli
ddf236993f Bug1502: VST and AU plug-ins should show correct rates and spectra 2017-07-24 14:20:54 -04:00
James Crook
bcf21ad0fd Make building without EXPERIMENTAL_MIDI_OUT possible again. 2017-07-19 18:02:03 +01:00
Pokechu22
03f9592f58 Bug 1690: Playback does not stop at the end of MIDI playback
This was caused by the indicator-passed-selection check being inside a loop over all wave tracks.  If there are no wave tracks, then the check never happened.  I added a duplicate version of the check if there are no wave tracks.  This may not be the best solution, but it works for now.

I'm not entirely sure why the check is in the loop (or what's going on with the len and maxLen variables); as such, I just haven't touched that.  Perhaps it would be safe to move the check always outside of the loop, but I'm not completely confident in that.
2017-07-16 20:52:09 -04:00