MCPcopy Create free account
hub / github.com/LMMS/lmms / write

Method write

src/core/RingBuffer.cpp:195–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193
194
195void RingBuffer::write( sampleFrame * src, f_cnt_t offset, f_cnt_t length )
196{
197 const f_cnt_t pos = ( m_position + offset ) % m_size;
198 if( length == 0 ) { length = m_fpp; }
199
200 if( pos + length <= m_size ) // we won't go over the edge so we can just memcpy here
201 {
202 memcpy( & m_buffer [pos], src, length * sizeof( sampleFrame ) );
203 }
204 else
205 {
206 f_cnt_t first = m_size - pos;
207 f_cnt_t second = length - first;
208
209 memcpy( & m_buffer [pos], src, first * sizeof( sampleFrame ) );
210
211 memcpy( m_buffer, & src [first], second * sizeof( sampleFrame ) );
212 }
213}
214
215
216void RingBuffer::write( sampleFrame * src, float offset, f_cnt_t length )

Callers

nothing calls this directly

Calls 1

writeFunction · 0.85

Tested by

no test coverage detected