Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

clComediIO Class Reference

Class for Comedi IO operations. More...

#include <ComediIO.hh>

List of all members.

Public Types

enum  { VERS_MASK_MAJ = 0x00ff0000, VERS_MASK_MIN = 0x0000ff00, VERS_MASK_PL = 0x000000ff }
enum  { VERS_SHIFT_MAJ = 16, VERS_SHIFT_MIN = 8, VERS_SHIFT_PL = 0 }

Public Member Functions

 clComediIO ()
 ~clComediIO ()
bool Open (const char *)
 Open device.

bool Close ()
 Close device.

int GetSubdeviceCount ()
 Get number of subdevices.

int GetVersionCode ()
 Get version code.

const char * GetDriverName ()
 Get driver name.

const char * GetBoardName ()
 Get board name.

const char * GetErrorMsg ()
 Get error message.

bool PcmInOpen ()
 Open PCM input device.

bool PcmInClose ()
 Close PCM input device.

int PcmInGetChannelCount ()
 Get number of channels for PCM input device.

bool PcmInStart (double *, int, double, bool=true, bool=false)
 Start input operation.

bool PcmInStop ()
 Stop input operation.

long PcmInRead (float *, long)
 Read input samples.

long PcmInRead (double *, long)
bool PcmBufferSizeSet (unsigned int)
 Set buffer size for PCM device.

int PcmBufferSizeGet ()
 Get buffer size for PCM device.

size_t PcmGetIntSampleSize ()
 Get internal sample size (for calculating buffer sizes).


Private Member Functions

void SetError ()
bool PcmStart (int, double *, int, unsigned int *, unsigned int, bool, bool)
long PcmRead (sampl_t **, long)

Private Attributes

int iInSubDev
char * cpErrorMsg
comedi_t * comediDev
lsampl_t iInMaxValue
clAlloc InScanList
clAlloc InBuf


Detailed Description

Class for Comedi IO operations.

Definition at line 36 of file ComediIO.hh.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
VERS_MASK_MAJ 
VERS_MASK_MIN 
VERS_MASK_PL 

Definition at line 49 of file ComediIO.hh.

anonymous enum
 

Enumeration values:
VERS_SHIFT_MAJ 
VERS_SHIFT_MIN 
VERS_SHIFT_PL 

Definition at line 55 of file ComediIO.hh.


Constructor & Destructor Documentation

clComediIO::clComediIO  ) 
 

Definition at line 108 of file ComediIO.cc.

References comediDev, cpErrorMsg, and iInSubDev.

clComediIO::~clComediIO  ) 
 

Definition at line 116 of file ComediIO.cc.

References Close().


Member Function Documentation

void clComediIO::SetError  )  [private]
 

Definition at line 30 of file ComediIO.cc.

References cpErrorMsg.

Referenced by Close(), GetVersionCode(), Open(), PcmBufferSizeGet(), PcmBufferSizeSet(), PcmInClose(), PcmInGetChannelCount(), PcmInOpen(), PcmInRead(), PcmInStart(), PcmInStop(), and PcmStart().

bool clComediIO::PcmStart int  iSubDev,
double *  dpSampleRate,
int  iChannels,
unsigned int *  uipScanList,
unsigned int  uiListLength,
bool  bDither,
bool  bDoubleClock
[private]
 

dpSampleRate = 1.0 / ((double) sComediCmd.convert_arg * iChannels / 1.0e9);

Definition at line 38 of file ComediIO.cc.

References comediDev, and SetError().

Referenced by PcmInStart().

long clComediIO::PcmRead sampl_t **  ,
long 
[private]
 

Definition at line 86 of file ComediIO.cc.

References comediDev, and InBuf.

Referenced by PcmInRead().

bool clComediIO::Open const char *   ) 
 

Open device.

Parameters:
cpDevice Device filename
Returns:
Success?

Definition at line 122 of file ComediIO.cc.

References comediDev, and SetError().

Referenced by clComediSrv::AudioInThread().

bool clComediIO::Close  ) 
 

Close device.

Returns:
Success?

Definition at line 134 of file ComediIO.cc.

References comediDev, cpErrorMsg, iInSubDev, and SetError().

Referenced by clComediSrv::AudioInThread(), and ~clComediIO().

int clComediIO::GetSubdeviceCount  ) 
 

Get number of subdevices.

Returns:
Number of subdevices

Definition at line 163 of file ComediIO.cc.

References comediDev.

int clComediIO::GetVersionCode  ) 
 

Get version code.

Returns:
Version code

Definition at line 169 of file ComediIO.cc.

References comediDev, and SetError().

Referenced by clComediSrv::AudioInThread().

const char * clComediIO::GetDriverName  ) 
 

Get driver name.

Returns:
Driver name

Definition at line 180 of file ComediIO.cc.

References comediDev.

Referenced by clComediSrv::AudioInThread().

