libpsynth 0.2.1
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes
psynth::io::detail::caching_file_input_impl< Range, InputPtr > Class Template Reference

#include <caching_file_input.hpp>

Inheritance diagram for psynth::io::detail::caching_file_input_impl< Range, InputPtr >:
Inheritance graph
[legend]
Collaboration diagram for psynth::io::detail::caching_file_input_impl< Range, InputPtr >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Range range
typedef boost::pointee
< InputPtr >::type 
input_type
typedef input_type::range input_range
typedef
sound::buffer_from_range
< input_range >::type 
input_buffer_type
typedef
sound::buffer_from_range
< range >::type 
buffer_type
typedef sound::ring_buffer
< buffer_type
ring_buffer_type

Public Member Functions

 caching_file_input_impl (InputPtr input=0, std::size_t chunk_size=default_chunk_size, std::size_t buffer_size=default_buffer_size, std::size_t threshold=default_threshold)
 caching_file_input_impl (caching_file_input_impl &&other)
 ~caching_file_input_impl ()
void start ()
void stop ()
std::size_t frame_rate () const
std::size_t length () const
const input_typeinput () const
bool is_backwards () const
void set_backwards (bool backwards)
void set_chunk_size (std::size_t cs)
void soft_seek (std::size_t pos)
std::size_t seek (std::ptrdiff_t pos, seek_dir dir)
std::size_t take (const range &buf)
template<class Range2 >
std::size_t take (const Range2 &buf)
void set_input (InputPtr ptr)
void do_seek (std::ptrdiff_t offst, seek_dir dir)
void run ()

Public Attributes

std::size_t _chunk_size
std::size_t _buffer_size
std::size_t _threshold
input_buffer_type _tmp_buffer
ring_buffer_type _buffer
ring_buffer_type::range_range
ring_buffer_type::position _read_ptr
bool _backwards
std::ptrdiff_t _read_pos
std::ptrdiff_t _new_read_pos
std::atomic< bool > _finished
std::thread _thread
std::mutex _input_mutex
std::mutex _buffer_mutex
std::condition_variable _cond

Static Public Attributes

static constexpr std::size_t default_chunk_size = 1024
static constexpr std::size_t default_buffer_size = 16384
static constexpr std::size_t default_threshold = 4096

Protected Attributes

InputPtr _input

template<class Range, class InputPtr>
class psynth::io::detail::caching_file_input_impl< Range, InputPtr >


Member Typedef Documentation

template<class Range, class InputPtr>
typedef sound::buffer_from_range<range>::type psynth::io::detail::caching_file_input_impl< Range, InputPtr >::buffer_type
template<class Range, class InputPtr>
typedef sound::buffer_from_range<input_range>::type psynth::io::detail::caching_file_input_impl< Range, InputPtr >::input_buffer_type
template<class Range, class InputPtr>
typedef input_type::range psynth::io::detail::caching_file_input_impl< Range, InputPtr >::input_range
template<class Range, class InputPtr>
typedef boost::pointee<InputPtr>::type psynth::io::detail::caching_file_input_impl< Range, InputPtr >::input_type
template<class Range, class InputPtr>
typedef Range psynth::io::detail::caching_file_input_impl< Range, InputPtr >::range

Reimplemented from psynth::io::input< Range >.

template<class Range, class InputPtr>
typedef sound::ring_buffer<buffer_type> psynth::io::detail::caching_file_input_impl< Range, InputPtr >::ring_buffer_type

Constructor & Destructor Documentation

template<class Range, class InputPtr>
psynth::io::detail::caching_file_input_impl< Range, InputPtr >::caching_file_input_impl ( InputPtr  input = 0,
std::size_t  chunk_size = default_chunk_size,
std::size_t  buffer_size = default_buffer_size,
std::size_t  threshold = default_threshold 
)
template<class Range, class InputPtr>
psynth::io::detail::caching_file_input_impl< Range, InputPtr >::caching_file_input_impl ( caching_file_input_impl< Range, InputPtr > &&  other)
template<class Range, class InputPtr>
psynth::io::detail::caching_file_input_impl< Range, InputPtr >::~caching_file_input_impl ( )

Member Function Documentation

template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::do_seek ( std::ptrdiff_t  offst,
seek_dir  dir 
)
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::frame_rate ( ) const [inline, virtual]
template<class Range, class InputPtr>
const input_type& psynth::io::detail::caching_file_input_impl< Range, InputPtr >::input ( ) const [inline]
template<class Range, class InputPtr>
bool psynth::io::detail::caching_file_input_impl< Range, InputPtr >::is_backwards ( ) const [inline]
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::length ( ) const [inline, virtual]
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::run ( )
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::seek ( std::ptrdiff_t  pos,
seek_dir  dir 
) [virtual]
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::set_backwards ( bool  backwards)
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::set_chunk_size ( std::size_t  cs) [inline]
Todo:
Synchronization?
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::set_input ( InputPtr  ptr)
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::soft_seek ( std::size_t  pos)
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::start ( )
template<class Range, class InputPtr>
void psynth::io::detail::caching_file_input_impl< Range, InputPtr >::stop ( )
template<class Range, class InputPtr>
template<class Range2 >
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::take ( const Range2 &  buf)
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::take ( const range buf) [inline, virtual]

Member Data Documentation

template<class Range, class InputPtr>
bool psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_backwards
template<class Range, class InputPtr>
ring_buffer_type psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_buffer
template<class Range, class InputPtr>
std::mutex psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_buffer_mutex
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_buffer_size
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_chunk_size
template<class Range, class InputPtr>
std::condition_variable psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_cond
template<class Range, class InputPtr>
std::atomic<bool> psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_finished
template<class Range, class InputPtr>
InputPtr psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_input [protected]
template<class Range, class InputPtr>
std::mutex psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_input_mutex
template<class Range, class InputPtr>
std::ptrdiff_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_new_read_pos
template<class Range, class InputPtr>
ring_buffer_type::range& psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_range
template<class Range, class InputPtr>
std::ptrdiff_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_read_pos
template<class Range, class InputPtr>
ring_buffer_type::position psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_read_ptr
template<class Range, class InputPtr>
std::thread psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_thread
template<class Range, class InputPtr>
std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_threshold
template<class Range, class InputPtr>
input_buffer_type psynth::io::detail::caching_file_input_impl< Range, InputPtr >::_tmp_buffer
template<class Range, class InputPtr>
constexpr std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::default_buffer_size = 16384 [static]
template<class Range, class InputPtr>
constexpr std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::default_chunk_size = 1024 [static]
template<class Range, class InputPtr>
constexpr std::size_t psynth::io::detail::caching_file_input_impl< Range, InputPtr >::default_threshold = 4096 [static]

The documentation for this class was generated from the following file: