javaclient
Class AudioMixerInterface

java.lang.Object
  extended by javaclient.PlayerDevice
      extended by javaclient.AudioMixerInterface

public class AudioMixerInterface
extends PlayerDevice

The audiomixer interface is used to control sound levels.

Version:
Author:
Radu Bogdan Rusu

Field Summary
protected static short PLAYER_AUDIOMIXER_SET_IGAIN
           
protected static short PLAYER_AUDIOMIXER_SET_LINE
           
protected static short PLAYER_AUDIOMIXER_SET_MASTER
           
protected static short PLAYER_AUDIOMIXER_SET_MIC
           
protected static short PLAYER_AUDIOMIXER_SET_OGAIN
           
protected static short PLAYER_AUDIOMIXER_SET_PCM
           
 
Fields inherited from class javaclient.PlayerDevice
device, DIFFERENCE_SYNCH_FACTOR, index, is, os, pc, PLAYER_MAX_REQREP_SIZE, PLAYER_STXX, reserved, size, t_sec, t_usec, ts_sec, ts_usec
 
Constructor Summary
AudioMixerInterface(PlayerClient pc, short indexOfDevice)
          Constructor for AudioMixerInterface.
 
Method Summary
 int getIGain()
           
 void getLevels(byte subtype)
          Configuration request: Get levels.
 int getLineLeft()
           
 int getLineRight()
           
 int getMasterLeft()
           
 int getMasterRight()
           
 int getMicLeft()
           
 int getMicRight()
           
 int getOGain()
           
 int getPCMLeft()
           
 int getPCMRight()
           
 void handleResponse(int size)
          Handle acknowledgement response messages (threaded mode).
 void setVolume(byte subtype, short left, short right)
          The audiomixer interface accepts commands to set the left and right volume levels of various channels.
 
Methods inherited from class javaclient.PlayerDevice
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, readData, readHeader, sendHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYER_AUDIOMIXER_SET_MASTER

protected static final short PLAYER_AUDIOMIXER_SET_MASTER
See Also:
Constant Field Values

PLAYER_AUDIOMIXER_SET_PCM

protected static final short PLAYER_AUDIOMIXER_SET_PCM
See Also:
Constant Field Values

PLAYER_AUDIOMIXER_SET_LINE

protected static final short PLAYER_AUDIOMIXER_SET_LINE
See Also:
Constant Field Values

PLAYER_AUDIOMIXER_SET_MIC

protected static final short PLAYER_AUDIOMIXER_SET_MIC
See Also:
Constant Field Values

PLAYER_AUDIOMIXER_SET_IGAIN

protected static final short PLAYER_AUDIOMIXER_SET_IGAIN
See Also:
Constant Field Values

PLAYER_AUDIOMIXER_SET_OGAIN

protected static final short PLAYER_AUDIOMIXER_SET_OGAIN
See Also:
Constant Field Values
Constructor Detail

AudioMixerInterface

public AudioMixerInterface(PlayerClient pc,
                           short indexOfDevice)
Constructor for AudioMixerInterface.

Parameters:
pc - a reference to the PlayerClient object
indexOfDevice - the index of the device
Method Detail

setVolume

public void setVolume(byte subtype,
                      short left,
                      short right)
The audiomixer interface accepts commands to set the left and right volume levels of various channels. The channel may be PLAYER_AUDIOMIXER_MASTER for the master volume, PLAYER_AUDIOMIXER_PCM for the PCM volume, PLAYER_AUDIOMIXER_LINE for the line in volume, PLAYER_AUDIOMIXER_MIC for the microphone volume, PLAYER_AUDIOMIXER_IGAIN for the input gain, and PLAYER_AUDIOMIXER_OGAIN for the output gain.

See the player_audiomixer_cmd structure from player.h

Parameters:
subtype - one of the types above
left - value for the left channel
right - value for the right channel

getLevels

public void getLevels(byte subtype)
Configuration request: Get levels.

The audiomixer interface provides accepts a configuration request which returns the current state of the mixer levels

See the player_audiomixer_config structure from player.h


handleResponse

public void handleResponse(int size)
Handle acknowledgement response messages (threaded mode).

Overrides:
handleResponse in class PlayerDevice
Parameters:
size - size of the payload

getMasterLeft

public int getMasterLeft()

getMasterRight

public int getMasterRight()

getPCMLeft

public int getPCMLeft()

getPCMRight

public int getPCMRight()

getLineLeft

public int getLineLeft()

getLineRight

public int getLineRight()

getMicLeft

public int getMicLeft()

getMicRight

public int getMicRight()

getIGain

public int getIGain()

getOGain

public int getOGain()