Exemplo n.º 1
0
 private void addBytesToTrackSequential(int addr, int length) {
   if (length > 0) {
     mem.memcpy(bufBytes.bufferAddr + bufBytes.writeOffset, addr, length);
     bufBytes.writeOffset += length;
     bufBytes.sizeAvailableForRead += length;
   }
 }
Exemplo n.º 2
0
  public void addBytesToTrack(int addr, int length) {
    int length1 = Math.min(length, bufBytes.totalSize - bufBytes.writeOffset);
    addBytesToTrackSequential(addr, length1);

    int length2 = length - length1;
    if (length2 > 0) {
      bufBytes.writeOffset = 0;
      addBytesToTrackSequential(addr + length1, length2);
    }
  }
Exemplo n.º 3
0
  public void readBytes(int addr, int length) {
    length = Math.min(length, bufBytes.sizeAvailableForRead);
    if (length > 0) {
      int length1 = Math.min(length, bufBytes.totalSize - bufBytes.readOffset);
      mem.memcpy(addr, bufBytes.bufferAddr + bufBytes.readOffset, length1);

      int length2 = length - length1;
      if (length2 > 0) {
        mem.memcpy(addr + length1, bufBytes.bufferAddr, length2);
      }

      bufBytes.notifyRead(length);
    }
  }
Exemplo n.º 4
0
 public void addSamplesToTrack(int samples) {
   bufSamples.sizeAvailableForRead += samples;
   currentSample += samples;
 }