
org.freedesktop.gstreamer.gst.LibraryError Maven / Gradle / Ivy
/* Java-GI - Java language bindings for GObject-Introspection-based libraries
* Copyright (C) 2022-2023 Jan-Willem Harmannij
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see .
*/
/* This file has been generated with Java-GI.
* Do not edit this file directly!
* Visit https://jwharm.github.io/java-gi for more information.
*/
package org.freedesktop.gstreamer.gst;
import io.github.jwharm.javagi.gobject.*;
import io.github.jwharm.javagi.gobject.types.*;
import io.github.jwharm.javagi.base.*;
import io.github.jwharm.javagi.interop.*;
import java.lang.foreign.*;
import java.lang.invoke.*;
import org.jetbrains.annotations.*;
/**
* Library errors are for errors from the library being used by elements
* (initializing, finalizing, settings, ...)
*/
public enum LibraryError implements io.github.jwharm.javagi.base.Enumeration {
/**
* a general error which doesn't fit in any other
* category. Make sure you add a custom message to the error call.
*/
FAILED(1),
/**
* do not use this except as a placeholder for
* deciding where to go while developing code.
*/
TOO_LAZY(2),
/**
* used when the library could not be opened.
*/
INIT(3),
/**
* used when the library could not be closed.
*/
SHUTDOWN(4),
/**
* used when the library doesn't accept settings.
*/
SETTINGS(5),
/**
* used when the library generated an encoding error.
*/
ENCODE(6),
/**
* the number of library error types.
*/
NUM_ERRORS(7);
/**
* Get the GType of the GstLibraryError class.
* @return the GType
*/
public static org.gnome.glib.Type getType() {
return Interop.getType("gst_library_error_get_type");
}
private final int value;
/**
* Create a new LibraryError for the provided value
* @param value the enum value
*/
LibraryError(int value) {
this.value = value;
}
/**
* Get the numeric value of this enum
* @return the enum value
*/
@Override
public int getValue() {
return value;
}
/**
* Create a new LibraryError for the provided value
* @param value the enum value
* @return the enum for the provided value
*/
public static LibraryError of(int value) {
return switch (value) {
case 1 -> FAILED;
case 2 -> TOO_LAZY;
case 3 -> INIT;
case 4 -> SHUTDOWN;
case 5 -> SETTINGS;
case 6 -> ENCODE;
case 7 -> NUM_ERRORS;
default -> throw new IllegalStateException("Unexpected value: " + value);
};
}
public static org.gnome.glib.Quark quark() {
FunctionDescriptor _fdesc = FunctionDescriptor.of(ValueLayout.JAVA_INT);
int _result;
try {
_result = (int) Interop.downcallHandle("gst_library_error_quark", _fdesc, false).invokeExact();
} catch (Throwable _err) {
throw new AssertionError("Unexpected exception occurred: ", _err);
}
return new org.gnome.glib.Quark(_result);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy