IMMPlayerPanel

IMMPlayerPanel is a device player panel that contains various buttons for controlling the device. It can be constructed directly or inherited if finer device control or more functionality is needed. The user is presented with a generic interface, sufficient to control most multimedia devices. The following figure shows an IMMPlayerPanel with device type of digital video.
An IMMPlayerPanel with Device Type of Digital Video

Not only does it create the buttons and organize them, but it also makes the actual function call for the button. For example, the play button calls the play function on whatever device is currently set into the player panel. Also, there is some intelligent processing for disabling and enabling the buttons. For example, if the device is stopped, the stop and pause buttons are disabled. Or, if the device is playing and the user presses the pause button, the pause button stays pressed in the down (latched) state and the play button is unlatched. If the user then presses the pause button again, the pause button is unlatched and the play button is latched. The player panel automatically attaches an IMMPlayerPanelHandler object to provide default behavior. See IMMPlayerPanelHandler for more information on the default processing for each of the buttons and for how to change the default behavior.

If you create the IMMPlayerPanel without passing in a device type, you get the default buttons, which are rewind, stop, pause, play, and fast forward. If you pass in overlay, videoDisc animation, or digitalVideo, you also get step forward and step backward buttons.

IMMPlayerPanel is implemented using a set of buttons on an IMultiCellCanvas. The canvas is set up with all of the default behavior and styles of the multicell canvas, and none of the rows or columns is made expandable. The buttons are added to the multicell canvas in the following coordinates:

play
Cell 4,1 or 5,1 if step buttons are enabled
pause
Cell 3,1 or 4,1 if step buttons are enabled
fastForward
Cell 5,1 or 6,1 if step buttons are enabled
rewind
Cell 1,1 or 2,1 if step buttons are enabled
stop
Cell 2,1 or 3,1 if step buttons are enabled
stepForward
Cell 7,1 if step buttons are enabled
stepBackward
Cell 1,1 if step buttons are enabled

By knowing where the buttons are, you can easily extend this class by using addToCell to add a vacant cell and to add a command handler to your object of this class to process the new buttons.
Note: The identifiers for the animated buttons are the same as the identifiers for the bitmaps, which are defined in icconst.h. They are IC_FF, IC_REWIND, IC_PAUSE, IC_STOP, IC_STEPF, IC_STEPB, and IC_PLAY1.


IMMPlayerPanel - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IMMPlayerPanel
public:
virtual ~IMMPlayerPanel()

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
IMMPlayerPanel
public:
IMMPlayerPanel( unsigned long identifier, IWindow* parent, IWindow* owner, unsigned long deviceType = IMMDevice::other, const IRectangle& initial = IRectangle ( ), const IMultiCellCanvas::Style& style = IMultiCellCanvas::defaultStyle ( ) )

You can construct objects of this class using the following parameters:

identifier
Window identifier of the player panel you construct.

We recommend that you do one of the following:

  • Give unique identifiers to all windows in the same frame window. "In the same window" means that the frame window is the first frame in their parent window chain.
  • Give the client window a window identifier of IC_FRAME_CLIENT_ID.
parent
The parent window of the player panel you construct. You must specify a parent window. This constructor throws an IInvalidParameter exception if you pass an IWindow* of 0. The parent window is primarily used for visible relationships.
owner
The owner window of the player panel you construct.
deviceType
The type of device the player panel is going to control. The main use of this is to determine the type of buttons to be displayed on the player panel. Optional.
initial
The initial position and size of the player panel you construct. The initial position is the lower-left corner of the player panel relative to the lower-left corner of the parent window. Optional.
style
Use the styles provided by IMultiCellCanvas Style to specify the control's styles. Optional.

Supported Platforms

Windows OS/2 AIX
Yes Yes No

OS/2 Considerations

The window identifier is limited to the range 0 through 65535.

The owner window is primarily used for routing notification events and unprocessed messages. The operating system also uses the owner window chain to inherit colors.


Buttons

Use these members to access the buttons on the player panel.


[view class]
fastForwardButton
public:
IAnimatedButton* fastForwardButton() const

Returns a pointer to the fast forward animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
pauseButton
public:
IAnimatedButton* pauseButton() const

Returns a pointer to the pause animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
playButton
public:
IAnimatedButton* playButton() const

Returns a pointer to the play animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
rewindButton
public:
IAnimatedButton* rewindButton() const

Returns a pointer to the rewind animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
stepBackwardButton
public:
IAnimatedButton* stepBackwardButton() const

Returns a pointer to the step backward animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
stepForwardButton
public:
IAnimatedButton* stepForwardButton() const

Returns a pointer to the step forward animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
stopButton
public:
IAnimatedButton* stopButton() const

Returns a pointer to the stop animated button.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Device

Use these members to query and set the device that the player panel is going to control and to query the type of device that is being controlled.


[view class]
deviceType
public:
unsigned long deviceType() const

Returns the type of device this player panel was created for. See the valid device types in IMMDevice.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
playableDevice
public:
IMMPlayableDevice* playableDevice() const

Returns a pointer to the IMMPlayableDevice the player is controlling. This allows the application to determine which device is set into the player panel.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
setPlayableDevice
public:
IMMPlayerPanel& setPlayableDevice( IMMPlayableDevice* device )

Sets a pointer to the IMMPlayableDevice that the player panel will control. This allows the player panel to control almost any device that the user wants. For example, you might want to control a digital video device. If so, you would create an IMMDigitalVideo device and pass it on this call. When the user presses the player panel buttons, such as play or pause, these functions would act upon that IMMDigitalVideo device.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


IMMPlayerPanel - Inherited Member Functions and Data

Inherited Public Functions

ICanvas
IControl
IMultiCellCanvas
INotifier
IWindow

Inherited Public Data

IWindow
INotifier
ICanvas
IMultiCellCanvas

Inherited Protected Functions

IWindow
INotifier
ICanvas
IControl
IMultiCellCanvas

Inherited Protected Data