00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef CSHELLSYNTH_SQUARE_H
00026 #define CSHELLSYNTH_SQUARE_H 1
00027
00028 #include <jack/jack.h>
00029 #include <cshellsynth/atomic-types.h>
00030 #include <cshellsynth/synth.h>
00031
00041 typedef struct cs_square_struct {
00042 jack_client_t *client;
00043 jack_port_t *freq_port;
00044 atomic_float_t freq;
00045 jack_port_t *out_port;
00046 atomic_float_t amp;
00047 atomic_float_t offset;
00048 atomic_float_t duty_cycle;
00049 double t;
00050 } cs_square_t;
00051
00057 #define cs_square_destroy(cs_square) cs_synth_destroy((cs_synth_t *) (cs_square))
00058
00064 int cs_square_init(cs_square_t *self, const char *client_name, jack_options_t flags, char *server_name);
00065
00069 #define cs_square_set_freq(cs_square, freq) cs_synth_set_freq((cs_synth_t *) (cs_square), (freq))
00070
00074 #define cs_square_set_offset(cs_square, offset) cs_synth_set_offset((cs_synth_t *) (cs_square), (offset))
00075
00079 #define cs_square_set_amp(cs_square, amp) cs_synth_set_amp((cs_synth_t *) (cs_square), (amp))
00080
00088 void cs_square_set_duty_cycle(cs_square_t *self, float duty_cycle);
00089
00090 #endif