QStringList DecoderRegistry::getSupportedTypes(void) { QStringList types; types << GET_FILETYPES(WaveDecoder); types << GET_FILETYPES(MP3Decoder); types << GET_FILETYPES(VorbisDecoder); types << GET_FILETYPES(AACDecoder); types << GET_FILETYPES(AC3Decoder); types << GET_FILETYPES(FLACDecoder); types << GET_FILETYPES(WavPackDecoder); types << GET_FILETYPES(MusepackDecoder); types << GET_FILETYPES(ShortenDecoder); types << GET_FILETYPES(MACDecoder); types << GET_FILETYPES(TTADecoder); types << GET_FILETYPES(SpeexDecoder); types << GET_FILETYPES(ALACDecoder); types << GET_FILETYPES(WMADecoder); types << GET_FILETYPES(ADPCMDecoder); types << GET_FILETYPES(OpusDecoder); types << GET_FILETYPES(AvisynthDecoder); QStringList extensions; extensions << QString(PlaylistImporter::supportedExtensions).split(" ", QString::SkipEmptyParts); QRegExp regExp("\\((.+)\\)", Qt::CaseInsensitive); for(int i = 0; i < types.count(); i++) { if(regExp.lastIndexIn(types.at(i)) >= 0) { extensions << regExp.cap(1).split(" ", QString::SkipEmptyParts); } } if(!extensions.empty()) { extensions.removeDuplicates(); extensions.sort(); types.prepend(QString("%1 (%2)").arg(tr("All supported types"), extensions.join(" "))); } types << QString("%1 (%2)").arg(tr("Playlists"), PlaylistImporter::supportedExtensions); types << QString("%1 (*.*)").arg(tr("All files")); return types; }
const DecoderRegistry::typeList_t &DecoderRegistry::getAvailableDecoderTypes(void) { if(!m_availableTypes.isNull()) { return (*m_availableTypes); } m_availableTypes.reset(new typeList_t()); GET_FILETYPES(*m_availableTypes, WaveDecoder); GET_FILETYPES(*m_availableTypes, MP3Decoder); GET_FILETYPES(*m_availableTypes, VorbisDecoder); GET_FILETYPES(*m_availableTypes, AACDecoder); GET_FILETYPES(*m_availableTypes, AC3Decoder); GET_FILETYPES(*m_availableTypes, FLACDecoder); GET_FILETYPES(*m_availableTypes, WavPackDecoder); GET_FILETYPES(*m_availableTypes, MusepackDecoder); GET_FILETYPES(*m_availableTypes, ShortenDecoder); GET_FILETYPES(*m_availableTypes, MACDecoder); GET_FILETYPES(*m_availableTypes, TTADecoder); GET_FILETYPES(*m_availableTypes, SpeexDecoder); GET_FILETYPES(*m_availableTypes, ALACDecoder); GET_FILETYPES(*m_availableTypes, WMADecoder); GET_FILETYPES(*m_availableTypes, ADPCMDecoder); GET_FILETYPES(*m_availableTypes, OpusDecoder); GET_FILETYPES(*m_availableTypes, AvisynthDecoder); return (*m_availableTypes); }