Import Filtering and Importer Order

Peter 10Jul11: This page has been created by "removing" it from the Importing Audio page, leaving a link to this new page there.

Using the Files of type: ... or Format drop-down menu in the Open and Import Audio Dialogs
The choice made in the "Files of type:" (Windows) or "Format" (Mac OS/X) drop-down menu in these dialogs does two things.
 * 1) It restricts the file list to files of that type (or those supported by that importer), according to the file extension.
 * 2) It chooses which importer to use.

The choices in the "Files of type:" or "Format" drop-down menu are:
 * All files
 * All files in the list are selectable, even those not supported by Audacity or FFmpeg
 * The built-in Audacity importers will be tried first, then FFmpeg (if installed)
 * All supported files
 * Only those files supported by Audacity or FFmpeg (if installed) are selectable
 * The built-in Audacity importers will be tried first, then FFmpeg
 * Audacity Projects - This option is available only when you use the File > Open command
 * Only Audacity project files (.aup) are selectable
 * No importer is involved, since you are opening an Audacity project, not importing an audio file
 * WAV, AIF and other uncompressed types
 * Only uncompressed files are selectable
 * The built-in Audacity importers will be tried first, then FFmpeg (if installed)
 * If the built-in Audacity importers are used and "read directly" is chosen in Import / Export Preferences then On-Demand Loading will be used. If the FFmpeg importer is used, On-Demand Loading will not be used.
 * Ogg vorbis files, FLAC files, MP3 files
 * Only files of the specified type are selectable
 * The built-in Audacity importers will be tried first, then FFmpeg (if installed)
 * List of files in basic text format
 * Only files ending in .lof are selectable. See LOF Files for how to create and use LOF files.
 * The importer used will depend on the files pointed to by the LOF file.
 * FFmpeg compatible files - this option is only available if you have installed the optional FFmpeg extension.
 * Any file types supported by FFmpeg are selectable
 * The FFmpeg importer will always be tried first if "Attempt to use filter in OpenFile dialog first" in Extended Import Preferences is checked, otherwise the native importer will be tried first.
 * Note that if this option is chosen and an uncompressed file type is selected from the list, On-Demand Loading will not be used.
 * QuickTime files - Mac only
 * Any file type supported by QuickTime is selectable
 * QuickTime will be used to decode the file and send it to Audacity

Interaction with the Extended Import Preferences
Bill: Proposed text follows ... (updated by Gale) The Extended Import Preferences pane has a checkbox that reads "Attempt to use filter in OpenFile dialog first". 'Filter' in this context means the choice made in the 'Format' drop-down menu when using File > Import > Audio or File > Open.

If then
 * there are any rules listed in the Extended Import Preferences for the file type being imported, and
 * "Attempt to use filter in OpenFile dialog first" is not checked
 * the importer used will always be determined by the Extended Import rule

(otherwise the importer used will be as detailed in the list in the section above).

If then
 * "Attempt to use filter in OpenFile dialog first" is checked, and
 * Any choice other than "All files" or "All supported files" is made in the Format drop-down menu
 * the importer used will be as detailed in the list in the section above.

Gale 26Jan11:

This is still quite complex and I hope keeping a bug open against this will lead to it being rethought.

Your first If is correct up to the part I put in parentheses. If the parenthesis is added, it gets a bit hazy for me as does your second If, because testing shows that the method of import can still govern the importer used. So the note div:

The current setting of the file-types drop-down (or the import rule set in Extended Import Preferences if "Attempt to use filter" is unchecked) always determines the importer that tries first to import the file. This is true irrespective of which File menu item you use to import the file(s), or whether you instead drag the file(s) into Audacity.

is wrong and I removed it for now. Only "the import rule set in Extended Import Preferences if "Attempt to use filter" is unchecked" always determines the importer irrespective of import method.

I summarise it thus in the Release Notes for the bug:

By default, the importer used depends on the import method. For example, to be able to use FFmpeg to import native Audacity formats like WAV and MP3, you must choose the "FFmpeg-compatible files" filter in File > Open or File > Import > Audio and always use one of those import methods.

To force FFmpeg to import native Audacity formats when using File > Recent Files or dragging in, add rules for those formats in Extended Import Preferences. To force FFmpeg import irrespective of the filter when using File > Open or File > Import > Audio, uncheck "Attempt to use filter in OpenFile dialog first" in Extended Import Preferences as well as adding the rule for the format.

As I see it the only really important filter in OpenFile (actually using OpenFile, and with no rules, checkbox checked) is "FFmpeg-compatible files". Otherwise whatever filter you choose gives you the "expected" importer for the format you actually select in the list window (native if it's a native format, FFmpeg if not native). Does it help to say something like that in the section above?

If you uncheck the box and use File > Open or File > Import > Audio, you basically undo the "expected" OpenFile rule, if there is an alternative. You force the native importer to be used even if you choose "FFmpeg-compatible files" for a native file. On Linux, you also force libsndfile to be used for FLAC (libsndfile is also used irrespective of the checkbox state if you drag in or use Recent Files). I'm not sure if it's worth even documenting "use OpenFile but uncheck the box". If you add rules, these always override FileOpen filters and always apply irrespective of the import method if the box is unchecked. If the box is checked, the FileOpen filter is tried first if you actually use File > Open or File > Import > Audio.

So how I'm feeling is to describe this by what end result you want instead of the if's/then's with rules on/off and checkbox on/off.