Re: QuickTime Callback
Re: QuickTime Callback
- Subject: Re: QuickTime Callback
- From: Michael Hanna <email@hidden>
- Date: Sat, 6 Nov 2004 13:22:19 -0500
I see, is it possible that there may be a flaw in how I'm encoding/decoding my object in the loadRepresentationFromData:[sic, should be loadDataRepresentation:] method? I did a once-over of the object and it looks OK...
<x-tad-smaller>- (</x-tad-smaller><x-tad-smaller>BOOL</x-tad-smaller><x-tad-smaller>)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
{
</x-tad-smaller><x-tad-smaller>//int _prompterRetainCount = [prompter retainCount];</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>// Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead.</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>//NSLog(@"loadDataRepresentation:");</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>//[prompter release];</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>//_prompterRetainCount = [prompter retainCount];</x-tad-smaller><x-tad-smaller>
prompter = [[NSUnarchiver unarchiveObjectWithData:data] retain];
</x-tad-smaller><x-tad-smaller>//_prompterRetainCount = [prompter retainCount];</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>if</x-tad-smaller><x-tad-smaller>([[prompter visualPromptPath] isNotEqualTo:</x-tad-smaller><x-tad-smaller>@"none selected"</x-tad-smaller><x-tad-smaller>])
[</x-tad-smaller><x-tad-smaller>self</x-tad-smaller><x-tad-smaller> _readVisualFile];
</x-tad-smaller><x-tad-smaller>if</x-tad-smaller><x-tad-smaller>([[prompter auralPromptPath] isNotEqualTo:</x-tad-smaller><x-tad-smaller>@"none selected"</x-tad-smaller><x-tad-smaller>])
[</x-tad-smaller><x-tad-smaller>self</x-tad-smaller><x-tad-smaller> _readAuralFile];
[</x-tad-smaller><x-tad-smaller>self</x-tad-smaller><x-tad-smaller> updateUI];
</x-tad-smaller><x-tad-smaller>return</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>YES</x-tad-smaller><x-tad-smaller>;
}
</x-tad-smaller>
the callback is actually created in the _readAuralFile method:
<x-tad-smaller>- (</x-tad-smaller><x-tad-smaller>void</x-tad-smaller><x-tad-smaller>)_readAuralFile
{
myMovie = [[NSMovie alloc] initWithURL:[NSURL fileURLWithPath:[prompter auralPromptPath]] byReference:</x-tad-smaller><x-tad-smaller>NO</x-tad-smaller><x-tad-smaller>];
[myMovieView setMovie:myMovie];
[myMovie release];
[</x-tad-smaller><x-tad-smaller>self</x-tad-smaller><x-tad-smaller> setupMoviePlayingCompleteCallback:[[myMovieView movie] QTMovie] callbackUPP:gMoviePlayingCompleteCallBack]; // ** callback created here ** //
[myVolumeSlider setDoubleValue: GetMovieVolume([[myMovieView movie] QTMovie])];
[myMainSlider setMaxValue:GetMovieDuration([[myMovieView movie] QTMovie])];
[myMainSlider setDoubleValue:</x-tad-smaller><x-tad-smaller>0.0</x-tad-smaller><x-tad-smaller>];
}
</x-tad-smaller>
like I mentioned before, the _readAuralFile is also called from another action and no error takes place.
I've also tried commenting-out [myMovie release]; and same problem occurs. Thanks for you help so far.
Michael
On 6-Nov-04, at 8:57 AM, Darrin Cardani wrote:
At 8:09 PM -0800 11/5/04, Michael Hanna <email@hidden> wrote:
This happens in MyDocument.m when I load a pre-existing document(i.e.
from the Open Recent... menu item) and does the
loadRepresentationFromData: method.
If I load the movie via my Import Movie... menu item, which runs the
exact same code(but does not use loadRepresentationFromData:), I get no
error(!)
It certainly looks like everything's OK, assuming theMovie isn't NULL, and other obvious things like that. Since it only happens when loadRepresentationFromData: is called, it sounds almost like something in that method is messing up the heap or stack, but you aren't seeing it until later when you set the callback.
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden