Beispiel #1
0
 public static FMOD_RESULT Memory_Initialize(
     ByteBuffer poolmem,
     int poollen,
     FMOD_MEMORY_ALLOCCALLBACK useralloc,
     FMOD_MEMORY_REALLOCCALLBACK userrealloc,
     FMOD_MEMORY_FREECALLBACK userfree,
     int memtypeflags) {
   if (poolmem != null && !poolmem.isDirect()) {
     throw new NonDirectBufferException();
   }
   if (useralloc != null && userrealloc != null && userfree != null) {
     CallbackManager.addCallback(25, useralloc, 0);
     CallbackManager.addCallback(27, userrealloc, 0);
     CallbackManager.addCallback(26, userfree, 0);
   } else {
     useralloc = null;
     userrealloc = null;
     userfree = null;
   }
   int javaResult =
       FmodExJNI.FmodEx_Memory_Initialize(
           poolmem,
           BufferUtils.getPositionInBytes(poolmem),
           poollen,
           useralloc == null ? false : true,
           userrealloc == null ? false : true,
           userfree == null ? false : true,
           memtypeflags);
   return FMOD_RESULT.get(javaResult);
 }
Beispiel #2
0
 public static FMOD_RESULT File_GetDiskBusy(IntBuffer busy) {
   if (busy != null && !busy.isDirect()) {
     throw new NonDirectBufferException();
   }
   int javaResult = FmodExJNI.FmodEx_File_GetDiskBusy(busy, BufferUtils.getPositionInBytes(busy));
   return FMOD_RESULT.get(javaResult);
 }
Beispiel #3
0
 public static FMOD_RESULT Debug_GetLevel(IntBuffer level) {
   if (level != null && !level.isDirect()) {
     throw new NonDirectBufferException();
   }
   int javaResult = FmodExJNI.FmodEx_Debug_GetLevel(level, BufferUtils.getPositionInBytes(level));
   return FMOD_RESULT.get(javaResult);
 }
Beispiel #4
0
 @Override
 public synchronized void pause() {
   ByteBuffer buffer = BufferUtils.newByteBuffer(SIZEOF_INT);
   channel.getPaused(buffer);
   paused = (buffer.get(0) == 0); // 0 means it's playing
   channel.setPaused(paused);
 }
Beispiel #5
0
 public static FMOD_RESULT Memory_GetStats(
     IntBuffer currentalloced, IntBuffer maxalloced, boolean blocking) {
   if (currentalloced != null && !currentalloced.isDirect()) {
     throw new NonDirectBufferException();
   }
   if (maxalloced != null && !maxalloced.isDirect()) {
     throw new NonDirectBufferException();
   }
   int javaResult =
       FmodExJNI.FmodEx_Memory_GetStats(
           currentalloced,
           BufferUtils.getPositionInBytes(currentalloced),
           maxalloced,
           BufferUtils.getPositionInBytes(maxalloced),
           blocking);
   return FMOD_RESULT.get(javaResult);
 }
Beispiel #6
0
 @Override
 public int getRow() {
   IntBuffer ib = BufferUtils.newIntBuffer(1);
   channel.getPosition(ib, FMOD_TIMEUNIT_MODROW);
   return ib.get(0);
 }