Debian Codegraph @

lib/wp/node.h

raw
1 /* WirePlumber
2 *
3 * Copyright © 2019 Collabora Ltd.
4 * @author Julian Bouzas <[email protected]>
5 *
6 * SPDX-License-Identifier: MIT
7 */
8
9 #ifndef __WIREPLUMBER_NODE_H__
10 #define __WIREPLUMBER_NODE_H__
11
12 #include "global-proxy.h"
13 #include "port.h"
14 #include "iterator.h"
15 #include "object-interest.h"
16
17 G_BEGIN_DECLS
18
19 struct pw_impl_node;
20
21 /*!
22 * \brief The state of the node
23 * \ingroup wpnode
24 */
25 typedef enum {
26 /*! error state */
27 WP_NODE_STATE_ERROR = -1,
28 /*! the node is being created */
29 WP_NODE_STATE_CREATING = 0,
30 /*! the node is suspended, the device might be closed */
31 WP_NODE_STATE_SUSPENDED = 1,
32 /*! the node is running but there is no active port */
33 WP_NODE_STATE_IDLE = 2,
34 /*! the node is running */
35 WP_NODE_STATE_RUNNING = 3,
36 } WpNodeState;
37
38 /*!
39 * \brief An extension of WpProxyFeatures
40 * \ingroup wpnode
41 */
42 typedef enum { /*< flags >*/
43 /*! caches information about ports, enabling
44 * the use of wp_node_get_n_ports(), wp_node_lookup_port(),
45 * wp_node_new_ports_iterator() and related methods */
46 WP_NODE_FEATURE_PORTS = (WP_PROXY_FEATURE_CUSTOM_START << 0),
47 } WpNodeFeatures;
48
49 /*!
50 * \brief The WpNode GType
51 * \ingroup wpnode
52 */
53 #define WP_TYPE_NODE (wp_node_get_type ())
54 WP_API
55 G_DECLARE_FINAL_TYPE (WpNode, wp_node, WP, NODE, WpGlobalProxy)
56
57 WP_API
58 WpNode * wp_node_new_from_factory (WpCore * core,
59 const gchar * factory_name, WpProperties * properties);
60
61 WP_API
62 WpNodeState wp_node_get_state (WpNode * self, const gchar ** error);
63
64 WP_API
65 guint wp_node_get_n_input_ports (WpNode * self, guint * max);
66
67 WP_API
68 guint wp_node_get_n_output_ports (WpNode * self, guint * max);
69
70 WP_API
71 guint wp_node_get_n_ports (WpNode * self);
72
73 WP_API
74 WpIterator * wp_node_new_ports_iterator (WpNode * self);
75
76 WP_API
77 WpIterator * wp_node_new_ports_filtered_iterator (WpNode * self, ...)
78 G_GNUC_NULL_TERMINATED;
79
80 WP_API
81 WpIterator * wp_node_new_ports_filtered_iterator_full (WpNode * self,
82 WpObjectInterest * interest);
83
84 WP_API
85 WpPort * wp_node_lookup_port (WpNode * self, ...) G_GNUC_NULL_TERMINATED;
86
87 WP_API
88 WpPort * wp_node_lookup_port_full (WpNode * self, WpObjectInterest * interest);
89
90 WP_API
91 void wp_node_send_command (WpNode * self, const gchar *command);
92
93 /*!
94 * \brief The WpImplNode GType
95 * \ingroup wpimplnode
96 */
97 #define WP_TYPE_IMPL_NODE (wp_impl_node_get_type ())
98 WP_API
99 G_DECLARE_FINAL_TYPE (WpImplNode, wp_impl_node, WP, IMPL_NODE, WpProxy)
100
101 WP_API
102 WpImplNode * wp_impl_node_new_wrap (WpCore * core, struct pw_impl_node * node);
103
104 WP_API
105 WpImplNode * wp_impl_node_new_from_pw_factory (WpCore * core,
106 const gchar * factory_name, WpProperties * properties);
107
108 G_END_DECLS
109
110 #endif