Exemplo n.º 1
0
static void
qsampler_set_handle (BstQSampler   *qsampler,
		     GslDataHandle *handle)
{
  GslDataCache *dcache = gsl_data_cache_new (handle, 1);
  
  gsl_data_cache_open (dcache);
  bst_qsampler_set_source (qsampler, gsl_data_handle_length (dcache->dhandle),
			   qsampler_dcache_filler, dcache, (GDestroyNotify) gsl_data_cache_close);
  gsl_data_cache_unref (dcache);
}
Exemplo n.º 2
0
static GslErrorType
dcache_handle_open (GslDataHandle      *dhandle,
		    GslDataHandleSetup *setup)
{
  DCacheHandle *chandle = (DCacheHandle*) dhandle;
  GslErrorType error;

  error = gsl_data_handle_open (chandle->dcache->dhandle);
  if (error != GSL_ERROR_NONE)
    return error;
  gsl_data_cache_open (chandle->dcache);
  *setup = chandle->dcache->dhandle->setup;
  gsl_data_handle_close (chandle->dcache->dhandle);

  return GSL_ERROR_NONE;
}