diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2020-06-03 17:22:56 +0900 |
---|---|---|
committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2020-06-03 17:22:56 +0900 |
commit | 2f3f4f3f2c87387e8a8c72dbd4d18074edefc563 (patch) | |
tree | 8ab8c4380adc0589f48646661efeab88c2761e0b | |
download | hinawa-rs-2f3f4f3f2c87387e8a8c72dbd4d18074edefc563.tar.gz |
Version 0.1.0 releasev0.1.0
The release includes FFI and API bindings to libhinawa 2 for ecosystem of
Rust language.
34 files changed, 5304 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4a69cd1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "gir"] + path = gir + url = https://github.com/gtk-rs/gir +[submodule "gir-files"] + path = gir-files + url = https://github.com/gtk-rs/gir-files diff --git a/Hinawa-3.0.gir b/Hinawa-3.0.gir new file mode 100644 index 0000000..f5438e3 --- /dev/null +++ b/Hinawa-3.0.gir @@ -0,0 +1,2623 @@ +<?xml version="1.0"?> +<!-- This file was automatically generated from C sources - DO NOT EDIT! +To affect the contents of this file, edit the original C definitions, +and/or use gtk-doc annotations. --> +<repository version="1.2" + xmlns="http://www.gtk.org/introspection/core/1.0" + xmlns:c="http://www.gtk.org/introspection/c/1.0" + xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> + <include name="GLib" version="2.0"/> + <include name="GObject" version="2.0"/> + <package name="hinawa"/> + <namespace name="Hinawa" + version="3.0" + shared-library="libhinawa.so.2" + c:identifier-prefixes="Hinawa" + c:symbol-prefixes="hinawa_"> + <function-macro name="FW_FCP" + c:identifier="HINAWA_FW_FCP" + introspectable="0"> + <source-position filename="../src/fw_fcp.h" line="15"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_FCP_CLASS" + c:identifier="HINAWA_FW_FCP_CLASS" + introspectable="0"> + <source-position filename="../src/fw_fcp.h" line="23"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_FCP_GET_CLASS" + c:identifier="HINAWA_FW_FCP_GET_CLASS" + introspectable="0"> + <source-position filename="../src/fw_fcp.h" line="30"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_NODE" + c:identifier="HINAWA_FW_NODE" + introspectable="0"> + <source-position filename="../src/fw_node.h" line="12"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_NODE_CLASS" + c:identifier="HINAWA_FW_NODE_CLASS" + introspectable="0"> + <source-position filename="../src/fw_node.h" line="20"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_NODE_GET_CLASS" + c:identifier="HINAWA_FW_NODE_GET_CLASS" + introspectable="0"> + <source-position filename="../src/fw_node.h" line="27"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_REQ" + c:identifier="HINAWA_FW_REQ" + introspectable="0"> + <source-position filename="../src/fw_req.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_REQ_CLASS" + c:identifier="HINAWA_FW_REQ_CLASS" + introspectable="0"> + <source-position filename="../src/fw_req.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_REQ_GET_CLASS" + c:identifier="HINAWA_FW_REQ_GET_CLASS" + introspectable="0"> + <source-position filename="../src/fw_req.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_RESP" + c:identifier="HINAWA_FW_RESP" + introspectable="0"> + <source-position filename="../src/fw_resp.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_RESP_CLASS" + c:identifier="HINAWA_FW_RESP_CLASS" + introspectable="0"> + <source-position filename="../src/fw_resp.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="FW_RESP_GET_CLASS" + c:identifier="HINAWA_FW_RESP_GET_CLASS" + introspectable="0"> + <source-position filename="../src/fw_resp.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <class name="FwFcp" + c:symbol-prefix="fw_fcp" + c:type="HinawaFwFcp" + parent="FwResp" + glib:type-name="HinawaFwFcp" + glib:get-type="hinawa_fw_fcp_get_type" + glib:type-struct="FwFcpClass"> + <source-position filename="../src/fw_fcp.h" line="47"/> + <constructor name="new" c:identifier="hinawa_fw_fcp_new" version="1.3."> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="160">Instantiate #HinawaFwFcp object and return the instance.</doc> + <source-position filename="../src/fw_fcp.h" line="51"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="165">an instance of #HinawaFwFcp.</doc> + <type name="FwFcp" c:type="HinawaFwFcp*"/> + </return-value> + </constructor> + <method name="bind" c:identifier="hinawa_fw_fcp_bind" throws="1"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="332">Start to listen to FCP responses.</doc> + <source-position filename="../src/fw_fcp.h" line="58"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="334">A #HinawaFwFcp.</doc> + <type name="FwFcp" c:type="HinawaFwFcp*"/> + </instance-parameter> + <parameter name="node" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="335">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </parameter> + </parameters> + </method> + <method name="transaction" + c:identifier="hinawa_fw_fcp_transaction" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="175">Execute FCP transaction.</doc> + <source-position filename="../src/fw_fcp.h" line="53"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="177">A #HinawaFwFcp.</doc> + <type name="FwFcp" c:type="HinawaFwFcp*"/> + </instance-parameter> + <parameter name="req_frame" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="178">An array with elements for + request byte data. The value of this argument should point to + the array and immutable.</doc> + <array length="1" zero-terminated="0" c:type="const guint8*"> + <type name="guint8" c:type="guint8"/> + </array> + </parameter> + <parameter name="req_frame_size" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="181">The size of array for request in byte unit.</doc> + <type name="gsize" c:type="gsize"/> + </parameter> + <parameter name="resp_frame" + direction="inout" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="182">An array with elements + for response byte data. Callers should give it for buffer with + enough space against the request since this library performs no + reallocation. Due to the reason, the value of this argument + should point to the pointer to the array and immutable. The + content of array is mutable.</doc> + <array length="3" zero-terminated="0" c:type="guint8* const*"> + <type name="guint8" c:type="guint8*"/> + </array> + </parameter> + <parameter name="resp_frame_size" + direction="inout" + caller-allocates="0" + transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="188">The size of array for response in byte unit. The value of + this argument should point to the numerical number and + mutable.</doc> + <type name="gsize" c:type="gsize*"/> + </parameter> + </parameters> + </method> + <method name="unbind" c:identifier="hinawa_fw_fcp_unbind" version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="361">Stop to listen to FCP responses.</doc> + <source-position filename="../src/fw_fcp.h" line="60"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_fcp.c" + line="363">A #HinawaFwFcp.</doc> + <type name="FwFcp" c:type="HinawaFwFcp*"/> + </instance-parameter> + </parameters> + </method> + <property name="is-bound" transfer-ownership="none"> + <type name="gboolean" c:type="gboolean"/> + </property> + <property name="timeout" + writable="1" + construct="1" + transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <field name="parent_instance"> + <type name="FwResp" c:type="HinawaFwResp"/> + </field> + <field name="priv"> + <type name="FwFcpPrivate" c:type="HinawaFwFcpPrivate*"/> + </field> + </class> + <record name="FwFcpClass" + c:type="HinawaFwFcpClass" + glib:is-gtype-struct-for="FwFcp"> + <source-position filename="../src/fw_fcp.h" line="47"/> + <field name="parent_class"> + <type name="FwRespClass" c:type="HinawaFwRespClass"/> + </field> + </record> + <record name="FwFcpPrivate" c:type="HinawaFwFcpPrivate" disguised="1"> + <source-position filename="../src/fw_fcp.h" line="37"/> + </record> + <class name="FwNode" + c:symbol-prefix="fw_node" + c:type="HinawaFwNode" + parent="GObject.Object" + glib:type-name="HinawaFwNode" + glib:get-type="hinawa_fw_node_get_type" + glib:type-struct="FwNodeClass"> + <source-position filename="../src/fw_node.h" line="68"/> + <constructor name="new" c:identifier="hinawa_fw_node_new" version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="220">Instantiate #HinawaFwNode object and return the instance.</doc> + <source-position filename="../src/fw_node.h" line="72"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="225">an instance of #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </return-value> + </constructor> + <virtual-method name="bus_update" version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_node.h" + line="45">When IEEE 1394 bus is updated, the ::bus-update handler is called. +The handlers can read current generation in the bus via 'generation' +property.</doc> + <source-position filename="../src/fw_node.h" line="55"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.h" + line="47">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </instance-parameter> + </parameters> + </virtual-method> + <virtual-method name="disconnected" version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_node.h" + line="57">When phicical FireWire devices are disconnected from IEEE 1394 bus, +the ::disconnected handler is called.</doc> + <source-position filename="../src/fw_node.h" line="66"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.h" + line="59">A #HinawaFwNode</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </instance-parameter> + </parameters> + </virtual-method> + <method name="create_source" + c:identifier="hinawa_fw_node_create_source" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="444">Create Gsource for GMainContext to dispatch events for the node on IEEE 1394 +bus.</doc> + <source-position filename="../src/fw_node.h" line="80"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="446">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </instance-parameter> + <parameter name="gsrc" + direction="out" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="447">A #GSource.</doc> + <type name="GLib.Source" c:type="GSource**"/> + </parameter> + </parameters> + </method> + <method name="get_config_rom" + c:identifier="hinawa_fw_node_get_config_rom" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="293">Get cached content of configuration ROM.</doc> + <source-position filename="../src/fw_node.h" line="77"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="295">A #HinawaFwNode</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </instance-parameter> + <parameter name="image" + direction="out" + caller-allocates="0" + transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="296">The content of + configuration ROM.</doc> + <array length="1" zero-terminated="0" c:type="const guint8**"> + <type name="guint8" c:type="guint8*"/> + </array> + </parameter> + <parameter name="length" + direction="out" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="298">The number of bytes consists of the configuration rom.</doc> + <type name="gsize" c:type="gsize*"/> + </parameter> + </parameters> + </method> + <method name="open" + c:identifier="hinawa_fw_node_open" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="261">Open Linux FireWire character device to operate node on IEEE 1394 bus.</doc> + <source-position filename="../src/fw_node.h" line="74"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="263">A #HinawaFwNode</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="264">A path to Linux FireWire character device</doc> + <type name="utf8" c:type="const gchar*"/> + </parameter> + </parameters> + </method> + <property name="bus-manager-node-id" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <property name="generation" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <property name="ir-manager-node-id" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <property name="local-node-id" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <property name="node-id" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <property name="root-node-id" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <field name="parent_instance"> + <type name="GObject.Object" c:type="GObject"/> + </field> + <field name="priv"> + <type name="FwNodePrivate" c:type="HinawaFwNodePrivate*"/> + </field> + <glib:signal name="bus-update" when="last" version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="173">When IEEE 1394 bus is updated, the ::bus-update signal is generated. +Handlers can read current generation in the bus via 'generation' +property.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + </glib:signal> + <glib:signal name="disconnected" when="last" version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_node.c" + line="192">When phicical FireWire devices are disconnected from IEEE 1394 bus, +the ::disconnected signal is generated.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + </glib:signal> + </class> + <record name="FwNodeClass" + c:type="HinawaFwNodeClass" + glib:is-gtype-struct-for="FwNode"> + <source-position filename="../src/fw_node.h" line="68"/> + <field name="parent_class"> + <type name="GObject.ObjectClass" c:type="GObjectClass"/> + </field> + <field name="bus_update"> + <callback name="bus_update"> + <source-position filename="../src/fw_node.h" line="55"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.h" + line="47">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </parameter> + </parameters> + </callback> + </field> + <field name="disconnected"> + <callback name="disconnected"> + <source-position filename="../src/fw_node.h" line="66"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_node.h" + line="59">A #HinawaFwNode</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <record name="FwNodePrivate" c:type="HinawaFwNodePrivate" disguised="1"> + <source-position filename="../src/fw_node.h" line="34"/> + </record> + <enumeration name="FwRcode" + glib:type-name="HinawaFwRcode" + glib:get-type="hinawa_fw_rcode_get_type" + c:type="HinawaFwRcode"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="54">A representation for rcode of asynchronous transaction on IEEE 1394 bus.</doc> + <member name="complete" + value="0" + c:identifier="HINAWA_FW_RCODE_COMPLETE" + glib:nick="complete"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="56">For completion.</doc> + </member> + <member name="conflict_error" + value="4" + c:identifier="HINAWA_FW_RCODE_CONFLICT_ERROR" + glib:nick="conflict-error"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="57">For error of conflicting.</doc> + </member> + <member name="data_error" + value="5" + c:identifier="HINAWA_FW_RCODE_DATA_ERROR" + glib:nick="data-error"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="58">For error of data.</doc> + </member> + <member name="type_error" + value="6" + c:identifier="HINAWA_FW_RCODE_TYPE_ERROR" + glib:nick="type-error"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="59">For error of type.</doc> + </member> + <member name="address_error" + value="7" + c:identifier="HINAWA_FW_RCODE_ADDRESS_ERROR" + glib:nick="address-error"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="60">For error of address.</doc> + </member> + <member name="send_error" + value="16" + c:identifier="HINAWA_FW_RCODE_SEND_ERROR" + glib:nick="send-error"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="61">For error of sending.</doc> + </member> + <member name="cancelled" + value="17" + c:identifier="HINAWA_FW_RCODE_CANCELLED" + glib:nick="cancelled"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="62">For cancellation.</doc> + </member> + <member name="busy" + value="18" + c:identifier="HINAWA_FW_RCODE_BUSY" + glib:nick="busy"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="63">For busyness.</doc> + </member> + <member name="generation" + value="19" + c:identifier="HINAWA_FW_RCODE_GENERATION" + glib:nick="generation"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="64">For generation.</doc> + </member> + <member name="no_ack" + value="20" + c:identifier="HINAWA_FW_RCODE_NO_ACK" + glib:nick="no-ack"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="65">For no acknowledge.</doc> + </member> + </enumeration> + <class name="FwReq" + c:symbol-prefix="fw_req" + c:type="HinawaFwReq" + parent="GObject.Object" + glib:type-name="HinawaFwReq" + glib:get-type="hinawa_fw_req_get_type" + glib:type-struct="FwReqClass"> + <source-position filename="../src/fw_req.h" line="45"/> + <constructor name="new" c:identifier="hinawa_fw_req_new" version="1.3."> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="127">Instantiate #HinawaFwReq object and return the instance.</doc> + <source-position filename="../src/fw_req.h" line="49"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="132">an instance of #HinawaFwReq.</doc> + <type name="FwReq" c:type="HinawaFwReq*"/> + </return-value> + </constructor> + <method name="transaction" + c:identifier="hinawa_fw_req_transaction" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="140">Execute transactions to the given node according to given code.</doc> + <source-position filename="../src/fw_req.h" line="51"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="142">A #HinawaFwReq.</doc> + <type name="FwReq" c:type="HinawaFwReq*"/> + </instance-parameter> + <parameter name="node" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="143">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </parameter> + <parameter name="tcode" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="144">A transaction code of HinawaFwTcode.</doc> + <type name="FwTcode" c:type="HinawaFwTcode"/> + </parameter> + <parameter name="addr" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="145">A destination address of target device</doc> + <type name="guint64" c:type="guint64"/> + </parameter> + <parameter name="length" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="146">The range of address in byte unit.</doc> + <type name="gsize" c:type="gsize"/> + </parameter> + <parameter name="frame" + direction="inout" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="147">An array with elements for byte + data. Callers should give it for buffer with enough space against the + request since this library performs no reallocation. Due to the + reason, the value of this argument should point to the pointer to the + array and immutable. The content of array is mutable for read and + lock transaction.</doc> + <array length="5" zero-terminated="0" c:type="guint8* const*"> + <type name="guint8" c:type="guint8*"/> + </array> + </parameter> + <parameter name="frame_size" + direction="inout" + caller-allocates="0" + transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_req.c" + line="153">The size of array in byte unit. The value of this argument + should point to the numerical number and mutable for read and + lock transaction.</doc> + <type name="gsize" c:type="gsize*"/> + </parameter> + </parameters> + </method> + <property name="timeout" + writable="1" + construct="1" + transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <field name="parent_instance"> + <type name="GObject.Object" c:type="GObject"/> + </field> + <field name="priv"> + <type name="FwReqPrivate" c:type="HinawaFwReqPrivate*"/> + </field> + </class> + <record name="FwReqClass" + c:type="HinawaFwReqClass" + glib:is-gtype-struct-for="FwReq"> + <source-position filename="../src/fw_req.h" line="45"/> + <field name="parent_class"> + <type name="GObject.ObjectClass" c:type="GObjectClass"/> + </field> + </record> + <record name="FwReqPrivate" c:type="HinawaFwReqPrivate" disguised="1"> + <source-position filename="../src/fw_req.h" line="35"/> + </record> + <class name="FwResp" + c:symbol-prefix="fw_resp" + c:type="HinawaFwResp" + parent="GObject.Object" + glib:type-name="HinawaFwResp" + glib:get-type="hinawa_fw_resp_get_type" + glib:type-struct="FwRespClass"> + <source-position filename="../src/fw_resp.h" line="60"/> + <constructor name="new" c:identifier="hinawa_fw_resp_new" version="1.3."> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="125">Instantiate #HinawaFwResp object and return the instance.</doc> + <source-position filename="../src/fw_resp.h" line="64"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="130">a new instance of #HinawaFwResp.</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </return-value> + </constructor> + <virtual-method name="requested"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="46">When any units transfer requests to the range of address to which +this object listening. The ::requested signal handler can get data +frame by a call of ::get_req_frame and set data frame by a call of +::set_resp_frame, then returns rcode.</doc> + <source-position filename="../src/fw_resp.h" line="59"/> + <return-value transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="56">One of #HinawaRcode enumerators corresponding to rcodes + defined in IEEE 1394 specification.</doc> + <type name="FwRcode" c:type="HinawaFwRcode"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="48">A #HinawaFwResp</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </instance-parameter> + <parameter name="tcode" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="49">One of #HinawaTcode enumerators</doc> + <type name="FwTcode" c:type="HinawaFwTcode"/> + </parameter> + </parameters> + </virtual-method> + <method name="get_req_frame" c:identifier="hinawa_fw_resp_get_req_frame"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="232">Retrieve byte frame to be requested.</doc> + <source-position filename="../src/fw_resp.h" line="70"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="234">A #HinawaFwResp</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </instance-parameter> + <parameter name="frame" + direction="out" + caller-allocates="0" + transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="235">a 8bit array for response + frame.</doc> + <array length="1" zero-terminated="0" c:type="const guint8**"> + <type name="guint8" c:type="guint8*"/> + </array> + </parameter> + <parameter name="length" + direction="out" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="237">The length of bytes for the frame.</doc> + <type name="gsize" c:type="gsize*"/> + </parameter> + </parameters> + </method> + <method name="release" + c:identifier="hinawa_fw_resp_release" + version="1.4."> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="196">stop to listen to a range of address in host controller.</doc> + <source-position filename="../src/fw_resp.h" line="68"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="198">A HinawaFwResp.</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </instance-parameter> + </parameters> + </method> + <method name="reserve" + c:identifier="hinawa_fw_resp_reserve" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="138">Start to listen to a range of address in host controller which connects to +the node.</doc> + <source-position filename="../src/fw_resp.h" line="66"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="140">A #HinawaFwResp.</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </instance-parameter> + <parameter name="node" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="141">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode*"/> + </parameter> + <parameter name="addr" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="142">A start address to listen to in host controller.</doc> + <type name="guint64" c:type="guint64"/> + </parameter> + <parameter name="width" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="143">The byte width of address to listen to host controller.</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </method> + <method name="set_resp_frame" + c:identifier="hinawa_fw_resp_set_resp_frame"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="255">Register byte frame as response.</doc> + <source-position filename="../src/fw_resp.h" line="72"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="257">A #HinawaFwResp</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </instance-parameter> + <parameter name="frame" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="258">a 8bit array for response + frame.</doc> + <array length="1" zero-terminated="0" c:type="guint8*"> + <type name="guint8"/> + </array> + </parameter> + <parameter name="length" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="260">The length of bytes for the frame.</doc> + <type name="gsize" c:type="gsize"/> + </parameter> + </parameters> + </method> + <property name="is-reserved" transfer-ownership="none"> + <type name="gboolean" c:type="gboolean"/> + </property> + <field name="parent_instance"> + <type name="GObject.Object" c:type="GObject"/> + </field> + <field name="priv"> + <type name="FwRespPrivate" c:type="HinawaFwRespPrivate*"/> + </field> + <glib:signal name="requested" when="last"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="97">When any node transfers requests to the range of address to which +this object listening. The ::requested signal handler can get data +frame by a call of ::get_req_frame and set data frame by a call of +::set_resp_frame, then returns rcode.</doc> + <return-value transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="107">One of #HinawaRcode enumerators corresponding to rcodes + defined in IEEE 1394 specification.</doc> + <type name="FwRcode"/> + </return-value> + <parameters> + <parameter name="tcode" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.c" + line="100">One of #HinawaTcode enumerators</doc> + <type name="FwTcode"/> + </parameter> + </parameters> + </glib:signal> + </class> + <record name="FwRespClass" + c:type="HinawaFwRespClass" + glib:is-gtype-struct-for="FwResp"> + <source-position filename="../src/fw_resp.h" line="60"/> + <field name="parent_class"> + <type name="GObject.ObjectClass" c:type="GObjectClass"/> + </field> + <field name="requested"> + <callback name="requested"> + <source-position filename="../src/fw_resp.h" line="59"/> + <return-value transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="56">One of #HinawaRcode enumerators corresponding to rcodes + defined in IEEE 1394 specification.</doc> + <type name="FwRcode" c:type="HinawaFwRcode"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="48">A #HinawaFwResp</doc> + <type name="FwResp" c:type="HinawaFwResp*"/> + </parameter> + <parameter name="tcode" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/fw_resp.h" + line="49">One of #HinawaTcode enumerators</doc> + <type name="FwTcode" c:type="HinawaFwTcode"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <record name="FwRespPrivate" c:type="HinawaFwRespPrivate" disguised="1"> + <source-position filename="../src/fw_resp.h" line="35"/> + </record> + <enumeration name="FwTcode" + glib:type-name="HinawaFwTcode" + glib:get-type="hinawa_fw_tcode_get_type" + c:type="HinawaFwTcode"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="9">A representation for tcode of asynchronous transaction on IEEE 1394 bus.</doc> + <member name="write_quadlet_request" + value="0" + c:identifier="HINAWA_FW_TCODE_WRITE_QUADLET_REQUEST" + glib:nick="write-quadlet-request"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="11">For request to write quadlet.</doc> + </member> + <member name="write_block_request" + value="1" + c:identifier="HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST" + glib:nick="write-block-request"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="12">For request to write block.</doc> + </member> + <member name="write_response" + value="2" + c:identifier="HINAWA_FW_TCODE_WRITE_RESPONSE" + glib:nick="write-response"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="13">For response to write.</doc> + </member> + <member name="read_quadlet_request" + value="4" + c:identifier="HINAWA_FW_TCODE_READ_QUADLET_REQUEST" + glib:nick="read-quadlet-request"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="14">For response to read quadlet.</doc> + </member> + <member name="read_block_request" + value="5" + c:identifier="HINAWA_FW_TCODE_READ_BLOCK_REQUEST" + glib:nick="read-block-request"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="15">For request to read block.</doc> + </member> + <member name="read_quadlet_response" + value="6" + c:identifier="HINAWA_FW_TCODE_READ_QUADLET_RESPONSE" + glib:nick="read-quadlet-response"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="16">For response to quadlet read.</doc> + </member> + <member name="read_block_response" + value="7" + c:identifier="HINAWA_FW_TCODE_READ_BLOCK_RESPONSE" + glib:nick="read-block-response"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="17">For response to block read.</doc> + </member> + <member name="cycle_start" + value="8" + c:identifier="HINAWA_FW_TCODE_CYCLE_START" + glib:nick="cycle-start"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="18">For cycle start.</doc> + </member> + <member name="lock_request" + value="9" + c:identifier="HINAWA_FW_TCODE_LOCK_REQUEST" + glib:nick="lock-request"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="19">For request to lock.</doc> + </member> + <member name="stream_data" + value="10" + c:identifier="HINAWA_FW_TCODE_STREAM_DATA" + glib:nick="stream-data"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="20">For stream data.</doc> + </member> + <member name="lock_response" + value="11" + c:identifier="HINAWA_FW_TCODE_LOCK_RESPONSE" + glib:nick="lock-response"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="21">For response to lock.</doc> + </member> + <member name="lock_mask_swap" + value="17" + c:identifier="HINAWA_FW_TCODE_LOCK_MASK_SWAP" + glib:nick="lock-mask-swap"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="22">For lock request for mask-swap.</doc> + </member> + <member name="lock_compare_swap" + value="18" + c:identifier="HINAWA_FW_TCODE_LOCK_COMPARE_SWAP" + glib:nick="lock-compare-swap"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="23">For lock request for compare-swap.</doc> + </member> + <member name="lock_fetch_add" + value="19" + c:identifier="HINAWA_FW_TCODE_LOCK_FETCH_ADD" + glib:nick="lock-fetch-add"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="24">For lock request for fetch-add.</doc> + </member> + <member name="lock_little_add" + value="20" + c:identifier="HINAWA_FW_TCODE_LOCK_LITTLE_ADD" + glib:nick="lock-little-add"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="25">For lock request for little-add.</doc> + </member> + <member name="lock_bounded_add" + value="21" + c:identifier="HINAWA_FW_TCODE_LOCK_BOUNDED_ADD" + glib:nick="lock-bounded-add"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="26">For lock request for bounded-add.</doc> + </member> + <member name="lock_wrap_add" + value="22" + c:identifier="HINAWA_FW_TCODE_LOCK_WRAP_ADD" + glib:nick="lock-wrap-add"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="27">For lock request for wrap-add.</doc> + </member> + <member name="lock_vendor_dependent" + value="23" + c:identifier="HINAWA_FW_TCODE_LOCK_VENDOR_DEPENDENT" + glib:nick="lock-vendor-dependent"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="28">For lock request for vendor-dependent.</doc> + </member> + </enumeration> + <function-macro name="IS_FW_FCP" + c:identifier="HINAWA_IS_FW_FCP" + introspectable="0"> + <source-position filename="../src/fw_fcp.h" line="19"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_FCP_CLASS" + c:identifier="HINAWA_IS_FW_FCP_CLASS" + introspectable="0"> + <source-position filename="../src/fw_fcp.h" line="27"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_NODE" + c:identifier="HINAWA_IS_FW_NODE" + introspectable="0"> + <source-position filename="../src/fw_node.h" line="16"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_NODE_CLASS" + c:identifier="HINAWA_IS_FW_NODE_CLASS" + introspectable="0"> + <source-position filename="../src/fw_node.h" line="24"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_REQ" + c:identifier="HINAWA_IS_FW_REQ" + introspectable="0"> + <source-position filename="../src/fw_req.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_REQ_CLASS" + c:identifier="HINAWA_IS_FW_REQ_CLASS" + introspectable="0"> + <source-position filename="../src/fw_req.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_RESP" + c:identifier="HINAWA_IS_FW_RESP" + introspectable="0"> + <source-position filename="../src/fw_resp.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_FW_RESP_CLASS" + c:identifier="HINAWA_IS_FW_RESP_CLASS" + introspectable="0"> + <source-position filename="../src/fw_resp.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_DG00X" + c:identifier="HINAWA_IS_SND_DG00X" + introspectable="0"> + <source-position filename="../src/snd_dg00x.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_DG00X_CLASS" + c:identifier="HINAWA_IS_SND_DG00X_CLASS" + introspectable="0"> + <source-position filename="../src/snd_dg00x.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_DICE" + c:identifier="HINAWA_IS_SND_DICE" + introspectable="0"> + <source-position filename="../src/snd_dice.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_DICE_CLASS" + c:identifier="HINAWA_IS_SND_DICE_CLASS" + introspectable="0"> + <source-position filename="../src/snd_dice.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_EFW" + c:identifier="HINAWA_IS_SND_EFW" + introspectable="0"> + <source-position filename="../src/snd_efw.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_EFW_CLASS" + c:identifier="HINAWA_IS_SND_EFW_CLASS" + introspectable="0"> + <source-position filename="../src/snd_efw.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_MOTU" + c:identifier="HINAWA_IS_SND_MOTU" + introspectable="0"> + <source-position filename="../src/snd_motu.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_MOTU_CLASS" + c:identifier="HINAWA_IS_SND_MOTU_CLASS" + introspectable="0"> + <source-position filename="../src/snd_motu.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_TSCM" + c:identifier="HINAWA_IS_SND_TSCM" + introspectable="0"> + <source-position filename="../src/snd_tscm.h" line="17"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_TSCM_CLASS" + c:identifier="HINAWA_IS_SND_TSCM_CLASS" + introspectable="0"> + <source-position filename="../src/snd_tscm.h" line="25"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_UNIT" + c:identifier="HINAWA_IS_SND_UNIT" + introspectable="0"> + <source-position filename="../src/snd_unit.h" line="16"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="IS_SND_UNIT_CLASS" + c:identifier="HINAWA_IS_SND_UNIT_CLASS" + introspectable="0"> + <source-position filename="../src/snd_unit.h" line="24"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_DG00X" + c:identifier="HINAWA_SND_DG00X" + introspectable="0"> + <source-position filename="../src/snd_dg00x.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_DG00X_CLASS" + c:identifier="HINAWA_SND_DG00X_CLASS" + introspectable="0"> + <source-position filename="../src/snd_dg00x.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_DG00X_GET_CLASS" + c:identifier="HINAWA_SND_DG00X_GET_CLASS" + introspectable="0"> + <source-position filename="../src/snd_dg00x.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_DICE" + c:identifier="HINAWA_SND_DICE" + introspectable="0"> + <source-position filename="../src/snd_dice.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_DICE_CLASS" + c:identifier="HINAWA_SND_DICE_CLASS" + introspectable="0"> + <source-position filename="../src/snd_dice.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_DICE_GET_CLASS" + c:identifier="HINAWA_SND_DICE_GET_CLASS" + introspectable="0"> + <source-position filename="../src/snd_dice.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_EFW" + c:identifier="HINAWA_SND_EFW" + introspectable="0"> + <source-position filename="../src/snd_efw.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_EFW_CLASS" + c:identifier="HINAWA_SND_EFW_CLASS" + introspectable="0"> + <source-position filename="../src/snd_efw.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_EFW_GET_CLASS" + c:identifier="HINAWA_SND_EFW_GET_CLASS" + introspectable="0"> + <source-position filename="../src/snd_efw.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_MOTU" + c:identifier="HINAWA_SND_MOTU" + introspectable="0"> + <source-position filename="../src/snd_motu.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_MOTU_CLASS" + c:identifier="HINAWA_SND_MOTU_CLASS" + introspectable="0"> + <source-position filename="../src/snd_motu.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_MOTU_GET_CLASS" + c:identifier="HINAWA_SND_MOTU_GET_CLASS" + introspectable="0"> + <source-position filename="../src/snd_motu.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_TSCM" + c:identifier="HINAWA_SND_TSCM" + introspectable="0"> + <source-position filename="../src/snd_tscm.h" line="13"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_TSCM_CLASS" + c:identifier="HINAWA_SND_TSCM_CLASS" + introspectable="0"> + <source-position filename="../src/snd_tscm.h" line="21"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_TSCM_GET_CLASS" + c:identifier="HINAWA_SND_TSCM_GET_CLASS" + introspectable="0"> + <source-position filename="../src/snd_tscm.h" line="28"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_UNIT" + c:identifier="HINAWA_SND_UNIT" + introspectable="0"> + <source-position filename="../src/snd_unit.h" line="12"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_UNIT_CLASS" + c:identifier="HINAWA_SND_UNIT_CLASS" + introspectable="0"> + <source-position filename="../src/snd_unit.h" line="20"/> + <parameters> + <parameter name="klass"> + </parameter> + </parameters> + </function-macro> + <function-macro name="SND_UNIT_GET_CLASS" + c:identifier="HINAWA_SND_UNIT_GET_CLASS" + introspectable="0"> + <source-position filename="../src/snd_unit.h" line="27"/> + <parameters> + <parameter name="obj"> + </parameter> + </parameters> + </function-macro> + <class name="SndDg00x" + c:symbol-prefix="snd_dg00x" + c:type="HinawaSndDg00x" + parent="SndUnit" + glib:type-name="HinawaSndDg00x" + glib:get-type="hinawa_snd_dg00x_get_type" + glib:type-struct="SndDg00xClass"> + <source-position filename="../src/snd_dg00x.h" line="52"/> + <constructor name="new" + c:identifier="hinawa_snd_dg00x_new" + version="1.3."> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="56">Instantiate #HinawaSndDg00x object and return the instance.</doc> + <source-position filename="../src/snd_dg00x.h" line="56"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="61">an instance of #HinawaSndDg00x.</doc> + <type name="SndDg00x" c:type="HinawaSndDg00x*"/> + </return-value> + </constructor> + <virtual-method name="message"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.h" + line="43">When Dg00x models transfer notification, the ::message handler is +called.</doc> + <source-position filename="../src/snd_dg00x.h" line="51"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.h" + line="45">A #HinawaSndDg00x</doc> + <type name="SndDg00x" c:type="HinawaSndDg00x*"/> + </instance-parameter> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.h" + line="46">A message</doc> + <type name="guint32" c:type="guint32"/> + </parameter> + </parameters> + </virtual-method> + <method name="open" c:identifier="hinawa_snd_dg00x_open" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="69">Open ALSA hwdep character device and check it for Dg00x devices.</doc> + <source-position filename="../src/snd_dg00x.h" line="58"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="71">A #HinawaSndUnit</doc> + <type name="SndDg00x" c:type="HinawaSndDg00x*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="72">A full path of a special file for ALSA hwdep character device</doc> + <type name="utf8" c:type="gchar*"/> + </parameter> + </parameters> + </method> + <field name="parent_instance"> + <type name="SndUnit" c:type="HinawaSndUnit"/> + </field> + <glib:signal name="message" when="last"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="33">When Dg00x models transfer notification, the ::message signal is +generated.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.c" + line="36">A message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </glib:signal> + </class> + <record name="SndDg00xClass" + c:type="HinawaSndDg00xClass" + glib:is-gtype-struct-for="SndDg00x"> + <source-position filename="../src/snd_dg00x.h" line="52"/> + <field name="parent_class"> + <type name="SndUnitClass" c:type="HinawaSndUnitClass"/> + </field> + <field name="message"> + <callback name="message"> + <source-position filename="../src/snd_dg00x.h" line="51"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.h" + line="45">A #HinawaSndDg00x</doc> + <type name="SndDg00x" c:type="HinawaSndDg00x*"/> + </parameter> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dg00x.h" + line="46">A message</doc> + <type name="guint32" c:type="guint32"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <class name="SndDice" + c:symbol-prefix="snd_dice" + c:type="HinawaSndDice" + parent="SndUnit" + glib:type-name="HinawaSndDice" + glib:get-type="hinawa_snd_dice_get_type" + glib:type-struct="SndDiceClass"> + <source-position filename="../src/snd_dice.h" line="55"/> + <constructor name="new" + c:identifier="hinawa_snd_dice_new" + version="1.3."> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="82">Instantiate #HinawaSndDice object and return the instance.</doc> + <source-position filename="../src/snd_dice.h" line="59"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="87">an instance of #HinawaSndDice.</doc> + <type name="SndDice" c:type="HinawaSndDice*"/> + </return-value> + </constructor> + <virtual-method name="notified"> + <doc xml:space="preserve" + filename="../src/snd_dice.h" + line="46">When Dice models transfer notification, the ::notified handler is +called.</doc> + <source-position filename="../src/snd_dice.h" line="54"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.h" + line="48">A #HinawaSndDice</doc> + <type name="SndDice" c:type="HinawaSndDice*"/> + </instance-parameter> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.h" + line="49">A notification message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </virtual-method> + <method name="open" c:identifier="hinawa_snd_dice_open" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="95">Open ALSA hwdep character device and check it for Dice devices.</doc> + <source-position filename="../src/snd_dice.h" line="61"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="97">A #HinawaSndUnit</doc> + <type name="SndDice" c:type="HinawaSndDice*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="98">A full path of a special file for ALSA hwdep character device</doc> + <type name="utf8" c:type="gchar*"/> + </parameter> + </parameters> + </method> + <method name="transaction" + c:identifier="hinawa_snd_dice_transaction" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="127">Execute write transactions to the given address, then wait and check +notification.</doc> + <source-position filename="../src/snd_dice.h" line="63"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="129">A #HinawaSndDice</doc> + <type name="SndDice" c:type="HinawaSndDice*"/> + </instance-parameter> + <parameter name="addr" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="130">A destination address of target device</doc> + <type name="guint64" c:type="guint64"/> + </parameter> + <parameter name="frame" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="131">An array with elements for quadlet + data to transmit.</doc> + <array length="2" zero-terminated="0" c:type="const guint32*"> + <type name="guint32" c:type="guint32"/> + </array> + </parameter> + <parameter name="frame_count" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="133">The number of quadlets in the frame.</doc> + <type name="gsize" c:type="gsize"/> + </parameter> + <parameter name="bit_flag" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="134">bit flag to wait</doc> + <type name="guint32" c:type="guint32"/> + </parameter> + </parameters> + </method> + <field name="parent_instance"> + <type name="SndUnit" c:type="HinawaSndUnit"/> + </field> + <field name="priv"> + <type name="SndDicePrivate" c:type="HinawaSndDicePrivate*"/> + </field> + <glib:signal name="notified" when="last"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="59">When Dice models transfer notification, the ::notified signal is +generated.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.c" + line="62">A notification message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </glib:signal> + </class> + <record name="SndDiceClass" + c:type="HinawaSndDiceClass" + glib:is-gtype-struct-for="SndDice"> + <source-position filename="../src/snd_dice.h" line="55"/> + <field name="parent_class"> + <type name="SndUnitClass" c:type="HinawaSndUnitClass"/> + </field> + <field name="notified"> + <callback name="notified"> + <source-position filename="../src/snd_dice.h" line="54"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.h" + line="48">A #HinawaSndDice</doc> + <type name="SndDice" c:type="HinawaSndDice*"/> + </parameter> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_dice.h" + line="49">A notification message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <record name="SndDicePrivate" c:type="HinawaSndDicePrivate" disguised="1"> + <source-position filename="../src/snd_dice.h" line="35"/> + </record> + <class name="SndEfw" + c:symbol-prefix="snd_efw" + c:type="HinawaSndEfw" + parent="SndUnit" + glib:type-name="HinawaSndEfw" + glib:get-type="hinawa_snd_efw_get_type" + glib:type-struct="SndEfwClass"> + <source-position filename="../src/snd_efw.h" line="45"/> + <constructor name="new" c:identifier="hinawa_snd_efw_new" version="1.3."> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="88">Instantiate #HinawaSndEfw object and return the instance.</doc> + <source-position filename="../src/snd_efw.h" line="49"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="93">an instance of #HinawaSndEfw.</doc> + <type name="SndEfw" c:type="HinawaSndEfw*"/> + </return-value> + </constructor> + <method name="open" c:identifier="hinawa_snd_efw_open" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="101">Open ALSA hwdep character device and check it for Fireworks devices.</doc> + <source-position filename="../src/snd_efw.h" line="51"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="103">A #HinawaSndUnit</doc> + <type name="SndEfw" c:type="HinawaSndEfw*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="104">A full path of a special file for ALSA hwdep character device</doc> + <type name="utf8" c:type="gchar*"/> + </parameter> + </parameters> + </method> + <method name="transaction" + c:identifier="hinawa_snd_efw_transaction" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="133">Execute transaction according to Echo Fireworks Transaction protocol.</doc> + <source-position filename="../src/snd_efw.h" line="53"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="135">A #HinawaSndEfw.</doc> + <type name="SndEfw" c:type="HinawaSndEfw*"/> + </instance-parameter> + <parameter name="category" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="136">one of category for the transaction.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="command" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="137">one of commands for the transaction.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="args" + transfer-ownership="none" + nullable="1" + allow-none="1"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="138">An array with elements for + quadlet data as arguments for command.</doc> + <array length="3" zero-terminated="0" c:type="const guint32*"> + <type name="guint32" c:type="guint32"/> + </array> + </parameter> + <parameter name="arg_count" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="140">The number of quadlets in the args array.</doc> + <type name="gsize" c:type="gsize"/> + </parameter> + <parameter name="params" + direction="inout" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="141">An array with elements for + quadlet data to save parameters in response. Callers should give it + for buffer with enough space against the request since this library + performs no reallocation. Due to the reason, the value of this + argument should point to the pointer to the array and immutable. + The content of array is mutable for parameters in response.</doc> + <array length="5" zero-terminated="0" c:type="guint32* const*"> + <type name="guint32" c:type="guint32*"/> + </array> + </parameter> + <parameter name="param_count" + direction="inout" + caller-allocates="0" + transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_efw.c" + line="147">The number of quadlets in the params array.</doc> + <type name="gsize" c:type="gsize*"/> + </parameter> + </parameters> + </method> + <field name="parent_instance"> + <type name="SndUnit" c:type="HinawaSndUnit"/> + </field> + <field name="priv"> + <type name="SndEfwPrivate" c:type="HinawaSndEfwPrivate*"/> + </field> + </class> + <record name="SndEfwClass" + c:type="HinawaSndEfwClass" + glib:is-gtype-struct-for="SndEfw"> + <source-position filename="../src/snd_efw.h" line="45"/> + <field name="parent_class"> + <type name="SndUnitClass" c:type="HinawaSndUnitClass"/> + </field> + </record> + <record name="SndEfwPrivate" c:type="HinawaSndEfwPrivate" disguised="1"> + <source-position filename="../src/snd_efw.h" line="35"/> + </record> + <class name="SndMotu" + c:symbol-prefix="snd_motu" + c:type="HinawaSndMotu" + parent="SndUnit" + glib:type-name="HinawaSndMotu" + glib:get-type="hinawa_snd_motu_get_type" + glib:type-struct="SndMotuClass"> + <source-position filename="../src/snd_motu.h" line="55"/> + <constructor name="new" + c:identifier="hinawa_snd_motu_new" + version="1.3."> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="59">Instantiate #HinawaSndMotu object and return the instance.</doc> + <source-position filename="../src/snd_motu.h" line="59"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="64">an instance of #HinawaSndMotu.</doc> + <type name="SndMotu" c:type="HinawaSndMotu*"/> + </return-value> + </constructor> + <virtual-method name="notified"> + <doc xml:space="preserve" + filename="../src/snd_motu.h" + line="46">When Motu models transfer notification, the ::notified handler is +called.</doc> + <source-position filename="../src/snd_motu.h" line="54"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.h" + line="48">A #HinawaSndMotu</doc> + <type name="SndMotu" c:type="HinawaSndMotu*"/> + </instance-parameter> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.h" + line="49">A notification message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </virtual-method> + <method name="open" c:identifier="hinawa_snd_motu_open" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="72">Open ALSA hwdep character device and check it for Motu devices.</doc> + <source-position filename="../src/snd_motu.h" line="61"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="74">A #HinawaSndUnit</doc> + <type name="SndMotu" c:type="HinawaSndMotu*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="75">A full path of a special file for ALSA hwdep character device</doc> + <type name="utf8" c:type="gchar*"/> + </parameter> + </parameters> + </method> + <field name="parent_instance"> + <type name="SndUnit" c:type="HinawaSndUnit"/> + </field> + <field name="priv"> + <type name="SndMotuPrivate" c:type="HinawaSndMotuPrivate*"/> + </field> + <glib:signal name="notified" when="last"> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="36">When Motu models transfer notification, the ::notified signal is +generated.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.c" + line="39">A notification message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </glib:signal> + </class> + <record name="SndMotuClass" + c:type="HinawaSndMotuClass" + glib:is-gtype-struct-for="SndMotu"> + <source-position filename="../src/snd_motu.h" line="55"/> + <field name="parent_class"> + <type name="SndUnitClass" c:type="HinawaSndUnitClass"/> + </field> + <field name="notified"> + <callback name="notified"> + <source-position filename="../src/snd_motu.h" line="54"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.h" + line="48">A #HinawaSndMotu</doc> + <type name="SndMotu" c:type="HinawaSndMotu*"/> + </parameter> + <parameter name="message" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_motu.h" + line="49">A notification message</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <record name="SndMotuPrivate" c:type="HinawaSndMotuPrivate" disguised="1"> + <source-position filename="../src/snd_motu.h" line="35"/> + </record> + <class name="SndTscm" + c:symbol-prefix="snd_tscm" + c:type="HinawaSndTscm" + parent="SndUnit" + glib:type-name="HinawaSndTscm" + glib:get-type="hinawa_snd_tscm_get_type" + glib:type-struct="SndTscmClass"> + <source-position filename="../src/snd_tscm.h" line="58"/> + <constructor name="new" + c:identifier="hinawa_snd_tscm_new" + version="1.3."> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="65">Instantiate #HinawaSndTscm object and return the instance.</doc> + <source-position filename="../src/snd_tscm.h" line="62"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="70">an instance of #HinawaSndTscm.</doc> + <type name="SndTscm" c:type="HinawaSndTscm*"/> + </return-value> + </constructor> + <virtual-method name="control"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="46">When TASCAM FireWire unit transfer control message, the ::control +signal is emitted.</doc> + <source-position filename="../src/snd_tscm.h" line="56"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="48">A #HinawaSndTscm</doc> + <type name="SndTscm" c:type="HinawaSndTscm*"/> + </instance-parameter> + <parameter name="index" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="49">the numerical index on image of status and control info.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="before" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="50">the value of info before changed.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="after" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="51">the value of info after changed.</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </virtual-method> + <method name="get_state" + c:identifier="hinawa_snd_tscm_get_state" + throws="1"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="103">Get the latest states of target device.</doc> + <source-position filename="../src/snd_tscm.h" line="66"/> + <return-value transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="110">state + image.</doc> + <array zero-terminated="0" c:type="const guint32*" fixed-size="64"> + <type name="guint32"/> + </array> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="105">A #HinawaSndTscm</doc> + <type name="SndTscm" c:type="HinawaSndTscm*"/> + </instance-parameter> + </parameters> + </method> + <method name="open" c:identifier="hinawa_snd_tscm_open" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="78">Open ALSA hwdep character device and check it for Dg00x devices.</doc> + <source-position filename="../src/snd_tscm.h" line="64"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="80">A #HinawaSndUnit</doc> + <type name="SndTscm" c:type="HinawaSndTscm*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="81">A full path of a special file for ALSA hwdep character device</doc> + <type name="utf8" c:type="gchar*"/> + </parameter> + </parameters> + </method> + <field name="parent_instance"> + <type name="SndUnit" c:type="HinawaSndUnit"/> + </field> + <field name="priv"> + <type name="SndTscmPrivate" c:type="HinawaSndTscmPrivate*"/> + </field> + <glib:signal name="control" when="last"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="39">When TASCAM FireWire unit transfer control message, the ::control +signal is emitted.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="index" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="42">the numerical index on image of status and control info.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="before" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="43">the value of info before changed.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="after" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.c" + line="44">the value of info after changed.</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </glib:signal> + </class> + <record name="SndTscmClass" + c:type="HinawaSndTscmClass" + glib:is-gtype-struct-for="SndTscm"> + <source-position filename="../src/snd_tscm.h" line="58"/> + <field name="parent_class"> + <type name="SndUnitClass" c:type="HinawaSndUnitClass"/> + </field> + <field name="control"> + <callback name="control"> + <source-position filename="../src/snd_tscm.h" line="56"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="48">A #HinawaSndTscm</doc> + <type name="SndTscm" c:type="HinawaSndTscm*"/> + </parameter> + <parameter name="index" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="49">the numerical index on image of status and control info.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="before" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="50">the value of info before changed.</doc> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="after" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_tscm.h" + line="51">the value of info after changed.</doc> + <type name="guint" c:type="guint"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <record name="SndTscmPrivate" c:type="HinawaSndTscmPrivate" disguised="1"> + <source-position filename="../src/snd_tscm.h" line="35"/> + </record> + <class name="SndUnit" + c:symbol-prefix="snd_unit" + c:type="HinawaSndUnit" + parent="GObject.Object" + glib:type-name="HinawaSndUnit" + glib:get-type="hinawa_snd_unit_get_type" + glib:type-struct="SndUnitClass"> + <source-position filename="../src/snd_unit.h" line="65"/> + <constructor name="new" + c:identifier="hinawa_snd_unit_new" + version="1.3."> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="189">Instantiate #HinawaSndUnit object and return the instance.</doc> + <source-position filename="../src/snd_unit.h" line="69"/> + <return-value transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="194">an instance of #HinawaSndUnit.</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </return-value> + </constructor> + <virtual-method name="disconnected"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="55">When the sound card is not available anymore due to unbinding driver +or hot unplugging, this signal is emit. The owner of this object +should call g_object_free() as quickly as possible to release ALSA +hwdep character device.</doc> + <source-position filename="../src/snd_unit.h" line="64"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="57">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + </parameters> + </virtual-method> + <virtual-method name="lock_status"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="45">When ALSA kernel-streaming status is changed, this ::lock_status +handler is called.</doc> + <source-position filename="../src/snd_unit.h" line="53"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="47">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + <parameter name="state" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="48">%TRUE when locked, %FALSE when unlocked.</doc> + <type name="gboolean" c:type="gboolean"/> + </parameter> + </parameters> + </virtual-method> + <method name="create_source" + c:identifier="hinawa_snd_unit_create_source" + version="1.4." + throws="1"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="416">Create Gsource for GMainContext to dispatch events for the sound device.</doc> + <source-position filename="../src/snd_unit.h" line="78"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="418">A #HinawaSndUnit.</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + <parameter name="gsrc" + direction="out" + caller-allocates="0" + transfer-ownership="full"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="419">A #GSource.</doc> + <type name="GLib.Source" c:type="GSource**"/> + </parameter> + </parameters> + </method> + <method name="get_node" + c:identifier="hinawa_snd_unit_get_node" + version="2.0."> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="237">Retrieve an instance of #HinawaFwNode associated to the given unit.</doc> + <source-position filename="../src/snd_unit.h" line="73"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="239">A #HinawaSndUnit.</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + <parameter name="node" + direction="out" + caller-allocates="0" + transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="240">A #HinawaFwNode.</doc> + <type name="FwNode" c:type="HinawaFwNode**"/> + </parameter> + </parameters> + </method> + <method name="lock" c:identifier="hinawa_snd_unit_lock" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="255">Disallow ALSA to start kernel-streaming.</doc> + <source-position filename="../src/snd_unit.h" line="75"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="257">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + </parameters> + </method> + <method name="open" c:identifier="hinawa_snd_unit_open" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="202">Open ALSA hwdep character device and check it for FireWire sound devices.</doc> + <source-position filename="../src/snd_unit.h" line="71"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="204">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + <parameter name="path" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="205">A full path of a special file for ALSA hwdep character device</doc> + <type name="utf8" c:type="gchar*"/> + </parameter> + </parameters> + </method> + <method name="unlock" c:identifier="hinawa_snd_unit_unlock" throws="1"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="273">Allow ALSA to start kernel-streaming.</doc> + <source-position filename="../src/snd_unit.h" line="76"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <instance-parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="275">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </instance-parameter> + </parameters> + </method> + <property name="card" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </property> + <property name="device" transfer-ownership="none"> + <type name="utf8" c:type="gchar*"/> + </property> + <property name="guid" transfer-ownership="none"> + <type name="guint64" c:type="guint64"/> + </property> + <property name="streaming" transfer-ownership="none"> + <type name="gboolean" c:type="gboolean"/> + </property> + <property name="type" transfer-ownership="none"> + <type name="SndUnitType"/> + </property> + <field name="parent_instance"> + <type name="GObject.Object" c:type="GObject"/> + </field> + <field name="priv"> + <type name="SndUnitPrivate" c:type="HinawaSndUnitPrivate*"/> + </field> + <glib:signal name="disconnected" when="last"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="163">When the sound card is not available anymore due to unbinding driver +or hot unplugging, this signal is emit. The owner of this object +should call g_object_free() as quickly as possible to release ALSA +hwdep character device.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + </glib:signal> + <glib:signal name="lock-status" when="last"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="146">When ALSA kernel-streaming status is changed, this ::lock-status +signal is generated.</doc> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="state" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.c" + line="149">%TRUE when locked, %FALSE when unlocked.</doc> + <type name="gboolean" c:type="gboolean"/> + </parameter> + </parameters> + </glib:signal> + </class> + <record name="SndUnitClass" + c:type="HinawaSndUnitClass" + glib:is-gtype-struct-for="SndUnit"> + <source-position filename="../src/snd_unit.h" line="65"/> + <field name="parent_class"> + <type name="GObject.ObjectClass" c:type="GObjectClass"/> + </field> + <field name="lock_status"> + <callback name="lock_status"> + <source-position filename="../src/snd_unit.h" line="53"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="47">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </parameter> + <parameter name="state" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="48">%TRUE when locked, %FALSE when unlocked.</doc> + <type name="gboolean" c:type="gboolean"/> + </parameter> + </parameters> + </callback> + </field> + <field name="disconnected"> + <callback name="disconnected"> + <source-position filename="../src/snd_unit.h" line="64"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="self" transfer-ownership="none"> + <doc xml:space="preserve" + filename="../src/snd_unit.h" + line="57">A #HinawaSndUnit</doc> + <type name="SndUnit" c:type="HinawaSndUnit*"/> + </parameter> + </parameters> + </callback> + </field> + </record> + <record name="SndUnitPrivate" c:type="HinawaSndUnitPrivate" disguised="1"> + <source-position filename="../src/snd_unit.h" line="34"/> + </record> + <enumeration name="SndUnitType" + glib:type-name="HinawaSndUnitType" + glib:get-type="hinawa_snd_unit_type_get_type" + c:type="HinawaSndUnitType"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="83">A representation of type for sound unit defined by Linux sound subsystem.</doc> + <member name="dice" + value="1" + c:identifier="HINAWA_SND_UNIT_TYPE_DICE" + glib:nick="dice"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="85">The type of DICE ASIC.</doc> + </member> + <member name="fireworks" + value="2" + c:identifier="HINAWA_SND_UNIT_TYPE_FIREWORKS" + glib:nick="fireworks"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="86">The type of Fireworks board module.</doc> + </member> + <member name="bebob" + value="3" + c:identifier="HINAWA_SND_UNIT_TYPE_BEBOB" + glib:nick="bebob"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="87">The type of BeBoB ASIC.</doc> + </member> + <member name="oxfw" + value="4" + c:identifier="HINAWA_SND_UNIT_TYPE_OXFW" + glib:nick="oxfw"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="88">The type of OXFW ASIC</doc> + </member> + <member name="digi00x" + value="5" + c:identifier="HINAWA_SND_UNIT_TYPE_DIGI00X" + glib:nick="digi00x"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="89">The type of Digi00x series.</doc> + </member> + <member name="tascam" + value="6" + c:identifier="HINAWA_SND_UNIT_TYPE_TASCAM" + glib:nick="tascam"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="90">The type of Tascam FireWire series.</doc> + </member> + <member name="motu" + value="7" + c:identifier="HINAWA_SND_UNIT_TYPE_MOTU" + glib:nick="motu"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="91">The type of MOTU FireWire series.</doc> + </member> + <member name="fireface" + value="8" + c:identifier="HINAWA_SND_UNIT_TYPE_FIREFACE" + glib:nick="fireface"> + <doc xml:space="preserve" + filename="../src/hinawa_enum_types.h" + line="92">The type of RME Fireface series.</doc> + </member> + </enumeration> + <function name="sigs_marshal_ENUM__ENUM" + c:identifier="hinawa_sigs_marshal_ENUM__ENUM"> + <source-position filename="../src/hinawa_sigs_marshal.h" line="10"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="closure" transfer-ownership="none"> + <type name="GObject.Closure" c:type="GClosure*"/> + </parameter> + <parameter name="return_value" transfer-ownership="none"> + <type name="GObject.Value" c:type="GValue*"/> + </parameter> + <parameter name="n_param_values" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="param_values" transfer-ownership="none"> + <type name="GObject.Value" c:type="const GValue*"/> + </parameter> + <parameter name="invocation_hint" + transfer-ownership="none" + nullable="1" + allow-none="1"> + <type name="gpointer" c:type="gpointer"/> + </parameter> + <parameter name="marshal_data" + transfer-ownership="none" + nullable="1" + allow-none="1"> + <type name="gpointer" c:type="gpointer"/> + </parameter> + </parameters> + </function> + <function name="sigs_marshal_VOID__UINT_UINT_UINT" + c:identifier="hinawa_sigs_marshal_VOID__UINT_UINT_UINT"> + <source-position filename="../src/hinawa_sigs_marshal.h" line="19"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="closure" transfer-ownership="none"> + <type name="GObject.Closure" c:type="GClosure*"/> + </parameter> + <parameter name="return_value" transfer-ownership="none"> + <type name="GObject.Value" c:type="GValue*"/> + </parameter> + <parameter name="n_param_values" transfer-ownership="none"> + <type name="guint" c:type="guint"/> + </parameter> + <parameter name="param_values" transfer-ownership="none"> + <type name="GObject.Value" c:type="const GValue*"/> + </parameter> + <parameter name="invocation_hint" + transfer-ownership="none" + nullable="1" + allow-none="1"> + <type name="gpointer" c:type="gpointer"/> + </parameter> + <parameter name="marshal_data" + transfer-ownership="none" + nullable="1" + allow-none="1"> + <type name="gpointer" c:type="gpointer"/> + </parameter> + </parameters> + </function> + </namespace> +</repository> @@ -0,0 +1,18 @@ +The MIT License (MIT) + +Copyright (c) 2020 Takashi Sakamoto + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..11c7952 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +#!/usr/bin/make -f + +GIR_EXEC = gir/target/release/gir + +.PHONY: all clean test + +all: hinawa-sys hinawa + +clean: + rm -rf gir-files/Hinawa-3.0.gir + rm -rf hinawa-sys + rm -rf hinawa/src/auto hinawa/target hinawa/Cargo.lock + +gir/Cargo.toml: + git submodule update --init gir + +$(GIR_EXEC): gir/Cargo.toml + cd gir && cargo build --release + +gir-files/GLib-2.0.toml: + git submodule update --init gir-files + +gir-files/Hinawa-3.0.gir: Hinawa-3.0.gir gir-files/GLib-2.0.toml + cp Hinawa-3.0.gir gir-files/Hinawa-3.0.gir + +hinawa-sys/src: conf/gir-hinawa-sys.toml gir-files/Hinawa-3.0.gir $(GIR_EXEC) + $(GIR_EXEC) -c conf/gir-hinawa-sys.toml -d gir-files -m sys -o hinawa-sys + +hinawa-sys: hinawa-sys/src + +hinawa/src/auto: conf/gir-hinawa.toml gir-files/Hinawa-3.0.gir $(GIR_EXEC) + $(GIR_EXEC) -c conf/gir-hinawa.toml -d gir-files -m normal -o hinawa + +hinawa: hinawa-sys hinawa/src/auto diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..888f953 --- /dev/null +++ b/README.rst @@ -0,0 +1,59 @@ +==================== +hinawa Rust bindings +==================== + +2020/06/03 +Takashi Sakamoto + +Introduction +============ + +* This repository includes FFI and API bindings for ``libhinawa 2`` which produces ``Hinawa-3.0.gir``. + + * https://github.com/takaswie/libhinawa + +* Unfortunately, it includes no support for ``libhinawa 1`` or former (``Hinawa-2.0.gir`` or ``Hinawa-1.0.gir``). + +License +======= + +MIT License + +Sample code +=========== + +Read 1 quadlet from address ``0xfffff0000404`` on the node represented as ``/dev/fw0`` :: + + extern crate hinawa; + extern crate glib; + + use hinawa::FwNodeExt; + use hinawa::FwReqExtManual; + + + fn main() { + let node = hinawa::FwNode::new(); + node.open("/dev/fw0").unwrap(); + + let ctx = glib::MainContext::new(); + let src = node.create_source().unwrap(); + src.attach(Some(&ctx)); + + let dispatcher = glib::MainLoop::new(Some(&ctx), false); + let cntr = std::sync::Arc::new(dispatcher); + let d = cntr.clone(); + let th = std::thread::spawn(move|| { + d.run(); + () + }); + + let req = hinawa::FwReq::new(); + let mut frames = [0;4]; + req.transaction(&node, FwTcode::ReadQuadletRequest, 0xfffff0000404, 4, + &mut frames).unwrap(); + + assert_eq!(0x31333934, u32::from_be_bytes(frames)); + + cntr.quit(); + th.join().unwrap(); + } diff --git a/conf/gir-hinawa-sys.toml b/conf/gir-hinawa-sys.toml new file mode 100644 index 0000000..3676a1f --- /dev/null +++ b/conf/gir-hinawa-sys.toml @@ -0,0 +1,10 @@ +[options] +work_mode = "sys" +library = "Hinawa" +version = "3.0" +min_cfg_version = "2.0" +single_version_file = "." +external_libraries = [ + "GLib", + "GObject", +] diff --git a/conf/gir-hinawa.toml b/conf/gir-hinawa.toml new file mode 100644 index 0000000..a1cc3f5 --- /dev/null +++ b/conf/gir-hinawa.toml @@ -0,0 +1,75 @@ +[options] +work_mode = "normal" +library = "Hinawa" +version = "3.0" +min_cfg_version = "3.0" +single_version_file = true + +generate = [ + "Hinawa.FwRcode", + "Hinawa.FwTcode", + "Hinawa.SndUnitType", + "Hinawa.SndUnit", + "Hinawa.SndDice", + "Hinawa.SndMotu", + "Hinawa.SndDg00x", +] + +manual = [ + "GLib.Error", + "GLib.Source", +] + +[[object]] +name = "Hinawa.FwNode" +status = "generate" +manual_traits = ["FwNodeExtManual"] + [[object.function]] + pattern = "get_config_rom" + ignore = true + doc_trait_name = "FwNodeExtManual" + +[[object]] +name = "Hinawa.FwReq" +status = "generate" +manual_traits = ["FwReqExtManual"] + [[object.function]] + pattern = "transaction" + ignore = true + doc_trait_name = "FwReqExtManual" + +[[object]] +name = "Hinawa.FwResp" +status = "generate" +manual_traits = ["FwRespExtManual"] + [[object.function]] + pattern = "get_req_frame" + ignore = true + doc_trait_name = "FwRespExtManual" + +[[object]] +name = "Hinawa.FwFcp" +status = "generate" +manual_traits = ["FwFcpExtManual"] + [[object.function]] + pattern = "transaction" + ignore = true + doc_trait_name = "FwFcpExtManual" + +[[object]] +name = "Hinawa.SndEfw" +status = "generate" +manual_traits = ["SndEfwExtManual"] + [[object.function]] + pattern = "transaction" + ignore = true + doc_trait_name = "SndEfwExtManual" + +[[object]] +name = "Hinawa.SndTscm" +status = "generate" +manual_traits = ["SndTscmExtManual"] + [[object.function]] + pattern = "get_state" + ignore = true + doc_trait_name = "SndTscmExtManual" diff --git a/gir b/gir new file mode 160000 +Subproject 57dbee33e5ccdb76876bf8895064e6efad5a143 diff --git a/gir-files b/gir-files new file mode 160000 +Subproject c31e734527636b4ace7972e1c61f8da17cc4f67 diff --git a/hinawa-sys/Cargo.toml b/hinawa-sys/Cargo.toml new file mode 100644 index 0000000..34a9129 --- /dev/null +++ b/hinawa-sys/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "hinawa-sys" +version = "0.1.0" +description = "FFI bindings for libhinawa2 library" +authors = ["Takashi Sakamoto <o-takashi@sakamocchi.jp>"] +links = "hinawa" +build = "build.rs" +[package.metadata.docs.rs] +features = ["dox"] + +[lib] +name = "hinawa_sys" + +[dependencies] +libc = "0.2" + +[dependencies.glib-sys] +git = "https://github.com/gtk-rs/sys" + +[dependencies.gobject-sys] +git = "https://github.com/gtk-rs/sys" + +[build-dependencies] +pkg-config = "0.3.7" + +[dev-dependencies] +shell-words = "0.1.0" +tempfile = "3" + +[features] +dox = [] diff --git a/hinawa-sys/build.rs b/hinawa-sys/build.rs new file mode 100644 index 0000000..b21572a --- /dev/null +++ b/hinawa-sys/build.rs @@ -0,0 +1,83 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +#[cfg(not(feature = "dox"))] +extern crate pkg_config; + +#[cfg(not(feature = "dox"))] +use pkg_config::{Config, Error}; +#[cfg(not(feature = "dox"))] +use std::env; +#[cfg(not(feature = "dox"))] +use std::io::prelude::*; +#[cfg(not(feature = "dox"))] +use std::io; +#[cfg(not(feature = "dox"))] +use std::process; + +#[cfg(feature = "dox")] +fn main() {} // prevent linking libraries to avoid documentation failure + +#[cfg(not(feature = "dox"))] +fn main() { + if let Err(s) = find() { + let _ = writeln!(io::stderr(), "{}", s); + process::exit(1); + } +} + +#[cfg(not(feature = "dox"))] +fn find() -> Result<(), Error> { + let package_name = "hinawa"; + let shared_libs = ["hinawa"]; + let version = { + "2.0" + }; + + if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") { + println!("cargo:include={}", inc_dir); + } + if let Ok(lib_dir) = env::var("GTK_LIB_DIR") { + for lib_ in shared_libs.iter() { + println!("cargo:rustc-link-lib=dylib={}", lib_); + } + println!("cargo:rustc-link-search=native={}", lib_dir); + return Ok(()) + } + + let target = env::var("TARGET").expect("TARGET environment variable doesn't exist"); + let hardcode_shared_libs = target.contains("windows"); + + let mut config = Config::new(); + config.atleast_version(version); + config.print_system_libs(false); + if hardcode_shared_libs { + config.cargo_metadata(false); + } + match config.probe(package_name) { + Ok(library) => { + if let Ok(paths) = std::env::join_paths(library.include_paths) { + println!("cargo:include={}", paths.to_string_lossy()); + } + if hardcode_shared_libs { + for lib_ in shared_libs.iter() { + println!("cargo:rustc-link-lib=dylib={}", lib_); + } + for path in library.link_paths.iter() { + println!("cargo:rustc-link-search=native={}", + path.to_str().expect("library path doesn't exist")); + } + } + Ok(()) + } + Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => { + for lib_ in shared_libs.iter() { + println!("cargo:rustc-link-lib=dylib={}", lib_); + } + Ok(()) + } + Err(err) => Err(err), + } +} + diff --git a/hinawa-sys/src/lib.rs b/hinawa-sys/src/lib.rs new file mode 100644 index 0000000..438f4fa --- /dev/null +++ b/hinawa-sys/src/lib.rs @@ -0,0 +1,533 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] +#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)] + +extern crate libc; +extern crate glib_sys as glib; +extern crate gobject_sys as gobject; + +#[allow(unused_imports)] +use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, + c_short, c_ushort, c_long, c_ulong, + c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE}; + +#[allow(unused_imports)] +use glib::{gboolean, gconstpointer, gpointer, GType}; + +// Enums +pub type HinawaFwRcode = c_int; +pub const HINAWA_FW_RCODE_COMPLETE: HinawaFwRcode = 0; +pub const HINAWA_FW_RCODE_CONFLICT_ERROR: HinawaFwRcode = 4; +pub const HINAWA_FW_RCODE_DATA_ERROR: HinawaFwRcode = 5; +pub const HINAWA_FW_RCODE_TYPE_ERROR: HinawaFwRcode = 6; +pub const HINAWA_FW_RCODE_ADDRESS_ERROR: HinawaFwRcode = 7; +pub const HINAWA_FW_RCODE_SEND_ERROR: HinawaFwRcode = 16; +pub const HINAWA_FW_RCODE_CANCELLED: HinawaFwRcode = 17; +pub const HINAWA_FW_RCODE_BUSY: HinawaFwRcode = 18; +pub const HINAWA_FW_RCODE_GENERATION: HinawaFwRcode = 19; +pub const HINAWA_FW_RCODE_NO_ACK: HinawaFwRcode = 20; + +pub type HinawaFwTcode = c_int; +pub const HINAWA_FW_TCODE_WRITE_QUADLET_REQUEST: HinawaFwTcode = 0; +pub const HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST: HinawaFwTcode = 1; +pub const HINAWA_FW_TCODE_WRITE_RESPONSE: HinawaFwTcode = 2; +pub const HINAWA_FW_TCODE_READ_QUADLET_REQUEST: HinawaFwTcode = 4; +pub const HINAWA_FW_TCODE_READ_BLOCK_REQUEST: HinawaFwTcode = 5; +pub const HINAWA_FW_TCODE_READ_QUADLET_RESPONSE: HinawaFwTcode = 6; +pub const HINAWA_FW_TCODE_READ_BLOCK_RESPONSE: HinawaFwTcode = 7; +pub const HINAWA_FW_TCODE_CYCLE_START: HinawaFwTcode = 8; +pub const HINAWA_FW_TCODE_LOCK_REQUEST: HinawaFwTcode = 9; +pub const HINAWA_FW_TCODE_STREAM_DATA: HinawaFwTcode = 10; +pub const HINAWA_FW_TCODE_LOCK_RESPONSE: HinawaFwTcode = 11; +pub const HINAWA_FW_TCODE_LOCK_MASK_SWAP: HinawaFwTcode = 17; +pub const HINAWA_FW_TCODE_LOCK_COMPARE_SWAP: HinawaFwTcode = 18; +pub const HINAWA_FW_TCODE_LOCK_FETCH_ADD: HinawaFwTcode = 19; +pub const HINAWA_FW_TCODE_LOCK_LITTLE_ADD: HinawaFwTcode = 20; +pub const HINAWA_FW_TCODE_LOCK_BOUNDED_ADD: HinawaFwTcode = 21; +pub const HINAWA_FW_TCODE_LOCK_WRAP_ADD: HinawaFwTcode = 22; +pub const HINAWA_FW_TCODE_LOCK_VENDOR_DEPENDENT: HinawaFwTcode = 23; + +pub type HinawaSndUnitType = c_int; +pub const HINAWA_SND_UNIT_TYPE_DICE: HinawaSndUnitType = 1; +pub const HINAWA_SND_UNIT_TYPE_FIREWORKS: HinawaSndUnitType = 2; +pub const HINAWA_SND_UNIT_TYPE_BEBOB: HinawaSndUnitType = 3; +pub const HINAWA_SND_UNIT_TYPE_OXFW: HinawaSndUnitType = 4; +pub const HINAWA_SND_UNIT_TYPE_DIGI00X: HinawaSndUnitType = 5; +pub const HINAWA_SND_UNIT_TYPE_TASCAM: HinawaSndUnitType = 6; +pub const HINAWA_SND_UNIT_TYPE_MOTU: HinawaSndUnitType = 7; +pub const HINAWA_SND_UNIT_TYPE_FIREFACE: HinawaSndUnitType = 8; + +// Records +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwFcpClass { + pub parent_class: HinawaFwRespClass, +} + +impl ::std::fmt::Debug for HinawaFwFcpClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwFcpClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaFwFcpPrivate(c_void); + +pub type HinawaFwFcpPrivate = *mut _HinawaFwFcpPrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwNodeClass { + pub parent_class: gobject::GObjectClass, + pub bus_update: Option<unsafe extern "C" fn(*mut HinawaFwNode)>, + pub disconnected: Option<unsafe extern "C" fn(*mut HinawaFwNode)>, +} + +impl ::std::fmt::Debug for HinawaFwNodeClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwNodeClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("bus_update", &self.bus_update) + .field("disconnected", &self.disconnected) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaFwNodePrivate(c_void); + +pub type HinawaFwNodePrivate = *mut _HinawaFwNodePrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwReqClass { + pub parent_class: gobject::GObjectClass, +} + +impl ::std::fmt::Debug for HinawaFwReqClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwReqClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaFwReqPrivate(c_void); + +pub type HinawaFwReqPrivate = *mut _HinawaFwReqPrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwRespClass { + pub parent_class: gobject::GObjectClass, + pub requested: Option<unsafe extern "C" fn(*mut HinawaFwResp, HinawaFwTcode) -> HinawaFwRcode>, +} + +impl ::std::fmt::Debug for HinawaFwRespClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwRespClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("requested", &self.requested) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaFwRespPrivate(c_void); + +pub type HinawaFwRespPrivate = *mut _HinawaFwRespPrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndDg00xClass { + pub parent_class: HinawaSndUnitClass, + pub message: Option<unsafe extern "C" fn(*mut HinawaSndDg00x, u32)>, +} + +impl ::std::fmt::Debug for HinawaSndDg00xClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndDg00xClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("message", &self.message) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndDiceClass { + pub parent_class: HinawaSndUnitClass, + pub notified: Option<unsafe extern "C" fn(*mut HinawaSndDice, c_uint)>, +} + +impl ::std::fmt::Debug for HinawaSndDiceClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndDiceClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("notified", &self.notified) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaSndDicePrivate(c_void); + +pub type HinawaSndDicePrivate = *mut _HinawaSndDicePrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndEfwClass { + pub parent_class: HinawaSndUnitClass, +} + +impl ::std::fmt::Debug for HinawaSndEfwClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndEfwClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaSndEfwPrivate(c_void); + +pub type HinawaSndEfwPrivate = *mut _HinawaSndEfwPrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndMotuClass { + pub parent_class: HinawaSndUnitClass, + pub notified: Option<unsafe extern "C" fn(*mut HinawaSndMotu, c_uint)>, +} + +impl ::std::fmt::Debug for HinawaSndMotuClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndMotuClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("notified", &self.notified) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaSndMotuPrivate(c_void); + +pub type HinawaSndMotuPrivate = *mut _HinawaSndMotuPrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndTscmClass { + pub parent_class: HinawaSndUnitClass, + pub control: Option<unsafe extern "C" fn(*mut HinawaSndTscm, c_uint, c_uint, c_uint)>, +} + +impl ::std::fmt::Debug for HinawaSndTscmClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndTscmClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("control", &self.control) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaSndTscmPrivate(c_void); + +pub type HinawaSndTscmPrivate = *mut _HinawaSndTscmPrivate; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndUnitClass { + pub parent_class: gobject::GObjectClass, + pub lock_status: Option<unsafe extern "C" fn(*mut HinawaSndUnit, gboolean)>, + pub disconnected: Option<unsafe extern "C" fn(*mut HinawaSndUnit)>, +} + +impl ::std::fmt::Debug for HinawaSndUnitClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndUnitClass @ {:?}", self as *const _)) + .field("parent_class", &self.parent_class) + .field("lock_status", &self.lock_status) + .field("disconnected", &self.disconnected) + .finish() + } +} + +#[repr(C)] +pub struct _HinawaSndUnitPrivate(c_void); + +pub type HinawaSndUnitPrivate = *mut _HinawaSndUnitPrivate; + +// Classes +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwFcp { + pub parent_instance: HinawaFwResp, + pub priv_: *mut HinawaFwFcpPrivate, +} + +impl ::std::fmt::Debug for HinawaFwFcp { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwFcp @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwNode { + pub parent_instance: gobject::GObject, + pub priv_: *mut HinawaFwNodePrivate, +} + +impl ::std::fmt::Debug for HinawaFwNode { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwNode @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwReq { + pub parent_instance: gobject::GObject, + pub priv_: *mut HinawaFwReqPrivate, +} + +impl ::std::fmt::Debug for HinawaFwReq { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwReq @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaFwResp { + pub parent_instance: gobject::GObject, + pub priv_: *mut HinawaFwRespPrivate, +} + +impl ::std::fmt::Debug for HinawaFwResp { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaFwResp @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndDg00x { + pub parent_instance: HinawaSndUnit, +} + +impl ::std::fmt::Debug for HinawaSndDg00x { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndDg00x @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndDice { + pub parent_instance: HinawaSndUnit, + pub priv_: *mut HinawaSndDicePrivate, +} + +impl ::std::fmt::Debug for HinawaSndDice { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndDice @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndEfw { + pub parent_instance: HinawaSndUnit, + pub priv_: *mut HinawaSndEfwPrivate, +} + +impl ::std::fmt::Debug for HinawaSndEfw { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndEfw @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndMotu { + pub parent_instance: HinawaSndUnit, + pub priv_: *mut HinawaSndMotuPrivate, +} + +impl ::std::fmt::Debug for HinawaSndMotu { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndMotu @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndTscm { + pub parent_instance: HinawaSndUnit, + pub priv_: *mut HinawaSndTscmPrivate, +} + +impl ::std::fmt::Debug for HinawaSndTscm { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndTscm @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct HinawaSndUnit { + pub parent_instance: gobject::GObject, + pub priv_: *mut HinawaSndUnitPrivate, +} + +impl ::std::fmt::Debug for HinawaSndUnit { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("HinawaSndUnit @ {:?}", self as *const _)) + .field("parent_instance", &self.parent_instance) + .field("priv_", &self.priv_) + .finish() + } +} + +extern "C" { + + //========================================================================= + // HinawaFwRcode + //========================================================================= + pub fn hinawa_fw_rcode_get_type() -> GType; + + //========================================================================= + // HinawaFwTcode + //========================================================================= + pub fn hinawa_fw_tcode_get_type() -> GType; + + //========================================================================= + // HinawaSndUnitType + //========================================================================= + pub fn hinawa_snd_unit_type_get_type() -> GType; + + //========================================================================= + // HinawaFwFcp + //========================================================================= + pub fn hinawa_fw_fcp_get_type() -> GType; + pub fn hinawa_fw_fcp_new() -> *mut HinawaFwFcp; + pub fn hinawa_fw_fcp_bind(self_: *mut HinawaFwFcp, node: *mut HinawaFwNode, error: *mut *mut glib::GError); + pub fn hinawa_fw_fcp_transaction(self_: *mut HinawaFwFcp, req_frame: *const u8, req_frame_size: size_t, resp_frame: *const *mut u8, resp_frame_size: *mut size_t, error: *mut *mut glib::GError); + pub fn hinawa_fw_fcp_unbind(self_: *mut HinawaFwFcp); + + //========================================================================= + // HinawaFwNode + //========================================================================= + pub fn hinawa_fw_node_get_type() -> GType; + pub fn hinawa_fw_node_new() -> *mut HinawaFwNode; + pub fn hinawa_fw_node_create_source(self_: *mut HinawaFwNode, gsrc: *mut *mut glib::GSource, error: *mut *mut glib::GError); + pub fn hinawa_fw_node_get_config_rom(self_: *mut HinawaFwNode, image: *mut *const u8, length: *mut size_t, error: *mut *mut glib::GError); + pub fn hinawa_fw_node_open(self_: *mut HinawaFwNode, path: *const c_char, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaFwReq + //========================================================================= + pub fn hinawa_fw_req_get_type() -> GType; + pub fn hinawa_fw_req_new() -> *mut HinawaFwReq; + pub fn hinawa_fw_req_transaction(self_: *mut HinawaFwReq, node: *mut HinawaFwNode, tcode: HinawaFwTcode, addr: u64, length: size_t, frame: *const *mut u8, frame_size: *mut size_t, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaFwResp + //========================================================================= + pub fn hinawa_fw_resp_get_type() -> GType; + pub fn hinawa_fw_resp_new() -> *mut HinawaFwResp; + pub fn hinawa_fw_resp_get_req_frame(self_: *mut HinawaFwResp, frame: *mut *const u8, length: *mut size_t); + pub fn hinawa_fw_resp_release(self_: *mut HinawaFwResp); + pub fn hinawa_fw_resp_reserve(self_: *mut HinawaFwResp, node: *mut HinawaFwNode, addr: u64, width: c_uint, error: *mut *mut glib::GError); + pub fn hinawa_fw_resp_set_resp_frame(self_: *mut HinawaFwResp, frame: *mut u8, length: size_t); + + //========================================================================= + // HinawaSndDg00x + //========================================================================= + pub fn hinawa_snd_dg00x_get_type() -> GType; + pub fn hinawa_snd_dg00x_new() -> *mut HinawaSndDg00x; + pub fn hinawa_snd_dg00x_open(self_: *mut HinawaSndDg00x, path: *mut c_char, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaSndDice + //========================================================================= + pub fn hinawa_snd_dice_get_type() -> GType; + pub fn hinawa_snd_dice_new() -> *mut HinawaSndDice; + pub fn hinawa_snd_dice_open(self_: *mut HinawaSndDice, path: *mut c_char, error: *mut *mut glib::GError); + pub fn hinawa_snd_dice_transaction(self_: *mut HinawaSndDice, addr: u64, frame: *const u32, frame_count: size_t, bit_flag: u32, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaSndEfw + //========================================================================= + pub fn hinawa_snd_efw_get_type() -> GType; + pub fn hinawa_snd_efw_new() -> *mut HinawaSndEfw; + pub fn hinawa_snd_efw_open(self_: *mut HinawaSndEfw, path: *mut c_char, error: *mut *mut glib::GError); + pub fn hinawa_snd_efw_transaction(self_: *mut HinawaSndEfw, category: c_uint, command: c_uint, args: *const u32, arg_count: size_t, params: *const *mut u32, param_count: *mut size_t, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaSndMotu + //========================================================================= + pub fn hinawa_snd_motu_get_type() -> GType; + pub fn hinawa_snd_motu_new() -> *mut HinawaSndMotu; + pub fn hinawa_snd_motu_open(self_: *mut HinawaSndMotu, path: *mut c_char, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaSndTscm + //========================================================================= + pub fn hinawa_snd_tscm_get_type() -> GType; + pub fn hinawa_snd_tscm_new() -> *mut HinawaSndTscm; + pub fn hinawa_snd_tscm_get_state(self_: *mut HinawaSndTscm, error: *mut *mut glib::GError) -> *const [u32; 64]; + pub fn hinawa_snd_tscm_open(self_: *mut HinawaSndTscm, path: *mut c_char, error: *mut *mut glib::GError); + + //========================================================================= + // HinawaSndUnit + //========================================================================= + pub fn hinawa_snd_unit_get_type() -> GType; + pub fn hinawa_snd_unit_new() -> *mut HinawaSndUnit; + pub fn hinawa_snd_unit_create_source(self_: *mut HinawaSndUnit, gsrc: *mut *mut glib::GSource, error: *mut *mut glib::GError); + pub fn hinawa_snd_unit_get_node(self_: *mut HinawaSndUnit, node: *mut *mut HinawaFwNode); + pub fn hinawa_snd_unit_lock(self_: *mut HinawaSndUnit, error: *mut *mut glib::GError); + pub fn hinawa_snd_unit_open(self_: *mut HinawaSndUnit, path: *mut c_char, error: *mut *mut glib::GError); + pub fn hinawa_snd_unit_unlock(self_: *mut HinawaSndUnit, error: *mut *mut glib::GError); + + //========================================================================= + // Other functions + //========================================================================= + pub fn hinawa_sigs_marshal_ENUM__ENUM(closure: *mut gobject::GClosure, return_value: *mut gobject::GValue, n_param_values: c_uint, param_values: *const gobject::GValue, invocation_hint: gpointer, marshal_data: gpointer); + pub fn hinawa_sigs_marshal_VOID__UINT_UINT_UINT(closure: *mut gobject::GClosure, return_value: *mut gobject::GValue, n_param_values: c_uint, param_values: *const gobject::GValue, invocation_hint: gpointer, marshal_data: gpointer); + +} diff --git a/hinawa-sys/versions.txt b/hinawa-sys/versions.txt new file mode 100644 index 0000000..b83a599 --- /dev/null +++ b/hinawa-sys/versions.txt @@ -0,0 +1,2 @@ +Generated by gir (https://github.com/gtk-rs/gir @ 997cbcb) +from gir-files (https://github.com/gtk-rs/gir-files @ c31e734) diff --git a/hinawa/Cargo.toml b/hinawa/Cargo.toml new file mode 100644 index 0000000..ddd83ef --- /dev/null +++ b/hinawa/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "hinawa" +version = "0.1.0" +description = "API bindings for libhinawa2 library" +authors = ["Takashi Sakamoto <o-takashi@sakamocchi.jp>"] + +[lib] +name = "hinawa" + +[dependencies] +libc = "0.2" +glib = { git = "https://github.com/gtk-rs/glib" } +glib-sys = { git = "https://github.com/gtk-rs/sys" } +gobject-sys = { git = "https://github.com/gtk-rs/sys" } +hinawa-sys = { path = "../hinawa-sys" } + +[dev-dependencies] +gir-format-check = "^0.1" diff --git a/hinawa/src/auto/enums.rs b/hinawa/src/auto/enums.rs new file mode 100644 index 0000000..18fefa2 --- /dev/null +++ b/hinawa/src/auto/enums.rs @@ -0,0 +1,336 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use glib::StaticType; +use glib::Type; +use gobject_sys; +use hinawa_sys; +use std::fmt; + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum FwRcode { + Complete, + ConflictError, + DataError, + TypeError, + AddressError, + SendError, + Cancelled, + Busy, + Generation, + NoAck, + #[doc(hidden)] + __Unknown(i32), +} + +impl fmt::Display for FwRcode { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FwRcode::{}", match *self { + FwRcode::Complete => "Complete", + FwRcode::ConflictError => "ConflictError", + FwRcode::DataError => "DataError", + FwRcode::TypeError => "TypeError", + FwRcode::AddressError => "AddressError", + FwRcode::SendError => "SendError", + FwRcode::Cancelled => "Cancelled", + FwRcode::Busy => "Busy", + FwRcode::Generation => "Generation", + FwRcode::NoAck => "NoAck", + _ => "Unknown", + }) + } +} + +#[doc(hidden)] +impl ToGlib for FwRcode { + type GlibType = hinawa_sys::HinawaFwRcode; + + fn to_glib(&self) -> hinawa_sys::HinawaFwRcode { + match *self { + FwRcode::Complete => hinawa_sys::HINAWA_FW_RCODE_COMPLETE, + FwRcode::ConflictError => hinawa_sys::HINAWA_FW_RCODE_CONFLICT_ERROR, + FwRcode::DataError => hinawa_sys::HINAWA_FW_RCODE_DATA_ERROR, + FwRcode::TypeError => hinawa_sys::HINAWA_FW_RCODE_TYPE_ERROR, + FwRcode::AddressError => hinawa_sys::HINAWA_FW_RCODE_ADDRESS_ERROR, + FwRcode::SendError => hinawa_sys::HINAWA_FW_RCODE_SEND_ERROR, + FwRcode::Cancelled => hinawa_sys::HINAWA_FW_RCODE_CANCELLED, + FwRcode::Busy => hinawa_sys::HINAWA_FW_RCODE_BUSY, + FwRcode::Generation => hinawa_sys::HINAWA_FW_RCODE_GENERATION, + FwRcode::NoAck => hinawa_sys::HINAWA_FW_RCODE_NO_ACK, + FwRcode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib<hinawa_sys::HinawaFwRcode> for FwRcode { + fn from_glib(value: hinawa_sys::HinawaFwRcode) -> Self { + match value { + 0 => FwRcode::Complete, + 4 => FwRcode::ConflictError, + 5 => FwRcode::DataError, + 6 => FwRcode::TypeError, + 7 => FwRcode::AddressError, + 16 => FwRcode::SendError, + 17 => FwRcode::Cancelled, + 18 => FwRcode::Busy, + 19 => FwRcode::Generation, + 20 => FwRcode::NoAck, + value => FwRcode::__Unknown(value), + } + } +} + +impl StaticType for FwRcode { + fn static_type() -> Type { + unsafe { from_glib(hinawa_sys::hinawa_fw_rcode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for FwRcode { + unsafe fn from_value_optional(value: &Value) -> Option<Self> { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for FwRcode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for FwRcode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum FwTcode { + WriteQuadletRequest, + WriteBlockRequest, + WriteResponse, + ReadQuadletRequest, + ReadBlockRequest, + ReadQuadletResponse, + ReadBlockResponse, + CycleStart, + LockRequest, + StreamData, + LockResponse, + LockMaskSwap, + LockCompareSwap, + LockFetchAdd, + LockLittleAdd, + LockBoundedAdd, + LockWrapAdd, + LockVendorDependent, + #[doc(hidden)] + __Unknown(i32), +} + +impl fmt::Display for FwTcode { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FwTcode::{}", match *self { + FwTcode::WriteQuadletRequest => "WriteQuadletRequest", + FwTcode::WriteBlockRequest => "WriteBlockRequest", + FwTcode::WriteResponse => "WriteResponse", + FwTcode::ReadQuadletRequest => "ReadQuadletRequest", + FwTcode::ReadBlockRequest => "ReadBlockRequest", + FwTcode::ReadQuadletResponse => "ReadQuadletResponse", + FwTcode::ReadBlockResponse => "ReadBlockResponse", + FwTcode::CycleStart => "CycleStart", + FwTcode::LockRequest => "LockRequest", + FwTcode::StreamData => "StreamData", + FwTcode::LockResponse => "LockResponse", + FwTcode::LockMaskSwap => "LockMaskSwap", + FwTcode::LockCompareSwap => "LockCompareSwap", + FwTcode::LockFetchAdd => "LockFetchAdd", + FwTcode::LockLittleAdd => "LockLittleAdd", + FwTcode::LockBoundedAdd => "LockBoundedAdd", + FwTcode::LockWrapAdd => "LockWrapAdd", + FwTcode::LockVendorDependent => "LockVendorDependent", + _ => "Unknown", + }) + } +} + +#[doc(hidden)] +impl ToGlib for FwTcode { + type GlibType = hinawa_sys::HinawaFwTcode; + + fn to_glib(&self) -> hinawa_sys::HinawaFwTcode { + match *self { + FwTcode::WriteQuadletRequest => hinawa_sys::HINAWA_FW_TCODE_WRITE_QUADLET_REQUEST, + FwTcode::WriteBlockRequest => hinawa_sys::HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST, + FwTcode::WriteResponse => hinawa_sys::HINAWA_FW_TCODE_WRITE_RESPONSE, + FwTcode::ReadQuadletRequest => hinawa_sys::HINAWA_FW_TCODE_READ_QUADLET_REQUEST, + FwTcode::ReadBlockRequest => hinawa_sys::HINAWA_FW_TCODE_READ_BLOCK_REQUEST, + FwTcode::ReadQuadletResponse => hinawa_sys::HINAWA_FW_TCODE_READ_QUADLET_RESPONSE, + FwTcode::ReadBlockResponse => hinawa_sys::HINAWA_FW_TCODE_READ_BLOCK_RESPONSE, + FwTcode::CycleStart => hinawa_sys::HINAWA_FW_TCODE_CYCLE_START, + FwTcode::LockRequest => hinawa_sys::HINAWA_FW_TCODE_LOCK_REQUEST, + FwTcode::StreamData => hinawa_sys::HINAWA_FW_TCODE_STREAM_DATA, + FwTcode::LockResponse => hinawa_sys::HINAWA_FW_TCODE_LOCK_RESPONSE, + FwTcode::LockMaskSwap => hinawa_sys::HINAWA_FW_TCODE_LOCK_MASK_SWAP, + FwTcode::LockCompareSwap => hinawa_sys::HINAWA_FW_TCODE_LOCK_COMPARE_SWAP, + FwTcode::LockFetchAdd => hinawa_sys::HINAWA_FW_TCODE_LOCK_FETCH_ADD, + FwTcode::LockLittleAdd => hinawa_sys::HINAWA_FW_TCODE_LOCK_LITTLE_ADD, + FwTcode::LockBoundedAdd => hinawa_sys::HINAWA_FW_TCODE_LOCK_BOUNDED_ADD, + FwTcode::LockWrapAdd => hinawa_sys::HINAWA_FW_TCODE_LOCK_WRAP_ADD, + FwTcode::LockVendorDependent => hinawa_sys::HINAWA_FW_TCODE_LOCK_VENDOR_DEPENDENT, + FwTcode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib<hinawa_sys::HinawaFwTcode> for FwTcode { + fn from_glib(value: hinawa_sys::HinawaFwTcode) -> Self { + match value { + 0 => FwTcode::WriteQuadletRequest, + 1 => FwTcode::WriteBlockRequest, + 2 => FwTcode::WriteResponse, + 4 => FwTcode::ReadQuadletRequest, + 5 => FwTcode::ReadBlockRequest, + 6 => FwTcode::ReadQuadletResponse, + 7 => FwTcode::ReadBlockResponse, + 8 => FwTcode::CycleStart, + 9 => FwTcode::LockRequest, + 10 => FwTcode::StreamData, + 11 => FwTcode::LockResponse, + 17 => FwTcode::LockMaskSwap, + 18 => FwTcode::LockCompareSwap, + 19 => FwTcode::LockFetchAdd, + 20 => FwTcode::LockLittleAdd, + 21 => FwTcode::LockBoundedAdd, + 22 => FwTcode::LockWrapAdd, + 23 => FwTcode::LockVendorDependent, + value => FwTcode::__Unknown(value), + } + } +} + +impl StaticType for FwTcode { + fn static_type() -> Type { + unsafe { from_glib(hinawa_sys::hinawa_fw_tcode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for FwTcode { + unsafe fn from_value_optional(value: &Value) -> Option<Self> { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for FwTcode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for FwTcode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum SndUnitType { + Dice, + Fireworks, + Bebob, + Oxfw, + Digi00x, + Tascam, + Motu, + Fireface, + #[doc(hidden)] + __Unknown(i32), +} + +impl fmt::Display for SndUnitType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndUnitType::{}", match *self { + SndUnitType::Dice => "Dice", + SndUnitType::Fireworks => "Fireworks", + SndUnitType::Bebob => "Bebob", + SndUnitType::Oxfw => "Oxfw", + SndUnitType::Digi00x => "Digi00x", + SndUnitType::Tascam => "Tascam", + SndUnitType::Motu => "Motu", + SndUnitType::Fireface => "Fireface", + _ => "Unknown", + }) + } +} + +#[doc(hidden)] +impl ToGlib for SndUnitType { + type GlibType = hinawa_sys::HinawaSndUnitType; + + fn to_glib(&self) -> hinawa_sys::HinawaSndUnitType { + match *self { + SndUnitType::Dice => hinawa_sys::HINAWA_SND_UNIT_TYPE_DICE, + SndUnitType::Fireworks => hinawa_sys::HINAWA_SND_UNIT_TYPE_FIREWORKS, + SndUnitType::Bebob => hinawa_sys::HINAWA_SND_UNIT_TYPE_BEBOB, + SndUnitType::Oxfw => hinawa_sys::HINAWA_SND_UNIT_TYPE_OXFW, + SndUnitType::Digi00x => hinawa_sys::HINAWA_SND_UNIT_TYPE_DIGI00X, + SndUnitType::Tascam => hinawa_sys::HINAWA_SND_UNIT_TYPE_TASCAM, + SndUnitType::Motu => hinawa_sys::HINAWA_SND_UNIT_TYPE_MOTU, + SndUnitType::Fireface => hinawa_sys::HINAWA_SND_UNIT_TYPE_FIREFACE, + SndUnitType::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib<hinawa_sys::HinawaSndUnitType> for SndUnitType { + fn from_glib(value: hinawa_sys::HinawaSndUnitType) -> Self { + match value { + 1 => SndUnitType::Dice, + 2 => SndUnitType::Fireworks, + 3 => SndUnitType::Bebob, + 4 => SndUnitType::Oxfw, + 5 => SndUnitType::Digi00x, + 6 => SndUnitType::Tascam, + 7 => SndUnitType::Motu, + 8 => SndUnitType::Fireface, + value => SndUnitType::__Unknown(value), + } + } +} + +impl StaticType for SndUnitType { + fn static_type() -> Type { + unsafe { from_glib(hinawa_sys::hinawa_snd_unit_type_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for SndUnitType { + unsafe fn from_value_optional(value: &Value) -> Option<Self> { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for SndUnitType { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for SndUnitType { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + diff --git a/hinawa/src/auto/fw_fcp.rs b/hinawa/src/auto/fw_fcp.rs new file mode 100644 index 0000000..39507ca --- /dev/null +++ b/hinawa/src/auto/fw_fcp.rs @@ -0,0 +1,133 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::Value; +use glib_sys; +use gobject_sys; +use hinawa_sys; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use std::ptr; +use FwNode; +use FwResp; + +glib_wrapper! { + pub struct FwFcp(Object<hinawa_sys::HinawaFwFcp, hinawa_sys::HinawaFwFcpClass, FwFcpClass>) @extends FwResp; + + match fn { + get_type => || hinawa_sys::hinawa_fw_fcp_get_type(), + } +} + +impl FwFcp { + pub fn new() -> FwFcp { + unsafe { + from_glib_full(hinawa_sys::hinawa_fw_fcp_new()) + } + } +} + +impl Default for FwFcp { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_FW_FCP: Option<&FwFcp> = None; + +pub trait FwFcpExt: 'static { + fn bind<P: IsA<FwNode>>(&self, node: &P) -> Result<(), glib::Error>; + + fn unbind(&self); + + fn get_property_is_bound(&self) -> bool; + + fn get_property_timeout(&self) -> u32; + + fn set_property_timeout(&self, timeout: u32); + + fn connect_property_is_bound_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<FwFcp>> FwFcpExt for O { + fn bind<P: IsA<FwNode>>(&self, node: &P) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_fw_fcp_bind(self.as_ref().to_glib_none().0, node.as_ref().to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn unbind(&self) { + unsafe { + hinawa_sys::hinawa_fw_fcp_unbind(self.as_ref().to_glib_none().0); + } + } + + fn get_property_is_bound(&self) -> bool { + unsafe { + let mut value = Value::from_type(<bool as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"is-bound\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `is-bound` getter").unwrap() + } + } + + fn get_property_timeout(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"timeout\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `timeout` getter").unwrap() + } + } + + fn set_property_timeout(&self, timeout: u32) { + unsafe { + gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"timeout\0".as_ptr() as *const _, Value::from(&timeout).to_glib_none().0); + } + } + + fn connect_property_is_bound_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_is_bound_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwFcp, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwFcp> + { + let f: &F = &*(f as *const F); + f(&FwFcp::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::is-bound\0".as_ptr() as *const _, + Some(transmute(notify_is_bound_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwFcp, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwFcp> + { + let f: &F = &*(f as *const F); + f(&FwFcp::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::timeout\0".as_ptr() as *const _, + Some(transmute(notify_timeout_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for FwFcp { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FwFcp") + } +} diff --git a/hinawa/src/auto/fw_node.rs b/hinawa/src/auto/fw_node.rs new file mode 100644 index 0000000..96e1174 --- /dev/null +++ b/hinawa/src/auto/fw_node.rs @@ -0,0 +1,262 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::Value; +use glib_sys; +use gobject_sys; +use hinawa_sys; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct FwNode(Object<hinawa_sys::HinawaFwNode, hinawa_sys::HinawaFwNodeClass, FwNodeClass>); + + match fn { + get_type => || hinawa_sys::hinawa_fw_node_get_type(), + } +} + +impl FwNode { + pub fn new() -> FwNode { + unsafe { + from_glib_full(hinawa_sys::hinawa_fw_node_new()) + } + } +} + +impl Default for FwNode { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_FW_NODE: Option<&FwNode> = None; + +pub trait FwNodeExt: 'static { + fn create_source(&self) -> Result<glib::Source, glib::Error>; + + fn open(&self, path: &str) -> Result<(), glib::Error>; + + fn get_property_bus_manager_node_id(&self) -> u32; + + fn get_property_generation(&self) -> u32; + + fn get_property_ir_manager_node_id(&self) -> u32; + + fn get_property_local_node_id(&self) -> u32; + + fn get_property_node_id(&self) -> u32; + + fn get_property_root_node_id(&self) -> u32; + + fn connect_bus_update<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_bus_manager_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_generation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_ir_manager_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_local_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_root_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<FwNode>> FwNodeExt for O { + fn create_source(&self) -> Result<glib::Source, glib::Error> { + unsafe { + let mut gsrc = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_fw_node_create_source(self.as_ref().to_glib_none().0, &mut gsrc, &mut error); + if error.is_null() { Ok(from_glib_full(gsrc)) } else { Err(from_glib_full(error)) } + } + } + + fn open(&self, path: &str) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_fw_node_open(self.as_ref().to_glib_none().0, path.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn get_property_bus_manager_node_id(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"bus-manager-node-id\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `bus-manager-node-id` getter").unwrap() + } + } + + fn get_property_generation(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"generation\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `generation` getter").unwrap() + } + } + + fn get_property_ir_manager_node_id(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"ir-manager-node-id\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `ir-manager-node-id` getter").unwrap() + } + } + + fn get_property_local_node_id(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"local-node-id\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `local-node-id` getter").unwrap() + } + } + + fn get_property_node_id(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"node-id\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `node-id` getter").unwrap() + } + } + + fn get_property_root_node_id(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"root-node-id\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `root-node-id` getter").unwrap() + } + } + + fn connect_bus_update<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn bus_update_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"bus-update\0".as_ptr() as *const _, + Some(transmute(bus_update_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn disconnected_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"disconnected\0".as_ptr() as *const _, + Some(transmute(disconnected_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_bus_manager_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_bus_manager_node_id_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::bus-manager-node-id\0".as_ptr() as *const _, + Some(transmute(notify_bus_manager_node_id_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_generation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_generation_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::generation\0".as_ptr() as *const _, + Some(transmute(notify_generation_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_ir_manager_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_ir_manager_node_id_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::ir-manager-node-id\0".as_ptr() as *const _, + Some(transmute(notify_ir_manager_node_id_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_local_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_local_node_id_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::local-node-id\0".as_ptr() as *const _, + Some(transmute(notify_local_node_id_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_node_id_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::node-id\0".as_ptr() as *const _, + Some(transmute(notify_node_id_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_root_node_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_root_node_id_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwNode, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwNode> + { + let f: &F = &*(f as *const F); + f(&FwNode::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::root-node-id\0".as_ptr() as *const _, + Some(transmute(notify_root_node_id_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for FwNode { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FwNode") + } +} diff --git a/hinawa/src/auto/fw_req.rs b/hinawa/src/auto/fw_req.rs new file mode 100644 index 0000000..ae96a18 --- /dev/null +++ b/hinawa/src/auto/fw_req.rs @@ -0,0 +1,85 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::Value; +use glib_sys; +use gobject_sys; +use hinawa_sys; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; + +glib_wrapper! { + pub struct FwReq(Object<hinawa_sys::HinawaFwReq, hinawa_sys::HinawaFwReqClass, FwReqClass>); + + match fn { + get_type => || hinawa_sys::hinawa_fw_req_get_type(), + } +} + +impl FwReq { + pub fn new() -> FwReq { + unsafe { + from_glib_full(hinawa_sys::hinawa_fw_req_new()) + } + } +} + +impl Default for FwReq { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_FW_REQ: Option<&FwReq> = None; + +pub trait FwReqExt: 'static { + fn get_property_timeout(&self) -> u32; + + fn set_property_timeout(&self, timeout: u32); + + fn connect_property_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<FwReq>> FwReqExt for O { + fn get_property_timeout(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"timeout\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `timeout` getter").unwrap() + } + } + + fn set_property_timeout(&self, timeout: u32) { + unsafe { + gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"timeout\0".as_ptr() as *const _, Value::from(&timeout).to_glib_none().0); + } + } + + fn connect_property_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwReq, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwReq> + { + let f: &F = &*(f as *const F); + f(&FwReq::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::timeout\0".as_ptr() as *const _, + Some(transmute(notify_timeout_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for FwReq { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FwReq") + } +} diff --git a/hinawa/src/auto/fw_resp.rs b/hinawa/src/auto/fw_resp.rs new file mode 100644 index 0000000..d84d069 --- /dev/null +++ b/hinawa/src/auto/fw_resp.rs @@ -0,0 +1,125 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::Value; +use glib_sys; +use gobject_sys; +use hinawa_sys; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use std::ptr; +use FwNode; +use FwRcode; +use FwTcode; + +glib_wrapper! { + pub struct FwResp(Object<hinawa_sys::HinawaFwResp, hinawa_sys::HinawaFwRespClass, FwRespClass>); + + match fn { + get_type => || hinawa_sys::hinawa_fw_resp_get_type(), + } +} + +impl FwResp { + pub fn new() -> FwResp { + unsafe { + from_glib_full(hinawa_sys::hinawa_fw_resp_new()) + } + } +} + +impl Default for FwResp { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_FW_RESP: Option<&FwResp> = None; + +pub trait FwRespExt: 'static { + fn release(&self); + + fn reserve<P: IsA<FwNode>>(&self, node: &P, addr: u64, width: u32) -> Result<(), glib::Error>; + + fn set_resp_frame(&self, frame: &[u8]); + + fn get_property_is_reserved(&self) -> bool; + + fn connect_requested<F: Fn(&Self, FwTcode) -> FwRcode + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_is_reserved_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<FwResp>> FwRespExt for O { + fn release(&self) { + unsafe { + hinawa_sys::hinawa_fw_resp_release(self.as_ref().to_glib_none().0); + } + } + + fn reserve<P: IsA<FwNode>>(&self, node: &P, addr: u64, width: u32) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_fw_resp_reserve(self.as_ref().to_glib_none().0, node.as_ref().to_glib_none().0, addr, width, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn set_resp_frame(&self, frame: &[u8]) { + let length = frame.len() as usize; + unsafe { + hinawa_sys::hinawa_fw_resp_set_resp_frame(self.as_ref().to_glib_none().0, frame.to_glib_none().0, length); + } + } + + fn get_property_is_reserved(&self) -> bool { + unsafe { + let mut value = Value::from_type(<bool as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"is-reserved\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `is-reserved` getter").unwrap() + } + } + + fn connect_requested<F: Fn(&Self, FwTcode) -> FwRcode + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn requested_trampoline<P, F: Fn(&P, FwTcode) -> FwRcode + 'static>(this: *mut hinawa_sys::HinawaFwResp, tcode: hinawa_sys::HinawaFwTcode, f: glib_sys::gpointer) -> hinawa_sys::HinawaFwRcode + where P: IsA<FwResp> + { + let f: &F = &*(f as *const F); + f(&FwResp::from_glib_borrow(this).unsafe_cast_ref(), from_glib(tcode)).to_glib() + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"requested\0".as_ptr() as *const _, + Some(transmute(requested_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_is_reserved_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_is_reserved_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaFwResp, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<FwResp> + { + let f: &F = &*(f as *const F); + f(&FwResp::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::is-reserved\0".as_ptr() as *const _, + Some(transmute(notify_is_reserved_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for FwResp { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FwResp") + } +} diff --git a/hinawa/src/auto/mod.rs b/hinawa/src/auto/mod.rs new file mode 100644 index 0000000..18a9416 --- /dev/null +++ b/hinawa/src/auto/mod.rs @@ -0,0 +1,60 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +mod fw_fcp; +pub use self::fw_fcp::{FwFcp, FwFcpClass, NONE_FW_FCP}; +pub use self::fw_fcp::FwFcpExt; + +mod fw_node; +pub use self::fw_node::{FwNode, FwNodeClass, NONE_FW_NODE}; +pub use self::fw_node::FwNodeExt; + +mod fw_req; +pub use self::fw_req::{FwReq, FwReqClass, NONE_FW_REQ}; +pub use self::fw_req::FwReqExt; + +mod fw_resp; +pub use self::fw_resp::{FwResp, FwRespClass, NONE_FW_RESP}; +pub use self::fw_resp::FwRespExt; + +mod snd_dg00x; +pub use self::snd_dg00x::{SndDg00x, SndDg00xClass, NONE_SND_DG00X}; +pub use self::snd_dg00x::SndDg00xExt; + +mod snd_dice; +pub use self::snd_dice::{SndDice, SndDiceClass, NONE_SND_DICE}; +pub use self::snd_dice::SndDiceExt; + +mod snd_efw; +pub use self::snd_efw::{SndEfw, SndEfwClass, NONE_SND_EFW}; + +mod snd_motu; +pub use self::snd_motu::{SndMotu, SndMotuClass, NONE_SND_MOTU}; +pub use self::snd_motu::SndMotuExt; + +mod snd_tscm; +pub use self::snd_tscm::{SndTscm, SndTscmClass, NONE_SND_TSCM}; +pub use self::snd_tscm::SndTscmExt; + +mod snd_unit; +pub use self::snd_unit::{SndUnit, SndUnitClass, NONE_SND_UNIT}; +pub use self::snd_unit::SndUnitExt; + +mod enums; +pub use self::enums::FwRcode; +pub use self::enums::FwTcode; +pub use self::enums::SndUnitType; + +#[doc(hidden)] +pub mod traits { + pub use super::FwFcpExt; + pub use super::FwNodeExt; + pub use super::FwReqExt; + pub use super::FwRespExt; + pub use super::SndDg00xExt; + pub use super::SndDiceExt; + pub use super::SndMotuExt; + pub use super::SndTscmExt; + pub use super::SndUnitExt; +} diff --git a/hinawa/src/auto/snd_dg00x.rs b/hinawa/src/auto/snd_dg00x.rs new file mode 100644 index 0000000..42160d0 --- /dev/null +++ b/hinawa/src/auto/snd_dg00x.rs @@ -0,0 +1,66 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib_sys; +use hinawa_sys; +use libc; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use SndUnit; + +glib_wrapper! { + pub struct SndDg00x(Object<hinawa_sys::HinawaSndDg00x, hinawa_sys::HinawaSndDg00xClass, SndDg00xClass>) @extends SndUnit; + + match fn { + get_type => || hinawa_sys::hinawa_snd_dg00x_get_type(), + } +} + +impl SndDg00x { + pub fn new() -> SndDg00x { + unsafe { + from_glib_full(hinawa_sys::hinawa_snd_dg00x_new()) + } + } +} + +impl Default for SndDg00x { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_SND_DG00X: Option<&SndDg00x> = None; + +pub trait SndDg00xExt: 'static { + fn connect_message<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<SndDg00x>> SndDg00xExt for O { + fn connect_message<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn message_trampoline<P, F: Fn(&P, u32) + 'static>(this: *mut hinawa_sys::HinawaSndDg00x, message: libc::c_uint, f: glib_sys::gpointer) + where P: IsA<SndDg00x> + { + let f: &F = &*(f as *const F); + f(&SndDg00x::from_glib_borrow(this).unsafe_cast_ref(), message) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"message\0".as_ptr() as *const _, + Some(transmute(message_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for SndDg00x { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndDg00x") + } +} diff --git a/hinawa/src/auto/snd_dice.rs b/hinawa/src/auto/snd_dice.rs new file mode 100644 index 0000000..0bfcd7d --- /dev/null +++ b/hinawa/src/auto/snd_dice.rs @@ -0,0 +1,79 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib_sys; +use hinawa_sys; +use libc; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use std::ptr; +use SndUnit; + +glib_wrapper! { + pub struct SndDice(Object<hinawa_sys::HinawaSndDice, hinawa_sys::HinawaSndDiceClass, SndDiceClass>) @extends SndUnit; + + match fn { + get_type => || hinawa_sys::hinawa_snd_dice_get_type(), + } +} + +impl SndDice { + pub fn new() -> SndDice { + unsafe { + from_glib_full(hinawa_sys::hinawa_snd_dice_new()) + } + } +} + +impl Default for SndDice { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_SND_DICE: Option<&SndDice> = None; + +pub trait SndDiceExt: 'static { + fn transaction(&self, addr: u64, frame: &[u32], bit_flag: u32) -> Result<(), glib::Error>; + + fn connect_notified<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<SndDice>> SndDiceExt for O { + fn transaction(&self, addr: u64, frame: &[u32], bit_flag: u32) -> Result<(), glib::Error> { + let frame_count = frame.len() as usize; + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_snd_dice_transaction(self.as_ref().to_glib_none().0, addr, frame.to_glib_none().0, frame_count, bit_flag, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn connect_notified<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notified_trampoline<P, F: Fn(&P, u32) + 'static>(this: *mut hinawa_sys::HinawaSndDice, message: libc::c_uint, f: glib_sys::gpointer) + where P: IsA<SndDice> + { + let f: &F = &*(f as *const F); + f(&SndDice::from_glib_borrow(this).unsafe_cast_ref(), message) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notified\0".as_ptr() as *const _, + Some(transmute(notified_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for SndDice { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndDice") + } +} diff --git a/hinawa/src/auto/snd_efw.rs b/hinawa/src/auto/snd_efw.rs new file mode 100644 index 0000000..02d2dfe --- /dev/null +++ b/hinawa/src/auto/snd_efw.rs @@ -0,0 +1,38 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib::translate::*; +use hinawa_sys; +use std::fmt; +use SndUnit; + +glib_wrapper! { + pub struct SndEfw(Object<hinawa_sys::HinawaSndEfw, hinawa_sys::HinawaSndEfwClass, SndEfwClass>) @extends SndUnit; + + match fn { + get_type => || hinawa_sys::hinawa_snd_efw_get_type(), + } +} + +impl SndEfw { + pub fn new() -> SndEfw { + unsafe { + from_glib_full(hinawa_sys::hinawa_snd_efw_new()) + } + } +} + +impl Default for SndEfw { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_SND_EFW: Option<&SndEfw> = None; + +impl fmt::Display for SndEfw { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndEfw") + } +} diff --git a/hinawa/src/auto/snd_motu.rs b/hinawa/src/auto/snd_motu.rs new file mode 100644 index 0000000..0e08b69 --- /dev/null +++ b/hinawa/src/auto/snd_motu.rs @@ -0,0 +1,66 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib_sys; +use hinawa_sys; +use libc; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use SndUnit; + +glib_wrapper! { + pub struct SndMotu(Object<hinawa_sys::HinawaSndMotu, hinawa_sys::HinawaSndMotuClass, SndMotuClass>) @extends SndUnit; + + match fn { + get_type => || hinawa_sys::hinawa_snd_motu_get_type(), + } +} + +impl SndMotu { + pub fn new() -> SndMotu { + unsafe { + from_glib_full(hinawa_sys::hinawa_snd_motu_new()) + } + } +} + +impl Default for SndMotu { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_SND_MOTU: Option<&SndMotu> = None; + +pub trait SndMotuExt: 'static { + fn connect_notified<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<SndMotu>> SndMotuExt for O { + fn connect_notified<F: Fn(&Self, u32) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notified_trampoline<P, F: Fn(&P, u32) + 'static>(this: *mut hinawa_sys::HinawaSndMotu, message: libc::c_uint, f: glib_sys::gpointer) + where P: IsA<SndMotu> + { + let f: &F = &*(f as *const F); + f(&SndMotu::from_glib_borrow(this).unsafe_cast_ref(), message) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notified\0".as_ptr() as *const _, + Some(transmute(notified_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for SndMotu { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndMotu") + } +} diff --git a/hinawa/src/auto/snd_tscm.rs b/hinawa/src/auto/snd_tscm.rs new file mode 100644 index 0000000..0fc83d0 --- /dev/null +++ b/hinawa/src/auto/snd_tscm.rs @@ -0,0 +1,66 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib_sys; +use hinawa_sys; +use libc; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use SndUnit; + +glib_wrapper! { + pub struct SndTscm(Object<hinawa_sys::HinawaSndTscm, hinawa_sys::HinawaSndTscmClass, SndTscmClass>) @extends SndUnit; + + match fn { + get_type => || hinawa_sys::hinawa_snd_tscm_get_type(), + } +} + +impl SndTscm { + pub fn new() -> SndTscm { + unsafe { + from_glib_full(hinawa_sys::hinawa_snd_tscm_new()) + } + } +} + +impl Default for SndTscm { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_SND_TSCM: Option<&SndTscm> = None; + +pub trait SndTscmExt: 'static { + fn connect_control<F: Fn(&Self, u32, u32, u32) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<SndTscm>> SndTscmExt for O { + fn connect_control<F: Fn(&Self, u32, u32, u32) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn control_trampoline<P, F: Fn(&P, u32, u32, u32) + 'static>(this: *mut hinawa_sys::HinawaSndTscm, index: libc::c_uint, before: libc::c_uint, after: libc::c_uint, f: glib_sys::gpointer) + where P: IsA<SndTscm> + { + let f: &F = &*(f as *const F); + f(&SndTscm::from_glib_borrow(this).unsafe_cast_ref(), index, before, after) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"control\0".as_ptr() as *const _, + Some(transmute(control_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for SndTscm { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndTscm") + } +} diff --git a/hinawa/src/auto/snd_unit.rs b/hinawa/src/auto/snd_unit.rs new file mode 100644 index 0000000..0ea5200 --- /dev/null +++ b/hinawa/src/auto/snd_unit.rs @@ -0,0 +1,269 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use glib; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::GString; +use glib::StaticType; +use glib::Value; +use glib_sys; +use gobject_sys; +use hinawa_sys; +use std::boxed::Box as Box_; +use std::fmt; +use std::mem::transmute; +use std::ptr; +use FwNode; +use SndUnitType; + +glib_wrapper! { + pub struct SndUnit(Object<hinawa_sys::HinawaSndUnit, hinawa_sys::HinawaSndUnitClass, SndUnitClass>); + + match fn { + get_type => || hinawa_sys::hinawa_snd_unit_get_type(), + } +} + +impl SndUnit { + pub fn new() -> SndUnit { + unsafe { + from_glib_full(hinawa_sys::hinawa_snd_unit_new()) + } + } +} + +impl Default for SndUnit { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_SND_UNIT: Option<&SndUnit> = None; + +pub trait SndUnitExt: 'static { + fn create_source(&self) -> Result<glib::Source, glib::Error>; + + fn get_node(&self) -> FwNode; + + fn lock(&self) -> Result<(), glib::Error>; + + fn open(&self, path: &str) -> Result<(), glib::Error>; + + fn unlock(&self) -> Result<(), glib::Error>; + + fn get_property_card(&self) -> u32; + + fn get_property_device(&self) -> Option<GString>; + + fn get_property_guid(&self) -> u64; + + fn get_property_streaming(&self) -> bool; + + fn get_property_type(&self) -> SndUnitType; + + fn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_lock_status<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_card_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_device_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_guid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_streaming_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; +} + +impl<O: IsA<SndUnit>> SndUnitExt for O { + fn create_source(&self) -> Result<glib::Source, glib::Error> { + unsafe { + let mut gsrc = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_snd_unit_create_source(self.as_ref().to_glib_none().0, &mut gsrc, &mut error); + if error.is_null() { Ok(from_glib_full(gsrc)) } else { Err(from_glib_full(error)) } + } + } + + fn get_node(&self) -> FwNode { + unsafe { + let mut node = ptr::null_mut(); + hinawa_sys::hinawa_snd_unit_get_node(self.as_ref().to_glib_none().0, &mut node); + from_glib_none(node) + } + } + + fn lock(&self) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_snd_unit_lock(self.as_ref().to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn open(&self, path: &str) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_snd_unit_open(self.as_ref().to_glib_none().0, path.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn unlock(&self) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = hinawa_sys::hinawa_snd_unit_unlock(self.as_ref().to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn get_property_card(&self) -> u32 { + unsafe { + let mut value = Value::from_type(<u32 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"card\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `card` getter").unwrap() + } + } + + fn get_property_device(&self) -> Option<GString> { + unsafe { + let mut value = Value::from_type(<GString as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"device\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `device` getter") + } + } + + fn get_property_guid(&self) -> u64 { + unsafe { + let mut value = Value::from_type(<u64 as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"guid\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `guid` getter").unwrap() + } + } + + fn get_property_streaming(&self) -> bool { + unsafe { + let mut value = Value::from_type(<bool as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"streaming\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `streaming` getter").unwrap() + } + } + + fn get_property_type(&self) -> SndUnitType { + unsafe { + let mut value = Value::from_type(<SndUnitType as StaticType>::static_type()); + gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"type\0".as_ptr() as *const _, value.to_glib_none_mut().0); + value.get().expect("Return Value for property `type` getter").unwrap() + } + } + + fn connect_disconnected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn disconnected_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"disconnected\0".as_ptr() as *const _, + Some(transmute(disconnected_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_lock_status<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn lock_status_trampoline<P, F: Fn(&P, bool) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, state: glib_sys::gboolean, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref(), from_glib(state)) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"lock-status\0".as_ptr() as *const _, + Some(transmute(lock_status_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_card_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_card_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::card\0".as_ptr() as *const _, + Some(transmute(notify_card_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_device_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_device_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::device\0".as_ptr() as *const _, + Some(transmute(notify_device_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_guid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_guid_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::guid\0".as_ptr() as *const _, + Some(transmute(notify_guid_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_streaming_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_streaming_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::streaming\0".as_ptr() as *const _, + Some(transmute(notify_streaming_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } + + fn connect_property_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_type_trampoline<P, F: Fn(&P) + 'static>(this: *mut hinawa_sys::HinawaSndUnit, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) + where P: IsA<SndUnit> + { + let f: &F = &*(f as *const F); + f(&SndUnit::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_<F> = Box_::new(f); + connect_raw(self.as_ptr() as *mut _, b"notify::type\0".as_ptr() as *const _, + Some(transmute(notify_type_trampoline::<Self, F> as usize)), Box_::into_raw(f)) + } + } +} + +impl fmt::Display for SndUnit { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SndUnit") + } +} diff --git a/hinawa/src/auto/versions.txt b/hinawa/src/auto/versions.txt new file mode 100644 index 0000000..b83a599 --- /dev/null +++ b/hinawa/src/auto/versions.txt @@ -0,0 +1,2 @@ +Generated by gir (https://github.com/gtk-rs/gir @ 997cbcb) +from gir-files (https://github.com/gtk-rs/gir-files @ c31e734) diff --git a/hinawa/src/fw_fcp.rs b/hinawa/src/fw_fcp.rs new file mode 100644 index 0000000..c9c43e1 --- /dev/null +++ b/hinawa/src/fw_fcp.rs @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +use glib::object::IsA; +use glib::translate::*; + +use FwFcp; + +pub trait FwFcpExtManual { + fn transaction(&self, req_frame: &[u8], resp_frame: &mut [u8]) + -> Result<usize, glib::Error>; +} + +impl<O: IsA<FwFcp>> FwFcpExtManual for O { + fn transaction(&self, req_frame: &[u8], resp_frame: &mut [u8]) + -> Result<usize, glib::Error> + { + unsafe { + let mut resp_frame_size = resp_frame.len(); + let mut error = std::ptr::null_mut(); + + hinawa_sys::hinawa_fw_fcp_transaction( + self.as_ref().to_glib_none().0, + req_frame.as_ptr(), + req_frame.len(), + &mut resp_frame.as_mut_ptr(), + &mut resp_frame_size, + &mut error); + + if error.is_null() { + Ok(resp_frame_size) + } else { + Err(from_glib_full(error)) + } + } + } +} diff --git a/hinawa/src/fw_node.rs b/hinawa/src/fw_node.rs new file mode 100644 index 0000000..1dca4e9 --- /dev/null +++ b/hinawa/src/fw_node.rs @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +use glib::object::IsA; +use glib::translate::*; + +use FwNode; + +pub trait FwNodeExtManual { + fn get_config_rom(&self) -> Result<&[u8], glib::Error>; +} + +impl<O: IsA<FwNode>> FwNodeExtManual for O { + fn get_config_rom(&self) -> Result<&[u8], glib::Error> + { + unsafe { + let mut ptr = std::ptr::null_mut() as *const u8; + let mut len = 0 as usize; + let mut error = std::ptr::null_mut(); + + hinawa_sys::hinawa_fw_node_get_config_rom( + self.as_ref().to_glib_none().0, + &mut ptr, + &mut len, + &mut error); + + if error.is_null() { + Ok(std::slice::from_raw_parts(ptr, len)) + } else { + Err(from_glib_full(error)) + } + } + } +} diff --git a/hinawa/src/fw_req.rs b/hinawa/src/fw_req.rs new file mode 100644 index 0000000..817698b --- /dev/null +++ b/hinawa/src/fw_req.rs @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +use glib::object::IsA; +use glib::translate::*; + +use FwReq; +use FwTcode; +use FwNode; + +pub trait FwReqExtManual { + fn transaction<P: IsA<FwNode>>(&self, node: &P, tcode: FwTcode, + addr: u64, length: usize, frame: &mut [u8]) + ->Result<(), glib::Error>; +} + +impl<O: IsA<FwReq>> FwReqExtManual for O { + fn transaction<P: IsA<FwNode>>(&self, node: &P, tcode: FwTcode, + addr: u64, length: usize, frame: &mut [u8]) + ->Result<(), glib::Error> + { + unsafe { + let mut frame_size = frame.len(); + let mut error = std::ptr::null_mut(); + + hinawa_sys::hinawa_fw_req_transaction( + self.as_ref().to_glib_none().0, + node.as_ref().to_glib_none().0, + tcode.to_glib(), addr, length, + &mut frame.as_mut_ptr(), &mut frame_size, + &mut error); + + if error.is_null() { + Ok(()) + } else { + Err(from_glib_full(error)) + } + } + } +} diff --git a/hinawa/src/fw_resp.rs b/hinawa/src/fw_resp.rs new file mode 100644 index 0000000..d353e38 --- /dev/null +++ b/hinawa/src/fw_resp.rs @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +use glib::object::IsA; +use glib::translate::*; + +use FwResp; + +pub trait FwRespExtManual { + fn get_req_frames(&self) -> &[u8]; +} + +impl<O: IsA<FwResp>> FwRespExtManual for O { + fn get_req_frames(&self) -> &[u8] { + unsafe { + let mut ptr = std::ptr::null_mut() as *const u8; + let mut len = 0 as usize; + + hinawa_sys::hinawa_fw_resp_get_req_frame( + self.as_ref().to_glib_none().0, + &mut ptr, + &mut len); + + std::slice::from_raw_parts(ptr, len) + } + } +} diff --git a/hinawa/src/lib.rs b/hinawa/src/lib.rs new file mode 100644 index 0000000..c6e2781 --- /dev/null +++ b/hinawa/src/lib.rs @@ -0,0 +1,29 @@ +#[macro_use] +extern crate glib; +extern crate glib_sys; +extern crate gobject_sys; +extern crate libc; +extern crate hinawa_sys; + +pub use glib::Error; + +mod auto; +pub use auto::*; + +mod fw_node; +pub use fw_node::*; + +mod fw_req; +pub use fw_req::*; + +mod fw_resp; +pub use fw_resp::*; + +mod fw_fcp; +pub use fw_fcp::*; + +mod snd_efw; +pub use snd_efw::*; + +mod snd_tscm; +pub use snd_tscm::*; diff --git a/hinawa/src/snd_efw.rs b/hinawa/src/snd_efw.rs new file mode 100644 index 0000000..6862a1f --- /dev/null +++ b/hinawa/src/snd_efw.rs @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +use glib::object::IsA; +use glib::translate::*; + +use SndEfw; + +pub trait SndEfwExtManual { + fn transaction(&self, category: u32, command: u32, args: &[u32], + params: &mut [u32]) -> Result<usize, glib::Error>; +} + +impl<O: IsA<SndEfw>> SndEfwExtManual for O { + fn transaction(&self, category: u32, command: u32, args: &[u32], + params: &mut [u32]) + -> Result<usize, glib::Error> { + unsafe { + let mut param_count = params.len(); + let mut error = std::ptr::null_mut(); + + hinawa_sys::hinawa_snd_efw_transaction( + self.as_ref().to_glib_none().0, + category, + command, + args.as_ptr(), + args.len() as usize, + &mut params.as_mut_ptr(), + &mut param_count, + &mut error); + + if error.is_null() { + Ok(param_count) + } else { + Err(from_glib_full(error)) + } + } + } +} diff --git a/hinawa/src/snd_tscm.rs b/hinawa/src/snd_tscm.rs new file mode 100644 index 0000000..87ae9a0 --- /dev/null +++ b/hinawa/src/snd_tscm.rs @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +use glib::object::IsA; +use glib::translate::*; + +use SndTscm; + +pub trait SndTscmExtManual { + fn get_state(&self) -> Result<&[u32;64], glib::Error>; +} + +impl<O: IsA<SndTscm>> SndTscmExtManual for O { + fn get_state(&self) + -> Result<&[u32;64], glib::Error> + { + unsafe { + let mut error = std::ptr::null_mut(); + + let image = hinawa_sys::hinawa_snd_tscm_get_state( + self.as_ref().to_glib_none().0, + &mut error); + + if error.is_null() { + Ok(&*image) + } else { + Err(from_glib_full(error)) + } + } + } +} |