public void pauseSource(AudioSource src) { checkDead(); synchronized (threadLock) { if (audioDisabled) { return; } if (src.getStatus() == Status.Playing) { assert src.getChannel() != -1; al.alSourcePause(channels[src.getChannel()]); src.setStatus(Status.Paused); } } }
if (src.getChannel() < 0) { return 0; int id = channels[src.getChannel()]; AudioData data = src.getAudioData(); int playbackOffsetBytes = 0;
boolean boundSource = i == src.getChannel(); boolean reclaimChannel = false;
public void stopSource(AudioSource src) { synchronized (threadLock) { if (audioDisabled) { return; } if (src.getStatus() != Status.Stopped) { int chan = src.getChannel(); assert chan != -1; // if it's not stopped, must have id src.setStatus(Status.Stopped); src.setChannel(-1); clearChannel(chan); freeChannel(chan); if (src.getAudioData() instanceof AudioStream) { // If the stream is seekable, then rewind it. // Otherwise, close it, as it is no longer valid. AudioStream stream = (AudioStream)src.getAudioData(); if (stream.isSeekable()) { stream.setTime(0); } else { stream.close(); } } } } }
al.alSourcePlay(channels[src.getChannel()]); src.setStatus(Status.Playing);
if (src.getChannel() < 0) { return; assert src.getChannel() >= 0; int id = channels[src.getChannel()]; switch (param) { case Position:
public void pauseSource(AudioSource src) { checkDead(); synchronized (threadLock) { if (audioDisabled) { return; } if (src.getStatus() == Status.Playing) { assert src.getChannel() != -1; al.alSourcePause(channels[src.getChannel()]); src.setStatus(Status.Paused); } } }
if (src.getChannel() < 0) { return 0; int id = channels[src.getChannel()]; AudioData data = src.getAudioData(); int playbackOffsetBytes = 0;
boolean boundSource = i == src.getChannel(); boolean reclaimChannel = false;
public void stopSource(AudioSource src) { synchronized (threadLock) { if (audioDisabled) { return; } if (src.getStatus() != Status.Stopped) { int chan = src.getChannel(); assert chan != -1; // if it's not stopped, must have id src.setStatus(Status.Stopped); src.setChannel(-1); clearChannel(chan); freeChannel(chan); if (src.getAudioData() instanceof AudioStream) { // If the stream is seekable, then rewind it. // Otherwise, close it, as it is no longer valid. AudioStream stream = (AudioStream)src.getAudioData(); if (stream.isSeekable()) { stream.setTime(0); } else { stream.close(); } } } } }
al.alSourcePlay(channels[src.getChannel()]); src.setStatus(Status.Playing);
if (src.getChannel() < 0) { return; assert src.getChannel() >= 0; int id = channels[src.getChannel()]; switch (param) { case Position: