|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAcquisition.DaqSystem
asiojni.ASIOSoundSystem
public class ASIOSoundSystem
Everything and everything to do with controlling and reading ASIO sound cards.
DaqSystem,
AcquisitionProcess| Nested Class Summary | |
|---|---|
(package private) class |
ASIOSoundSystem.CaptureThreadAsio
|
| Field Summary | |
|---|---|
private AcquisitionControl |
acquisitionControl
|
private AsioJniInterface |
asioJniInterface
|
private ASIOPlaybackSystem |
asioPlaybackSystem
|
(package private) javax.swing.JComboBox |
audioDevices
|
private javax.sound.sampled.AudioFormat |
audioFormat
|
private int[] |
channelList
locally held channel list i.e. |
private int |
daqChannels
|
(package private) javax.swing.JPanel |
daqDialog
|
private int |
dataUnitSamples
|
(package private) int |
expectedChannel
|
(package private) java.util.List<RawDataUnit> |
newDataUnits
|
private int |
rawBufferSizeInBytes
|
private int[] |
reverseChannelList
locally held convert hardware channels to software chans |
private int |
sampleSizeInBytes
|
(package private) SoundCardParameters |
soundCardParameters
|
private boolean |
stopCapture
|
(package private) long[] |
totalSamples
|
private static boolean |
ZeroIndexChannels
collect data using zero channel indexes rather than the annoying hardware channel numbers. |
| Fields inherited from class Acquisition.DaqSystem |
|---|
PARAMETER_FIXED, PARAMETER_UNKNOWN, STREAM_CLOSED, STREAM_ENDED, STREAM_OPEN, STREAM_PAUSED, STREAM_RUNNING |
| Constructor Summary | |
|---|---|
ASIOSoundSystem(AcquisitionControl acquisitionControl)
|
|
| Method Summary | |
|---|---|
boolean |
areSampleSettingsOk(int numInputsRequested,
float sampleRateRequested)
|
boolean |
canPlayBack(float sampleRate)
|
private javax.swing.JPanel |
createDaqDialogPanel()
|
void |
daqHasEnded()
Called after DAQ has stopped - for whatever reason. |
boolean |
dialogGetParams()
Called by AcquisitionDialog.GetParams so that parameters can be extracted from the dialog component. |
void |
dialogSetParams()
Called by AcquisitionDialog.SetParams so that the dialog componenet can update it's fields |
int |
getChannels()
|
javax.swing.JPanel |
getDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog)
The AcquisitionDialog has been designed to that each data source type can plug in it's own panel of device specific controls. |
int |
getDataUnitSamples()
|
java.lang.String |
getDeviceName()
Gets a name for the acquisition device (may just be a number but need to generalise). |
java.util.ArrayList<AsioDriverInfo> |
getDevicesList()
|
int |
getMaxChannels()
|
int |
getMaxSampleRate()
|
double |
getPeak2PeakVoltage(int swChannel)
|
PlaybackSystem |
getPlaybackSystem()
Gets a playback system for playing sound back out through headphones / speakers, etc. |
static short |
getSample(byte[] buffer,
int position)
|
java.io.Serializable |
getSettingsReference()
|
long |
getSettingsVersion()
|
java.lang.String |
getSystemName()
|
java.lang.String |
getSystemType()
|
java.lang.String |
getUnitName()
|
java.lang.String |
getUnitType()
|
boolean |
isRealTime()
|
boolean |
newASIOData(double[] data,
int channel)
|
protected boolean |
playData(int outputChannel,
RawDataUnit rawDataUnit)
|
boolean |
preparePlayback(int channels,
float sampleRate)
|
boolean |
prepareSystem(AcquisitionControl daqControl)
Prepare the DaqSystem. |
boolean |
restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
|
void |
showSampleSettingsDialog(AcquisitionDialog acquisitionDialog)
|
boolean |
startSystem(AcquisitionControl daqControl)
Start the DaqSystem. |
void |
stopSystem(AcquisitionControl daqControl)
Stop the DaqSystem. |
boolean |
supportsChannelLists()
|
| Methods inherited from class Acquisition.DaqSystem |
|---|
getDaqSpecificChannelListPanel, getInputChannelMap, getStatusBarComponent, getStreamStatus, setSelected, setStreamStatus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
javax.swing.JPanel daqDialog
javax.swing.JComboBox audioDevices
SoundCardParameters soundCardParameters
private javax.sound.sampled.AudioFormat audioFormat
java.util.List<RawDataUnit> newDataUnits
private volatile boolean stopCapture
private AcquisitionControl acquisitionControl
private int rawBufferSizeInBytes
private final int sampleSizeInBytes
private int daqChannels
private static final boolean ZeroIndexChannels
private int[] channelList
private int[] reverseChannelList
private AsioJniInterface asioJniInterface
private ASIOPlaybackSystem asioPlaybackSystem
private int dataUnitSamples
long[] totalSamples
int expectedChannel
| Constructor Detail |
|---|
public ASIOSoundSystem(AcquisitionControl acquisitionControl)
| Method Detail |
|---|
public boolean prepareSystem(AcquisitionControl daqControl)
DaqSystemUsually this is the time for opening files, preparing data buffers, etc.
prepareSystem in class DaqSystemdaqControl - AcquisitionControl unit.
public int getDataUnitSamples()
getDataUnitSamples in class DaqSystem
public boolean preparePlayback(int channels,
float sampleRate)
public boolean areSampleSettingsOk(int numInputsRequested,
float sampleRateRequested)
areSampleSettingsOk in class DaqSystempublic void showSampleSettingsDialog(AcquisitionDialog acquisitionDialog)
showSampleSettingsDialog in class DaqSystempublic boolean startSystem(AcquisitionControl daqControl)
DaqSystemMost things should be ready from the call to PrepareSystem. In StartSystem you will generally need to start a thread which will read in the data and place PamDataUnits in a buffer from where they are read by the main thred and passed on to other Pam modules for processing (see SoundCardSystem for an example)
startSystem in class DaqSystemdaqControl - AcquisitionControl unit.
public void stopSystem(AcquisitionControl daqControl)
DaqSystem
stopSystem in class DaqSystempublic javax.swing.JPanel getDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog)
DaqSystemThe AcquisitionDialog will handle placing this component on the dialog when a particular DaqSystem is selected. The component will be placed between a drop down list of available DaqSystem's and a section of the dialog showing the sample rate and number of channels.
getDaqSpecificDialogComponent in class DaqSystemacquisitionDialog - the AcquisitionDialog this component will be added to
private javax.swing.JPanel createDaqDialogPanel()
public java.util.ArrayList<AsioDriverInfo> getDevicesList()
public void dialogSetParams()
DaqSystem
dialogSetParams in class DaqSystempublic boolean dialogGetParams()
DaqSystem
dialogGetParams in class DaqSystempublic java.lang.String getSystemType()
getSystemType in class DaqSystemCalling functions should be able to handle 'null'
public java.lang.String getSystemName()
getSystemName in class DaqSystempublic int getMaxChannels()
getMaxChannels in class DaqSystempublic int getMaxSampleRate()
getMaxSampleRate in class DaqSystempublic double getPeak2PeakVoltage(int swChannel)
getPeak2PeakVoltage in class DaqSystempublic boolean isRealTime()
isRealTime in class DaqSystempublic boolean canPlayBack(float sampleRate)
canPlayBack in class DaqSystempublic PlaybackSystem getPlaybackSystem()
DaqSystemGenerally, anything acquiring data in real time should play the sound back through itself so that clocks are correctly synchronised. i.e. A sound card input will go to the same sound card output, etc. At a later date, we may try to support output through different devices at different speeds - but this will be problematic !
If data are being read from a file, then playback is through a sound card which sits in a standalone implementation of PlaybackSystem
getPlaybackSystem in class DaqSystemPlaybackSystem,
FilePlaybackpublic int getChannels()
public java.io.Serializable getSettingsReference()
getSettingsReference in interface PamSettingspublic long getSettingsVersion()
getSettingsVersion in interface PamSettingspublic java.lang.String getUnitName()
getUnitName in interface PamSettingspublic java.lang.String getUnitType()
getUnitType in interface PamSettingspublic boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
restoreSettings in interface PamSettings
public boolean newASIOData(double[] data,
int channel)
public static short getSample(byte[] buffer,
int position)
public void daqHasEnded()
DaqSystem
daqHasEnded in class DaqSystempublic boolean supportsChannelLists()
supportsChannelLists in class DaqSystem
protected boolean playData(int outputChannel,
RawDataUnit rawDataUnit)
public java.lang.String getDeviceName()
DaqSystem
getDeviceName in class DaqSystem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||