[comp.sys.mac.programmer] sndplay in MPW C

max@reed.UUCP (David Fedchenko) (03/05/88)

Two questions.

First, why can't I get the sndplay function to work in MPW C?
It claims that it can't find it in the libraries when linking, which
is further confused by the fact that I could get it to work in MPW
Pascal.  Can somebody help?

Second, I would appreciate anybody who would like to explain just how to
use the sound manager routines, mostly on the subject of opening channels
in all their various forms.


thanks.

	- David -

cswarren@gershwin.berkeley.edu (Warren Gish;133B Biochem;x3-9219) (03/07/88)

In article <8399@reed.UUCP> max@reed.UUCP (David Fedchenko) writes:
>... why can't I get the sndplay function to work in MPW C?
>It claims that it can't find it in the libraries when linking, which
>is further confused by the fact that I could get it to work in MPW
>Pascal.  Can somebody help?
This is a bug in MPW C version 2.0.2.  The bug fix was posted to
comp.sys.mac about a month ago by Apple, but here goes again...

The trap numbers were omitted from the Sound Manager function definitions
in sound.h.  The missing trap numbers, and their associated function
names, are:

	SndDoCommand		0xA803
	SndDoImmediate		0xA804
	SndAddModifier		0xA802
	SndNewChannel		0xA807
	SndDisposeChannel	0xA801
	SndPlay			0xA805
	SndControl		0xA806

Just place the trap numbers after the "extern" attribute in each
function prototype.  (If this isn't clear, take a look at the functions
listed in, e.g., Events.h).


Warren Gish
IS&T
Biochemistry Bldg
University of California
Berkeley, CA 94720
cswarren@violet.berkeley.edu
cswarren@ucbviole.bitnet

levin@bbn.com (Joel B Levin) (03/08/88)

In article <7435@agate.BERKELEY.EDU> cswarren@gershwin.berkeley.edu.UUCP (Warren Gish) writes:
:In article <8399@reed.UUCP> max@reed.UUCP (David Fedchenko) writes:
:>... why can't I get the sndplay function to work in MPW C?
:The trap numbers were omitted from the Sound Manager function definitions
:in sound.h.  The missing trap numbers, and their associated function
:names, are:
:	[list of traps]

What a coincidence.  I was playing with it over the weekend, and I had
the same trouble with the libraries.  I came in, saw these two
articles, and went home last night to try it.  Now it links just fine,
but I get "unimplemented A-trap" when I try to run!

IM V (final glossy version) says that the Sound Manager is in both the
SE and the II.  I am using an SE and the System Release 5.0 stuff (w/o
MultiFinder).  What goes on?

	/JBL

PS:  the final MPW documentation came yesterday, Federal Express.  Much
cleaner looking, and there is an appendix in the C manual about pascal
strings and the traps you can call without glue.


UUCP: {harvard, husc6, etc.}!bbn!levin
ARPA: levin@bbn.com

dgold@Apple.COM (David Goldsmith) (03/10/88)

In article <21736@bbn.COM> levin@powell.BBN.COM (Joel B Levin) writes:
>In article <7435@agate.BERKELEY.EDU> cswarren@gershwin.berkeley.edu.UUCP (Warren Gish) writes:
>IM V (final glossy version) says that the Sound Manager is in both the
>SE and the II.  I am using an SE and the System Release 5.0 stuff (w/o
>MultiFinder).  What goes on?

I guess IM V has an error.  As of System Release 5.0, only the Mac II supports
the Sound Manager.  It is likely that the next system we send out will support
the Sound Manager on the Mac Plus and Mac SE as well (insert here your
favorite caveat about counting on features in systems which haven't been
released or frozen yet).

dowdy@Apple.COM (Tom Dowdy) (03/10/88)

In article <21736@bbn.COM> levin@powell.BBN.COM (Joel B Levin) writes:
>In article <7435@agate.BERKELEY.EDU> cswarren@gershwin.berkeley.edu.UUCP (Warren Gish) writes:
> [various comments about a fight between MPW C and Sound Manager]

I won't say that this is the gospel on this subject, but I believe that
the glue to the Sound Manager from MPW C is messed up.
Would anyone care to comment about this?

I spent a while the other day tracking down a similar problem that
looks like it's in the Sound *Driver* glue.  (Hint: Sound Driver = old
Sound Manager = new).  The problems were non-consistant, but
occured on multiple runs of the same program without reboot.
The bomb was fixed by going to low-level driver calls.  
(This isn't really a solution, if you are using the Sound Manager, 
you desire the functionality of it (such as non-clicking multiple
SndPlay calls))

The only other thing that makes me think that these problems *might*
be the glue is that I also had problems with Sound related calls
on early versions of a number of different development packages.
Maybe it's difficult to write the sound glue (?)
  
  Tom Dowdy                 CSNET:    dowdy@apple.CSNET
  Apple Computer MS:27Y     AppleLink:DOWDY1
  20525 Mariani Ave         UUCP:     {sun,voder,amdahl,decwrl}!apple!dowdy
  Cupertino, CA 95014    
  "The 'Oo-Ah' Bird is so called because it lays square eggs."   

dplatt@coherent.com (Dave Platt) (03/10/88)

From Apple's very own Technical Note #180, "MiltiFinder Miscellanea", last
page, first paragraph under "Miscellaneous Miscellanea":

 "The sound glue that shipped with MPW 1.0 and 2.0 is _not_ MultiFinder
  compatible and should not be used.  Instead, applications should make direct
  calls to the sound driver."

This might be your problem...
-- 

Dave Platt
  UUCP: ...!{ames,sun,uunet}!coherent!dplatt     DOMAIN: dplatt@coherent.com
    INTERNET: coherent!dplatt@ames.arpa, ...@sun.com, ...@uunet.uu.net