///
///
///
///
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Wp?version=0.5' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace Wp {
/**
* Wp-0.5
*/
export namespace ConstraintType {
export const $gtype: GObject.GType;
}
enum ConstraintType {
NONE,
PW_GLOBAL_PROPERTY,
PW_PROPERTY,
G_PROPERTY,
}
export namespace ConstraintVerb {
export const $gtype: GObject.GType;
}
enum ConstraintVerb {
EQUALS,
NOT_EQUALS,
IN_LIST,
IN_RANGE,
MATCHES,
IS_PRESENT,
IS_ABSENT,
}
export namespace Direction {
export const $gtype: GObject.GType;
}
enum Direction {
INPUT,
OUTPUT,
}
export namespace LibraryErrorEnum {
export const $gtype: GObject.GType;
}
enum LibraryErrorEnum {
INVARIANT,
INVALID_ARGUMENT,
OPERATION_FAILED,
SERVICE_UNAVAILABLE,
}
export namespace LinkState {
export const $gtype: GObject.GType;
}
enum LinkState {
ERROR,
UNLINKED,
INIT,
NEGOTIATING,
ALLOCATING,
PAUSED,
ACTIVE,
}
export namespace NodeState {
export const $gtype: GObject.GType;
}
enum NodeState {
ERROR,
CREATING,
SUSPENDED,
IDLE,
RUNNING,
}
export namespace SettingsSpecType {
export const $gtype: GObject.GType;
}
enum SettingsSpecType {
UNKNOWN,
BOOL,
INT,
FLOAT,
STRING,
ARRAY,
OBJECT,
}
export namespace SiAdapterPortsState {
export const $gtype: GObject.GType;
}
enum SiAdapterPortsState {
NONE,
CONFIGURING,
CONFIGURED,
}
export namespace TransitionStep {
export const $gtype: GObject.GType;
}
enum TransitionStep {
NONE,
ERROR,
CUSTOM_START,
}
const ITERATOR_METHODS_VERSION: number;
/**
* A custom GLib log level for trace messages (extension of GLogLevelFlags)
*/
const LOG_LEVEL_TRACE: number;
/**
* Special value that can be used to activate all the supported features in any given object.
*/
const OBJECT_FEATURES_ALL: ObjectFeatures;
const OBJECT_FORMAT: string;
const SETTINGS_PERSISTENT_METADATA_NAME_PREFIX: string;
const SETTINGS_SCHEMA_METADATA_NAME_PREFIX: string;
/**
* Type id representing an invalid SPA type.
*/
const SPA_TYPE_INVALID: SpaType;
/**
* Searches for `filename` in the hierarchy of directories specified by the `flags` parameter.
*
*
* Returns the highest priority file found in the hierarchy of directories specified by the `flags` parameter. The `subdir` parameter is the name of the subdirectory to search in, inside the specified directories. If `subdir` is NULL, the base path of each directory is used.
* The `filename` parameter is the name of the file to search for. If the file is found, its full path is returned. If the file is not found, NULL is returned. The file is considered found if it is a regular file.
* If the `filename` is an absolute path, it is tested for existence and returned as is, ignoring the lookup directories in `flags` as well as the `subdir` parameter.
* @param flags flags to specify the directories to look into and other options specific to the kind of file being looked up
* @param subdir the name of the subdirectory to search in, inside the specified directories
* @param filename the name of the file to search for
* @returns A newly allocated string with the absolute, canonicalized file path, or NULL if the file was not found.
*/
function base_dirs_find_file(
flags: BaseDirsFlags | null,
subdir: string | null,
filename: string,
): string | null;
/**
* Creates an iterator to iterate over all files that match `suffix` within the `subdir` of the directories specified in `flags`.
*
*
* The `subdir` parameter is the name of the subdirectory to search in, inside the directories specified by `flags`. If `subdir` is NULL, the base path of each directory is used. If `subdir` is an absolute path, files are only looked up in that directory and the directories in `flags` are ignored.
* The `suffix` parameter is the filename suffix to match. If `suffix` is NULL, all files are matched.
* The iterator will iterate over the absolute paths of all the files files found, in the order of priority of the directories, starting from the lowest priority directory (e.g. /usr/share/wireplumber) and ending with the highest priority directory (e.g. $XDG_CONFIG_HOME/wireplumber). Files within each directory are also sorted by filename.
* @param flags flags to specify the directories to look into and other options specific to the kind of file being looked up
* @param subdir the name of the subdirectory to search in, inside the configuration directories
* @param suffix The filename suffix, NULL matches all entries
* @returns a new iterator iterating over strings which are absolute & canonicalized paths to the files found
*/
function base_dirs_new_files_iterator(
flags: BaseDirsFlags | null,
subdir?: string | null,
suffix?: string | null,
): Iterator;
function domain_library_quark(): GLib.Quark;
/**
* Gets the WirePlumber library API version.
* @returns WirePlumber library API version
*/
function get_library_api_version(): string;
/**
* Gets the WirePlumber library version.
* @returns WirePlumber library version
*/
function get_library_version(): string;
/**
* Initializes WirePlumber and PipeWire underneath.
*
*
* `flags` can modify which parts are initialized, in cases where you want to handle part of this initialization externally.
* @param flags initialization flags
*/
function init(flags: InitFlags | null): void;
/**
* Matches the given properties against a set of rules described in JSON and calls the given callback to perform actions on a successful match.
*
*
* The given JSON should be an array of objects, where each object has a "matches" and an "actions" property. The "matches" value should also be an array of objects, where each object is a set of properties to match. Inside such an object, all properties must match to consider a successful match. However, if multiple objects are provided, only one object needs to match.
* The "actions" value should be an object where the key is the action name and the value can be any valid JSON. Both the action name and the value are passed as-is on the `callback`.
* @param json a JSON array containing rules in the described format
* @param match_props the properties to match against the rules
* @param callback a function to call for each action on a successful match
* @returns FALSE if an error occurred, TRUE otherwise
*/
function json_utils_match_rules(json: SpaJson, match_props: Properties, callback: RuleMatchCallback): boolean;
/**
* Matches the given properties against a set of rules described in JSON and updates the properties if the rule actions include the "update-props" action.
* @param json a JSON array containing rules in the format accepted by wp_json_utils_match_rules()
* @param props the properties to match against the rules and also update, acting on the "update-props" action
* @returns the number of properties that were updated
*/
function json_utils_match_rules_update_properties(json: SpaJson, props: Properties): number;
/**
* Merges two JSON containers (objects or arrays) into one.
*
*
* If both `a` and `b` are objects, the result will be a new object containing all properties from both `a` and `b`. If a property exists in both `a` and `b,` the values are recursively merged. If a property exists in both `a` and `b` and the property name starts with the "override." prefix in either of those, the value from the key with the prefix is used.
* If both `a` and `b` are arrays, the result will be a new array containing all elements from both `a` and `b`.
* If `a` and `b` are not of the same type, NULL is returned.
* @param a a JSON container
* @param b a JSON container
* @returns a new JSON container containing the merged contents of @a and @b or NULL if @a and @b are not of the same type
*/
function json_utils_merge_containers(a: SpaJson, b: SpaJson): SpaJson;
function log_set_level(log_level: string): boolean;
/**
* WirePlumber's GLogWriterFunc.
*
*
* This is installed automatically when you call wp_init() with WP_INIT_SET_GLIB_LOG set in the flags
* @param log_level
* @param fields
* @param n_fields
* @param user_data
*/
function log_writer_default(
log_level: GLib.LogLevelFlags | null,
fields: GLib.LogField,
n_fields: number,
user_data?: any | null,
): GLib.LogWriterOutput;
/**
* Registers an additional WpSpaIdTable in the spa type system.
*
*
* This is useful to add custom enumeration types.
* Note that both `name` and `values` must be statically allocated, or otherwise guaranteed to be kept in memory until wp_spa_dynamic_type_deinit() is called. No memory copy is done by this function.
* @param name the name of the id table
* @param values an array of spa_type_info that contains the values of the table
* @returns the new table
*/
function spa_dynamic_id_table_register(name: string, values?: any | null): SpaIdTable;
/**
* Deinitializes the spa type registry.
*
*
* You do not need to ever call this, unless you want to free memory at the end of the execution of a test, so that it doesn't show as leaked in the memory profiler.
*/
function spa_dynamic_type_deinit(): void;
/**
* Initializes the spa dynamic type registry.
*
*
* This allows registering new spa types at runtime. The spa type system still works if this function is not called.
* Normally called by wp_init() when WP_INIT_SPA_TYPES is passed in its flags.
*/
function spa_dynamic_type_init(): void;
/**
* Registers an additional type in the spa type system.
*
*
* This is useful to add a custom pod object type.
* Note that both `name` and `values` must be statically allocated, or otherwise guaranteed to be kept in memory until wp_spa_dynamic_type_deinit() is called. No memory copy is done by this function.
* @param name the name of the type
* @param parent the parent type
* @param values an array of spa_type_info that contains the values of the type, used only for Object types
* @returns the new type
*/
function spa_dynamic_type_register(name: string, parent: SpaType, values?: any | null): SpaType;
/**
* Finds a value in an SPA Id table.
* @param table the id table
* @param value a numeric value that is contained in the table
* @returns the WpSpaIdValue associated with @value, or NULL
*/
function spa_id_table_find_value(table: SpaIdTable, value: number): SpaIdValue | null;
/**
* Finds a named value in an SPA Id table.
* @param table the id table
* @param name the full name of a value that is contained in the table
* @returns the WpSpaIdValue associated with @name, or NULL
*/
function spa_id_table_find_value_from_name(table: SpaIdTable, name: string): SpaIdValue | null;
/**
* Finds a short named value in an SPA Id table.
* @param table the id table
* @param short_name the short name of a value that is contained in the table
* @returns the WpSpaIdValue associated with @short_name, or NULL
*/
function spa_id_table_find_value_from_short_name(table: SpaIdTable, short_name: string): SpaIdValue | null;
/**
* Finds a WpSpaIdTable given its name.
*
*
* This name can either be the full type name of an object type, or the name of an enum (which is (!!) a type). For example, "Spa:Pod:Object:Param:Format" and "Spa:Enum:ParamId" are both valid table names.
* @param name the full name of an id table
* @returns the associated table, or NULL
*/
function spa_id_table_from_name(name: string): SpaIdTable | null;
function spa_id_table_get_type(): GObject.GType;
/**
* This function returns an iterator that allows you to iterate through the values associated with this table.
*
*
* The items in the iterator are of type WpSpaIdValue.
* @param table the id table
* @returns a WpIterator that iterates over WpSpaIdValue items
*/
function spa_id_table_new_iterator(table: SpaIdTable): Iterator;
/**
* If the value type of `id` is SPA_TYPE_Array, this function returns the type that is allowed to be contained inside the array.
*
*
* When the returned type is (or is derived from) SPA_TYPE_Id or SPA_TYPE_Object, `table` is set to point to the WpSpaIdTable that contains the possible Id values / object fields.
* @param id an id value
* @returns the type that is allowed in the array, if @id represents an object field that takes an array as value
*/
function spa_id_value_array_get_item_type(id: SpaIdValue): [SpaType, SpaIdTable | null];
/**
* Looks up an id value (enum, flag or object field) directly from its full name.
*
*
* For instance, "Spa:Enum:Direction:Input" will resolve to the id value that represents "Input" in the "Spa:Enum:Direction" enum.
* @param name the full name of an id value
* @returns the id value for @name, or NULL if no such id value was found
*/
function spa_id_value_from_name(name: string): SpaIdValue;
/**
* Looks up an id value given its container `table_name` and its numeric representation, `id`.
* @param table_name the name of the WpSpaIdTable to look up the value in
* @param id the numeric representation of the value to look up
* @returns the id value or NULL if it was not found
*/
function spa_id_value_from_number(table_name: string, id: number): SpaIdValue;
/**
* Looks up an id value given its container `table_name` and its `short_name`.
* @param table_name the name of the WpSpaIdTable to look up the value in
* @param short_name the short name of the value to look up
* @returns the id value or NULL if it was not found
*/
function spa_id_value_from_short_name(table_name: string, short_name: string): SpaIdValue;
function spa_id_value_get_type(): GObject.GType;
/**
* Returns the value type associated with this WpSpaIdValue.
*
*
* This information is useful when `id` represents an object field, which can take a value of an arbitrary type.
* When the returned type is (or is derived from) SPA_TYPE_Id or SPA_TYPE_Object, `table` is set to point to the WpSpaIdTable that contains the possible Id values / object fields.
* @param id an id value
* @returns the value type associated with @id
*/
function spa_id_value_get_value_type(id: SpaIdValue): [SpaType, SpaIdTable | null];
/**
* Gets the name of an id value.
* @param id an id value
* @returns the full name of this id value
*/
function spa_id_value_name(id: SpaIdValue): string;
/**
* Gets the numeric value of an id value.
* @param id an id value
* @returns the numeric representation of this id value
*/
function spa_id_value_number(id: SpaIdValue): number;
/**
* Gets the short name of an id value.
* @param id an id value
* @returns the short name of this id value
*/
function spa_id_value_short_name(id: SpaIdValue): string;
/**
* Gets WirePlumber's instance of spa_log
* @returns WirePlumber's instance of spa_log, which can be used to redirect PipeWire's log messages to the currently installed GLogWriterFunc. This is installed automatically when you call wp_init() with WP_INIT_SET_PW_LOG set in the flags
*/
function spa_log_get_instance(): any | null;
interface IteratorFoldFunc {
(item: GObject.Value | any, ret: GObject.Value | any, data?: any | null): boolean;
}
interface IteratorForeachFunc {
(item: GObject.Value | any, data?: any | null): void;
}
interface RuleMatchCallback {
(data: any | null, action: string, value: SpaJson): boolean;
}
interface SettingsChangedCallback {
(obj: Settings, setting: string, value: SpaJson): void;
}
export namespace BaseDirsFlags {
export const $gtype: GObject.GType;
}
enum BaseDirsFlags {
ENV_CONFIG,
ENV_DATA,
ENV_MODULE,
XDG_CONFIG_HOME,
XDG_DATA_HOME,
XDG_CONFIG_DIRS,
BUILD_SYSCONFDIR,
XDG_DATA_DIRS,
BUILD_DATADIR,
BUILD_LIBDIR,
FLAG_MODULE,
FLAG_SUBDIR_WIREPLUMBER,
CONFIGURATION,
DATA,
MODULE,
}
export namespace CoreFeatures {
export const $gtype: GObject.GType;
}
enum CoreFeatures {
CONNECTED,
COMPONENTS,
}
export namespace InitFlags {
export const $gtype: GObject.GType;
}
enum InitFlags {
PIPEWIRE,
SPA_TYPES,
SET_PW_LOG,
SET_GLIB_LOG,
ALL,
}
export namespace InterestMatch {
export const $gtype: GObject.GType;
}
enum InterestMatch {
NONE,
GTYPE,
PW_GLOBAL_PROPERTIES,
PW_PROPERTIES,
G_PROPERTIES,
ALL,
}
export namespace InterestMatchFlags {
export const $gtype: GObject.GType;
}
enum InterestMatchFlags {
NONE,
CHECK_ALL,
}
export namespace LogTopicFlags {
export const $gtype: GObject.GType;
}
enum LogTopicFlags {
LEVEL_MASK,
FLAG_STATIC,
FLAG_INITIALIZED,
}
export namespace MetadataFeatures {
export const $gtype: GObject.GType;
}
enum MetadataFeatures {
DATA,
}
export namespace NodeFeatures {
export const $gtype: GObject.GType;
}
enum NodeFeatures {
PORTS,
}
export namespace PluginFeatures {
export const $gtype: GObject.GType;
}
enum PluginFeatures {
ENABLED,
}
export namespace ProxyFeatures {
export const $gtype: GObject.GType;
}
enum ProxyFeatures {
PROXY_FEATURE_BOUND,
PIPEWIRE_OBJECT_FEATURE_INFO,
PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS,
PIPEWIRE_OBJECT_FEATURE_PARAM_FORMAT,
PIPEWIRE_OBJECT_FEATURE_PARAM_PROFILE,
PIPEWIRE_OBJECT_FEATURE_PARAM_PORT_CONFIG,
PIPEWIRE_OBJECT_FEATURE_PARAM_ROUTE,
PIPEWIRE_OBJECT_FEATURES_MINIMAL,
PIPEWIRE_OBJECT_FEATURES_ALL,
}
export namespace SessionItemFeatures {
export const $gtype: GObject.GType;
}
enum SessionItemFeatures {
ACTIVE,
EXPORTED,
}
export namespace SettingsFeatures {
export const $gtype: GObject.GType;
}
enum SettingsFeatures {
LOADED,
}
export namespace SpaDeviceFeatures {
export const $gtype: GObject.GType;
}
enum SpaDeviceFeatures {
ENABLED,
}
namespace AsyncEventHook {
// Constructor properties interface
interface ConstructorProps extends InterestEventHook.ConstructorProps {
execute_step: GObject.Closure;
executeStep: GObject.Closure;
get_next_step: GObject.Closure;
getNextStep: GObject.Closure;
}
}
/**
* An event hook that runs a WpTransition, implemented with closures.
*/
class AsyncEventHook extends InterestEventHook {
static $gtype: GObject.GType;
// Properties
set execute_step(val: GObject.Closure);
set executeStep(val: GObject.Closure);
set get_next_step(val: GObject.Closure);
set getNextStep(val: GObject.Closure);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
name: string,
before: string,
after: string,
get_next_step: GObject.Closure,
execute_step: GObject.Closure,
): AsyncEventHook;
}
namespace Client {
// Constructor properties interface
interface ConstructorProps extends GlobalProxy.ConstructorProps, PipewireObject.ConstructorProps {}
}
/**
* The WpClient class allows accessing the properties and methods of a PipeWire client object (struct pw_client). A WpClient is constructed internally when a new client connects to PipeWire and it is made available through the WpObjectManager API.
*/
class Client extends GlobalProxy implements PipewireObject {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Send an error to the client.
* @param id the global id to report the error on
* @param res an errno style error code
* @param message the error message string
*/
send_error(id: number, res: number, message: string): void;
/**
* Updates the properties of `self`.
*
*
* This requires W and X permissions on the client.
* @param updates updates to apply to the properties of @self; this does not need to include properties that have not changed
*/
update_properties(updates: Properties): void;
// Inherited properties
get native_info(): any;
get nativeInfo(): any;
get param_info(): GLib.Variant;
get paramInfo(): GLib.Variant;
get properties(): Properties;
get bound_id(): number;
get boundId(): number;
get pw_proxy(): any;
get pwProxy(): any;
// Inherited methods
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id: string | null,
filter: SpaPod | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
* @returns an iterator to iterate over the collected params, or NULL if the operation resulted in error; the items in the iterator are WpSpaPod
*/
enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
* @returns an iterator to iterate over cached parameters, or NULL if parameters for this @id are not cached; the items in the iterator are WpSpaPod
*/
enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the native pipewire info structure of this object
*/
get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns a variant of type a{ss} or NULL if the object does not support params at all
*/
get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the pipewire properties of this object; normally these are the properties that are part of the info structure
*/
get_properties(): Properties;
/**
* Returns the value of a single pipewire property.
*
*
* This is the same as getting the whole properties structure with wp_pipewire_object_get_properties() and accessing a single property with wp_properties_get(), but saves one call and having to clean up the WpProperties reference count afterwards.
* The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop.
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @param key the property name
* @returns the value of the pipewire property @key or NULL if the property doesn't exist
*/
get_property(key: string): string | null;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Iterates over the object's PipeWire properties.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.
*/
new_properties_iterator(): Iterator;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
* @returns TRUE on success, FALSE if setting the param failed
*/
set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
vfunc_enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
*/
vfunc_enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
*/
vfunc_enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_properties(): Properties;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
*/
vfunc_set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Returns the proxy bound id.
*
*
* The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.
* Requires WP_PROXY_FEATURE_BOUND
* @returns the bound id of this object
*/
get_bound_id(): number;
/**
* Gets the interface type of the proxied object.
* @returns the PipeWire type of the interface that is being proxied
*/
get_interface_type(): [string, number];
/**
* Gets the pw_proxy wrapped by this proxy object.
* @returns a pointer to the underlying pw_proxy object
*/
get_pw_proxy(): any | null;
/**
* Private method to be used by subclasses to set the pw_proxy pointer when it is available.
*
*
* This can be called only if there is no pw_proxy already set. Takes ownership of `proxy`.
* @param proxy
*/
set_pw_proxy(proxy?: any | null): void;
vfunc_bound(id: number): void;
vfunc_error(seq: number, res: number, message: string): void;
vfunc_pw_proxy_created(proxy?: any | null): void;
vfunc_pw_proxy_destroyed(): void;
}
namespace Conf {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
name: string;
properties: Properties;
}
}
/**
* WpConf allows accessing the different sections of the wireplumber configuration.
*/
class Conf extends GObject.Object {
static $gtype: GObject.GType;
// Properties
get name(): string;
get properties(): Properties;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string, properties?: Properties | null): Conf;
static new_open(name: string, properties?: Properties | null): Conf;
// Methods
/**
* Closes the configuration file and its fragments.
*/
close(): void;
/**
* Gets the name of the configuration file.
* @returns the name of the configuration file
*/
get_name(): string;
/**
* This method will get the JSON value of a specific section from the configuration. If the same section is defined in multiple locations, the sections with the same name will be either merged in case of arrays and objects, or overridden in case of boolean, int, double and strings.
* @param section the section name
* @returns the JSON value of the section or NULL if the section does not exist
*/
get_section(section: string): SpaJson | null;
/**
* Tests if the configuration files are open.
* @returns TRUE if the configuration files are open, FALSE otherwise
*/
is_open(): boolean;
/**
* Opens the configuration file and its fragments and keeps them mapped in memory for further access.
* @returns TRUE on success, FALSE on error
*/
open(): boolean;
/**
* Parses standard pw_context sections from `conf`.
* @param context the associated pw_context
*/
parse_pw_context_sections(context?: any | null): void;
/**
* Updates the given properties with the values of a specific section from the configuration.
* @param section the section name
* @param props the properties to update
* @returns the number of properties updated
*/
section_update_props(section: string, props: Properties): number;
}
namespace Core {
// Signal callback interfaces
interface Connected {
(): void;
}
interface Disconnected {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
conf: Conf;
g_main_context: GLib.MainContext;
gMainContext: GLib.MainContext;
properties: Properties;
pw_context: any;
pwContext: any;
pw_core: any;
pwCore: any;
}
}
/**
* The core is the central object around which everything operates. It is essential to create a WpCore before using any other WirePlumber API.
* The core object has the following responsibilities:
* - it initializes the PipeWire library
* - it creates a pw_context and allows connecting to the PipeWire server, creating a local pw_core
* - it glues the PipeWire library's event loop system with GMainLoop
* - it maintains a list of registered objects, which other classes use to keep objects loaded permanently into memory
* - it watches the PipeWire registry and keeps track of remote and local objects that appear in the registry, making them accessible through the WpObjectManager API.
*
* The core is also responsible for loading components, which are defined in the main configuration file. Components are loaded when WP_CORE_FEATURE_COMPONENTS is activated.
* The main configuration file needs to be created and opened before the core is created, using the WpConf API. It is then passed to the core as an argument in the constructor.
* If a configuration file is not provided, the core will let the underlying pw_context load its own configuration, based on the rules that apply to all pipewire clients (e.g. it respects the PIPEWIRE_CONFIG_NAME environment variable and loads "client.conf" as a last resort).
* If a configuration file is provided, the core does not let the underlying pw_context load any configuration and instead uses the provided WpConf object.
*/
class Core extends Object {
static $gtype: GObject.GType;
// Properties
get conf(): Conf;
get g_main_context(): GLib.MainContext;
get gMainContext(): GLib.MainContext;
get properties(): Properties;
get pw_context(): any;
get pwContext(): any;
get pw_core(): any;
get pwCore(): any;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](context?: GLib.MainContext | null, conf?: Conf | null, properties?: Properties | null): Core;
// Signals
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect_after(signal: 'connected', callback: (_source: this) => void): number;
emit(signal: 'connected'): void;
connect_after(signal: 'disconnected', callback: (_source: this) => void): number;
emit(signal: 'disconnected'): void;
// Methods
/**
* Clones a core with the same context as `self`.
* @returns the clone WpCore
*/
clone(): Core;
/**
* Connects this core to the PipeWire server.
*
*
* When connection succeeds, the WpCore "connected" signal is emitted.
* @returns TRUE if the core is effectively connected or FALSE if connection failed
*/
connect(): boolean;
connect(...args: never[]): any;
/**
* Connects this core to the PipeWire server on the given socket.
*
*
* When connection succeeds, the WpCore "connected" signal is emitted.
* @param fd the connected socket to use, the socket will be closed automatically on disconnect or error
* @returns TRUE if the core is effectively connected or FALSE if connection failed
*/
connect_fd(fd: number): boolean;
/**
* Disconnects this core from the PipeWire server.
*
*
* This also effectively destroys all WpCore objects that were created through the registry, destroys the pw_core and finally emits the WpCore "disconnected" signal.
*/
disconnect(): void;
/**
* Finds a registered object.
* @param func a function that takes the object being searched as the first argument and @data as the second. it should return TRUE if the object is found or FALSE otherwise
* @returns the registered object or NULL if not found
*/
find_object(func: GLib.EqualFunc): T;
/**
* Gets the main configuration file of the core.
* @returns the main configuration file
*/
get_conf(): Conf | null;
/**
* Returns the special WpCore that is used to maintain a secondary connection to PipeWire, for exporting objects.
*
*
* The export core is enabled by loading the built-in "export-core" component.
* @returns the export WpCore
*/
get_export_core(): Core;
/**
* Gets the GMainContext of the core.
* @returns the GMainContext that is in use by this core for events
*/
get_g_main_context(): GLib.MainContext | null;
/**
* Gets the bound id of the client object that is created as a result of this core being connected to the PipeWire daemon.
* @returns the bound id of this client
*/
get_own_bound_id(): number;
/**
* Gets the properties of the core.
* @returns the properties of @self
*/
get_properties(): Properties;
/**
* Gets the internal PipeWire context of the core.
* @returns the internal pw_context object
*/
get_pw_context(): any | null;
/**
* Gets the internal PipeWire core of the core.
* @returns the internal pw_core object, or NULL if the core is not connected to PipeWire
*/
get_pw_core(): any | null;
/**
* Gets the cookie of the core's connected PipeWire instance.
* @returns The cookie of the PipeWire instance that @self is connected to. The cookie is a unique random number for identifying an instance of PipeWire
*/
get_remote_cookie(): number;
/**
* Gets the host name of the core's connected PipeWire instance.
* @returns The name of the host where the PipeWire instance that @self is connected to is running on
*/
get_remote_host_name(): string;
/**
* Gets the name of the core's connected PipeWire instance.
* @returns The name of the PipeWire instance that @self is connected to
*/
get_remote_name(): string;
/**
* Gets the properties of the core's connected PipeWire instance.
* @returns the properties of the PipeWire instance that @self is connected to
*/
get_remote_properties(): Properties;
/**
* Gets the user name of the core's connected PipeWire instance.
* @returns The name of the user that started the PipeWire instance that @self is connected to
*/
get_remote_user_name(): string;
/**
* Gets the version of the core's connected PipeWire instance.
* @returns The version of the PipeWire instance that @self is connected to
*/
get_remote_version(): string;
/**
* Gets the virtual machine type of the core.
* @returns a comma separated string with all the virtual machine types that this core matches, or NULL if the core is not running in a virtual machine.
*/
get_vm_type(): string | null;
/**
* Adds an idle callback to be called in the same GMainContext as the one used by this core.
*
*
* This is essentially the same as g_idle_add_full(), but it adds the created GSource on the GMainContext used by this core instead of the default context.
* @param _function the function to call
* @param destroy a function to destroy @data
*/
idle_add(_function: GLib.SourceFunc, destroy?: GLib.DestroyNotify | null): GLib.Source | null;
/**
* Adds an idle callback to be called in the same GMainContext as the one used by this core.
*
*
* This is the same as wp_core_idle_add(), but it allows you to specify a GClosure instead of a C callback.
* @param closure the closure to invoke
*/
idle_add_closure(closure: GObject.Closure): GLib.Source | null;
/**
* Installs the object manager on this core, activating its internal management engine.
*
*
* This will immediately emit signals about objects added on `om` if objects that the `om` is interested in were in existence already.
* @param om a WpObjectManager
*/
install_object_manager(om: ObjectManager): void;
/**
* Checks if the core is connected to PipeWire.
* @returns TRUE if the core is connected to PipeWire, FALSE otherwise
*/
is_connected(): boolean;
/**
* Loads the specified `component` on `self`.
*
*
* The `type` will determine which component loader to use. The following types are built-in and will always work without a component loader:
* - "module" - Loads a WirePlumber module
* - "array" - Loads multiple components interpreting the `args` as a JSON array with component definitions, as they would appear in the configuration file. When this type is used, `component` is ignored and can be NULL
* @param component the module name or file name
* @param type the type of the component
* @param args additional arguments for the component, expected to be a JSON object
* @param provides the name of the feature that this component will provide if it loads successfully; this can be queried later with wp_core_test_feature()
* @param cancellable optional GCancellable
*/
load_component(
component: string | null,
type: string,
args?: SpaJson | null,
provides?: string | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Loads the specified `component` on `self`.
*
*
* The `type` will determine which component loader to use. The following types are built-in and will always work without a component loader:
* - "module" - Loads a WirePlumber module
* - "array" - Loads multiple components interpreting the `args` as a JSON array with component definitions, as they would appear in the configuration file. When this type is used, `component` is ignored and can be NULL
* @param component the module name or file name
* @param type the type of the component
* @param args additional arguments for the component, expected to be a JSON object
* @param provides the name of the feature that this component will provide if it loads successfully; this can be queried later with wp_core_test_feature()
* @param cancellable optional GCancellable
* @param callback the callback to call when the operation is done
*/
load_component(
component: string | null,
type: string,
args: SpaJson | null,
provides: string | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Loads the specified `component` on `self`.
*
*
* The `type` will determine which component loader to use. The following types are built-in and will always work without a component loader:
* - "module" - Loads a WirePlumber module
* - "array" - Loads multiple components interpreting the `args` as a JSON array with component definitions, as they would appear in the configuration file. When this type is used, `component` is ignored and can be NULL
* @param component the module name or file name
* @param type the type of the component
* @param args additional arguments for the component, expected to be a JSON object
* @param provides the name of the feature that this component will provide if it loads successfully; this can be queried later with wp_core_test_feature()
* @param cancellable optional GCancellable
* @param callback the callback to call when the operation is done
*/
load_component(
component: string | null,
type: string,
args?: SpaJson | null,
provides?: string | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes the operation started by wp_core_load_component(). This is meant to be called in the callback that was passed to that method.
* @param res the async result
* @returns TRUE if the requested component was loaded, FALSE otherwise
*/
load_component_finish(res: Gio.AsyncResult): boolean;
/**
* Registers `obj` with the core, making it appear on WpObjectManager instances as well.
*
*
* The core will also maintain a ref to that object until it is removed.
* @param obj the object to register
*/
register_object(obj: GObject.Object): void;
/**
* Detaches and unrefs the specified object from this core.
* @param obj a pointer to the object to remove
*/
remove_object(obj: GObject.Object): void;
/**
* Asks the PipeWire server to call the `callback` via an event.
*
*
* Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
* In both success and error cases, `callback` is always called. Use wp_core_sync_finish() from within the `callback` to determine whether the operation completed successfully or if an error occurred.
* @param cancellable a GCancellable to cancel the operation
* @returns TRUE if the sync operation was started, FALSE if an error occurred before returning from this function
*/
sync(cancellable?: Gio.Cancellable | null): Promise;
/**
* Asks the PipeWire server to call the `callback` via an event.
*
*
* Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
* In both success and error cases, `callback` is always called. Use wp_core_sync_finish() from within the `callback` to determine whether the operation completed successfully or if an error occurred.
* @param cancellable a GCancellable to cancel the operation
* @param callback a function to call when the operation is done
* @returns TRUE if the sync operation was started, FALSE if an error occurred before returning from this function
*/
sync(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asks the PipeWire server to call the `callback` via an event.
*
*
* Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
* In both success and error cases, `callback` is always called. Use wp_core_sync_finish() from within the `callback` to determine whether the operation completed successfully or if an error occurred.
* @param cancellable a GCancellable to cancel the operation
* @param callback a function to call when the operation is done
* @returns TRUE if the sync operation was started, FALSE if an error occurred before returning from this function
*/
sync(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Asks the PipeWire server to invoke the `closure` via an event.
*
*
* Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
* In both success and error cases, `closure` is always invoked. Use wp_core_sync_finish() from within the `closure` to determine whether the operation completed successfully or if an error occurred.
* @param cancellable a GCancellable to cancel the operation
* @param closure a closure to invoke when the operation is done
* @returns TRUE if the sync operation was started, FALSE if an error occurred before returning from this function
*/
sync_closure(cancellable: Gio.Cancellable | null, closure: GObject.Closure): boolean;
/**
* This function is meant to be called from within the callback of wp_core_sync() in order to determine the success or failure of the operation.
* @param res a GAsyncResult
* @returns TRUE if the operation succeeded, FALSE otherwise
*/
sync_finish(res: Gio.AsyncResult): boolean;
/**
* Test if a global feature is provided.
* @param feature the feature name
* @returns TRUE if the feature is provided, FALSE otherwise
*/
test_feature(feature: string): boolean;
/**
* Adds a timeout callback to be called at regular intervals in the same GMainContext as the one used by this core.
*
*
* The function is called repeatedly until it returns FALSE, at which point the timeout is automatically destroyed and the function will not be called again. The first call to the function will be at the end of the first interval.
* This is essentially the same as g_timeout_add_full(), but it adds the created GSource on the GMainContext used by this core instead of the default context.
* @param timeout_ms the timeout in milliseconds
* @param _function the function to call
* @param destroy a function to destroy @data
*/
timeout_add(
timeout_ms: number,
_function: GLib.SourceFunc,
destroy?: GLib.DestroyNotify | null,
): GLib.Source | null;
/**
* Adds a timeout callback to be called at regular intervals in the same GMainContext as the one used by this core.
*
*
* This is the same as wp_core_timeout_add(), but it allows you to specify a GClosure instead of a C callback.
* @param timeout_ms the timeout in milliseconds
* @param closure the closure to invoke
*/
timeout_add_closure(timeout_ms: number, closure: GObject.Closure): GLib.Source | null;
/**
* Updates the properties of `self` on the connection, making them appear on the client object that represents this connection.
*
*
* If `self` is not connected yet, these properties are stored and passed to pw_context_connect() when connecting.
* @param updates updates to apply to the properties of @self; this does not need to include properties that have not changed
*/
update_properties(updates: Properties): void;
}
namespace Device {
// Constructor properties interface
interface ConstructorProps extends GlobalProxy.ConstructorProps, PipewireObject.ConstructorProps {}
}
/**
* The WpDevice class allows accessing the properties and methods of a PipeWire device object (struct pw_device).
* A WpDevice is constructed internally when a new device appears on the PipeWire registry and it is made available through the WpObjectManager API. Alternatively, a WpDevice can also be constructed using wp_device_new_from_factory(), which creates a new device object on the remote PipeWire server by calling into a factory.
*/
class Device extends GlobalProxy implements PipewireObject {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_factory(core: Core, factory_name: string, properties?: Properties | null): Device;
// Inherited properties
get native_info(): any;
get nativeInfo(): any;
get param_info(): GLib.Variant;
get paramInfo(): GLib.Variant;
get properties(): Properties;
get bound_id(): number;
get boundId(): number;
get pw_proxy(): any;
get pwProxy(): any;
// Inherited methods
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id: string | null,
filter: SpaPod | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
* @returns an iterator to iterate over the collected params, or NULL if the operation resulted in error; the items in the iterator are WpSpaPod
*/
enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
* @returns an iterator to iterate over cached parameters, or NULL if parameters for this @id are not cached; the items in the iterator are WpSpaPod
*/
enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the native pipewire info structure of this object
*/
get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns a variant of type a{ss} or NULL if the object does not support params at all
*/
get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the pipewire properties of this object; normally these are the properties that are part of the info structure
*/
get_properties(): Properties;
/**
* Returns the value of a single pipewire property.
*
*
* This is the same as getting the whole properties structure with wp_pipewire_object_get_properties() and accessing a single property with wp_properties_get(), but saves one call and having to clean up the WpProperties reference count afterwards.
* The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop.
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @param key the property name
* @returns the value of the pipewire property @key or NULL if the property doesn't exist
*/
get_property(key: string): string | null;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Iterates over the object's PipeWire properties.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.
*/
new_properties_iterator(): Iterator;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
* @returns TRUE on success, FALSE if setting the param failed
*/
set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
vfunc_enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
*/
vfunc_enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
*/
vfunc_enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_properties(): Properties;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
*/
vfunc_set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Returns the proxy bound id.
*
*
* The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.
* Requires WP_PROXY_FEATURE_BOUND
* @returns the bound id of this object
*/
get_bound_id(): number;
/**
* Gets the interface type of the proxied object.
* @returns the PipeWire type of the interface that is being proxied
*/
get_interface_type(): [string, number];
/**
* Gets the pw_proxy wrapped by this proxy object.
* @returns a pointer to the underlying pw_proxy object
*/
get_pw_proxy(): any | null;
/**
* Private method to be used by subclasses to set the pw_proxy pointer when it is available.
*
*
* This can be called only if there is no pw_proxy already set. Takes ownership of `proxy`.
* @param proxy
*/
set_pw_proxy(proxy?: any | null): void;
vfunc_bound(id: number): void;
vfunc_error(seq: number, res: number, message: string): void;
vfunc_pw_proxy_created(proxy?: any | null): void;
vfunc_pw_proxy_destroyed(): void;
}
namespace EventDispatcher {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* The event dispatcher holds all the events and hooks and dispatches them. It orchestras the show on event stack.
*/
class EventDispatcher extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Returns the event dispatcher instance that is associated with the given core.
*
*
* This method will also create the instance and register it with the core, if it had not been created before.
* @param core the core
*/
static get_instance(core: Core): EventDispatcher;
// Methods
/**
* Returns an iterator to iterate over all the registered hooks.
* @returns a new iterator
*/
new_hooks_iterator(): Iterator;
/**
* Pushes a new event onto the event stack for dispatching only if there are any hooks are available for it.
* @param event the new event
*/
push_event(event: Event): void;
/**
* Registers an event hook.
* @param hook the hook to register
*/
register_hook(hook: EventHook): void;
/**
* Unregisters an event hook.
* @param hook the hook to unregister
*/
unregister_hook(hook: EventHook): void;
}
namespace EventHook {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
dispatcher: EventDispatcher;
name: string;
runs_after_hooks: string[];
runsAfterHooks: string[];
runs_before_hooks: string[];
runsBeforeHooks: string[];
}
}
/**
* The event hook is a structure that describes some executable action that an event dispatcher will run when a matching event has been received.
*/
abstract class EventHook extends GObject.Object {
static $gtype: GObject.GType;
// Properties
get dispatcher(): EventDispatcher;
get name(): string;
get runs_after_hooks(): string[];
get runsAfterHooks(): string[];
get runs_before_hooks(): string[];
get runsBeforeHooks(): string[];
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
/**
* Finishes the async operation that was started by wp_event_hook_run()
* @param res the async operation result
*/
vfunc_finish(res: Gio.AsyncResult): boolean;
/**
* Runs the hook on the given event.
* @param event the event that triggered the hook
* @param cancellable a GCancellable to cancel the async operation
* @param callback a callback to fire after execution of the hook has completed
*/
vfunc_run(
event: Event,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Checks if the hook should be executed for a given event.
* @param event the event
*/
vfunc_runs_for_event(event: Event): boolean;
// Methods
/**
* Finishes the async operation that was started by wp_event_hook_run()
* @param res the async operation result
* @returns FALSE if there was an error, TRUE otherwise
*/
finish(res: Gio.AsyncResult): boolean;
/**
* Returns the name of the hook.
* @returns the event hook name
*/
get_name(): string;
/**
* Returns the names of the hooks that should run before this hook, or in other words, this hook should run after them.
* @returns a NULL-terminated array of hook names
*/
get_runs_after_hooks(): string[];
/**
* Returns the names of the hooks that should run after this hook, or in other words, this hook should run before them.
* @returns a NULL-terminated array of hook names
*/
get_runs_before_hooks(): string[];
/**
* Runs the hook on the given event.
* @param event the event that triggered the hook
* @param cancellable a GCancellable to cancel the async operation
* @param callback a callback to fire after execution of the hook has completed
*/
run(
event: Event,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Checks if the hook should be executed for a given event.
* @param event the event
* @returns TRUE if the hook should be executed for the given event, FALSE otherwise
*/
runs_for_event(event: Event): boolean;
}
namespace Factory {
// Constructor properties interface
interface ConstructorProps extends GlobalProxy.ConstructorProps, PipewireObject.ConstructorProps {}
}
/**
* The WpFactory class allows accessing the properties and methods of PipeWire Factory objects (struct pw_factory).
* A WpFactory is constructed internally by wireplumber, when the pipewire constructed factory objects are reported in by PipeWire registry and it is made available for wireplumber clients through the WpObjectManager API.
*/
class Factory extends GlobalProxy implements PipewireObject {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited properties
get native_info(): any;
get nativeInfo(): any;
get param_info(): GLib.Variant;
get paramInfo(): GLib.Variant;
get properties(): Properties;
get bound_id(): number;
get boundId(): number;
get pw_proxy(): any;
get pwProxy(): any;
// Inherited methods
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id: string | null,
filter: SpaPod | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
* @returns an iterator to iterate over the collected params, or NULL if the operation resulted in error; the items in the iterator are WpSpaPod
*/
enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
* @returns an iterator to iterate over cached parameters, or NULL if parameters for this @id are not cached; the items in the iterator are WpSpaPod
*/
enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the native pipewire info structure of this object
*/
get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns a variant of type a{ss} or NULL if the object does not support params at all
*/
get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the pipewire properties of this object; normally these are the properties that are part of the info structure
*/
get_properties(): Properties;
/**
* Returns the value of a single pipewire property.
*
*
* This is the same as getting the whole properties structure with wp_pipewire_object_get_properties() and accessing a single property with wp_properties_get(), but saves one call and having to clean up the WpProperties reference count afterwards.
* The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop.
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @param key the property name
* @returns the value of the pipewire property @key or NULL if the property doesn't exist
*/
get_property(key: string): string | null;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Iterates over the object's PipeWire properties.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.
*/
new_properties_iterator(): Iterator;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
* @returns TRUE on success, FALSE if setting the param failed
*/
set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
vfunc_enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
*/
vfunc_enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
*/
vfunc_enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_properties(): Properties;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
*/
vfunc_set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Returns the proxy bound id.
*
*
* The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.
* Requires WP_PROXY_FEATURE_BOUND
* @returns the bound id of this object
*/
get_bound_id(): number;
/**
* Gets the interface type of the proxied object.
* @returns the PipeWire type of the interface that is being proxied
*/
get_interface_type(): [string, number];
/**
* Gets the pw_proxy wrapped by this proxy object.
* @returns a pointer to the underlying pw_proxy object
*/
get_pw_proxy(): any | null;
/**
* Private method to be used by subclasses to set the pw_proxy pointer when it is available.
*
*
* This can be called only if there is no pw_proxy already set. Takes ownership of `proxy`.
* @param proxy
*/
set_pw_proxy(proxy?: any | null): void;
vfunc_bound(id: number): void;
vfunc_error(seq: number, res: number, message: string): void;
vfunc_pw_proxy_created(proxy?: any | null): void;
vfunc_pw_proxy_destroyed(): void;
}
namespace FeatureActivationTransition {
// Constructor properties interface
interface ConstructorProps extends Transition.ConstructorProps, Gio.AsyncResult.ConstructorProps {}
}
/**
* A WpTransition that is used by WpObject to implement feature activation.
*/
class FeatureActivationTransition extends Transition implements Gio.AsyncResult {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the features requested to be activated in this transition.
* @returns the features that were requested to be activated in this transition; this contains the features as they were passed in wp_object_activate() and therefore it may contain unsupported or already active features
*/
get_requested_features(): ObjectFeatures;
// Inherited methods
/**
* Gets the source object from a [iface`Gio`.AsyncResult].
* @returns a new reference to the source object for the @res, or `NULL` if there is none.
*/
get_source_object(): T;
/**
* Gets the user data from a [iface`Gio`.AsyncResult].
* @returns the user data for @res.
*/
get_user_data(): any | null;
/**
* Checks if `res` has the given `source_tag` (generally a function
* pointer indicating the function `res` was created by).
* @param source_tag an application-defined tag
* @returns `TRUE` if @res has the indicated @source_tag, `FALSE` if not.
*/
is_tagged(source_tag?: any | null): boolean;
/**
* If `res` is a [class`Gio`.SimpleAsyncResult], this is equivalent to
* [method`Gio`.SimpleAsyncResult.propagate_error]. Otherwise it returns
* `FALSE`.
*
* This can be used for legacy error handling in async `*_finish()`
* wrapper functions that traditionally handled [class`Gio`.SimpleAsyncResult]
* error returns themselves rather than calling into the virtual method.
* This should not be used in new code; [iface`Gio`.AsyncResult] errors that are
* set by virtual methods should also be extracted by virtual methods,
* to enable subclasses to chain up correctly.
* @returns `TRUE` if @error is has been filled in with an error from @res, `FALSE` if not.
*/
legacy_propagate_error(): boolean;
/**
* Gets the source object from a [iface`Gio`.AsyncResult].
*/
vfunc_get_source_object(): T;
/**
* Gets the user data from a [iface`Gio`.AsyncResult].
*/
vfunc_get_user_data(): any | null;
/**
* Checks if `res` has the given `source_tag` (generally a function
* pointer indicating the function `res` was created by).
* @param source_tag an application-defined tag
*/
vfunc_is_tagged(source_tag?: any | null): boolean;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
// Conflicted with Wp.Transition.get_data
get_data(...args: never[]): any;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
// Conflicted with Wp.Transition.set_data
set_data(...args: never[]): any;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace GlobalProxy {
// Constructor properties interface
interface ConstructorProps extends Proxy.ConstructorProps {
factory_name: string;
factoryName: string;
global_properties: Properties;
globalProperties: Properties;
permissions: number;
}
}
/**
* A proxy that represents a PipeWire global object, i.e. an object that is made available through the PipeWire registry.
*/
class GlobalProxy extends Proxy {
static $gtype: GObject.GType;
// Properties
set factory_name(val: string);
set factoryName(val: string);
get global_properties(): Properties;
get globalProperties(): Properties;
get permissions(): number;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Binds to the global and creates the underlying pw_proxy.
*
*
* This is mostly meant to be called internally. It will create the pw_proxy and will activate the WP_PROXY_FEATURE_BOUND feature.
* This may only be called if there is no pw_proxy associated with this object yet.
* @returns TRUE on success, FALSE if there is no global to bind to
*/
bind(): boolean;
/**
* Gets the global properties of a pipewire global.
* @returns the global (immutable) properties of this pipewire object
*/
get_global_properties(): Properties;
/**
* Gets the permissions of a pipewire global.
* @returns the permissions that wireplumber has on this object
*/
get_permissions(): number;
/**
* Requests the PipeWire server to destroy the object represented by this proxy.
*
*
* If the server allows it, the object will be destroyed and the WpProxy's pw-proxy-destroyed signal will be emitted. If the server does not allow it, nothing will happen.
* This is mostly useful for destroying WpLink objects.
*/
request_destroy(): void;
}
namespace ImplMetadata {
// Constructor properties interface
interface ConstructorProps extends Metadata.ConstructorProps {
name: string;
properties: Properties;
}
}
/**
* Implementation of the metadata object.
* Activate this object with at least WP_PROXY_FEATURE_BOUND to export it to PipeWire.
*/
class ImplMetadata extends Metadata {
static $gtype: GObject.GType;
// Properties
get name(): string;
get properties(): Properties;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](core: Core): ImplMetadata;
static new_full(core: Core, name?: string | null, properties?: Properties | null): ImplMetadata;
}
namespace ImplModule {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
arguments: string;
core: any;
name: string;
properties: Properties;
pw_impl_module: any;
pwImplModule: any;
}
}
/**
* Used to load PipeWire modules within the WirePlumber process. This is slightly different from other objects in that the module is not exported to PipeWire, but it may create an export objects itself.
*/
class ImplModule extends GObject.Object {
static $gtype: GObject.GType;
// Properties
get arguments(): string;
get core(): any;
get name(): string;
get properties(): Properties;
set properties(val: Properties);
get pw_impl_module(): any;
get pwImplModule(): any;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Loads a PipeWire module into the WirePlumber process.
* @param core The WirePlumber core
* @param name the name of the module to load
* @param _arguments arguments to be passed to the module
* @param properties additional properties to be provided to the module
*/
static load(
core: Core,
name: string,
_arguments?: string | null,
properties?: Properties | null,
): ImplModule | null;
}
namespace ImplNode {
// Constructor properties interface
interface ConstructorProps extends Proxy.ConstructorProps, PipewireObject.ConstructorProps {
pw_impl_node: any;
pwImplNode: any;
}
}
/**
* A WpImplNode allows running a node implementation (struct pw_impl_node) locally, loading the implementation from factory or wrapping a manually constructed pw_impl_node. This object can then be exported to PipeWire by requesting WP_PROXY_FEATURE_BOUND.
*/
class ImplNode extends Proxy implements PipewireObject {
static $gtype: GObject.GType;
// Properties
get pw_impl_node(): any;
get pwImplNode(): any;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_pw_factory(core: Core, factory_name: string, properties?: Properties | null): ImplNode;
static new_wrap(core: Core, node?: any | null): ImplNode;
// Inherited properties
get native_info(): any;
get nativeInfo(): any;
get param_info(): GLib.Variant;
get paramInfo(): GLib.Variant;
get properties(): Properties;
get bound_id(): number;
get boundId(): number;
get pw_proxy(): any;
get pwProxy(): any;
// Inherited methods
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id: string | null,
filter: SpaPod | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
* @returns an iterator to iterate over the collected params, or NULL if the operation resulted in error; the items in the iterator are WpSpaPod
*/
enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
* @returns an iterator to iterate over cached parameters, or NULL if parameters for this @id are not cached; the items in the iterator are WpSpaPod
*/
enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the native pipewire info structure of this object
*/
get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns a variant of type a{ss} or NULL if the object does not support params at all
*/
get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the pipewire properties of this object; normally these are the properties that are part of the info structure
*/
get_properties(): Properties;
/**
* Returns the value of a single pipewire property.
*
*
* This is the same as getting the whole properties structure with wp_pipewire_object_get_properties() and accessing a single property with wp_properties_get(), but saves one call and having to clean up the WpProperties reference count afterwards.
* The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop.
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @param key the property name
* @returns the value of the pipewire property @key or NULL if the property doesn't exist
*/
get_property(key: string): string | null;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Iterates over the object's PipeWire properties.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.
*/
new_properties_iterator(): Iterator;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
* @returns TRUE on success, FALSE if setting the param failed
*/
set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
vfunc_enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
*/
vfunc_enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
*/
vfunc_enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_properties(): Properties;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
*/
vfunc_set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Returns the proxy bound id.
*
*
* The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.
* Requires WP_PROXY_FEATURE_BOUND
* @returns the bound id of this object
*/
get_bound_id(): number;
/**
* Gets the interface type of the proxied object.
* @returns the PipeWire type of the interface that is being proxied
*/
get_interface_type(): [string, number];
/**
* Gets the pw_proxy wrapped by this proxy object.
* @returns a pointer to the underlying pw_proxy object
*/
get_pw_proxy(): any | null;
/**
* Private method to be used by subclasses to set the pw_proxy pointer when it is available.
*
*
* This can be called only if there is no pw_proxy already set. Takes ownership of `proxy`.
* @param proxy
*/
set_pw_proxy(proxy?: any | null): void;
vfunc_bound(id: number): void;
vfunc_error(seq: number, res: number, message: string): void;
vfunc_pw_proxy_created(proxy?: any | null): void;
vfunc_pw_proxy_destroyed(): void;
}
namespace InterestEventHook {
// Constructor properties interface
interface ConstructorProps extends EventHook.ConstructorProps {}
}
/**
* An event hook that declares interest in specific events. This subclass implements the WpEventHook.runs_for_event() vmethod and returns TRUE from that method if the given event has properties that match one of the declared interests.
*/
abstract class InterestEventHook extends EventHook {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
add_interest_full(interest: ObjectInterest): void;
}
namespace Link {
// Signal callback interfaces
interface StateChanged {
(object: LinkState, p0: LinkState): void;
}
// Constructor properties interface
interface ConstructorProps extends GlobalProxy.ConstructorProps, PipewireObject.ConstructorProps {
state: LinkState;
}
}
/**
* The WpLink class allows accessing the properties and methods of a PipeWire link object (struct pw_link).
* A WpLink is constructed internally when a new link appears on the PipeWire registry and it is made available through the WpObjectManager API. Alternatively, a WpLink can also be constructed using wp_link_new_from_factory(), which creates a new link object on the remote PipeWire server by calling into a factory.
*/
class Link extends GlobalProxy implements PipewireObject {
static $gtype: GObject.GType;
// Properties
get state(): LinkState;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_factory(core: Core, factory_name: string, properties?: Properties | null): Link;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'state-changed',
callback: (_source: this, object: LinkState, p0: LinkState) => void,
): number;
connect_after(
signal: 'state-changed',
callback: (_source: this, object: LinkState, p0: LinkState) => void,
): number;
emit(signal: 'state-changed', object: LinkState, p0: LinkState): void;
// Methods
/**
* Retrieves the ids of the objects that are linked by this link.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
get_linked_object_ids(): [number, number, number, number];
/**
* Gets the current state of the link.
* @returns the current state of the link
*/
get_state(): [LinkState, string];
// Inherited properties
get native_info(): any;
get nativeInfo(): any;
get param_info(): GLib.Variant;
get paramInfo(): GLib.Variant;
get properties(): Properties;
get bound_id(): number;
get boundId(): number;
get pw_proxy(): any;
get pwProxy(): any;
// Inherited methods
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id: string | null,
filter: SpaPod | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
* @returns an iterator to iterate over the collected params, or NULL if the operation resulted in error; the items in the iterator are WpSpaPod
*/
enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
* @returns an iterator to iterate over cached parameters, or NULL if parameters for this @id are not cached; the items in the iterator are WpSpaPod
*/
enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the native pipewire info structure of this object
*/
get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns a variant of type a{ss} or NULL if the object does not support params at all
*/
get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the pipewire properties of this object; normally these are the properties that are part of the info structure
*/
get_properties(): Properties;
/**
* Returns the value of a single pipewire property.
*
*
* This is the same as getting the whole properties structure with wp_pipewire_object_get_properties() and accessing a single property with wp_properties_get(), but saves one call and having to clean up the WpProperties reference count afterwards.
* The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop.
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @param key the property name
* @returns the value of the pipewire property @key or NULL if the property doesn't exist
*/
get_property(key: string): string | null;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Iterates over the object's PipeWire properties.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.
*/
new_properties_iterator(): Iterator;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
* @returns TRUE on success, FALSE if setting the param failed
*/
set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
vfunc_enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
*/
vfunc_enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
*/
vfunc_enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_properties(): Properties;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
*/
vfunc_set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Returns the proxy bound id.
*
*
* The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.
* Requires WP_PROXY_FEATURE_BOUND
* @returns the bound id of this object
*/
get_bound_id(): number;
/**
* Gets the interface type of the proxied object.
* @returns the PipeWire type of the interface that is being proxied
*/
get_interface_type(): [string, number];
/**
* Gets the pw_proxy wrapped by this proxy object.
* @returns a pointer to the underlying pw_proxy object
*/
get_pw_proxy(): any | null;
/**
* Private method to be used by subclasses to set the pw_proxy pointer when it is available.
*
*
* This can be called only if there is no pw_proxy already set. Takes ownership of `proxy`.
* @param proxy
*/
set_pw_proxy(proxy?: any | null): void;
vfunc_bound(id: number): void;
vfunc_error(seq: number, res: number, message: string): void;
vfunc_pw_proxy_created(proxy?: any | null): void;
vfunc_pw_proxy_destroyed(): void;
}
namespace Metadata {
// Signal callback interfaces
interface Changed {
(object: number, p0: string, p1: string, p2: string): void;
}
// Constructor properties interface
interface ConstructorProps extends GlobalProxy.ConstructorProps {}
}
/**
* The WpMetadata class allows accessing the properties and methods of PipeWire metadata object (struct pw_metadata).
* A WpMetadata is constructed internally when a new metadata object appears on the PipeWire registry and it is made available through the WpObjectManager API.
*/
class Metadata extends GlobalProxy {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'changed',
callback: (_source: this, object: number, p0: string, p1: string, p2: string) => void,
): number;
connect_after(
signal: 'changed',
callback: (_source: this, object: number, p0: string, p1: string, p2: string) => void,
): number;
emit(signal: 'changed', object: number, p0: string, p1: string, p2: string): void;
// Methods
/**
* Clears permanently all stored metadata.
*/
clear(): void;
/**
* Finds the metadata value given its `subject` and `key`.
* @param subject the metadata subject id
* @param key the metadata key name
* @returns the metadata string value, or NULL if not found.
*/
find(subject: number, key: string): [string, string];
/**
* Iterates over metadata items that matches the given `subject`.
*
*
* If no constraints are specified, the returned iterator iterates over all the stored metadata.
* Note that this method works on cached metadata. When you change metadata with wp_metadata_set(), this cache will be updated on the next round-trip with the pipewire server.
* @param subject the metadata subject id, or -1 (PW_ID_ANY)
* @returns an iterator that iterates over the found metadata. The type of the iterator item is WpMetadataItem.
*/
new_iterator(subject: number): Iterator;
/**
* Sets the metadata associated with the given `subject` and `key`. Use NULL as a value to unset the given `key` and use NULL in both `key` and `value` to remove all metadata associated with the given `subject`.
* @param subject the subject id for which this metadata property is being set
* @param key the key to set, or NULL to remove all metadata for @subject
* @param type the type of the value; NULL is synonymous to "string"
* @param value the value to set, or NULL to unset the given @key
*/
set(subject: number, key?: string | null, type?: string | null, value?: string | null): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
}
namespace Node {
// Signal callback interfaces
interface PortsChanged {
(): void;
}
interface StateChanged {
(object: NodeState, p0: NodeState): void;
}
// Constructor properties interface
interface ConstructorProps extends GlobalProxy.ConstructorProps, PipewireObject.ConstructorProps {
max_input_ports: number;
maxInputPorts: number;
max_output_ports: number;
maxOutputPorts: number;
n_input_ports: number;
nInputPorts: number;
n_output_ports: number;
nOutputPorts: number;
state: NodeState;
}
}
/**
* The WpNode class allows accessing the properties and methods of a PipeWire node object (struct pw_node).
* A WpNode is constructed internally when a new node appears on the PipeWire registry and it is made available through the WpObjectManager API. Alternatively, a WpNode can also be constructed using wp_node_new_from_factory(), which creates a new node object on the remote PipeWire server by calling into a factory.
*/
class Node extends GlobalProxy implements PipewireObject {
static $gtype: GObject.GType;
// Properties
get max_input_ports(): number;
get maxInputPorts(): number;
get max_output_ports(): number;
get maxOutputPorts(): number;
get n_input_ports(): number;
get nInputPorts(): number;
get n_output_ports(): number;
get nOutputPorts(): number;
get state(): NodeState;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_factory(core: Core, factory_name: string, properties?: Properties | null): Node;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'ports-changed', callback: (_source: this) => void): number;
connect_after(signal: 'ports-changed', callback: (_source: this) => void): number;
emit(signal: 'ports-changed'): void;
connect(
signal: 'state-changed',
callback: (_source: this, object: NodeState, p0: NodeState) => void,
): number;
connect_after(
signal: 'state-changed',
callback: (_source: this, object: NodeState, p0: NodeState) => void,
): number;
emit(signal: 'state-changed', object: NodeState, p0: NodeState): void;
// Methods
/**
* Gets the number of input ports of this node.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the number of input ports of this node, as reported by the node info
*/
get_n_input_ports(): [number, number];
/**
* Gets the number of output ports of this node.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the number of output ports of this node, as reported by the node info
*/
get_n_output_ports(): [number, number];
/**
* Gets the number of ports of this node.
*
*
* Note that this number may not add up to wp_node_get_n_input_ports() + wp_node_get_n_output_ports() because it is discovered by looking at the number of available ports in the registry, however ports may appear there with a delay or may not appear at all if this client does not have permission to read them
* Requires WP_NODE_FEATURE_PORTS
* @returns the number of ports of this node.
*/
get_n_ports(): number;
/**
* Gets the current state of the node.
* @returns the current state of the node
*/
get_state(): [NodeState, string];
/**
* Retrieves the first port that matches the `interest`.
*
*
* Requires WP_NODE_FEATURE_PORTS
* @param interest the interest
* @returns the first port that matches the @interest, or NULL if there is no such port
*/
lookup_port_full(interest: ObjectInterest): Port | null;
/**
* Gets a new iterator that iterates over all the ports that belong to this node and match the `interest`.
*
*
* Requires WP_NODE_FEATURE_PORTS
* @param interest the interest
* @returns a WpIterator that iterates over WpPort objects
*/
new_ports_filtered_iterator_full(interest: ObjectInterest): Iterator;
/**
* Gets a new iterator that iterates over all the ports that belong to this node.
*
*
* Requires WP_NODE_FEATURE_PORTS
* @returns a WpIterator that iterates over WpPort objects
*/
new_ports_iterator(): Iterator;
/**
* Sends a command to a node.
*
*
* Valid commands are the short string reprepsentations of enum spa_node_command. For example, "Suspend" or "Flush" are valid commands
* @param command the command
*/
send_command(command: string): void;
// Inherited properties
get native_info(): any;
get nativeInfo(): any;
get param_info(): GLib.Variant;
get paramInfo(): GLib.Variant;
get properties(): Properties;
get bound_id(): number;
get boundId(): number;
get pw_proxy(): any;
get pwProxy(): any;
// Inherited methods
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
): Promise;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id: string | null,
filter: SpaPod | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
* @returns an iterator to iterate over the collected params, or NULL if the operation resulted in error; the items in the iterator are WpSpaPod
*/
enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
* @returns an iterator to iterate over cached parameters, or NULL if parameters for this @id are not cached; the items in the iterator are WpSpaPod
*/
enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the native pipewire info structure of this object
*/
get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns a variant of type a{ss} or NULL if the object does not support params at all
*/
get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns the pipewire properties of this object; normally these are the properties that are part of the info structure
*/
get_properties(): Properties;
/**
* Returns the value of a single pipewire property.
*
*
* This is the same as getting the whole properties structure with wp_pipewire_object_get_properties() and accessing a single property with wp_properties_get(), but saves one call and having to clean up the WpProperties reference count afterwards.
* The value is owned by the proxy, but it is guaranteed to stay alive until execution returns back to the event loop.
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @param key the property name
* @returns the value of the pipewire property @key or NULL if the property doesn't exist
*/
get_property(key: string): string | null;
// Conflicted with GObject.Object.get_property
get_property(...args: never[]): any;
/**
* Iterates over the object's PipeWire properties.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
* @returns an iterator that iterates over the pipewire properties of this object. Use wp_properties_iterator_item_get_key() and wp_properties_iterator_item_get_value() to parse the items returned by this iterator.
*/
new_properties_iterator(): Iterator;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
* @returns TRUE on success, FALSE if setting the param failed
*/
set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Enumerate object parameters.
*
*
* This will asynchronously return the result, or an error, by calling the given `callback`. The result is going to be a WpIterator containing WpSpaPod objects, which can be retrieved with wp_pipewire_object_enum_params_finish().
* @param id the parameter id to enumerate or NULL for all parameters
* @param filter a param filter or NULL
* @param cancellable a cancellable for the async operation
* @param callback a callback to call with the result
*/
vfunc_enum_params(
id?: string | null,
filter?: SpaPod | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Finishes an asynchronous parameter enumeration operation.
* @param res the async result
*/
vfunc_enum_params_finish(res: Gio.AsyncResult): Iterator | null;
/**
* This method can be used to retrieve object parameters in a synchronous way (in contrast with wp_pipewire_object_enum_params(), which is async).
*
*
* The WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ feature that corresponds to the specified `id` must have been activated earlier. These features enable monitoring and caching of params underneath, so that they are always available for retrieval with this method.
* Note, however, that cached params may be out-of-date if they have changed very recently on the remote object and the caching mechanism hasn't been able to update them yet, so if you really need up-to-date information you should only rely on wp_pipewire_object_enum_params() instead.
* @param id the parameter id to enumerate
* @param filter a param filter or NULL
*/
vfunc_enum_params_sync(id: string, filter?: SpaPod | null): Iterator | null;
/**
* Retrieves the native info structure of this object (pw_node_info, pw_port_info, etc...)
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_native_info(): any | null;
/**
* Returns the available parameters of this pipewire object.
*
*
* The return value is a GVariant of type a{ss}, where the key of each map entry is a spa param type id (the same ids that you can pass in wp_pipewire_object_enum_params()) and the value is a string that can contain the following letters, each of them representing a flag:
* - r: the param is readable (SPA_PARAM_INFO_READ)
* - w: the param is writable (SPA_PARAM_INFO_WRITE)
*
* For params that are readable, you can query them with wp_pipewire_object_enum_params()
* Params that are writable can be set with wp_pipewire_object_set_param()
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_param_info(): GLib.Variant | null;
/**
* Retrieves the PipeWire properties of this object.
*
*
* Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO
*/
vfunc_get_properties(): Properties;
/**
* Sets a parameter on the object.
* @param id the parameter id to set
* @param flags optional flags or 0
* @param param the parameter to set
*/
vfunc_set_param(id: string, flags: number, param: SpaPod): boolean;
/**
* Returns the proxy bound id.
*
*
* The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.
* Requires WP_PROXY_FEATURE_BOUND
* @returns the bound id of this object
*/
get_bound_id(): number;
/**
* Gets the interface type of the proxied object.
* @returns the PipeWire type of the interface that is being proxied
*/
get_interface_type(): [string, number];
/**
* Gets the pw_proxy wrapped by this proxy object.
* @returns a pointer to the underlying pw_proxy object
*/
get_pw_proxy(): any | null;
/**
* Private method to be used by subclasses to set the pw_proxy pointer when it is available.
*
*
* This can be called only if there is no pw_proxy already set. Takes ownership of `proxy`.
* @param proxy
*/
set_pw_proxy(proxy?: any | null): void;
vfunc_bound(id: number): void;
vfunc_error(seq: number, res: number, message: string): void;
vfunc_pw_proxy_created(proxy?: any | null): void;
vfunc_pw_proxy_destroyed(): void;
}
namespace Object {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
active_features: number;
activeFeatures: number;
core: Core;
id: number;
supported_features: number;
supportedFeatures: number;
}
}
/**
* Base class for objects that have activatable features.
*/
abstract class Object extends GObject.Object {
static $gtype: GObject.GType