[PD-cvs] pd/src u_main.tk,1.4.4.6,1.4.4.7 s_main.c,1.7.4.10,1.7.4.11 s_audio_alsa.c,1.5.4.3,1.5.4.4 s_audio_alsamm.c,1.1.4.3,1.1.4.4

Tim Blechmann timblech at users.sourceforge.net
Mon Feb 21 10:20:14 CET 2005


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

Modified Files:
      Tag: devel_0_38
	u_main.tk s_main.c s_audio_alsa.c s_audio_alsamm.c 
Log Message:
 

Index: s_audio_alsa.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_alsa.c,v
retrieving revision 1.5.4.3
retrieving revision 1.5.4.4
diff -C2 -d -r1.5.4.3 -r1.5.4.4
*** s_audio_alsa.c	11 Nov 2004 22:30:42 -0000	1.5.4.3
--- s_audio_alsa.c	21 Feb 2005 09:19:59 -0000	1.5.4.4
***************
*** 64,80 ****
  {
      snd_pcm_hw_params_t *hw_params;
!     int err;
      
      snd_pcm_hw_params_alloca(&hw_params);
  
!     err = snd_pcm_hw_params_any(dev->a_handle, hw_params);
!     if (err < 0) {
!       check_error(err,"Broken configuration: no configurations available"); 
        return (0);
      }
  
!     err = snd_pcm_hw_params_set_access(dev->a_handle,
          hw_params, SND_PCM_ACCESS_MMAP_NONINTERLEAVED);
!     return (err >= 0);
  }
  
--- 64,84 ----
  {
      snd_pcm_hw_params_t *hw_params;
!     int err1, err2;
      
      snd_pcm_hw_params_alloca(&hw_params);
  
!     err1 = snd_pcm_hw_params_any(dev->a_handle, hw_params);
!     if (err1 < 0) {
!       check_error(err1,"Broken configuration: no configurations available"); 
        return (0);
      }
  
!     err1 = snd_pcm_hw_params_set_access(dev->a_handle,
          hw_params, SND_PCM_ACCESS_MMAP_NONINTERLEAVED);
!     err2 = snd_pcm_hw_params_set_access(dev->a_handle,
!         hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
!     post("err 1 %d (%s), err2 %d (%s)", err1, snd_strerror(err1),
!          err2, snd_strerror(err2));
!     return ((err1 < 0) && (err2 >= 0));
  }
  

Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.7.4.10
retrieving revision 1.7.4.11
diff -C2 -d -r1.7.4.10 -r1.7.4.11
*** s_main.c	22 Jan 2005 09:24:25 -0000	1.7.4.10
--- s_main.c	21 Feb 2005 09:19:59 -0000	1.7.4.11
***************
*** 8,12 ****
   */
  
! char pd_version[] = "Pd version 0.38.2 devel\n";
  char pd_compiletime[] = __TIME__;
  char pd_compiledate[] = __DATE__;
--- 8,12 ----
   */
  
! char pd_version[] = "Pd version 0.38.3 devel\n";
  char pd_compiletime[] = __TIME__;
  char pd_compiledate[] = __DATE__;

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.4.4.6
retrieving revision 1.4.4.7
diff -C2 -d -r1.4.4.6 -r1.4.4.7
*** u_main.tk	14 Dec 2004 10:06:23 -0000	1.4.4.6
--- u_main.tk	21 Feb 2005 09:19:52 -0000	1.4.4.7
***************
*** 51,54 ****
--- 51,66 ----
      load $pd_guidir/bin/pdtcl
      set pd_tearoff 0
+ 
+ 	 # tk::mac::OpenDocument is called with the filenames put into the 
+ 	 # var args whenever docs are either dropped on the Pd.app icon or 
+ 	 # opened from the Finder.
+ 	 # It uses menu_doc_open so it can handles numerous file types.
+ 	 proc tk::mac::OpenDocument {args} {
+ 		  foreach file $args {
+ 				pd [concat pd open [pdtk_enquote [file tail $file]] \
+ 						  [pdtk_enquote  [file dirname $file]] \;]
+ 				menu_doc_open [file dirname $file] [file tail $file]
+ 		  }
+ 	 }
  }
  
***************
*** 75,78 ****
--- 87,92 ----
  
  ################## set up main window #########################
+ # the menus are instantiated here for the main window
+ # for the patch windows, they are created by pdtk_canvas_new
  menu .mbar
  canvas .dummy -height 2p -width 6c
***************
*** 89,99 ****
      .mbar add cascade -label "Windows" -menu .mbar.windows
      .mbar add cascade -label "Media" -menu .mbar.audio
  } else {
! # Perhaps this is silly, but Mac HIG want "Window  Help" as the last menus
      .mbar add cascade -label "Media" -menu .mbar.audio
!     .mbar add cascade -label "Windows" -menu .mbar.windows
  }
