/[svn]/linuxsampler/trunk/src/engines/sfz/sfz.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/sfz/sfz.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2299 by iliev, Sun Dec 11 20:50:31 2011 UTC revision 2311 by persson, Sat Feb 11 11:08:09 2012 UTC
# Line 3  Line 3 
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  *
# Line 893  namespace sfz Line 893  namespace sfz
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())
# Line 936  namespace sfz Line 938  namespace sfz
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
# Line 1276  namespace sfz Line 1283  namespace sfz
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          }          }

Legend:
Removed from v.2299  
changed lines
  Added in v.2311

  ViewVC Help
Powered by ViewVC