const char * clComediIO::GetBoardName  ) 
 

Get board name.

Returns:
Board name

Definition at line 186 of file ComediIO.cc.

References comediDev.

Referenced by clComediSrv::AudioInThread().

const char* clComediIO::GetErrorMsg  )  [inline]
 

Get error message.

Returns:
Error message

Definition at line 106 of file ComediIO.hh.

References cpErrorMsg.

Referenced by clComediSrv::AudioInThread().

bool clComediIO::PcmInOpen  ) 
 

Open PCM input device.

Returns:
Success?

Definition at line 192 of file ComediIO.cc.

References comediDev, iInMaxValue, iInSubDev, and SetError().

bool clComediIO::PcmInClose  ) 
 

Close PCM input device.

Returns:
Success?

Definition at line 216 of file ComediIO.cc.

References comediDev, iInSubDev, and SetError().

Referenced by clComediSrv::AudioInThread().

int clComediIO::PcmInGetChannelCount  ) 
 

Get number of channels for PCM input device.

Returns:
Number of channels

Definition at line 231 of file ComediIO.cc.

References comediDev, iInSubDev, and SetError().

bool clComediIO::PcmInStart double *  ,
int  ,
double  ,
bool  = true,
bool  = false
 

Start input operation.

Parameters:
dpSampleRate Samplerate (actual rate is returned)
iChannels Number of channels to use
dRange Input range (in volts)
bDither User dither?
bDoubleClock Use scan/channel timers instead of one?
Returns:
Success?

Definition at line 242 of file ComediIO.cc.

References comediDev, iInSubDev, InScanList, PcmStart(), and SetError().

Referenced by clComediSrv::AudioInThread().

bool clComediIO::PcmInStop  ) 
 

Stop input operation.

Returns:
Success?

Definition at line 265 of file ComediIO.cc.

References comediDev, iInSubDev, and SetError().

Referenced by clComediSrv::AudioInThread().

long clComediIO::PcmInRead float *  ,
long 
 

Read input samples.

Parameters:
Buffer 
Buffer size (in samples)
Returns:
Number of samples

Definition at line 276 of file ComediIO.cc.

References iInMaxValue, PcmRead(), and SetError().

Referenced by clComediSrv::AudioInThread().

long clComediIO::PcmInRead double *  ,
long 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 296 of file ComediIO.cc.

References iInMaxValue, PcmRead(), and SetError().

bool clComediIO::PcmBufferSizeSet unsigned  int  ) 
 

Set buffer size for PCM device.

Note:
Buffer size must be multiple of pagesize.
Parameters:
uiBufSize Buffer size
Returns:
Success?

Definition at line 316 of file ComediIO.cc.

References comediDev, iInSubDev, and SetError().

Referenced by clComediSrv::AudioInThread().

int clComediIO::PcmBufferSizeGet  ) 
 

Get buffer size for PCM device.

Returns:
Size of buffer

Definition at line 334 of file ComediIO.cc.

References comediDev, iInSubDev, and SetError().

Referenced by clComediSrv::AudioInThread().

size_t clComediIO::PcmGetIntSampleSize  )  [inline]
 

Get internal sample size (for calculating buffer sizes).

Returns:
Intenal sample size

Definition at line 174 of file ComediIO.hh.

Referenced by clComediSrv::AudioInThread().


Member Data Documentation

int clComediIO::iInSubDev [private]
 

Definition at line 38 of file ComediIO.hh.

Referenced by clComediIO(), Close(), PcmBufferSizeGet(), PcmBufferSizeSet(), PcmInClose(), PcmInGetChannelCount(), PcmInOpen(), PcmInStart(), and PcmInStop().

char* clComediIO::cpErrorMsg [private]
 

Definition at line 39 of file ComediIO.hh.

Referenced by clComediIO(), Close(), GetErrorMsg(), and SetError().

comedi_t* clComediIO::comediDev [private]
 

Definition at line 40 of file ComediIO.hh.

Referenced by clComediIO(), Close(), GetBoardName(), GetDriverName(), GetSubdeviceCount(), GetVersionCode(), Open(), PcmBufferSizeGet(), PcmBufferSizeSet(), PcmInClose(), PcmInGetChannelCount(), PcmInOpen(), PcmInStart(), PcmInStop(), PcmRead(), and PcmStart().

lsampl_t clComediIO::iInMaxValue [private]
 

Definition at line 41 of file ComediIO.hh.

Referenced by PcmInOpen(), and PcmInRead().

clAlloc clComediIO::InScanList [private]
 

Definition at line 42 of file ComediIO.hh.

Referenced by PcmInStart().

clAlloc clComediIO::InBuf [private]
 

Definition at line 43 of file ComediIO.hh.

Referenced by PcmRead().


The documentation for this class was generated from the following files:
Generated on Sun Oct 26 19:12:14 2003 for HASAS by doxygen 1.3.3