org.lwjgl.openal.SOFTPauseDevice Maven / Gradle / Ivy
Show all versions of lwjgl-openal Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.openal;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
/**
* Native bindings to the SOFT_pause_device extension.
*
* This extension allows applications to pause a playback device. The main purpose of this is to silence output, stop processing, and allow the audio
* hardware to go into a low-power mode. On a mobile device, for instance, apps may want to silence output and not waste battery life with unneeded
* processing when in the background.
*/
public class SOFTPauseDevice {
protected SOFTPauseDevice() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(ALCCapabilities caps) {
return checkFunctions(
caps.alcDevicePauseSOFT, caps.alcDeviceResumeSOFT
);
}
// --- [ alcDevicePauseSOFT ] ---
/**
* Pauses a playback device.
*
* When paused, no contexts associated with the device will be processed or updated. Playing sources will not produce sound, have their offsets
* incremented, or process any more buffers, until the device is resumed. Pausing a device that is already paused is a legal no-op.
*
* @param device the device to pause
*/
@NativeType("ALCvoid")
public static void alcDevicePauseSOFT(@NativeType("ALCdevice *") long device) {
long __functionAddress = ALC.getICD().alcDevicePauseSOFT;
if (CHECKS) {
check(__functionAddress);
check(device);
}
invokePV(__functionAddress, device);
}
// --- [ alcDeviceResumeSOFT ] ---
/**
* Resumes playback of a paused device.
*
* This will restart processing on the device -- sources will resume playing sound as normal. Resuming playback on a device that is not paused is a legal
* no-op.
*
* These functions are not reference counted. alcDeviceResumeSOFT only needs to be called once to resume playback, regardless of how many times
* {@link #alcDevicePauseSOFT DevicePauseSOFT} was called.
*
* @param device the device to resume
*/
@NativeType("ALCvoid")
public static void alcDeviceResumeSOFT(@NativeType("ALCdevice *") long device) {
long __functionAddress = ALC.getICD().alcDeviceResumeSOFT;
if (CHECKS) {
check(__functionAddress);
check(device);
}
invokePV(__functionAddress, device);
}
}