|
libpsynth 0.2.1
|
#include <ring_buffer_range.hpp>


Public Types | |
| typedef Range | range |
| typedef Range::size_type | size_type |
| typedef Range::difference_type | difference_type |
| typedef detail::unsafe_ring_position < ring_buffer_range_base > | unsafe_position |
| typedef detail::ring_position < ring_buffer_range_base > | position |
Public Member Functions | |
| ring_buffer_range_base () | |
| Constructor. | |
| ring_buffer_range_base (const ring_buffer_range_base &range) | |
| Copy constructor. | |
| ring_buffer_range_base (const Range &range) | |
| template<class Range2 > | |
| ring_buffer_range_base (const ring_buffer_range_base< Range2 > &range) | |
| Copy constructor. | |
| ring_buffer_range_base & | operator= (const ring_buffer_range_base &range) |
| Assignment operator. | |
| size_type | size () const |
| Returns the size of the buffer. | |
| unsafe_position | begin_unsafe_pos () const |
| Returns a read pointer to the beginning of the available data. | |
| unsafe_position | end_unsafe_pos () const |
| Returns a read pointer to the end of the available data. | |
| position | begin_pos () const |
| Returns a read pointer to the beginning of the available data. | |
| position | end_pos () const |
| Returns a read pointer to the end of the available data. | |
| size_type | available (const position &r) const |
| Returns the number of available data from a read pointer. | |
| size_type | available (const unsafe_position &r) const |
| Returns the number of available data from a read pointer. | |
| size_type | available () const |
| Returns the number of available data from a read pointer. | |
| int | check_position (const position &reader) const |
| Checks a iterator for error states. | |
| template<class Position > | |
| buffer_range_type< Range >::type | sub_buffer_one (const Position &p, size_type slice) const |
| template<class Position > | |
| buffer_range_type< Range >::type | sub_buffer_two (const Position &p, size_type slice) const |
| template<class Position , class Range2 > | |
| size_t | read (Position &r, const Range2 &range) const |
| Fills a sample_buffer with data from the ring buffer. | |
| template<class Position , class Range2 > | |
| size_type | read (Position &r, const Range2 &range, size_type samples) const |
| Fills a sample_buffer with data from the ring buffer. | |
| template<class Position , class Range2 , class CC = default_channel_converter> | |
| size_t | read_and_convert (Position &r, const Range2 &range, CC cc=CC()) const |
| Fills a sample_buffer with data from the ring buffer. | |
| template<class Position , class Range2 , class CC = default_channel_converter> | |
| size_type | read_and_convert (Position &r, const Range2 &range, size_type samples, CC cc=CC()) const |
| Fills a sample_buffer with data from the ring buffer. | |
| template<class Range2 > | |
| void | write (const Range2 &range) |
| Write all the data in a sample_buffer to the ring buffer. | |
| template<class Range2 > | |
| void | write (const Range2 &range, size_type samples) |
| Write some data in a sample_buffer to the ring buffer. | |
| template<class Range2 , class CC = default_channel_converter> | |
| void | write_and_convert (const Range2 &range, CC cc=CC()) |
| Write all the data in a sample_buffer to the ring buffer. | |
| template<class Range2 , class CC = default_channel_converter> | |
| void | write_and_convert (const Range2 &range, size_type samples, CC cc=CC()) |
| Write some data in a sample_buffer to the ring buffer. | |
| void | zero () |
| Sets to zero all the contents of the buffer. | |
| bool | is_backwards () const |
| Returns wether this buffer is being written backwards. | |
| void | set_backwards () |
| Changes the reading direction of the current pointer write pointer. | |
| void | advance (difference_type n) |
| Advances the write pointer of the buffer a given number of elements. | |
| template<typename Position > | |
| void | advance (Position &r, difference_type n) const |
| Advances a read pointer a given number of elements. | |
| difference_type | distance (const unsafe_position &ra, const unsafe_position &rb) const |
| difference_type | distance (const position &ra, const position &rb) const |
| template<typename Position > | |
| void | increment (Position &r) const |
| template<typename Position > | |
| void | decrement (Position &r) const |
| difference_type | count () const |
| position | sync (const position &r) const |
| Returns a new iterator in the same position but with the read count calculated from the read position to the write position. | |
Public Attributes | |
| bool | _backwards |
true if we are reading and writting the ringbuffer backwards. | |
| size_type | _startpos |
| The new starting position of the ring buffer. | |
| position | _writepos |
| Range | _range |
| typedef Range::difference_type psynth::sound::ring_buffer_range_base< Range >::difference_type |
| typedef detail::ring_position<ring_buffer_range_base> psynth::sound::ring_buffer_range_base< Range >::position |
| typedef Range psynth::sound::ring_buffer_range_base< Range >::range |
| typedef Range::size_type psynth::sound::ring_buffer_range_base< Range >::size_type |
| typedef detail::unsafe_ring_position<ring_buffer_range_base> psynth::sound::ring_buffer_range_base< Range >::unsafe_position |
| psynth::sound::ring_buffer_range_base< Range >::ring_buffer_range_base | ( | ) | [inline] |
Constructor.
| size | The size of the buffer, defaults to zero. |
| psynth::sound::ring_buffer_range_base< Range >::ring_buffer_range_base | ( | const ring_buffer_range_base< Range > & | range | ) | [inline] |
Copy constructor.
| psynth::sound::ring_buffer_range_base< Range >::ring_buffer_range_base | ( | const Range & | range | ) | [inline, explicit] |
| psynth::sound::ring_buffer_range_base< Range >::ring_buffer_range_base | ( | const ring_buffer_range_base< Range2 > & | range | ) | [inline] |
Copy constructor.
| void psynth::sound::ring_buffer_range_base< Range >::advance | ( | difference_type | n | ) | [inline] |
Advances the write pointer of the buffer a given number of elements.
| n | The number of elements to advance. |
| void psynth::sound::ring_buffer_range_base< Range >::advance | ( | Position & | r, |
| difference_type | n | ||
| ) | const [inline] |
Advances a read pointer a given number of elements.
| r | The iterator to advance. |
| n | The number of elements to advance. |
| size_type psynth::sound::ring_buffer_range_base< Range >::available | ( | const unsafe_position & | r | ) | const [inline] |
Returns the number of available data from a read pointer.
| r | The read pointer to test for available data. |
| size_type psynth::sound::ring_buffer_range_base< Range >::available | ( | ) | const [inline] |
Returns the number of available data from a read pointer.
| r | The read pointer to test for available data. |
| size_type psynth::sound::ring_buffer_range_base< Range >::available | ( | const position & | r | ) | const [inline] |
Returns the number of available data from a read pointer.
| r | The read pointer to test for available data. |
| position psynth::sound::ring_buffer_range_base< Range >::begin_pos | ( | ) | const [inline] |
Returns a read pointer to the beginning of the available data.
| unsafe_position psynth::sound::ring_buffer_range_base< Range >::begin_unsafe_pos | ( | ) | const [inline] |
Returns a read pointer to the beginning of the available data.
| int psynth::sound::ring_buffer_range_base< Range >::check_position | ( | const position & | reader | ) | const [inline] |
Checks a iterator for error states.
| difference_type psynth::sound::ring_buffer_range_base< Range >::count | ( | ) | const [inline] |
| void psynth::sound::ring_buffer_range_base< Range >::decrement | ( | Position & | r | ) | const [inline] |
| difference_type psynth::sound::ring_buffer_range_base< Range >::distance | ( | const unsafe_position & | ra, |
| const unsafe_position & | rb | ||
| ) | const [inline] |
| difference_type psynth::sound::ring_buffer_range_base< Range >::distance | ( | const position & | ra, |
| const position & | rb | ||
| ) | const [inline] |
| position psynth::sound::ring_buffer_range_base< Range >::end_pos | ( | ) | const [inline] |
Returns a read pointer to the end of the available data.
| unsafe_position psynth::sound::ring_buffer_range_base< Range >::end_unsafe_pos | ( | ) | const [inline] |
Returns a read pointer to the end of the available data.
| void psynth::sound::ring_buffer_range_base< Range >::increment | ( | Position & | r | ) | const [inline] |
| bool psynth::sound::ring_buffer_range_base< Range >::is_backwards | ( | ) | const [inline] |
Returns wether this buffer is being written backwards.
| ring_buffer_range_base& psynth::sound::ring_buffer_range_base< Range >::operator= | ( | const ring_buffer_range_base< Range > & | range | ) | [inline] |
Assignment operator.
| size_t psynth::sound::ring_buffer_range_base< Range >::read | ( | Position & | r, |
| const Range2 & | range | ||
| ) | const [inline] |
Fills a sample_buffer with data from the ring buffer.
| r | The reader posize_ter. |
| buf | The buffer to fill with the data. |
| size_type psynth::sound::ring_buffer_range_base< Range >::read | ( | Position & | r, |
| const Range2 & | range, | ||
| size_type | samples | ||
| ) | const |
Fills a sample_buffer with data from the ring buffer.
| r | The reader pointer. |
| buf | The buffer to fill with the data. |
| samples | The number of samples to read. |
| size_type psynth::sound::ring_buffer_range_base< Range >::read_and_convert | ( | Position & | r, |
| const Range2 & | range, | ||
| size_type | samples, | ||
| CC | cc = CC() |
||
| ) | const |
Fills a sample_buffer with data from the ring buffer.
| r | The reader pointer. |
| buf | The buffer to fill with the data. |
| samples | The number of samples to read. |
| size_t psynth::sound::ring_buffer_range_base< Range >::read_and_convert | ( | Position & | r, |
| const Range2 & | range, | ||
| CC | cc = CC () |
||
| ) | const [inline] |
Fills a sample_buffer with data from the ring buffer.
| r | The reader posize_ter. |
| buf | The buffer to fill with the data. |
| void psynth::sound::ring_buffer_range_base< Range >::set_backwards | ( | ) | [inline] |
Changes the reading direction of the current pointer write pointer.
If you are using this buffer as an intermediate buffer from another medium and your where reading that medium forwards, this allows you to not to lose the already read data remaining in the buffer if you change the reading direction.
This seems to be fixed.
caching_file_input_impl::set_backwards seems to compensate the reading backwards bug. Check old implementation.
| size_type psynth::sound::ring_buffer_range_base< Range >::size | ( | ) | const [inline] |
Returns the size of the buffer.
| buffer_range_type<Range>::type psynth::sound::ring_buffer_range_base< Range >::sub_buffer_one | ( | const Position & | p, |
| size_type | slice | ||
| ) | const |
| buffer_range_type<Range>::type psynth::sound::ring_buffer_range_base< Range >::sub_buffer_two | ( | const Position & | p, |
| size_type | slice | ||
| ) | const |
| position psynth::sound::ring_buffer_range_base< Range >::sync | ( | const position & | r | ) | const [inline] |
Returns a new iterator in the same position but with the read count calculated from the read position to the write position.
This function may be called to get back from an erratic iterator and must be called whenever the write direction is changed using the backwards () function.
| void psynth::sound::ring_buffer_range_base< Range >::write | ( | const Range2 & | range | ) | [inline] |
Write all the data in a sample_buffer to the ring buffer.
| buf | The buffer to write. |
| void psynth::sound::ring_buffer_range_base< Range >::write | ( | const Range2 & | range, |
| size_type | samples | ||
| ) |
Write some data in a sample_buffer to the ring buffer.
| buf | The buffer to write. |
| samples | The number of samples to write. |
| void psynth::sound::ring_buffer_range_base< Range >::write_and_convert | ( | const Range2 & | range, |
| size_type | samples, | ||
| CC | cc = CC() |
||
| ) |
Write some data in a sample_buffer to the ring buffer.
| buf | The buffer to write. |
| samples | The number of samples to write. |
| void psynth::sound::ring_buffer_range_base< Range >::write_and_convert | ( | const Range2 & | range, |
| CC | cc = CC () |
||
| ) | [inline] |
Write all the data in a sample_buffer to the ring buffer.
| buf | The buffer to write. |
| void psynth::sound::ring_buffer_range_base< Range >::zero | ( | ) | [inline] |
Sets to zero all the contents of the buffer.
| bool psynth::sound::ring_buffer_range_base< Range >::_backwards |
true if we are reading and writting the ringbuffer backwards.
| Range psynth::sound::ring_buffer_range_base< Range >::_range |
| size_type psynth::sound::ring_buffer_range_base< Range >::_startpos |
The new starting position of the ring buffer.
| position psynth::sound::ring_buffer_range_base< Range >::_writepos |
1.7.4