The magic number 7 was determined by Ed's experimentation. Frankly, this is a hack to work around a bug in wxTreebook, and will have to be revisited if we add another category to mCategories.
* Fix memory leaks.
* Add comments about initializations and checking for successful results.
* Add checks for NULL deref.
* Consistency in "TODO" vs "TO-DO" comments!
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.
* /ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice preference enables the override (backward-compatibel behaviour), and it is now false by default
* File names (and mime types) and patterns are Lower()'ed before being fed to wxMatchWild(), now matching should be case-insensitive
* Now empty rule elements (empty list of extensions, empty list of mime types) will match anything (just as if they had one "*" element)
* "Extended Import" preferences tab is now next to "Import/Export" tab
* Preferences now use Grid class (the one used in Tag editor) instead of default wxGrid. Tabbing now works correctly.
* First attempt to add Drag'n'Drop re-ordering for Rule table. Seems to be working.
* Cleaned up a couple of cruft code comments.
* Separate buttons (with hotkeys) for moving rules and filters up and down (ctrl+up/down still works)
* Moved some code into helper funcions (can be called from both button and keyboard event handlers)
* Grid is now configured in PopulateOrExchange (the same way it is in Tags.cpp)
* Keep selection while moving table rows and list items
* Detect trailing/leading spaces in rule condition and offer to trim them