[PD-cvs] pd/src s_audio_jack.c,1.5.4.8.2.7.2.11,1.5.4.8.2.7.2.12
Mathieu Bouchard
matju at users.sourceforge.net
Thu Jul 19 23:09:20 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15757
Modified Files:
Tag: desiredata
s_audio_jack.c
Log Message:
cleanup
Index: s_audio_jack.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_jack.c,v
retrieving revision 1.5.4.8.2.7.2.11
retrieving revision 1.5.4.8.2.7.2.12
diff -C2 -d -r1.5.4.8.2.7.2.11 -r1.5.4.8.2.7.2.12
*** s_audio_jack.c 12 Jul 2007 00:05:30 -0000 1.5.4.8.2.7.2.11
--- s_audio_jack.c 19 Jul 2007 21:09:18 -0000 1.5.4.8.2.7.2.12
***************
*** 86,106 ****
}
for (int i = 0; i != dspticks_per_jacktick; ++i) {
- /* get sound from the inputs */
for (int j=0; j<sys_inchannels; j++) {
t_sample *in = (t_sample *)jack_port_get_buffer(input_port[j], nframes);
copyblock(sys_soundin + j * sys_dacblocksize, in + i * sys_dacblocksize, sys_dacblocksize);
}
- /* run dsp */
sched_tick(sys_time + sys_time_per_dsp_tick);
! /* send sound to the output */
! int j;
! for (j=0; j<sys_outchannels; j++) {
t_sample *out = (t_sample *)jack_port_get_buffer (output_port[j], nframes);
copyblock(out + i * sys_dacblocksize, sys_soundout + j * sys_dacblocksize, sys_dacblocksize);
}
- /* update peak meters */
if (sys_meters) sys_peakmeters();
! /* clear the output buffer */
! zeroblock(sys_soundout, j * sys_dacblocksize);
}
run_all_idle_callbacks();
--- 86,100 ----
}
for (int i = 0; i != dspticks_per_jacktick; ++i) {
for (int j=0; j<sys_inchannels; j++) {
t_sample *in = (t_sample *)jack_port_get_buffer(input_port[j], nframes);
copyblock(sys_soundin + j * sys_dacblocksize, in + i * sys_dacblocksize, sys_dacblocksize);
}
sched_tick(sys_time + sys_time_per_dsp_tick);
! for (int j=0; j<sys_outchannels; j++) {
t_sample *out = (t_sample *)jack_port_get_buffer (output_port[j], nframes);
copyblock(out + i * sys_dacblocksize, sys_soundout + j * sys_dacblocksize, sys_dacblocksize);
}
if (sys_meters) sys_peakmeters();
! zeroblock(sys_soundout, sys_outchannels * sys_dacblocksize);
}
run_all_idle_callbacks();
***************
*** 141,145 ****
/* Build a list of clients from the list of ports */
for (int i=0; jack_ports[i] != 0; i++) {
- int client_seen;
regmatch_t match_info;
char tmp_client_name[100];
--- 135,138 ----
***************
*** 149,153 ****
tmp_client_name[ match_info.rm_eo - match_info.rm_so ] = '\0';
/* do we know about this port's client yet? */
! client_seen = 0;
for (int j=0; j<num_clients; j++) if (strcmp(tmp_client_name, jack_client_names[j])==0) client_seen = 1;
if (!client_seen) {
--- 142,146 ----
tmp_client_name[ match_info.rm_eo - match_info.rm_so ] = '\0';
/* do we know about this port's client yet? */
! int client_seen = 0;
for (int j=0; j<num_clients; j++) if (strcmp(tmp_client_name, jack_client_names[j])==0) client_seen = 1;
if (!client_seen) {
***************
*** 354,364 ****
for (int i=0; i<NUM_JACK_PORTS; i++) {
/* saving the inputs connections */
! if (jack_in_connections[i]) free(jack_in_connections[i]);
! if (i < sys_inchannels) jack_in_connections[i] = jack_port_get_all_connections(jack_client, input_port[i]);
! else jack_in_connections[i] = 0;
/* saving the outputs connections */
if (jack_out_connections[i]) free(jack_out_connections[i]);
! if (i < sys_outchannels) jack_out_connections[i] = jack_port_get_all_connections(jack_client, output_port[i]);
! else jack_out_connections[i] = 0;
}
return 0;
--- 347,355 ----
for (int i=0; i<NUM_JACK_PORTS; i++) {
/* saving the inputs connections */
! if ( jack_in_connections[i]) free( jack_in_connections[i]);
! jack_in_connections[i] = i< sys_inchannels ? jack_port_get_all_connections(jack_client, input_port[i]) : 0;
/* saving the outputs connections */
if (jack_out_connections[i]) free(jack_out_connections[i]);
! jack_out_connections[i]= i<sys_outchannels ? jack_port_get_all_connections(jack_client, output_port[i]) : 0;
}
return 0;
***************
*** 372,379 ****
if (jack_in_connections[i]) {
for (int j=0;;j++) {
! const char *src_port = jack_in_connections[i][j];
! if (!src_port) break; /* we've connected all incoming ports */
! int status = jack_connect(jack_client, src_port, jack_port_name(input_port[i]));
! if (status) post("cannot connect input ports %s -> %s", src_port, jack_port_name (input_port[i]));
}
}
--- 363,370 ----
if (jack_in_connections[i]) {
for (int j=0;;j++) {
! const char *port = jack_in_connections[i][j];
! if (!port) break; /* we've connected all incoming ports */
! int status = jack_connect(jack_client, port, jack_port_name(input_port[i]));
! if (status) post("cannot connect input ports %s -> %s", port, jack_port_name (input_port[i]));
}
}
***************
*** 381,388 ****
if (jack_out_connections[i]) {
for (int j=0;;j++) {
! const char *dst_port = jack_out_connections[i][j];
! if (!dst_port) break; /* we've connected all outgoing ports */
! int status = jack_connect(jack_client, jack_port_name(output_port[i]), dst_port);
! if (status) post("cannot connect output ports %s -> %s", jack_port_name(output_port[i]), dst_port);
}
}
--- 372,379 ----
if (jack_out_connections[i]) {
for (int j=0;;j++) {
! const char *port = jack_out_connections[i][j];
! if (!port) break; /* we've connected all outgoing ports */
! int status = jack_connect(jack_client, jack_port_name(output_port[i]), port);
! if (status) post("cannot connect output ports %s -> %s", jack_port_name(output_port[i]), port);
}
}
More information about the Pd-cvs
mailing list