MCPcopy Create free account
hub / github.com/davy7125/polyphone / getInput

Method getInput

sources/core/input/inputfactory.cpp:70–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70AbstractInputParser * InputFactory::getInput(QString fileName)
71{
72 if (s_instance == nullptr)
73 s_instance = new InputFactory();
74
75 AbstractInputParser * input = nullptr;
76
77 if (fileName.isEmpty())
78 {
79 // New soundfont from scratch
80 input = new InputParserEmpty();
81 }
82 else
83 {
84 QFileInfo fileInfo(fileName);
85 QString extension = fileInfo.suffix().toLower();
86 if (s_instance->_mapToInput.contains(extension))
87 input = s_instance->_mapToInput[extension]->getParser(fileName);
88 }
89 if (input == nullptr)
90 input = new InputParserNotSupported();
91 input->initialize(fileName, SoundfontManager::getInstance());
92
93 return input;
94}
95
96bool InputFactory::isSuffixSupported(QString suffix)
97{

Callers

nothing calls this directly

Calls 3

containsMethod · 0.80
getParserMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected