コード例 #1
0
ファイル: bin1.cpp プロジェクト: maxximino/dpacalc
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];
	}
}
コード例 #2
0
ファイル: movieaudiofactory.cpp プロジェクト: OpenMW/openmw
 virtual double getAudioClock()
 {
     return (double)getSampleOffset()/(double)mAudioContext->sample_rate -
            MWBase::Environment::get().getSoundManager()->getTrackTimeDelay(mAudioTrack);
 }
コード例 #3
0
bool RxIoSampleBaseResponse::isDigitalEnabled(uint8_t pin) {
	if (pin < 8) {
		return ((getFrameData()[getSampleOffset() + 4] >> pin) & 1) == 1;
	}
	else {
		return (getFrameData()[getSampleOffset() + 3] & 1) == 1;
コード例 #4
0
bool RxIoSampleBaseResponse::isAnalogEnabled(uint8_t pin) {
	return (((getFrameData()[getSampleOffset() + 1] >> (pin + 1)) & 1) == 1);
}
コード例 #5
0
bool RxIoSampleBaseResponse::containsDigital() {
	return (getFrameData()[getSampleOffset() + 1] & 0x1) > 0 || getFrameData()[getSampleOffset() + 2] > 0;
}
コード例 #6
0
bool RxIoSampleBaseResponse::containsAnalog() {
	return (getFrameData()[getSampleOffset() + 1] & 0x7e) > 0;
}
コード例 #7
0
uint8_t RxIoSampleBaseResponse::getSampleSize() {
	return getFrameData()[getSampleOffset()];
}