[PD-cvs] pd/src d_soundfile.c,1.1.1.2.2.1,1.1.1.2.2.2 g_editor.c,1.1.1.4.2.3,1.1.1.4.2.4 g_mycanvas.c,1.1.1.3.2.2,1.1.1.3.2.3 g_text.c,1.1.1.4.2.2,1.1.1.4.2.3 m_glob.c,1.1.1.2.2.5,1.1.1.2.2.6 m_sched.c,1.1.1.2.2.7,1.1.1.2.2.8 s_audio.c,1.1.1.1.2.7,1.1.1.1.2.8 s_audio_alsa.c,1.1.1.1.2.6,1.1.1.1.2.7 s_audio_mmio.c,1.1.1.1.2.2,1.1.1.1.2.3 s_inter.c,1.1.1.3.2.9,1.1.1.3.2.10 s_main.c,1.1.1.4.2.10,1.1.1.4.2.11

ggeiger at users.sourceforge.net ggeiger at users.sourceforge.net
Sun Feb 22 18:36:54 CET 2004


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14470

Modified Files:
      Tag: devel_0_37
	d_soundfile.c g_editor.c g_mycanvas.c g_text.c m_glob.c 
	m_sched.c s_audio.c s_audio_alsa.c s_audio_mmio.c s_inter.c 
	s_main.c 
Log Message:
merged in version 0.37-1test6

Index: d_soundfile.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v
retrieving revision 1.1.1.2.2.1
retrieving revision 1.1.1.2.2.2
diff -C2 -d -r1.1.1.2.2.1 -r1.1.1.2.2.2
*** d_soundfile.c	8 Jul 2003 09:48:57 -0000	1.1.1.2.2.1
--- d_soundfile.c	22 Feb 2004 17:36:50 -0000	1.1.1.2.2.2
***************
*** 541,545 ****
  	else if (!strcmp(flag, "little"))
  	{
! 	    endianness = 1;
  	    argc -= 1; argv += 1;
  	}
--- 541,545 ----
  	else if (!strcmp(flag, "little"))
  	{
! 	    endianness = 0;
  	    argc -= 1; argv += 1;
  	}
***************
*** 671,675 ****
      	wavehdr->w_navgbytespersec =
  	    swap4((int)(samplerate * nchannels * bytespersamp), swap);
!     	wavehdr->w_nblockalign = swap2(bytespersamp, swap);
      	wavehdr->w_nbitspersample = swap2(8 * bytespersamp, swap);
      	strncpy(wavehdr->w_datachunkid, "data", 4);
--- 671,675 ----
      	wavehdr->w_navgbytespersec =
  	    swap4((int)(samplerate * nchannels * bytespersamp), swap);
!     	wavehdr->w_nblockalign = swap2(nchannels * bytespersamp, swap);
      	wavehdr->w_nbitspersample = swap2(8 * bytespersamp, swap);
      	strncpy(wavehdr->w_datachunkid, "data", 4);
***************
*** 730,733 ****
--- 730,746 ----
      	    	goto baddonewrite;
  	}
+ 	if (filetype == FORMAT_NEXT)
+ 	{
+ 	    /* do it the lazy way: just set the size field to 'unknown size'*/
+ 	    uint32 nextsize = 0xffffffff;
+ 	    if (lseek(fd, 8, SEEK_SET) == 0)
+ 	    {
+ 	        goto baddonewrite;
+ 	    }
+ 	    if (write(fd, &nextsize, 4) < 4)
+ 	    {
+ 	        goto baddonewrite;
+ 	    }
+ 	}
      }
      return;

Index: g_editor.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v
retrieving revision 1.1.1.4.2.3
retrieving revision 1.1.1.4.2.4
diff -C2 -d -r1.1.1.4.2.3 -r1.1.1.4.2.4
*** g_editor.c	25 Nov 2003 19:19:57 -0000	1.1.1.4.2.3
--- g_editor.c	22 Feb 2004 17:36:50 -0000	1.1.1.4.2.4
***************
*** 1472,1475 ****
--- 1472,1477 ----
  	pd_list(keynamesym->s_thing, 0, 2, at);
      }
+     if (!x->gl_editor)	/* if that 'invis'ed the window, we'd better stop. */
+     	return;
      if (x && down)
      {

Index: g_mycanvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v
retrieving revision 1.1.1.3.2.2
retrieving revision 1.1.1.3.2.3
diff -C2 -d -r1.1.1.3.2.2 -r1.1.1.3.2.3
*** g_mycanvas.c	18 Nov 2003 10:34:10 -0000	1.1.1.3.2.2
--- g_mycanvas.c	22 Feb 2004 17:36:50 -0000	1.1.1.3.2.3
***************
*** 299,303 ****
  	    the slot x_labelbindex) and initialize it specially here. */
      	iemgui_new_dogetname(&x->x_gui, i+3, argv);
! 	x->x_gui.x_labelbindex = i+3;
  	ldx = (int)atom_getintarg(i+4, argc, argv);
  	ldy = (int)atom_getintarg(i+5, argc, argv);
--- 299,303 ----
  	    the slot x_labelbindex) and initialize it specially here. */
      	iemgui_new_dogetname(&x->x_gui, i+3, argv);
! 	x->x_gui.x_labelbindex = i+4;
  	ldx = (int)atom_getintarg(i+4, argc, argv);
  	ldy = (int)atom_getintarg(i+5, argc, argv);

Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.1.1.4.2.2
retrieving revision 1.1.1.4.2.3
diff -C2 -d -r1.1.1.4.2.2 -r1.1.1.4.2.3
*** g_text.c	12 Sep 2003 20:55:31 -0000	1.1.1.4.2.2
--- g_text.c	22 Feb 2004 17:36:50 -0000	1.1.1.4.2.3
***************
*** 493,497 ****
      	if (x->a_text.te_outlet)
      	    outlet_symbol(x->a_text.te_outlet, x->a_atom.a_w.w_symbol);
! 	if (*x->a_symto->s_name && x->a_symto->s_thing)
  	{
  	    if (x->a_symto == x->a_symfrom)
--- 493,497 ----
      	if (x->a_text.te_outlet)
      	    outlet_symbol(x->a_text.te_outlet, x->a_atom.a_w.w_symbol);
! 	if (*x->a_symto->s_name && x->a_expanded_to->s_thing)
  	{
  	    if (x->a_symto == x->a_symfrom)

Index: m_glob.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_glob.c,v
retrieving revision 1.1.1.2.2.5
retrieving revision 1.1.1.2.2.6
diff -C2 -d -r1.1.1.2.2.5 -r1.1.1.2.2.6
*** m_glob.c	22 Feb 2004 05:52:16 -0000	1.1.1.2.2.5
--- m_glob.c	22 Feb 2004 17:36:51 -0000	1.1.1.2.2.6
***************
*** 101,105 ****
      class_addmethod(glob_pdobject, (t_method)glob_tooltips,
      	gensym("tooltips"), A_DEFFLOAT, 0);
! #ifdef UNIX
      class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0);
  #endif
--- 101,105 ----
      class_addmethod(glob_pdobject, (t_method)glob_tooltips,
      	gensym("tooltips"), A_DEFFLOAT, 0);
! #ifdef __linux__
      class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0);
  #endif

Index: m_sched.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v
retrieving revision 1.1.1.2.2.7
retrieving revision 1.1.1.2.2.8
diff -C2 -d -r1.1.1.2.2.7 -r1.1.1.2.2.8
*** m_sched.c	14 Jan 2004 15:50:28 -0000	1.1.1.2.2.7
--- m_sched.c	22 Feb 2004 17:36:51 -0000	1.1.1.2.2.8
***************
*** 266,270 ****
      	/* if there's no GUI but we're running in "realtime", here is
  	where we arrange to ping the watchdog every 2 seconds. */
! #ifdef UNIX
      if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0))
      {
--- 266,270 ----
      	/* if there's no GUI but we're running in "realtime", here is
  	where we arrange to ping the watchdog every 2 seconds. */
! #ifdef __linux__
      if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0))
      {

Index: s_audio.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v
retrieving revision 1.1.1.1.2.7
retrieving revision 1.1.1.1.2.8
diff -C2 -d -r1.1.1.1.2.7 -r1.1.1.1.2.8
*** s_audio.c	14 Jan 2004 15:50:28 -0000	1.1.1.1.2.7
--- s_audio.c	22 Feb 2004 17:36:51 -0000	1.1.1.1.2.8
***************
*** 43,47 ****
--- 43,53 ----
  int sys_schedadvance; 	/* scheduler advance in microseconds */
  float sys_dacsr;
+ 
+ #ifdef MACOSX
+ int sys_hipriority = 1;
+ #else
  int sys_hipriority = 0;
+ #endif
+ 
  t_sample *sys_soundout;
  t_sample *sys_soundin;

Index: s_audio_alsa.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_alsa.c,v
retrieving revision 1.1.1.1.2.6
retrieving revision 1.1.1.1.2.7
diff -C2 -d -r1.1.1.1.2.6 -r1.1.1.1.2.7
*** s_audio_alsa.c	22 Feb 2004 16:40:40 -0000	1.1.1.1.2.6
--- s_audio_alsa.c	22 Feb 2004 17:36:51 -0000	1.1.1.1.2.7
***************
*** 843,847 ****
  	    }
  	    defect = indelay + outdelay - alsa_buf_samps;
! 	    if (defect < -DEFDACBLKSIZE)
      	    {
  		checkit = 1;
--- 843,847 ----
  	    }
  	    defect = indelay + outdelay - alsa_buf_samps;
! 	    if (defect < -(3 * DEFDACBLKSIZE / 2) )
      	    {
  		checkit = 1;
***************
*** 861,868 ****
  }
  
- void alsa_listdevs( void)
- {
-     post("device listing not implemented in ALSA yet\n");
- }
  
  static int alsa_nnames = 0;
--- 861,864 ----

Index: s_audio_mmio.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_mmio.c,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.3
diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3
*** s_audio_mmio.c	12 Sep 2003 21:02:15 -0000	1.1.1.1.2.2
--- s_audio_mmio.c	22 Feb 2004 17:36:51 -0000	1.1.1.1.2.3
***************
*** 33,37 ****
  #define DEFBUFFER 30	/* default is about 30x6 = 180 msec! */
  static int nt_naudiobuffer = DEFBUFFER;
- 
  float sys_dacsr = DEFAULTSRATE;
  
--- 33,36 ----
***************
*** 114,118 ****
  }
  
- static int nt_inalloc[NAPORTS], nt_outalloc[NAPORTS];
  static UINT nt_whichdac = WAVE_MAPPER, nt_whichadc = WAVE_MAPPER;
  