- menu .mbar.help -tearoff $pd_tearoff
- .mbar add cascade -label "Help" -menu .mbar.help
  
  set ctrls_audio_on 0
--- 103,125 ----
      .mbar add cascade -label "Windows" -menu .mbar.windows
      .mbar add cascade -label "Media" -menu .mbar.audio
+ # a menu on the main menubar named $whatever.help while be treated
+ # as a special menu with specific behaviors on different platforms.
+ # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
+ 	 menu .mbar.help -tearoff $pd_tearoff
+ 	 .mbar add cascade -label "Help" -menu .mbar.help
  } else {
! 	 menu .mbar.apple -tearoff 0
! 	 .mbar add cascade -label "Apple" -menu .mbar.apple 
! # arrange menus according to Apple HIG
      .mbar add cascade -label "Media" -menu .mbar.audio
!     .mbar add cascade -label "Window" -menu .mbar.windows
! # a menu on the main menubar named "$whatever.help" while be treated
! # as a special menu with specific behaviors on different platforms.
! # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
! # Apple doesn't allow cascading menus in their Help so I had to call this 
! # one $mbar.docs # <hans at at.or.at>
! 	 menu .mbar.docs -tearoff $pd_tearoff
! 	 .mbar add cascade -label "Help" -menu .mbar.docs
  }
  
  set ctrls_audio_on 0
***************
*** 312,315 ****
--- 338,342 ----
  set doc_number 1
  
+ # open text docs in a Pd window
  proc menu_opentext {filename} {
      global doc_number
***************
*** 336,340 ****
--- 363,385 ----
  }
  
+ # open HTML docs from the menu using the OS-default HTML viewer
+ proc menu_openhtml {filename} {
+ 	 global pd_nt	 
+ 	 
+ 	 if {$pd_nt == 0} {
+ 		  exec sh -c \
+ 				[format "mozilla file:%s || netscape file:%s &\n" \
+ 					  $filename $filename]
+ 	 } elseif {$pd_nt == 2} {
+ 		  puts stderr [format "open %s" $filename]
+ 		  exec sh -c [format "open %s" $filename]
+ 	 } else {
+ 		  exec rundll32 url.dll,FileProtocolHandler \
+ 				[format "file:%s" $filename] &
+ 	 }
+ }
+ 
  set help_directory $pd_guidir/doc
