*
*/
-// #define USE_GTK
-
#include "ivac.h"
int usage(void) {
puts("-h \t\t show this help");
puts("-n <name> \t specify your name");
puts("-p <port> \t specify port to listen for incoming connections");
+ puts("-u <port> \t specify udp data port");
puts("-d <device> \t specify audio device");
puts("");
/* default values */
strcpy(ivac.username,"ivac");
ivac.net.l_port=IVAC_LISTEN_PORT;
+ ivac.net.l_udp_port=IVAC_UDP_PORT;
strcpy(ivac.audio.dsp_dev,SOUND_DEVICE);
/* parse argv and change default values */
case 'p':
ivac.net.l_port=atoi(argv[++i]);
break;
+ case 'u':
+ ivac.net.l_udp_port=atoi(argv[++i]);
+ break;
case 'd':
strncpy(ivac.audio.dsp_dev,argv[++i],MAX_CHAR_DEVICE);
break;
ivac_shutdown(&ivac);
return ERROR;
}
+ network_udp_listen_init(&(ivac.net));
- /* add listening port + stdin to (read) event system */
+ /* add listening port(s) + stdin to (read) event system */
event_math(ivac.net.l_fd,&(ivac.event),READ,ADD);
+ event_math(ivac.net.l_udp_fd,&(ivac.event),READ,ADD);
event_math(0,&(ivac.event),READ,ADD);
/* display init */
int ivac_shutdown(t_ivac *ivac) {
network_shutdown(&(ivac->net));
+ network_udp_shutdown(&(ivac->net));
input_shutdown(&(ivac->input));
event_stop(&(ivac->event));
audio_shutdown(&(ivac->audio));