FileDocCategorySizeDatePackage
AudioRenderer.javaAPI DocphoneME MR2 API (J2ME)3156Wed May 02 16:47:16 BST 2007com.sun.mmedia

AudioRenderer

public abstract class AudioRenderer extends Object implements javax.microedition.media.control.VolumeControl
Description of the Class
created
January 17, 2005

Fields Summary
protected boolean
muted
Description of the Field
protected int
level
Description of the Field
private BasicPlayer
player
Constructors Summary
Methods Summary
public intgetLevel()
Gets the level attribute of the AudioRenderer object

return
The level value

        return level;
    
public voidinit(BasicPlayer player)
Description of the Method

param
player Description of the Parameter

        this.player = player;
    
public booleanisMuted()
Gets the muted attribute of the AudioRenderer object

return
The muted value

        return muted;
    
public intsetLevel(int ll)
Sets the level attribute of the AudioRenderer object

param
ll The new level value
return
Description of the Return Value

        int newl;

        if (ll < 0) {
            ll = 0;
        } else if (ll > 100) {
            ll = 100;
        }

        if (!muted) {
            newl = player.doSetLevel(ll);
            if (newl != level) {
                level = newl;
                player.sendEvent(PlayerListener.VOLUME_CHANGED, this);
            }
        }
        
        return level;
    
public voidsetMute(boolean mute)
Sets the mute attribute of the AudioRenderer object

param
mute The new mute value

        if (mute && !muted) {
            player.doSetLevel(0);
            muted = true;
            player.sendEvent(PlayerListener.VOLUME_CHANGED, this);
        } else if (!mute && muted) {
            level = player.doSetLevel(level);
            muted = false;
            player.sendEvent(PlayerListener.VOLUME_CHANGED, this);
        }