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

Diff of /linuxsampler/trunk/src/engines/common/SampleFile.cpp

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

revision 2673 by persson, Sun Jan 13 17:22:23 2013 UTC revision 2674 by persson, Thu Sep 11 18:22:14 2014 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003 - 2009 Christian Schoenebeck                       *   *   Copyright (C) 2003 - 2009 Christian Schoenebeck                       *
6   *   Copyright (C) 2009 - 2013 Grigor Iliev                                *   *   Copyright (C) 2009 - 2014 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 62  namespace LinuxSampler { Line 62  namespace LinuxSampler {
62                  break;                  break;
63              case SF_FORMAT_PCM_24:              case SF_FORMAT_PCM_24:
64              case SF_FORMAT_DWVW_24:              case SF_FORMAT_DWVW_24:
65                case SF_FORMAT_PCM_32:
66                case SF_FORMAT_FLOAT:
67                  FrameSize = 3 * ChannelCount;                  FrameSize = 3 * ChannelCount;
68                  break;                  break;
69              default:              default:
# Line 86  namespace LinuxSampler { Line 88  namespace LinuxSampler {
88          }          }
89          if(!DontClose) Close();          if(!DontClose) Close();
90    
91            if (FrameSize == 3 * ChannelCount && (
92  #if HAVE_DECL_SF_FORMAT_FLAC  #if HAVE_DECL_SF_FORMAT_FLAC
93          if (FrameSize == 3 * ChannelCount &&                  (Format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC ||
94              (Format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC) {  #endif
95                    (Format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT ||
96                    (Format & SF_FORMAT_SUBMASK) == SF_FORMAT_PCM_32)) {
97              pConvertBuffer = new int[CONVERT_BUFFER_SIZE];              pConvertBuffer = new int[CONVERT_BUFFER_SIZE];
98          }          }
 #endif  
99      }      }
100    
101      SampleFile::~SampleFile() {      SampleFile::~SampleFile() {
# Line 205  namespace LinuxSampler { Line 209  namespace LinuxSampler {
209  #endif  #endif
210              ) {              ) {
211              return sf_readf_short(pSndFile, static_cast<short*>(pBuffer), FrameCount);              return sf_readf_short(pSndFile, static_cast<short*>(pBuffer), FrameCount);
212            } else if (FrameSize == 3 * ChannelCount && (
213  #if HAVE_DECL_SF_FORMAT_FLAC  #if HAVE_DECL_SF_FORMAT_FLAC
214          } else if (FrameSize == 3 * ChannelCount &&                         (Format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC ||
215                     (Format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC) {  #endif
216                           (Format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT ||
217                           (Format & SF_FORMAT_SUBMASK) == SF_FORMAT_PCM_32)) {
218              // 24 bit flac needs to be converted from the 32 bit              // 24 bit flac needs to be converted from the 32 bit
219              // integers returned by libsndfile              // integers returned by libsndfile. Float and 32 bit pcm
220                // are treated in the same way.
221              int j = 0;              int j = 0;
222              sf_count_t count = FrameCount;              sf_count_t count = FrameCount;
223              const sf_count_t bufsize = CONVERT_BUFFER_SIZE / ChannelCount;              const sf_count_t bufsize = CONVERT_BUFFER_SIZE / ChannelCount;
# Line 225  namespace LinuxSampler { Line 233  namespace LinuxSampler {
233                  count -= n;                  count -= n;
234              }              }
235              return FrameCount - count;              return FrameCount - count;
 #endif              
236          } else          } else
237  #endif  #endif
238          {          {

Legend:
Removed from v.2673  
changed lines
  Added in v.2674

  ViewVC Help
Powered by ViewVC