--- 113,116 ----
***************
*** 120,127 ****
  { 
      PCMWAVEFORMAT  form; 
!     int i;
      UINT mmresult;
      int nad, nda;
! 
      if (sys_verbose)
      	post("%d devices in, %d devices out",
--- 118,125 ----
  { 
      PCMWAVEFORMAT  form; 
!     int i, j;
      UINT mmresult;
      int nad, nda;
!     static int naudioprepped = 0, nindevsprepped = 0, noutdevsprepped = 0;
      if (sys_verbose)
      	post("%d devices in, %d devices out",
***************
*** 137,140 ****
--- 135,164 ----
      if (nt_nwavein <= 1 && nt_nwaveout <= 1)
      	nt_noresync();
+ 
+     if (nindevsprepped < nt_nwavein)
+     {
+     	for (i = nindevsprepped; i < nt_nwavein; i++)
+     	    for (j = 0; j < nt_naudiobuffer; j++)
+ 	    	wave_prep(&ntsnd_invec[i][j]);
+     	nindevsprepped = nt_nwavein;
+     }
+     if (noutdevsprepped < nt_nwaveout)
+     {
+     	for (i = noutdevsprepped; i < nt_nwaveout; i++)
+     	    for (j = 0; j < nt_naudiobuffer; j++)
+ 	    	wave_prep(&ntsnd_outvec[i][j]);
+     	noutdevsprepped = nt_nwaveout;
+     }
+     if (naudioprepped < nt_naudiobuffer)
+     {
+     	for (j = naudioprepped; j < nt_naudiobuffer; j++)
+ 	{
+     	    for (i = 0; i < nt_nwavein; i++)
+ 	    	wave_prep(&ntsnd_invec[i][j]);
+     	    for (i = 0; i < nt_nwaveout; i++)
+ 	    	wave_prep(&ntsnd_outvec[i][j]);
+     	}
+ 	naudioprepped = nt_naudiobuffer;
+     }
      for (nad=0; nad < nt_nwavein; nad++)
      {
***************
*** 155,164 ****
  	else 
  	{
- 	    if (!nt_inalloc[nad])
- 	    {
- 		for (i = 0; i < nt_naudiobuffer; i++)
- 	    	    wave_prep(&ntsnd_invec[nad][i]);
- 		nt_inalloc[nad] = 1;
- 	    }
  	    for (i = 0; i < nt_naudiobuffer; i++)
  	    {
--- 179,182 ----
***************
*** 175,184 ****
      }
      	/* quickly start them all together */
!     for(nad=0; nad < nt_nwavein; nad++)
      	waveInStart(ntsnd_indev[nad]);
  
!     for(nda=0; nda < nt_nwaveout; nda++)
!     {
!     	
      	    /* Open a waveform device for output in sucessiv device numbering*/
      	mmresult = waveOutOpen(&ntsnd_outdev[nda], nt_whichdac + nda,
--- 193,201 ----
      }
      	/* quickly start them all together */
!     for (nad = 0; nad < nt_nwavein; nad++)
      	waveInStart(ntsnd_indev[nad]);
  
!     for (nda = 0; nda < nt_nwaveout; nda++)
!     {	
      	    /* Open a waveform device for output in sucessiv device numbering*/
      	mmresult = waveOutOpen(&ntsnd_outdev[nda], nt_whichdac + nda,
***************
*** 195,211 ****
              nt_nwaveout = nda;
      	}
- 	else
- 	{
- 	    if (!(nt_outalloc[nda]))
- 	    {
- 	    	for (i = 0; i < nt_naudiobuffer; i++)
- 	    	{
-     	    	    wave_prep(&ntsnd_outvec[nda][i]);
- 	    	    	    /* set DONE flag as if we had queued them */
-     	    	    ntsnd_outvec[nda][i].lpWaveHdr->dwFlags = WHDR_DONE;
-     	    	}
-     	    	nt_outalloc[nda] = 1;
- 	    }
-     	}
      }
  
--- 212,215 ----

Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.1.1.3.2.9
retrieving revision 1.1.1.3.2.10
diff -C2 -d -r1.1.1.3.2.9 -r1.1.1.3.2.10
*** s_inter.c	21 Jan 2004 19:53:04 -0000	1.1.1.3.2.9
--- s_inter.c	22 Feb 2004 17:36:51 -0000	1.1.1.3.2.10
***************
*** 530,533 ****
--- 530,534 ----
  static int sys_watchfd;
  
+ #ifdef __linux__
  void glob_ping(t_pd *dummy)
  {
***************
*** 538,541 ****
--- 539,543 ----
      }
  }
+ #endif
  
  static int defaultfontshit[] = {
***************
*** 636,640 ****
  	if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY,
      	    &intarg, sizeof(intarg)) < 0)
!     		post("setsockopt (TCP_NODELAY) failed\n");
  	
  	
--- 638,645 ----
  	if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY,
      	    &intarg, sizeof(intarg)) < 0)
! #ifndef MSW
!     		post("setsockopt (TCP_NODELAY) failed\n")
! #endif
!     	    	    ;
  	
  	
***************
*** 743,747 ****
      	    /* in MSW land "guipath" is unused; we just do everything from
  	    the libdir. */
!     	fprintf(stderr, "%s\n", sys_libdir->s_name);
      	
      	strcpy(scriptbuf, "\"");
--- 748,752 ----
      	    /* in MSW land "guipath" is unused; we just do everything from
  	    the libdir. */
!     	/* fprintf(stderr, "%s\n", sys_libdir->s_name); */
      	
      	strcpy(scriptbuf, "\"");
***************
*** 842,845 ****
--- 847,851 ----
  #endif
  #ifdef MACOSX
+     if (sys_hipriority)
      {
  	struct sched_param param;
***************
*** 873,878 ****
--- 879,886 ----
  
  	    /* here is where we start the pinging. */
+ #ifdef __linux__
  	if (sys_hipriority)
      	    sys_gui("pdtk_watchdog\n");
+ #endif
      	sys_get_audio_apis(buf);
  	sys_vgui("pdtk_pd_startup {%s} %s\n", pd_version, buf); 

Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.1.1.4.2.10
retrieving revision 1.1.1.4.2.11
diff -C2 -d -r1.1.1.4.2.10 -r1.1.1.4.2.11
*** s_main.c	21 Feb 2004 22:05:20 -0000	1.1.1.4.2.10
--- s_main.c	22 Feb 2004 17:36:51 -0000	1.1.1.4.2.11
***************
*** 233,238 ****
  }
  
! static void sys_addextrapath(void);
! static void sys_addreferencepath(void);
  
  /* this is called from main() in s_entry.c */
--- 233,237 ----
  }
  
! static void sys_afterargparse(void);
  
  /* this is called from main() in s_entry.c */
***************
*** 248,254 ****
      sys_rcfile();                               /* parse the startup file */
  #endif
!     if (sys_argparse(argc, argv)) return (1);	/* parse cmd line */
!     sys_addextrapath();
!     sys_addreferencepath();
      if (sys_verbose || sys_version) fprintf(stderr, "%scompiled %s %s\n",
      	pd_version, pd_compiletime, pd_compiledate);
--- 247,253 ----
      sys_rcfile();                               /* parse the startup file */
  #endif
!     if (sys_argparse(argc, argv))   	    /* parse cmd line */
!     	return (1);
!     sys_afterargparse();    	    	    /* post-argparse settings */
      if (sys_verbose || sys_version) fprintf(stderr, "%scompiled %s %s\n",
      	pd_version, pd_compiletime, pd_compiledate);
***************
*** 355,360 ****
  "-guicmd \"cmd...\" -- substitute another GUI program (e.g., rsh)\n",
  "-send \"msg...\"   -- send a message at startup (after patches are loaded)\n",
! #ifdef __linux__
! "-rt or -realtime -- use real-time priority (needs root privilege)\n",
  #endif
  };
--- 354,360 ----
  "-guicmd \"cmd...\" -- substitute another GUI program (e.g., rsh)\n",
  "-send \"msg...\"   -- send a message at startup (after patches are loaded)\n",
! #ifdef UNIX
! "-rt or -realtime -- use real-time priority\n",
! "-nrt             -- don't use real-time priority\n",
  #endif
  };
***************
*** 485,497 ****
  }
  
  int sys_argparse(int argc, char **argv)
  {
      char sbuf[MAXPDSTRING];
      int i;
- #ifdef MSW
-     int mmio = 1;
- #else
-     int mmio = 0;
- #endif
      argc--; argv++;
      while ((argc > 0) && **argv == '-')
--- 485,498 ----
  }
  
+ #ifdef MSW
+ static int sys_mmio = 1;
+ #else
+ static int sys_mmio = 0;
+ #endif
+ 
  int sys_argparse(int argc, char **argv)
  {
      char sbuf[MAXPDSTRING];
      int i;
      argc--; argv++;
      while ((argc > 0) && **argv == '-')
***************
*** 620,624 ****
      	{
      	    sys_set_audio_api(API_PORTAUDIO);
! 	    mmio = 0;
      	    argc--; argv++;
      	}
--- 621,625 ----
      	{
      	    sys_set_audio_api(API_PORTAUDIO);
! 	    sys_mmio = 0;
      	    argc--; argv++;
      	}
***************
*** 628,632 ****
      	{
      	    sys_set_audio_api(API_MMIO);
! 	    mmio = 1;
      	    argc--; argv++;
      	}
--- 629,633 ----
      	{
      	    sys_set_audio_api(API_MMIO);
! 	    sys_mmio = 1;
      	    argc--; argv++;
      	}
***************
*** 746,749 ****
--- 747,755 ----
      	    argc--; argv++;
      	}
