| 165 | } |
| 166 | |
| 167 | bool Importer::Initialize() |
| 168 | { |
| 169 | // build the list of import plugin and/or unusableImporters. |
| 170 | // order is significant. If none match, they will all be tried |
| 171 | // in the order defined here. |
| 172 | |
| 173 | using namespace Registry; |
| 174 | static OrderingPreferenceInitializer init{ |
| 175 | PathStart, |
| 176 | // FFmpeg is in default of all other modules that might handle a format |
| 177 | // better and specially; including MIDI import |
| 178 | { {wxT(""), wxT("AUP,PCM,OGG,FLAC,MP3,LOF,WavPack,portsmf,FFmpeg") } } |
| 179 | }; |
| 180 | |
| 181 | // Once only, visit the registry to collect the plug-ins properly |
| 182 | // sorted |
| 183 | static std::once_flag flag; |
| 184 | std::call_once(flag, []{ |
| 185 | GroupItem<Traits> top{ PathStart }; |
| 186 | Registry::Visit( |
| 187 | [](const ImporterItem &item, auto&) { |
| 188 | sImportPluginList().push_back(item.mpPlugin.get()); }, |
| 189 | &top, &ImporterItem::Registry()); |
| 190 | }); |
| 191 | |
| 192 | // Ordering of the unusable plugin list is not important. |
| 193 | |
| 194 | ExtImportItems{}.swap(mExtImportItems); |
| 195 | |
| 196 | ReadImportItems(); |
| 197 | |
| 198 | return true; |
| 199 | } |
| 200 | |
| 201 | bool Importer::Terminate() |
| 202 | { |