Esempio n. 1
0
template <class T>void SamplesInput::bin1::readSamples ( shared_ptr<TracesMatrix>& traces, unsigned long curtrace, unsigned long startingsample, unsigned long numsamples )
{
	T* buffer;
	//File is big enough, checked right after open.
	buffer = ( T* ) ( ( char* ) fileoffset + getSampleOffset ( curtrace, startingsample ) );
	for ( unsigned long i = 0; i < numsamples; i++ ) {
		( *traces ) ( curtrace, i ) = buffer[i];
	}
}
Esempio n. 2
0
 virtual double getAudioClock()
 {
     return (double)getSampleOffset()/(double)mAudioContext->sample_rate -
            MWBase::Environment::get().getSoundManager()->getTrackTimeDelay(mAudioTrack);
 }
bool RxIoSampleBaseResponse::isDigitalEnabled(uint8_t pin) {
	if (pin < 8) {
		return ((getFrameData()[getSampleOffset() + 4] >> pin) & 1) == 1;
	}
	else {
		return (getFrameData()[getSampleOffset() + 3] & 1) == 1;
bool RxIoSampleBaseResponse::isAnalogEnabled(uint8_t pin) {
	return (((getFrameData()[getSampleOffset() + 1] >> (pin + 1)) & 1) == 1);
}
bool RxIoSampleBaseResponse::containsDigital() {
	return (getFrameData()[getSampleOffset() + 1] & 0x1) > 0 || getFrameData()[getSampleOffset() + 2] > 0;
}
bool RxIoSampleBaseResponse::containsAnalog() {
	return (getFrameData()[getSampleOffset() + 1] & 0x7e) > 0;
}
uint8_t RxIoSampleBaseResponse::getSampleSize() {
	return getFrameData()[getSampleOffset()];
}