00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef CSHELLSYNTH_SEQUENCER_H
00026 #define CSHELLSYNTH_SEQUENCER_H 1
00027
00028 #include <jack/jack.h>
00029 #include <stdbool.h>
00030 #include <cshellsynth/atomic-types.h>
00031 #include <cshellsynth/controller.h>
00032
00036 typedef struct cs_seq_sequence_struct {
00037 float offset;
00038 float length;
00039 float **seq;
00040 bool started;
00041 bool repeat;
00042 } cs_seq_sequence_t;
00043
00053 typedef struct cs_seq_struct {
00054 jack_client_t *client;
00055 jack_port_t *ctl_port;
00056 jack_port_t *out_port;
00057 jack_port_t *clock_port;
00058 float last;
00059 float offset;
00060 float **current;
00061 float out;
00062 bool playing;
00063 cs_seq_sequence_t *curr_seq;
00064 atomic_ptr_t next_seq;
00065 } cs_seq_t;
00066
00072 int cs_seq_destroy(cs_seq_t *self);
00073
00079 int cs_seq_init(cs_seq_t *self, const char *client_name, jack_options_t flags, char *server_name);
00080
00094 int cs_seq_make_sequence(cs_seq_t *self, float offset, float length, size_t sequence_length, const float sequence[][3], bool repeat);
00095
00100 int cs_seq_make_sequence_ll(cs_seq_t *self, float offset, float length, float **sequence, bool repeat);
00101
00107 #define cs_seq_sequence(self, offset, length, sequence_length, sequence) cs_seq_make_sequence(self, offset, length, sequence_length, sequence, true);
00108
00114 #define cs_seq_sequence_once(self, offset, length, sequence_length, sequence) cs_seq_make_sequence(self, offset, length, sequence_length, sequence, false);
00115
00116 #endif