// If there's still data to copy memcpy whatever remains, starting at the first element *(begin) until the end of data. The first step will have ensured
// that we don't crash into the tail during this process.
// Should be from 1 - 16, specifies which channel to observe as input i
m_oConfig.analog_in_channel[i]=i+1;
// Don't use any of the filters on channel i
m_oConfig.bandpass[i]=GT_FILTER_NONE;
// Don't use any of the notch filters on channel i
m_oConfig.notch[i]=GT_FILTER_NONE;
// Don't use any of the other channels for bi-polar derivation
m_oConfig.bipolar[i]=GT_BIPOLAR_DERIVATION_NONE;
}
// Now look for any connected devices. If any exist we'll set the name to the first one found
char**l_pDeviceList=0;
size_tl_ui32ListSize=0;
// Refresh and get the list of currently connnected devices
GT_UpdateDevices();
l_ui32ListSize=GT_GetDeviceListSize();
l_pDeviceList=GT_GetDeviceList();
// If any devices were found at all, set the combo box to the first one listed
if(l_ui32ListSize)
{
m_oDeviceName=l_pDeviceList[0];
}
GT_FreeDeviceList(l_pDeviceList,l_ui32ListSize);
// Now retrieve all those configs from the settings file if they are there to be found (don't need to worry about sample rate or channel number though since they're already in the header)
// If the scan digital inputs flag is set, the API will return one extra channel outside of the analog data requested, so we need to match that on the header
// So when the gtec buffer grows larger than a send buffer, copy it all to a send buffer sized array, then copy it into the actual send buffer one by one.
booleanCDriverGTecGUSBampLinux::loop(void)
{
if(!m_rDriverContext.isConnected())returnfalse;
if(!m_rDriverContext.isStarted())returntrue;
OpenViBE::CStimulationSetl_oStimulationSet;
// while there's new data available on the queue
while(m_oSampleQueue.Avail())
{
// take it off and put it in the appropriate element in the outgoing buffer