🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #376

CallMeWhen problem

#376
From: Steven Daedelus
Date: Wed, 30 Mar 2005 01:09
56 lines
2850 bytes
Howdy,

I'm trying to install a callback in a faceless quicktime app I'm 
developing in Codewarrior using Carbon. For the life of me I can't get 
it to work.

My playback code goes basically like this:

   EnterMovies();
   OpenMovieFile ( &myFileSpec, &myResRefNum, fsRdPerm );
   NewMovieFromFile ( &myMovie, myResRefNum, 0, NULL, newMovieActive, 
NULL );


Then I define the callback:

   myCallback = NewCallBack ( GetMovieTimeBase ( myMovie ), 
callBackAtExtremes );
   err = CallMeWhen ( myCallback, NewQTCallBackUPP 
(QTFinishedPlayingProc), NULL, triggerAtStop, 0, 0 );


And finally run the movie (its actually an audio file):

   StartMovie (myMovie);


Now, I'm doing most of the development on a command-line, then porting 
working code into my faceless app, so my callback, at the moment, looks 
like this:

pascal void QTFinishedPlayingProc ( QTCallBack cb, long refCon ) {
   printf("Callback reached: %d | %d", cb, refCon);
}


So I run the code. The movie plays and the callback never gets executed. 
I suspect it is because the program returns as soon as playback begins 
-- but supposedly OSX automatically runs MoviesTask, which makes sense, 
as the audio continues to the end, so I don't know about that. In any 
case I tried throwing in a MoviesTask loop, but it didn't make one whit 
of difference -- the callback still doesn't get executed.

I'm at my wit's end. This is the last hurdle I have to clear to finish 
the software, after which I can bill it and earn money with which to 
feed my daughter. So you see a lot is at stake. ;)

Any help appreciated.

sp

-- 
This sig property of the Soviet Union

-- 
This sig property of the Soviet Union
Technical Details
Message-ID: <1112144936.ba5e86f2773c4caf729e7163efd9c328@teranews>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed-west.nntpserver.com!gnome.nntpserver.com.POSTED!teranews!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f635e,b546dcd2fdc74899,start
X-Google-Thread: 10bcce,b546dcd2fdc74899,start
X-Google-Attributes: gidf635e,gid10bcce,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed-west.nntpserver.com!gnome.nntpserver.com.POSTED!teranews!not-for-mail
From: Steven Daedelus <sdaedelus@ira.gov>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: CallMeWhen problem
Organization: Irish Republican Army
User-Agent: MT-NewsWatcher/3.4 (PPC Mac OS X)
Lines: 56
NNTP-Posting-Date: Tue, 29 Mar 2005 20:08:56 EST
Message-ID: <1112144936.ba5e86f2773c4caf729e7163efd9c328@teranews>
X-Abuse-Report: http://www.usenetabuse.com
X-Abuse-Notes: Abuse reports must be submited via the usenetabuse.com portal listed above.
X-Abuse-Notes2: Reports sent via any other method will not be processed.
X-Abuse-Notes3: Any other abuse reporting headers in this article are fraudulent.
X-Orginal-Message-ID: <sdaedelus-DA59A8.20090329032005@gnome.nibble.net>
Date: Tue, 29 Mar 2005 20:09:03 -0500