QMedia |
![]() ![]() |
QMedia lets you intercept and handle a number of events which are produced by QuickTime while a movie is hosted in a movie plug-in area.
These events can be produced as a result of user interaction, like mouse clicks on the movie area, or of specific movie activity, like the movie being started or stopped. In order to intercept and to handle these events, QMedia lets you declare a handler method that is able of capturing these events before they are serviced by QuickTime's internal handling mechanism.
All events provided by QMedia are by default handled by QuickTime. QuickTime handles all events regardless of whether there is a handler method or not. The purpose of existence of a handler method can be, for example:
There are several types of events, each with several properties specific to its type. As the handler method is called for each event, the specific event properties are each time passed to the handler method as a set of process variables.
The event handler method works much like a typical form method in 4D: it contains a large case statement where each event type is individually intercepted and handled.
Structure of the Event Handler Method
An event handler method must comply with the following calling interface:
-> | $1 | areaRef | Longint | Reference to the movie area |
-> | $2 | movieRef | Longint | Reference to the movie instance assigned to the plug-in area |
-> | $3 | eventType | Longint | The type of the event |
<- | $0 | eventHandled | Longint | Result code |
If eventHandled ($0) returns 1, processing of the event stops at this point. If it returns any value other than 1, the event is passed on to QuickTime for further processing.
The handler will intercept all event types defined using the QM_SetEventHandler command.
The types of events currently supported are:
qm_ClickEvent | 1 | A mousedown event occured in the movie controller. Properties:
|
qm_KeyEvent | 2 | A keydown event occured in the movie controller. Properties:
|
qm_PlayEvent | 3 | Play or Stop command issued. Properties:
|
qm_GoToTimeEvent | 4 | Movie time was set. Properties:
|
qm_SetVolumeEvent | 5 | Sound volume was set. Properties:
|
qm_StepEvent | 6 | The movie controller was instructed to step a movie. Properties:
|
qm_BadgeClickEvent | 7 | The controller badge was clicked. |
qm_MovieClickEvent | 8 | The movie was clicked. Properties:
|
qm_CustomButtonClickEvent | 9 | The custom button of the movie controller was clicked. Properties:
|
qm_SetSelectionBeginEvent | 10 | The movie selection start time was changed. Properties:
|
qm_SetSelectionDurationEvent | 11 | The movie selection duration was changed. Properties:
|
qm_URLLinkEvent | 12 | User clicked on a URL link. Properties:
|
qm_ResizeEvent | 14 | The movie was dynamically resized. |
qm_NodeEnterEvent | 16 | The user is entering a node in a VR movie. Properties:
|
qm_NodeLeaveEvent | 17 | The user is leaving a node in a VR movie. Properties:
|
qm_HotSpotEnterEvent | 18 | The user moved the mouse over a hot spot area in a VR movie. Properties:
|
qm_HotSpotLeaveEvent | 19 | The user moved the mouse outside of a hot spot area in a VR movie. Properties:
|
qm_HotSpotClickEvent | 20 | The user clicked on a hot spot area in a VR movie. Properties:
|
qm_SetPanAngleEvent | 21 | The user changed the pan angle. Properties:
|
qm_SetTiltAngleEvent | 22 | The user changed the tilt angle. Properties:
|
qm_SetFieldOfViewEvent | 23 | The user changed the field of view angle. Properties:
|
qm_SetViewCenterEvent | 24 | The user changed the view center angle. Properties:
|
Example event handler
C_LONGINT($1) `Area
C_LONGINT($2) `Movie
C_LONGINT($3) `Event
C_LONGINT($0) `Handled
$0:=0 `Not handled
C_LONGINT($area;$movie;$event)
$area:=$1
$movie:=$2
$event:=$3
Case of
: ($event= qm_KeyEvent )
...
: ($event= qm_PlayEvent )
...
: ($event= qm_SetViewCenterEvent )
...
End case
QM_SetEventHandler | Specifies the event handler of a movie plug-in area. |
QM_GetEventHandler | Returns the event handler of a movie plug-in area. |