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

414 Commits

Author SHA1 Message Date
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
Pokechu22
4d3d32ca4d Remove MIDI-only playback (without portaudio) logic
Instead, always start a portaudio stream (if there is either a note track or a wave track).  This ensures that playback is always in sync (eg when recording), and gets rid of a lot of duplicate logic throughout.

Scrubbing (currently) still doesn't work with only note tracks, but it should be easier to fix that now than trying to reimplement all of the scrubbing time logic.

Conflicts:
	src/AudioIO.cpp
2017-07-16 18:10:48 -04:00
Pokechu22
c50567e1db Time track properly warps the MIDI event times (but not pitches)
mMidiPlaySpeed doesn't handle all of the options provided by time tracks,
and in fact doesn't even use time tracks.  Using the time track
instead allows note tracks to remain synchronized with the rest of the audio.

mMidiPlaySpeed _did_ work where it was used in the transcription tool
bar, but that already updates a time track so no special handling is
needed.
2017-07-16 14:28:58 -04:00
Pokechu22
8a02687b5f Fix velocity offset edge case
If the velocity of a note was, for instance, 30, and the velocity slider was at -30, then you'd get a data2 of 0, which wouldn't be clamped (and would produce a note off).  However, if the note were 29 or 31, you'd get a velocity of 1.  This makes it so that note ons always have a velocity of at least 1, even in that edge case.
2017-07-16 11:07:28 -04:00
Pokechu22
62ebb2f95d Remove unused and unneeded MIDI methods and variables
The fields in AudioIO are simply unneeded (commented out, declared but never implemented, or otherwise unused).

mLastMidiPosition (in NoteTrack) looks like the vestiges of a far older attempt at MIDI playback; the field itself is completely unused though so it is safe to remove it.
2017-07-16 11:07:28 -04:00
Pokechu22
bd294ea4ed Midi diag mentions conditional compilation flags, but only in ALPHA 2017-07-16 11:06:13 -04:00
Pokechu22
681161f60b Add MIDI device diagnostics
* MIDI Device Info menu item, like Audio Device Info

 * MIDI device info in crash reports

 * Only enabled with EXPERIMENTAL_MIDI_OUT, but tracks info related to the (unimplemented) EXPERIMENTAL_MIDI_IN
2017-07-16 10:58:53 -04:00
Paul Licameli
a8ac80eda9 Bug1651: NoteTrack sync-lock and crash fixes...
Simplify the logic of duplication of NoteTrack.  Duplicates are always in
serialized state.  Un-serialization can happen on demand in any of the
NoteTrack operations that require a defined sequence.

Changing the duration of the sequence after paste is needed,
as it was also needed, when I fixed Stretch at commit
90eb4ec142f7d575d0870dd9c755589bff520cbe.  I don't know if this should be
considered a bug in Allegro that we are compensating.
2017-05-25 08:08:31 -04:00
Pokechu22
a76ad22c91 Fix midi channel toggling
This reintroduces the buttons to toggle display of individual midi
channels, and cleans up the code behind that feature.

This functionality has actually been present in production versions of
audacity for a while, at least for clicking.  However, the buttons
themselves were not drawn, making it exteremly painful (but possible) to
use.

As requested by PRL, this is always enabled if USE_MIDI is defined.
2017-05-02 00:37:31 -04:00
James Crook
7f98672e22 MIDI_OUT on by default on windows.
The idea is to get SOME use and test of MIDI_OUT even though it does not compile on Linux yet.
2017-04-27 12:56:39 +01:00
James Crook
419b790235 Make monitoring work after a theme change 2017-04-05 17:29:24 +01:00
Paul Licameli
aa83c4cf29 Implement the more than weak guarantees needed for recording...
... in WaveClip and WaveTrack, to save as much recording as we can,
assuming the strong guarantees that Sequence will give.

Also comment that some other WaveTrack methods can give strong guarantee,
incidentally to making HandleClear give strong.
2017-04-02 12:46:47 -04:00
Paul Licameli
e1473dfe76 void return, not boolean success, from some Track virtual functions...
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.

It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change.  No matter now.
2017-03-31 18:26:52 -04:00
Paul Licameli
80984c9f1d From Pokechu22: Rename gain to velocity on note tracks
"Velocity" is the technical term, and it's the term that's used everywhere.
"Gain" was probably only used because "gain" is used on wave tracks; since
note tracks aren't wave tracks (and shouldn't be treated as them) the
corresponding variables should be named velocity.
2017-03-29 13:27:22 -04:00
Pokechu22
0ce9598274 Fix midi-related compile problems in AudioIO and NoteTrack
The compilation was broken in 67cec5a but fixed in ed8c7fd.  However, the warnings weren't fixed.  The same general sign-related changes from 67cec5a were applied, fixing several warnings.

This also changes the arguments for NoteTrack's label click handler, to match the ones found in TrackPanel.  That's needed to handle some other const-related changes.

Additionally, EXPERIMENTAL_MIDI_PLAYBACK was changed to EXPERIMENTAL_MIDI_OUT in the documentation, as that is the correct name.
2017-03-27 01:12:16 -04:00