 |
 |
NSMoviewView never !isPlaying?
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Okay, so I created this nice NSMovieView object that I can play NSMovies in. aiff and mp3 files are coming out great. I didn't add it into any contentViews cause I wanted to control it entirely programatically. So, I wanted my NSMovieView to start playing another song after it gone done with whatever it is playing now. To check that, I probably should just call isPlaying(). Hmm... the only thing is, it always returns true unless I manually call stop off of my NSMovieObject. So, how do I know when my NSMovieView object is done playing it's current movie? Is there a way?
Thanks,
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2001
Location: Pleasant Valley, NY
Status:
Offline
|
|
You can try using the regular QT callbacks (though I've found problems where the callback isn't always called, even if it is set up properly). I've also only used it with movies, never sounds. But it's worth a try. The code to set up the callback looks something like:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
TimeBase tb = GetMovieTimeBase([[movieView movie] QTMovie]);
QTCallBackUPP movieStoppedUPP = NewQTCallBackUPP(&MovieStopped);
QTCallBack movieStoppedCallBack = NewCallBack(tb, callBackAtExtremes);
CallMeWhen(movieStoppedCallBack, movieStoppedUPP, (long) self, triggerAtStop, NULL, NULL);
</font>[/code]
This will pass self as an argument to the callback function. All these functions are in the QuickTime documentation, so take a look - hopeflly this will point you in the right direction.
Matt
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Originally posted by mreda:
<STRONG>You can try using the regular QT callbacks (though I've found problems where the callback isn't always called, even if it is set up properly). I've also only used it with movies, never sounds. But it's worth a try. The code to set up the callback looks something like:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre>& amp;lt;font size=1 face=courier>
TimeBase tb = GetMovieTimeBase([[movieView movie] QTMovie]);
QTCallBackUPP movieStoppedUPP = NewQTCallBackUPP(&MovieStopped);
QTCallBack movieStoppedCallBack = NewCallBack(tb, callBackAtExtremes);
CallMeWhen(movieStoppedCallBack, movieStoppedUPP, (long) self, triggerAtStop, NULL, NULL);
</font></pre><HR></BLOCKQUOTE>
This will pass self as an argument to the callback function. All these functions are in the QuickTime documentation, so take a look - hopeflly this will point you in the right direction.
Matt</STRONG>
The only catch is that in the Java version of NSMovie, there is no method called QTMovie(). I wonder if I could send my NSMovie object an objective-C message? I think I read about that somewhere in the docs. I'll see what I can do with this info.
Thanks,
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2001
Location: Pleasant Valley, NY
Status:
Offline
|
|
I didn't realize you were working in Java. I think there is some kind of bridge between java and ObjC, but I don't know the details.
Matt
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Arggh! This is so frustrating. I'm trying to figure out how to use the QuickTime API's to use a regular Java QT object, but where the hell are they? I have the intro thing, but I can't find them.
Alright, so I can import the QuickTime framework into my project, that's easy. But I'm looking at these header files and getting nothing that looks decipherable (sure it's code, but nothing I can read).
All I need to do is use the QuickTime API's to start playing a song and stop when I tell it to or if it reaches the song. That's it! Does anyone have any insight on how I would do this? I'm so lost.
Thanks,
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Finally! Here's all I had to do: add my NSMovieView object to an open window. Not a closed window. It had to be an open window. Then isPlaying worked fine. Why? I have no idea. Since I didn't want the enduser to see the NSMovieView, I made the NSWindow transparent, and now I'm very happy.
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Originally posted by Ghoser777:
<STRONG>Since I didn't want the enduser to see the NSMovieView, I made the NSWindow transparent, and now I'm very happy.</STRONG>
It would probably be a better solution to make it offscreen instead of transparent, less hackish at any rate 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|