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 * |
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. |