00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CSHELLSYNTH_SAMPLER_H
00029 #define CSHELLSYNTH_SAMPLER_H 1
00030
00031 #include <jack/jack.h>
00032 #include <cshellsynth/atomic-types.h>
00033 #include <cshellsynth/jclient.h>
00034 #include <stdbool.h>
00035 #include <sndfile.h>
00036
00037 typedef struct cs_sampler_sndfile_struct {
00038 SNDFILE *sf;
00039 SF_INFO sf_info;
00040 } cs_sampler_sf_t;
00041
00049 typedef struct cs_sampler_struct {
00050 jack_client_t *client;
00051 jack_port_t *ctl_port;
00052 jack_port_t *outL_port;
00053 jack_port_t *outR_port;
00054 atomic_ptr_t sf;
00055 atomic_t sf_sync;
00056 bool playing;
00057 } cs_sampler_t;
00058
00064 int cs_sampler_destroy(cs_sampler_t *self);
00065
00071 int cs_sampler_init(cs_sampler_t *self, const char *client_name, jack_options_t flags, char *server_name);
00072
00079 int cs_sampler_load(cs_sampler_t *self, char *path);
00080
00081 #endif