freeze to risk fixing it now. Will readdress after 2.0.5 is
released.
Basically, RingBuffer is ill equiped to handle an input stride
other than 1.
Thanks to Peter for testing this for me.
the job quite nicely...well, given the "stride" information he needs. And in
some cases, it will just use memcpy() so it may improve capture performance a
bit more.
For Resample.* and QualityPrefs.cpp, this commit has my restructuring for distinguishing constant-rate vs variable-rate resamplers more generally. I think it's complete and ready for const-rate, but I have more review and testing to do for the var-rate cases.
Variable-rate resampling is not implemented here, so Time Tracks are still broken, but this is a milestone in getting to a more general and correct structure.
Also I think this fixes AboutDialog issues Steve noticed.
* Fix memory leaks.
* Add comments about initializations and checking for successful results.
* Add checks for NULL deref.
* Consistency in "TODO" vs "TO-DO" comments!
I refactored the code into AudacityApp with a new timer. This is provisional pending discussion - if it is decided that it should go somewhere else I will move it.
Fixed bug in resetting mPrevT1. That caused remaining issue noted in Bug 258 comments 2 and 3.
Moved call to UpdateMeters from TrackPanel::OnTimer() to audacityAudioCallback, where it calls gAudioIO->mOutputMeter->UpdateDisplay(), so the updates are synchronized with Meter Toolbar updates.
Removed unnecessary call to MixerBoard::UpdateMeters() in AudacityProject::UpdateMixerBoard().
Various cleanup.
Patch by Rick Yorgason
I modified it to use linear instead of n squared ring buffer size after verifying that this yields better performance on my mac and pc.
This is just a workaround for what appears to be a portaudio bug, where Pa_OpenStream() resets the device level that port mixer should control.
Looked at portaudio src (pa_win_wmme.c's OpenStream()) but I couldn't find the origin of the problem.
If the Meter Toolbar was monitoring input, PrefsDialog can be opened, but then PrefsDialog::OnOK() needs to StopStream() or AudioIO::HandleDeviceChange() will no-op. We could instead disable the Preferences command while monitoring, i.e., set AudioIONotBusyFlag/AudioIOBusyFlag according to monitoring, as well as gAudioIO->IsAudioTokenActive(). Instead allow it because unlike recording, for example, monitoring is not clearly something that should prohibit opening prefs.
This may have been some of the occasions of bug 29, where user changed device while monitoring, but the AudioIO::HandleDeviceChange() code did not actually change the device, so it look like the user had specificied the motherboard/sound card default device, but Audacity was still using the USB device.
// TO-DO: We *could* be smarter in this method and call HandleDeviceChange()
// only when the device choices actually changed. True of lots of prefs!
// As is, we always stop monitoring and handle the device change.
In AudacityProject::GetUpdateFlags(), don't need to check (GetAudioIOToken() == 0) alternative because gAudioIO->IsAudioTokenActive() checks that it's greater than zero.
In AudioIO.cpp, cleaned up some logic and encapsulation of boolean methods.