|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
in my Windows Proc, do I need to call_______________________________________________
NativeEventToMacEvent
even when I'm not going to call
MCIsPlayerEvent
(when movie controller is null)?
Apple's sample code at
http://17.254.0.113/techpubs/quicktime/qtdevdocs/WIN/tp_qtwin_qtforwindows.13.htm#11434
does
...
if ( Hwnd2Wptr(hWnd) )
{
MSG msg;
EventRecord macEvent;
LONG thePoints = GetMessagePos();
msg.hwnd = hWnd;
msg.message = message;
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = GetMessageTime();
msg.pt.x = LOWORD(thePoints);
msg.pt.y = HIWORD(thePoints);
// Convert the message to a QTML event.
NativeEventToMacEvent (&msg, &macEvent);
// If we have a movie controller, pass the QTML event.
if ( gMovieStuff.theMC )
MCIsPlayerEvent (gMovieStuff.theMC,
(const EventRecord *) &macEvent);
} /* end if ( Hwnd2Wptr(hWnd) ) */
switch ( message ) {
//...
default:
return DefWindowProc (hWnd, message, wParam, lParam);
}
return 0;
}
that is it calls NativeEventToMacEvent, then checks if the Movie controller is null and if not calls MCIsPlayerEvent. Why not have
that "if" action enclose NativeEventToMacEvent as well?
that is do:
//...
if ( Hwnd2Wptr(hWnd) && gMovieStuff.theMC) {
//...
NativeEventToMacEvent (&msg, &macEvent);
MCIsPlayerEvent (gMovieStuff.theMC, (const EventRecord *) &macEvent);
}
//...
is this because NativeEventToMacEvent does side-effects, e.g. needs to be called even if we don't have MCIsPlayerEvent for QT
threads to work OK? I have been experiencing crashes with linear movies playback in QT4Delphi lately (whereas QTVR worked OK) and
I'm just testing if that was that the problem (among other code changes I'm doing). If I don't need to call the
"NativeEventToMacEvent" when a movie controller isn't present, then I'd prefer to not call it (for speedup).
I wonder why the Apple sample always calls that proc converting a Windows event to a native event and then goes on to check if
there's a movie controller and pass the event to the movie controller if there's one. Does it have to do with house keeping of
internal Apple structures related to ports and handles? If so, more documentation is needed on that and an explicit warning to not
forget to ALWAYS call NativeEventToMacEvent at the wndproc of a window that has been hooked by QTML via CreatePortAssociation, even
if there's not a movie controller available (yet - e.g. a movie hasn't been loaded etc.). Comments welcome!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <email@hidden>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QuickTime for Delphi (QT4Delphi)
http://members.fortunecity.com/birbilis/QT4Delphi/
......................................................................................
_______________________________________________
quicktime-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-api
Do not post admin requests to the list. They will be ignored.
| References: | |
| >NativeEventToMacEvent & MCIsPlayerEvent (From: "George Birbilis" <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.