Package javax.microedition.media.control

Examples of javax.microedition.media.control.VolumeControl


     *            The new required volume level
     * @throws MediaActionException
     *             If an error occurs performing this action
     */
    public void changeVolume(final int newVolume) throws MediaActionException {
        final VolumeControl control = _volumeController;
        if (control != null) {
            try {
                control.setLevel(newVolume);
            } catch (final Exception e) {
                throw new MediaActionException("unable to set volume to "
                        + newVolume + ": " + e);
            }
        }
View Full Code Here


     * @return true If mute operation was successful, otherwise false
     * @throws MediaActionException
     *             If an error occurs performing this action
     */
    public boolean doMute(final boolean mute) throws MediaActionException {
        final VolumeControl volumeControl = _handler.getVolumeController();

        final boolean curMute = MediaPlayerDemo.isMuted(volumeControl);
        if (curMute == mute || volumeControl == null) {
            return false;
        }

        try {
            volumeControl.setMute(mute);
        } catch (final Exception e) {
            throw new MediaActionException("unable to " + (mute ? "" : "un")
                    + "mute audio: " + e);
        }

View Full Code Here

                            .getControl("net.rim.device.api.media.control.StreamingBufferControl");
            sbc.setBufferTime(0);

            Control control = player.getControl("VolumeControl");
            if (control instanceof VolumeControl) {
                final VolumeControl volumeControl = (VolumeControl) control;
                _handler.setVolumeController(volumeControl);

                // Unmute the application on the assumption that if the user
                // asks to
                // play a track they actually want to hear it.
View Full Code Here

TOP

Related Classes of javax.microedition.media.control.VolumeControl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.