Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!dali.cs.montana.edu!milton!wiml From: wiml@milton.u.washington.edu (William Lewis) Newsgroups: comp.lang.objective-c Subject: Re: sound-text synchronizing Summary: Window server synching Message-ID: <13225@milton.u.washington.edu> Date: 18 Dec 90 21:49:52 GMT References: <009415D9.95ACE680@uno.edu> Followup-To: comp.sys.next Organization: University of Washington, Seattle Lines: 28 In article <009415D9.95ACE680@uno.edu> jrscs@uno.edu writes: >one problem I hope someone can help me with. I am having difficulty >synchronizing the highlighting of a word in a window with actually saying >the word. As of now, the relevant code looks like the following: On a first look, it seems as if the problem is that the Window Server (which actually *does* the drawing for all processes) is a separate process. When you call [ text setSel ], it just sends the PostScript code to the WS to do the drawing. The WS might not get around to executing your code for a little while. As a result, you send off the code to the window server, then immediately play the sound, and then send some more code, which probably just gets put in the queue. Try using the NXPing() function right before you play the sound: this function just blocks until your application's context is caught up on the sent code (presumably meaning that the selection is actually highlighted on the screen). As far as I know, there is very little delay for sounds (unless your sound gets put in a queue behind someone else's, or another of your own...) I'd continue, but it's starting to lightning here. Followups redirected to comp.sys.next. -- wiml@milton.acs.washington.edu Seattle, Washington (William Lewis) | 47 41' 15" N 122 42' 58" W "These 2 cents will cost the net thousands upon thousands of dollars to send everywhere. Are you sure you want to do this?"