3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2008 Anders Dahnielson <anders@dahnielson.com> * |
* Copyright (C) 2008 Anders Dahnielson <anders@dahnielson.com> * |
6 |
* Copyright (C) 2009 - 2011 Anders Dahnielson and Grigor Iliev * |
* Copyright (C) 2009 - 2012 Anders Dahnielson and Grigor Iliev * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
893 |
|
|
894 |
// DEFINITION |
// DEFINITION |
895 |
std::stringstream linestream(line); |
std::stringstream linestream(line); |
896 |
|
linestream >> std::noskipws; |
897 |
|
int spaces = 0; |
898 |
while (linestream >> token) |
while (linestream >> token) |
899 |
{ |
{ |
900 |
if (token[0] == '<' and token[token.size()-1] == '>') |
if (token[0] == '<' && token[token.size()-1] == '>') |
901 |
{ |
{ |
902 |
// HEAD |
// HEAD |
903 |
if (!token_string.empty()) |
if (!token_string.empty()) |
938 |
else |
else |
939 |
{ |
{ |
940 |
// TAIL |
// TAIL |
941 |
token_string.append(" "); |
token_string.append(spaces, ' '); |
942 |
token_string.append(token); |
token_string.append(token); |
943 |
} |
} |
944 |
|
spaces = 0; |
945 |
|
while (isspace(linestream.peek())) { |
946 |
|
linestream.ignore(); |
947 |
|
spaces++; |
948 |
|
} |
949 |
} |
} |
950 |
|
|
951 |
// EOL |
// EOL |
1283 |
{ |
{ |
1284 |
std::string path = default_path + value; |
std::string path = default_path + value; |
1285 |
#ifndef WIN32 |
#ifndef WIN32 |
1286 |
for (int i = 0; i < path.length(); i++) if( path[i] == '\\') path[i] = '/'; |
for (int i = 0; i < path.length(); i++) if (path[i] == '\\') path[i] = '/'; |
1287 |
|
bool absolute = path[0] == '/'; |
1288 |
|
#else |
1289 |
|
bool absolute = path[0] == '/' || path[0] == '\\' || |
1290 |
|
(path.length() >= 2 && isalpha(path[0]) && path[1] == ':'); |
1291 |
#endif |
#endif |
1292 |
path = currentDir + LinuxSampler::File::DirSeparator + path; // TODO: check for absolute path |
if (!absolute) path = currentDir + LinuxSampler::File::DirSeparator + path; |
|
|
|
1293 |
if(pCurDef) pCurDef->sample = path; |
if(pCurDef) pCurDef->sample = path; |
1294 |
return; |
return; |
1295 |
} |
} |