Strings

Updated: April 19, 2023

This interface allows an addon library file (i.e., a DLL) to make strings available to applications even after it has been unloaded. The library file can publish information about itself so applications don't have to load it just to query the addon about what it supports. For example, some interfaces such as AOMimetypeInspector and AOExtInspector use the Strings interface to cache the strings for addons so they can quickly see which ones can handle certain file and media types and thus, optimize searches for addon ratings.

Applications have to call AoGetStrings() rather than AoGetInterface() to get the strings, because the latter function returns NULL if the DLL is not loaded. They can then use AoFindString() to search the set of strings. The meanings of these strings are defined by other interfaces implemented in the addon.

The Strings interface itself is a constant pointer to an array of immutable strings with a NULL pointer as the last element:
static const char *const strings_interface[] = {
    "FirstString=1",
    "AudioInputFourccs=60:M2AP,80:M1A2,80:M1A3,80:M1A1,80:M2A1,80:M2A2,80:M2A3",
    "ThirdString",
    NULL
};

AOInterface_t interfaces[] =
{
    { "Name", 1, "xing_mpega_decoder" },
    { "Strings", 1, strings_interface },
    { "Version", MM_VERSION, NULL },
    ...
}
When addons publish strings through this interface, they must format them in one of two ways:

After the application has finished reading the strings, it should call AoUngetStrings() to inform the AOI library that it's no longer using them.