All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.util.opus.OPDecodeCBFunc Maven / Gradle / Ivy

There is a newer version: 3.3.5
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.util.opus;

import org.jspecify.annotations.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;

/**
 * Instances of this class may be passed to the {@link OpusFile#op_set_decode_callback} method.
 * 
 * 

Type

* *

 * int (*{@link #invoke}) (
 *     void *_ctx,
 *     OpusMSDecoder *_decoder,
 *     void *_pcm,
 *     ogg_packet const *_op,
 *     int _nsamples,
 *     int _nchannels,
 *     int _format,
 *     int _li
 * )
*/ public abstract class OPDecodeCBFunc extends Callback implements OPDecodeCBFuncI { /** * Creates a {@code OPDecodeCBFunc} instance from the specified function pointer. * * @return the new {@code OPDecodeCBFunc} */ public static OPDecodeCBFunc create(long functionPointer) { OPDecodeCBFuncI instance = Callback.get(functionPointer); return instance instanceof OPDecodeCBFunc ? (OPDecodeCBFunc)instance : new Container(functionPointer, instance); } /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ public static @Nullable OPDecodeCBFunc createSafe(long functionPointer) { return functionPointer == NULL ? null : create(functionPointer); } /** Creates a {@code OPDecodeCBFunc} instance that delegates to the specified {@code OPDecodeCBFuncI} instance. */ public static OPDecodeCBFunc create(OPDecodeCBFuncI instance) { return instance instanceof OPDecodeCBFunc ? (OPDecodeCBFunc)instance : new Container(instance.address(), instance); } protected OPDecodeCBFunc() { super(CIF); } OPDecodeCBFunc(long functionPointer) { super(functionPointer); } private static final class Container extends OPDecodeCBFunc { private final OPDecodeCBFuncI delegate; Container(long functionPointer, OPDecodeCBFuncI delegate) { super(functionPointer); this.delegate = delegate; } @Override public int invoke(long _ctx, long _decoder, long _pcm, long _op, int _nsamples, int _nchannels, int _format, int _li) { return delegate.invoke(_ctx, _decoder, _pcm, _op, _nsamples, _nchannels, _format, _li); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy