tl_procession *init_procession(void){ tl_procession *x = malloc(sizeof(tl_procession)); x->class_head = init_class(); x->ctl_head = init_ctl(TL_HEAD_CTL); x->lvl_stck = init_lvl_stck(); x->ab_in = init_audio_buff(TL_MAXCHANNS); x->ab_out = init_audio_buff(TL_MAXCHANNS); return x; }
void tl_init_dac(int in_cnt, int up){ printf("creating dac...\n"); // think more about this policy // later ... // one idea is to have a module called dac_bus // that simply looks like a [dac~] in Pd and directs // its output to 'the' tl_dac /* if(tl_dac_cnt > 0) */ /* { */ /* printf("error: tl_dac_init: only one dac allowed\n"); */ /* return(NULL); */ /* } */ tl_g_dac = (tl_dac *)malloc(sizeof(tl_dac)); tl_g_dac->dsp_func = &tl_dsp_dac; tl_g_dac->kill_func = &tl_kill_dac; tl_g_dac->inlets = init_sigs(in_cnt, TL_INLET, 1); tl_g_dac->in_cnt = in_cnt; tl_g_dac->sr = tl_get_samplerate(); //tl_dac_cnt++; // again, we are presuming only one dac at a time ... set_g_out_chann_cnt(in_cnt); tl_g_dac->ab = init_audio_buff(in_cnt); set_g_audio_buff_out(tl_g_dac->ab); }
//initializes audio buffer int initAudio(char* fname) { alt_up_sd_card_dev *device_reference = NULL; device_reference = alt_up_sd_card_open_dev(SD_CARD_NAME); open_sd(); av_config_setup(); init_audio_buff(ab); ab->audio = alt_up_audio_open_dev(AUDIO_0_NAME); alt_up_audio_reset_audio_core(ab->audio); file_handle = alt_up_sd_card_fopen(fname, 0); offset(file_handle, ab); fill_buff(file_handle, ab); return file_handle; }
void resize_audio_buff_block_len(tl_audio_buff *x){ int channs = x->channs; kill_audio_buff(x); x = init_audio_buff(channs); }
void resize_audio_buff_channs(tl_audio_buff *x, int channs){ // will this work? kill_audio_buff(x); x = init_audio_buff(channs); }