/[svn]/linuxsampler/trunk/src/engines/common/StreamBase.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/StreamBase.h

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

revision 3053 by iliev, Fri Oct 23 17:53:17 2009 UTC revision 3054 by schoenebeck, Thu Dec 15 12:47:45 2016 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2009 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2016 Christian Schoenebeck                       *
7   *   Copyright (C) 2009 Grigor Iliev                                       *   *   Copyright (C) 2009 Grigor Iliev                                       *
8   *                                                                         *   *                                                                         *
9   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
# Line 68  namespace LinuxSampler { Line 68  namespace LinuxSampler {
68    
69                  // we must delay the increment_write_ptr_with_wrap() after the while() loop because we need to                  // we must delay the increment_write_ptr_with_wrap() after the while() loop because we need to
70                  // ensure that we read exactly SampleCount sample, otherwise the buffer wrapping code will fail                  // ensure that we read exactly SampleCount sample, otherwise the buffer wrapping code will fail
71                  pRingBuffer->increment_write_ptr_with_wrap(total_readsamples * SampleInfo.FrameSize);                  pRingBuffer->increment_write_ptr_with_wrap(int(total_readsamples * SampleInfo.FrameSize));
72    
73                  return total_readsamples;                  return (int)total_readsamples;
74              }              }
75    
76              virtual void WriteSilence(unsigned long SilenceSampleWords) {              virtual void WriteSilence(unsigned long SilenceSampleWords) {
77                  memset(pRingBuffer->get_write_ptr(), 0, SilenceSampleWords * SampleInfo.BytesPerSample);                  memset(pRingBuffer->get_write_ptr(), 0, SilenceSampleWords * SampleInfo.BytesPerSample);
78                  pRingBuffer->increment_write_ptr_with_wrap(SilenceSampleWords * SampleInfo.BytesPerSample);                  pRingBuffer->increment_write_ptr_with_wrap(int(SilenceSampleWords * SampleInfo.BytesPerSample));
79              }              }
80    
81              /// Called by disk thread to activate the disk stream.              /// Called by disk thread to activate the disk stream.

Legend:
Removed from v.3053  
changed lines
  Added in v.3054

  ViewVC Help
Powered by ViewVC