diff options
author | Wim Taymans <wtaymans@redhat.com> | 2016-07-22 17:17:44 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2016-07-22 17:17:44 +0200 |
commit | 907bd7bfd71f13a67337195abaac25f205a39068 (patch) | |
tree | b91060e0975b435c05d21aee003ffd34755f2657 /pinos/server/port.c | |
parent | 86afa662067abf84d0bd632afc51fbed7ec82e74 (diff) |
add client-node again
Add a client node again that uses the channel protocol but looks like
a node in the graph.
Diffstat (limited to 'pinos/server/port.c')
-rw-r--r-- | pinos/server/port.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/pinos/server/port.c b/pinos/server/port.c index c84bf7dd..738a96f0 100644 --- a/pinos/server/port.c +++ b/pinos/server/port.c @@ -48,7 +48,7 @@ struct _PinosPortPrivate { PinosDaemon *daemon; - gulong id; + guint id; PinosNode *node; PinosDirection direction; @@ -75,6 +75,7 @@ enum PROP_DAEMON, PROP_NODE, PROP_DIRECTION, + PROP_ID, PROP_POSSIBLE_FORMATS, PROP_FORMAT, PROP_PROPERTIES, @@ -183,6 +184,10 @@ pinos_port_get_property (GObject *_object, g_value_set_enum (value, priv->direction); break; + case PROP_ID: + g_value_set_uint (value, priv->id); + break; + case PROP_POSSIBLE_FORMATS: g_value_set_boxed (value, priv->possible_formats); break; @@ -223,6 +228,10 @@ pinos_port_set_property (GObject *_object, priv->direction = g_value_get_enum (value); break; + case PROP_ID: + priv->id = g_value_get_uint (value); + break; + case PROP_POSSIBLE_FORMATS: if (priv->possible_formats) g_bytes_unref (priv->possible_formats); @@ -336,6 +345,17 @@ pinos_port_class_init (PinosPortClass * klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, + PROP_ID, + g_param_spec_uint ("id", + "Id", + "The id of the port", + 0, + G_MAXUINT, + 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_POSSIBLE_FORMATS, @@ -364,7 +384,7 @@ pinos_port_class_init (PinosPortClass * klass) "The properties of the port", PINOS_TYPE_PROPERTIES, G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | + G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); @@ -474,6 +494,25 @@ pinos_port_get_direction (PinosPort *port) } /** + * pinos_port_get_id: + * @port: a #PinosPort + * + * Get the id of @port + * + * Returns: the id or %NULL + */ +guint +pinos_port_get_id (PinosPort *port) +{ + PinosPortPrivate *priv; + + g_return_val_if_fail (PINOS_IS_PORT (port), -1); + priv = port->priv; + + return priv->id; +} + +/** * pinos_port_get_possible_formats: * @port: a #PinosPort * |