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); } } }
Status jmeStatus = src.getStatus();
Status jmeStatus = src.getStatus();
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(); } } } } }
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); } } }
Status jmeStatus = src.getStatus();
Status jmeStatus = src.getStatus();
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(); } } } } }