Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QuickTime-API Digest, Vol 2, Issue 250



At 15:56 16/08/2005, Bendicht Thomet wrote:
I've been experimenting with the new QuckTime ActiveX control, and I realize that it's still being changed quite a bit, and no documentation seems to be available yet. Nevertheless, I find it very practical as the simpler functionality is intuitive to use, and with a little QuickTime api knowldege, many other aspects of the control can be guessed at as well.

What I haven't figured out, however, is how I can make the control fire QTEvent notifications. And I suspect that QTEvent is the only way to get more precise notifications about what the control is doing.
With the version 7.0.2.70 update (public preview 3, I believe), for example, the control doesn't seem to be sending messages like "Buffering..." as StatusUpdate events anymore. So if I'd like "Buffering.." back, I'd probably have to subscribe to some event interface now...

My question is therefore: Does anyone have more detailed knowledge on how to get QTEvent events out of the new QuickTime control?

You can register for QTEvent notifications on a number of the QuickTime objects, most commonly the QTMovie, QTTrack and QTQuickTime objects. For 'buffering...' type notifications you should register for qtEventShowStatusStringRequest notifications on the movie instance once it is loaded:


if (axQTControl1.Movie != null)  // Make sure movie is loaded
{
        axQTControl1.Movie.EventListeners.Add(
                QTEventClassesEnum.qtEventClassApplicationRequest,
                QTEventIDsEnum.qtEventShowStatusStringRequest, 0, null);
}

Then in your QTEvent handler you need to trap this notification ID:

private void axQTControl1_QTEvent(object sender, AxQTOControlLib._IQTControlEvents_QTEventEvent e)
{
switch (e.eventID)
{
case (int) QTEventIDsEnum.qtEventShowStatusStringRequest:


string msg = e.eventObject.GetParam(QTEventObjectParametersEnum.qtEventParamStatusString).ToString();
Console.WriteLine("qtEventShowStatusStringRequest : {0}", msg);
break;
}
}


e.eventObject.GetParam provides access to notification-specific parameters, listed in QTEventObjectParametersEnum.

A couple of other useful notifications are:

// QTEventClassesEnum, QTEventIDsEnum
qtEventClassStateChange, qtEventRateWillChange
qtEventClassStateChange, qtEventMovieDidEnd
qtEventClassTemporal, qtEventTimeWillChange


Also, to avoid having to prefix enumerations with QTOLibrary or QTOControlLib, just import the relevant namespaces at the top of your .cs or .vb code module:


// C#
using QTOControlLib;
using QTOLibrary;

'VB.NET
Imports QTOControlLib
Imports QTOLibrary

Hope this helps.


John Cromie
QuickTime Engineering


_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.