+     	else if (!strcmp(*argv, "-nrt"))
+     	{
+     	    sys_hipriority = 0;
+     	    argc--; argv++;
+     	}
  #endif
      	else if (!strcmp(*argv, "-soundindev") ||
***************
*** 802,820 ****
      	sys_openlist = namelist_append(sys_openlist, *argv);
  
-     	/* correct to make audio and MIDI device lists zero based.  On
- 	MMIO, however, "1" really means the second device (the first one
- 	is "mapper" which is was not included when the command args were
- 	set up, so we leave it that way for compatibility. */
-     if (!mmio)
-     {
-     	for (i = 0; i < sys_nsoundin; i++)
-     	    sys_soundindevlist[i]--;
-     	for (i = 0; i < sys_nsoundout; i++)
-     	    sys_soundoutdevlist[i]--;
-     }
-     for (i = 0; i < sys_nmidiin; i++)
-     	sys_midiindevlist[i]--;
-     for (i = 0; i < sys_nmidiout; i++)
-     	sys_midioutdevlist[i]--;
  
      return (0);
--- 808,811 ----
***************
*** 826,832 ****
  }
  
! static void sys_addextrapath(void)
  {
      char sbuf[MAXPDSTRING];
  	    /* add "extra" library to path */
      strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30);
--- 817,826 ----
  }
  
!     /* stuff to do, once, after calling sys_argparse() -- which may itself
!     be called twice because of the .pdrc hack. */
! static void sys_afterargparse(void)
  {
      char sbuf[MAXPDSTRING];
+     int i;
  	    /* add "extra" library to path */
      strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30);
***************
*** 834,842 ****
      strcat(sbuf, "/extra");
      sys_addpath(sbuf);
- }
- 
- static void sys_addreferencepath(void)
- {
-     char sbuf[MAXPDSTRING];
  	    /* add "doc/5.reference" library to helppath */
      strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30);
--- 828,831 ----
***************
*** 844,846 ****
--- 833,855 ----
      strcat(sbuf, "/doc/5.reference");
      sys_addhelppath(sbuf);
+     	/* correct to make audio and MIDI device lists zero based.  On
+ 	MMIO, however, "1" really means the second device (the first one
+ 	is "mapper" which is was not included when the command args were
+ 	set up, so we leave it that way for compatibility. */
+     if (!sys_mmio)
+     {
+     	for (i = 0; i < sys_nsoundin; i++)
+     	    sys_soundindevlist[i]--;
+     	for (i = 0; i < sys_nsoundout; i++)
+     	    sys_soundoutdevlist[i]--;
+     }
+     for (i = 0; i < sys_nmidiin; i++)
+     	sys_midiindevlist[i]--;
+     for (i = 0; i < sys_nmidiout; i++)
+     	sys_midioutdevlist[i]--;
+ }
+ 
+ static void sys_addreferencepath(void)
+ {
+     char sbuf[MAXPDSTRING];
  }





More information about the Pd-cvs mailing list