+ set help_top_directory $pd_guidir/doc
  
  proc menu_documentation {} {
***************
*** 358,373 ****
      	    menu_opentext $filename
      	} elseif {[string first .htm $filename] >= 0} {
! 	    if {$pd_nt == 0} {
! 	    	exec sh -c \
! 		    [format "mozilla file:%s || netscape file:%s &\n" \
! 		    	 $filename $filename]
!             } elseif {$pd_nt == 2} {
! 		puts stderr [format "open %s" $filename]
!                 exec sh -c \
! 		    [format "open %s" $filename]
! 	    } else {
!      	    	exec rundll32 url.dll,FileProtocolHandler \
! 		    [format "file:%s" $filename] &
!     	    }
  	} else {
  	    set help_directory [string range $filename 0 \
--- 403,407 ----
      	    menu_opentext $filename
      	} elseif {[string first .htm $filename] >= 0} {
! 				menu_openhtml $filename
  	} else {
  	    set help_directory [string range $filename 0 \
***************
*** 386,391 ****
      set dirname $pd_guidir/$subdir
  
!     if {[string first .txt $basename] >= 0} {
      	menu_opentext $dirname/$basename
      } else {
      	pd [concat pd open [pdtk_enquote $basename] \
--- 420,427 ----
      set dirname $pd_guidir/$subdir
  
!     if {[regexp ".*\.(txt|c)$" $basename]} {
      	menu_opentext $dirname/$basename
+     } elseif {[regexp ".*\.html?$" $basename]} {
+ 		  menu_openhtml $dirname/$basename
      } else {
      	pd [concat pd open [pdtk_enquote $basename] \
***************
*** 394,401 ****
  }
  
! ############# routine to add audio and help menus ###############
  
  proc menu_addstd {mbar} {
!     global pd_apilist
  #          the "Audio" menu
      $mbar.audio add command -label {audio ON} -accelerator [accel_munge "Ctrl+/"] \
--- 430,459 ----
  }
  
! proc doc_submenu {helpmenu subdir} {
! 	 global help_top_directory pd_tearoff
! 
! 	 set menudir $help_top_directory/$subdir
! 
!     regsub -all "\\\." $subdir "" submenu
! 
! 	 menu $helpmenu.$submenu -tearoff $pd_tearoff
!     regsub -all "\\\." $subdir " " submenuname
! 	 $helpmenu add cascade -label $submenuname \
! 		  -menu $helpmenu.$submenu
! 
! # use this glob pattern to exclude the supporting files
! #	 foreach file [ lsort [ glob -dir $menudir {*[0-9][0-9]*} ] ] 
! 	 foreach file [ lsort [ glob -dir $menudir * ] ] {
! 		  set filename ""
! 		  regsub {.*/(.*\..+$)} $file {\1} filename
! 		  $helpmenu.$submenu add command -label $filename \
! 				-command "menu_doc_open doc/$subdir $filename"
! 	 }
! }
! 
! ############# routine to add media, help, and apple menu items ###############
  
  proc menu_addstd {mbar} {
!     global pd_apilist pd_nt pd_tearoff
  #          the "Audio" menu
      $mbar.audio add command -label {audio ON} -accelerator [accel_munge "Ctrl+/"] \
***************
*** 409,417 ****
  		-command {pd [concat pd audio-setapi $pd_whichapi \;]}
      }
      $mbar.audio add command -label {Audio settings...} \
  	-command {pd pd audio-properties \;}
- 
      $mbar.audio add command -label {MIDI settings...} \
  	-command {pd pd midi-properties \;}
      $mbar.audio add command -label {Test Audio and MIDI} \
  	-command {menu_doc_open doc/7.stuff/tools testtone.pd} 
--- 467,477 ----
  		-command {pd [concat pd audio-setapi $pd_whichapi \;]}
      }
+ 	 if {$pd_nt != 2} {
      $mbar.audio add command -label {Audio settings...} \
  	-command {pd pd audio-properties \;}
      $mbar.audio add command -label {MIDI settings...} \
  	-command {pd pd midi-properties \;}
+ 	 }
+ 	 
      $mbar.audio add command -label {Test Audio and MIDI} \
  	-command {menu_doc_open doc/7.stuff/tools testtone.pd} 
***************
*** 419,427 ****
--- 479,530 ----
  	-command {menu_doc_open doc/7.stuff/tools load-meter.pd} 
  
+ #       the MacOS X app menu
+ 
+ # The menu on the main menubar named $whatever.apple while be treated
+ # as a special menu on MacOS X.  Tcl/Tk assigns the $whatever.apple menu
+ # to the app-specific menu in MacOS X that is named after the app,
+ # so in our case, the Pd menu.  <hans at at.or.at>
+ # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
+ 	 if {$pd_nt == 2} {
+ 		  $mbar.apple add command -label "About Pd..." -command \
+ 				{menu_doc_open doc/1.manual 1.introduction.txt} 
+ 		  menu $mbar.apple.preferences -tearoff 0
+ 		  $mbar.apple add cascade -label "Preferences" -menu $mbar.apple.preferences
+ 		  $mbar.apple.preferences add command -label "Path..." \
+ 				-command {pd pd start-path-dialog \;}
+ 		  $mbar.apple.preferences add command -label "Startup..." \
+ 				-command {pd pd start-startup-dialog \;}
+ 		  $mbar.apple.preferences add command -label "Audio Settings..." \
+ 				-command {pd pd audio-properties \;}
+ 		  $mbar.apple.preferences add command -label "MIDI settings..." \
+ 				-command {pd pd midi-properties \;}
+ 	 }
+ 
+ 
  #          the "Help" menu
+ 	 if {$pd_nt != 2} {
+ # a menu on the main menubar named "$whatever.help" while be treated
+ # as a special menu with specific behaviors on different platforms.
+ # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
      $mbar.help add command -label {About Pd} \
  	-command {menu_doc_open doc/1.manual 1.introduction.txt} 
      $mbar.help add command -label {Pure Documentation...} \
  	-command {menu_documentation} 
+ 		  # add menu items for each section instead of using Pd patches
+ 		  $mbar.help add separator
+ 		  set helpmenuname help
+ 	 } else {
+ # Apple doesn't allow cascading menus in their Help so I had to call this 
+ # one "docs"  <hans at at.or.at>
+ 		  set helpmenuname docs
+ 	 }
+ 
+ 	 $mbar.$helpmenuname add command -label {1 manual...} \
+ 		  -command {menu_doc_open doc/1.manual index.htm} 
+ 	 doc_submenu $mbar.$helpmenuname 2.control.examples
+ 	 doc_submenu $mbar.$helpmenuname 3.audio.examples
+ 	 doc_submenu $mbar.$helpmenuname 4.fft.examples
+ 	 doc_submenu $mbar.$helpmenuname 5.reference
+ 	 doc_submenu $mbar.$helpmenuname 6.externs
  }
  
***************
*** 435,442 ****
--- 538,549 ----
  .mbar.file add command -label Message -command {menu_send} \
      -accelerator [accel_munge "Ctrl+m"]
+ # On MacOS X, these are in the standard HIG locations
+ # i.e. the Preferences menu under "Pd"
+ if {$pd_nt != 2} {
  .mbar.file add command -label Path... \
      -command {pd pd start-path-dialog \;}
  .mbar.file add command -label Startup... \
      -command {pd pd start-startup-dialog \;}
+ }
  .mbar.file add  separator
  .mbar.file add command -label Quit -command {menu_quit} \
***************
*** 444,448 ****
  
  #################### the "Find" menu for the Pd window ##############
! .mbar.find add command -label {last error?} -command {menu_finderror} 
  
  ###########  functions for menu functions on document windows ########
--- 551,555 ----
  
  #################### the "Find" menu for the Pd window ##############
! .mbar.find add command -label {Find last error} -command {menu_finderror} 
  
  ###########  functions for menu functions on document windows ########
***************
*** 742,745 ****
--- 849,855 ----
  # the file menu
  
+ # The menus are instantiated here for the patch windows.
+ # For the main window, they are created on load, at the 
+ # top of this file.
      menu $name.m
      menu $name.m.file -tearoff $pd_tearoff
***************
*** 756,759 ****
--- 866,872 ----
  	-accelerator [accel_munge "Ctrl+m"]
  
+ 	 # arrange menus according to Apple HIG
+ 	 # these are now part of Preferences...
+ 	 if {$pd_nt != 2 } {
      $name.m.file add command -label Path... \
      	-command {pd pd start-path-dialog \;} 
***************
*** 761,764 ****
--- 874,878 ----
      $name.m.file add command -label Startup... \
      	-command {pd pd start-startup-dialog \;} 
+ 	 }
  
      $name.m.file add  separator
***************
*** 826,829 ****
--- 940,955 ----
      $name.m.edit add separator
      
+ # Apple, Microsoft, and others put find functions in the Edit menu.
+     $name.m.edit add command -label {Find...} \
+ 		  -accelerator [accel_munge "Ctrl+f"] \
+ 		  -command [concat menu_findobject $name] 
+     $name.m.edit add command -label {Find Again} \
+ 		  -accelerator [accel_munge "Ctrl+g"] \
+ 		  -command [concat menu_findagain $name] 
+     $name.m.edit add command -label {Find last error} \
+ 		  -command [concat menu_finderror] 
+ 
+     $name.m.edit add separator
+ 
  ############iemlib##################
  # instead of "red = #BC3C60" we take "grey85", so there is no difference,
***************
*** 915,918 ****
--- 1041,1049 ----
  
  # the find menu
+ # Apple, Microsoft, and others put find functions in the Edit menu.
+ # But in order to move these items to the Edit menu, the Find menu
+ # handling needs to be dealt with, including this line in g_canvas.c:
+ #         sys_vgui(".mbar.find delete %d\n", i);
+ # <hans at at.or.at>
      menu $name.m.find -tearoff $pd_tearoff
      $name.m add cascade -label Find -menu $name.m.find
***************
*** 945,953 ****
--- 1076,1098 ----
          $name.m add cascade -label Media -menu $name.m.audio
          $name.m add cascade -label Window -menu $name.m.windows
+ # the MacOS X app menu
+ 		  menu $name.m.apple -tearoff $pd_tearoff
+ 		  $name.m add cascade -label "Apple" -menu $name.m.apple 
      }
  
  # the help menu
+ 
+ # a menu on the main menubar named "$whatever.help" while be treated
+ # as a special menu with specific behaviors on different platforms.
+ # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
+ 	 if {$pd_nt != 2} {
      menu $name.m.help -tearoff $pd_tearoff
      $name.m add cascade -label Help -menu $name.m.help
+ 	 } else {
+ 		  # Apple doesn't allow cascading menus in their Help
+ 		  # so I had to call this one "docs". <hans at at.or.at>
+ 		  menu $name.m.docs -tearoff $pd_tearoff
+ 		  $name.m add cascade -label Help -menu  $name.m.docs
+ 	 }
  
      menu_addstd $name.m

Index: s_audio_alsamm.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_alsamm.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -C2 -d -r1.1.4.3 -r1.1.4.4
*** s_audio_alsamm.c	11 Nov 2004 22:30:42 -0000	1.1.4.3
--- s_audio_alsamm.c	21 Feb 2005 09:20:10 -0000	1.1.4.4
***************
*** 773,779 ****
    if(sys_verbose)
      post("set sw finished");
  #else
    post("alsa: need version 1.0 or above for mmap operation");
- #endif
  #endif /* ALSAAPI9 */
    return 0;
--- 773,779 ----
    if(sys_verbose)
      post("set sw finished");
+ #endif
  #else
    post("alsa: need version 1.0 or above for mmap operation");
  #endif /* ALSAAPI9 */
    return 0;





More information about the Pd-cvs mailing list