* 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.
This is a workaround for the portaudio issue where changing the default device in xp will corrupt the portaudio device indecies.
This combined with the portmixer fix (earlier today) should address bug 29.
// but we can't make the AddItem flags and mask have both, because they'd both have to be true for the
// command to be enabled.
// If user has Undone the entire stack, RedoAvailableFlag is on but UndoAvailableFlag is off.
// If user has done things but not Undone anything, RedoAvailableFlag is off but UndoAvailableFlag is on.
// So in either of those cases, (AudioIONotBusyFlag | UndoAvailableFlag | RedoAvailableFlag) mask
// would fail.
// The only way to fix this in the current architecture is to hack in special cases for RedoAvailableFlag
// in AudacityProject::UpdateMenus() (ugly) and CommandManager::HandleCommandEntry() (*really* ugly --
// shouldn't know about particular command names and flags).
// So for now, enable the command regardless of stack. It will just show empty (except for Created Project) sometimes.
// FOR REDESIGN, clearly there are some limitations with the flags/mask bitmaps.
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.
Ed Musgrove's patch to fix cases where the bug currently occurs.
This does not completely fix the bug, because users can still set modifier keys in the wrong order so they would be two separate entries in CommandManager::mCommandKeyHash, but KeyEventToKeyString() will put them in the expected order, so the version in the expected order will always be the one CommandManager::HandleKey() uses.
EXPERIMENTAL_LINKING -> EXPERIMENTAL_SYNC_LOCK
Restore some "border" lines in TrackInfo.
Get rid of unused DEFINE_COLOUR( clrTrackInfoSyncLockSel...).
Clean out some undocumented commented-out code. Add/remove some comments.