Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
gsldatahandle.cc File Reference
#include "gsldatahandle.hh"
#include "gslcommon.hh"
#include "gsldatacache.hh"
#include "gsldatautils.hh"
#include "gslfilehash.hh"
#include <string.h>
#include <errno.h>
Include dependency graph for gsldatahandle.cc:

Typedefs

typedef ChainHandle ReversedHandle
 

Functions

gboolean gsl_data_handle_common_init (GslDataHandle *dhandle, const gchar *file_name)
 
GslDataHandle * gsl_data_handle_ref (GslDataHandle *dhandle)
 
void gsl_data_handle_common_free (GslDataHandle *dhandle)
 
void gsl_data_handle_unref (GslDataHandle *dhandle)
 
Bse::Error gsl_data_handle_open (GslDataHandle *dhandle)
 
void gsl_data_handle_close (GslDataHandle *dhandle)
 
int64 gsl_data_handle_read (GslDataHandle *dhandle, int64 value_offset, int64 n_values, gfloat *values)
 
GslDataHandle * gsl_data_handle_get_source (GslDataHandle *dhandle)
 
int64 gsl_data_handle_get_state_length (GslDataHandle *dhandle)
 
int64 gsl_data_handle_length (GslDataHandle *dhandle)
 
guint gsl_data_handle_n_channels (GslDataHandle *dhandle)
 
guint gsl_data_handle_bit_depth (GslDataHandle *dhandle)
 
gfloat gsl_data_handle_mix_freq (GslDataHandle *dhandle)
 
gfloat gsl_data_handle_osc_freq (GslDataHandle *dhandle)
 
gfloat gsl_data_handle_volume (GslDataHandle *dhandle)
 
gfloat gsl_data_handle_fine_tune (GslDataHandle *dhandle)
 
const gchar * gsl_data_handle_name (GslDataHandle *dhandle)
 
gboolean gsl_data_handle_needs_cache (GslDataHandle *dhandle)
 
GslDataHandle * gsl_data_handle_new_mem (guint n_channels, guint bit_depth, gfloat mix_freq, gfloat osc_freq, int64 n_values, const gfloat *values, void(*free)(gpointer values))
 
GslDataHandle * gsl_data_handle_new_add_xinfos (GslDataHandle *src_handle, gchar **xinfos)
 
GslDataHandle * gsl_data_handle_new_remove_xinfos (GslDataHandle *src_handle, gchar **xinfos)
 
GslDataHandle * gsl_data_handle_new_clear_xinfos (GslDataHandle *src_handle)
 
GslDataHandle * gsl_data_handle_new_reverse (GslDataHandle *src_handle)
 
GslDataHandle * gsl_data_handle_new_scale (GslDataHandle *src_handle, double factor)
 
GslDataHandle * gsl_data_handle_new_cut (GslDataHandle *src_handle, int64 cut_offset, int64 n_cut_values)
 
GslDataHandle * gsl_data_handle_new_crop (GslDataHandle *src_handle, int64 n_head_cut, int64 n_tail_cut)
 
GslDataHandle * gsl_data_handle_new_insert (GslDataHandle *src_handle, guint paste_bit_depth, int64 insertion_offset, int64 n_paste_values, const gfloat *paste_values, void(*free)(gpointer values))
 
GslDataHandle * gsl_data_handle_new_looped (GslDataHandle *src_handle, int64 loop_first, int64 loop_last)
 
GslDataHandle * gsl_data_handle_new_dcached (GslDataCache *dcache)
 
guint gsl_wave_format_bit_depth (GslWaveFormatType format)
 
guint gsl_wave_format_byte_width (GslWaveFormatType format)
 
GslDataHandle * gsl_wave_handle_new (const gchar *file_name, guint n_channels, GslWaveFormatType format, guint byte_order, gfloat mix_freq, gfloat osc_freq, int64 byte_offset, int64 n_values, gchar **xinfos)
 
GslDataHandle * gsl_wave_handle_new_zoffset (const gchar *file_name, guint n_channels, GslWaveFormatType format, guint byte_order, gfloat mix_freq, gfloat osc_freq, int64 byte_offset, int64 byte_size, gchar **xinfos)
 
const gchar * gsl_wave_format_to_string (GslWaveFormatType format)
 
GslWaveFormatType gsl_wave_format_from_string (const gchar *string)
 

Function Documentation

int64 gsl_data_handle_get_state_length ( GslDataHandle *  dhandle)
Parameters
data_handlea DataHandle
Returns
the state length of the data handle

Most data handles produce output samples from an input data handle. Some of them, like filtering and resampling datahandles, have an internal state which means that the value of one input sample affects not only one output sample, but some samples before and/or some samples after the "corresponding" output sample.

Often the state is symmetric, so that the number of output samples affected before and after the "corresponding" output sample is the same. Then the function returns this number. If the state is asymmetric, this function shall return the maximum of the two numbers.

If multiple data handles are nested (for instance when resampling a filtered signal), the function propagates the state length, so that the accumulated state length of all operations together is returned.

Note: This function can only be used while the data handle is opened.

This function is MT-safe and may be called from any thread.

Referenced by gsl_data_handle_get_state_length(), and gsl_data_handle_new_crop().

Here is the call graph for this function:

Here is the caller graph for this function:

GslDataHandle* gsl_data_handle_new_crop ( GslDataHandle *  src_handle,
int64  n_head_cut,
int64  n_tail_cut 
)
Parameters
src_handlesource GslDataHandle
n_head_cutnumber of values to cut at data handle head
n_tail_cutnumber of values to cut at data handle tail
Returns
a newly created data handle

Create a new data handle containing the contents of src_handle minus n_head_cut values at the start and n_tail_cut values at the end.

Referenced by gsl_data_clip_sample().

Here is the call graph for this function:

Here is the caller graph for this function:

GslDataHandle* gsl_data_handle_new_cut ( GslDataHandle *  src_handle,
int64  cut_offset,
int64  n_cut_values 
)
Parameters
src_handlesource GslDataHandle
cut_offsetoffset of gap into src_handle
n_cut_valueslength of gap in src_handle
Returns
a newly created data handle

Create a new data handle containing the contents of src_handle minus n_cut_values at offset cut_offset.