Framework for context independent sounffont management
Not tested yet!
This commit is contained in:
parent
3d08c1fbc7
commit
a6fa906764
9 changed files with 612 additions and 52 deletions
|
|
@ -222,7 +222,7 @@ std::pair<FileReader *, std::string> PathList::openFile(const char *name, bool i
|
|||
{
|
||||
/* First try the given name */
|
||||
|
||||
if (!isAbsPath(name))
|
||||
if (!IsAbsPath(name))
|
||||
{
|
||||
for (int i = (int)paths.size() - 1; i >= 0; i--)
|
||||
{
|
||||
|
|
@ -253,18 +253,6 @@ std::pair<FileReader *, std::string> PathList::openFile(const char *name, bool i
|
|||
return std::make_pair(nullptr, std::string());
|
||||
}
|
||||
|
||||
int PathList::isAbsPath(const char *name)
|
||||
{
|
||||
if (name[0] == '/') return 1;
|
||||
|
||||
#ifdef _WIN32
|
||||
/* [A-Za-z]: (for Windows) */
|
||||
if (isalpha(name[0]) && name[1] == ':') return 1;
|
||||
#endif /* _WIN32 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct timidity_file *open_file(const char *name, bool ismainfile, PathList &pathList)
|
||||
{
|
||||
auto file = pathList.openFile(name, ismainfile);
|
||||
|
|
@ -320,4 +308,4 @@ long tf_tell(struct timidity_file *tf)
|
|||
return tf->url->Tell();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue