javax.microedition.amms.control
Interface PriorityControl

All Superinterfaces:
Control

public interface PriorityControl
extends Control

PriorityControl is an interface for manipulating the priority of a Player among other Players.

Priority Settings

This interface allows prioritizing the playback of a Player by setting a priority level between 0 and 100. 100 being the highest priority, 50 the default level and zero the lowest priority. This interface can be used for automatic handling of essential sounds and experience-enhancing sounds inside the java virtual machine.

Priority 100-51: High priority, should be used for Players that are more vital for the user interface than the default priority level Players. Priority 50: The default middle priority, if all Players have this priority level the functionality is identical to MMAPI 1.1. Priority 49-1: Low priority, should be used for Players that are not as important for the user interface as the default priority level Players. Priority 0: The lowest priority. These Players are dropped if there is any risk that they would hinder other Players.

For Players where the priority level is not set, the default priority 50 is used.

When a Player makes a transition from REALIZED to PREFETCHED or STARTED and there are no resources available to perform the transition then the following happens: If the Player doing the transition has a higher priority than some Player holding a resource needed to perform the transition then The Player having the lowest priority among the Players holding the resource will send DEVICE_UNAVAILABLE event to its PlayerListener and do state transition from STARTED or PREFETCHED to REALIZED. The Player doing the transition performs the transition normally. If the Player doing the transition has a lower or equal priority than the priorities of all the Players holding the needed resource then transition cannot be performed.

Since:
BlackBerry API 5.0.0

Method Summary
 int getPriority()
          Gets the current priority.
 void setPriority(int level)
          Sets the new priority.
 



Method Detail

getPriority

int getPriority()
Gets the current priority.

Returns:
the current priority level
Since:
BlackBerry API 5.0.0

setPriority

void setPriority(int level)
Sets the new priority.

Parameters:
level - new priority
Throws:
IllegalArgumentException - if the given level < 0 or the given level > 100
Since:
BlackBerry API 5.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.