void SampleAudioSource::getNextAudioBlock(const AudioSourceChannelInfo& buf) {
    ScopedLock l(lock_);
    if (not (source_ and isRunning_)) {
        buf.clearActiveBufferRegion();
        return;
    }

    currentTime_ += buf.numSamples;
    SampleTime overrun(currentTime_ - length_);
    if (overrun < 0) {
        source_->getNextAudioBlock(buf);
        panGainPlayer_->apply(buf);
        return;
    }

    AudioSourceChannelInfo b = buf;
    b.numSamples -= overrun;
    source_->getNextAudioBlock(b);
    panGainPlayer_->apply(b);
    b.startSample += b.numSamples;
    b.numSamples = overrun;
    b.clearActiveBufferRegion();
    isRunning_ = false;
    callback_(callbackData_);
    // Might block - perhaps we should do this in another thread?
}
Beispiel #2
0
void processRTL8019Interrupt(void)
{
  volatile unsigned char *base = (unsigned char *)0x8300;
  unsigned char byte = readRTL(ISR);
	
  if( byte & (1<<ISR_OVW) )
    overrun();

}