MCPcopy Create free account
hub / github.com/LMMS/lmms / determineFileType

Method determineFileType

src/gui/FileBrowser.cpp:994–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992
993
994void FileItem::determineFileType( void )
995{
996 m_handling = NotSupported;
997
998 const QString ext = extension();
999 if( ext == "mmp" || ext == "mpt" || ext == "mmpz" )
1000 {
1001 m_type = ProjectFile;
1002 m_handling = LoadAsProject;
1003 }
1004 else if( ext == "xpf" || ext == "xml" )
1005 {
1006 m_type = PresetFile;
1007 m_handling = LoadAsPreset;
1008 }
1009 else if( ext == "xiz" && ! pluginFactory->pluginSupportingExtension(ext).isNull() )
1010 {
1011 m_type = PresetFile;
1012 m_handling = LoadByPlugin;
1013 }
1014 else if( ext == "sf2" )
1015 {
1016 m_type = SoundFontFile;
1017 }
1018 else if( ext == "pat" )
1019 {
1020 m_type = PatchFile;
1021 }
1022 else if( ext == "mid" )
1023 {
1024 m_type = MidiFile;
1025 m_handling = ImportAsProject;
1026 }
1027 else if( ext == "dll" )
1028 {
1029 m_type = VstPluginFile;
1030 m_handling = LoadByPlugin;
1031 }
1032 else
1033 {
1034 m_type = UnknownFile;
1035 }
1036
1037 if( m_handling == NotSupported &&
1038 !ext.isEmpty() && ! pluginFactory->pluginSupportingExtension(ext).isNull() )
1039 {
1040 m_handling = LoadByPlugin;
1041 // classify as sample if not classified by anything yet but can
1042 // be handled by a certain plugin
1043 if( m_type == UnknownFile )
1044 {
1045 m_type = SampleFile;
1046 }
1047 }
1048}
1049
1050
1051

Callers

nothing calls this directly

Calls 3

isNullMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected