API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
IFrameModel IDirectMode Frame Widget Class ID IWidget_SetRasterOp() IWidget_GetRasterOp() Widget Events ISHELL_CreateInstance()
The frame widget is a user interface element for displaying frames from a media source such as video or camera. This media source is contained in a frame model which sends events to the widget indicating the frame has changed. When receiving the frame event, the widget requests the new frame from the model and displays it within the widget's extent.
To create a frame widget, an application would do the following:
       1. Create an instance of the frame widget using AEECLSID_FrameWidget.
       2. Configure the widget and set the extent using IWidget_SetExtent.
       3. Create an instance of IFrameModel and call IWidget_SetModel on the frame

Typically, widget sets the frame size based on its own extent, by calling IFrameModel_SetSize(). However, the frame size could be different because of underlying media object limitations or applications changing the frame size explicitly by calling IFrameModel_SetSize(). If the frame size is smaller than the widget extent, frame is drawn at the center of the widget. If the frame size is larger than the widget extent, frame will be clipped to the widget's extent.
The frame widget listens to the following model events:
Event                   Description
-----                   ------------------------------------------------------------
EVT_FRAMEMDL_FRAME:     The current frame has changed.  Calls IFrameModel_GetFrame
                        and redraws the widget.         

Supported Events: The frame widgets supports the following events:
Event                 Description
-----                 ------------------------------------------------------------
EVT_WDG_SETPROPERTY:  The progress widget responds to this event by attempting to set the
                      property identified by the 'wParam' parameter.  The progress widget
                      recognizes those properties defined in the "Properties" section, below.

EVT_WDG_GETPROPERTY:  The progress widget responds to this event by attempting to retrieve the
                      property identified by the 'wParam' parameter.  The progress widget
                      recognizes those properties defined in the "Properties" section, below.

Property              Description
--------              ------------------------------------------------------------
PROP_BGCOLOR:         This property contains the background color that is drawn when
                      there is no frame image to display or the frame image is smaller
                      than the widget's extent.

                      Property Value:  RGBVal

PROP_EX:              FrameWidget supports PROP_EX for the following ClsId(s)

                      Property Id: PROPEX_DIRECT 
                      Property Value: int.
                      By setting this extended property to TRUE, the widget's regular
                      draw routine is bypassed and the underlying interface(like IMedia) 
                      will be allowed to draw directly to the screen. Note that
                      the applications will have to disable this, or pause the 
                      media, when they want some other widget to draw on top of 
                      this FrameWidget.
                      Before setting this property, 
                      - FrameWidget must have been inserted in Widget tree with a RootContainer.
                      - FrameModel must have been initialized with correct size by calling

                      int nDirect = DMF_ENABLE;
                      IWidget_SetPropertyEx(piWidget, PROPEX_DIRECT, 
                                            sizeof(int), (void*) &nDirect);

                      If there is a layout change such that the position of the framewidget
                      changes, then this property should be set again.

                      Property Id:    PROPEX_ROP
                      Property Value: AEERasterOp
                      Default Value:  AEE_RO_COPY

                      This extended property allows overriding the widget's raster
                      operation used when rendering each frame to the display buffer.
                      This is the raster op used when framewidget ultimately calls
                      IBitmap_BltIn() on the canvas' display bitmap.

                      The widget will also be invalidated when this property is set, which
                      will incur a redraw of the current frame using the new raster op.

                      AEERasterOp rop = AEE_RO_BLEND;
                      IWidget_SetPropertyEx(piWidget, PROPEX_ROP,
                                            sizeof(AEERasterOp), (void*)&rop);

                      A pair of inline helper functions, IWIDGET_SetRasterOp() and
                      IWidget_GetRasterOp() are available to simplify getting
                      and setting this property.

Required Model: IFrameModel Interface
To create a Frame Widget object, pass AEECLSID_FrameWidget into ISHELL_CreateInstance().
The Frame Widget object is a reference-counted object. When you are finished with a reference, Release it. When the reference count goes to 0, any frame widget-specific clean33up will be done.
Default Interface Name