aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-07-20 20:29:16 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-10-03 21:45:12 +0900
commit2a91614e7bd93c64c34679473e91955df4ced922 (patch)
tree1777bf0d3df8c81baa9fb7a40fb1a854585e5e92
parent69bda21d4b777cb6299c4bd66ca7bcf014e60eaa (diff)
downloadlibhinawa-2a91614e7bd93c64c34679473e91955df4ced922.tar.gz
snd_unit: remove Hinawa.SndUnit and Hinawa.SndUnitError
Hinawa.SndUnit was added in version 0.6.0, and Hinawa.SndUnitError was added in version 2.1.0. They have been deprecated since version 2.5.0. This commit removes them as well as removes UAPI backported from Linux sound subsystem. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--include/sound/firewire.h257
-rw-r--r--src/hinawa.h2
-rw-r--r--src/hinawa.map14
-rw-r--r--src/hinawa_enum_types.h56
-rw-r--r--src/internal.h6
-rw-r--r--src/meson.build2
-rw-r--r--src/snd_unit.c624
-rw-r--r--src/snd_unit.h59
-rw-r--r--tests/hinawa-enum23
-rw-r--r--tests/hinawa-functions3
-rw-r--r--tests/meson.build1
-rwxr-xr-xtests/snd-unit37
12 files changed, 0 insertions, 1084 deletions
diff --git a/include/sound/firewire.h b/include/sound/firewire.h
deleted file mode 100644
index 7dc7f49..0000000
--- a/include/sound/firewire.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _SOUND_FIREWIRE_H_INCLUDED
-#define _SOUND_FIREWIRE_H_INCLUDED
-
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-/* events can be read() from the hwdep device */
-
-#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
-#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
-#define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
-#define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
-#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
-#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
-#define SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE 0x4d545244
-
-struct snd_firewire_event_common {
- unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
-};
-
-struct snd_firewire_event_lock_status {
- unsigned int type;
- unsigned int status; /* 0/1 = unlocked/locked */
-};
-
-struct snd_firewire_event_dice_notification {
- unsigned int type;
- unsigned int notification; /* DICE-specific bits */
-};
-
-#define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
-/* each field should be in big endian */
-struct snd_efw_transaction {
- __be32 length;
- __be32 version;
- __be32 seqnum;
- __be32 category;
- __be32 command;
- __be32 status;
- __be32 params[0];
-};
-struct snd_firewire_event_efw_response {
- unsigned int type;
- __be32 response[0]; /* some responses */
-};
-
-struct snd_firewire_event_digi00x_message {
- unsigned int type;
- __u32 message; /* Digi00x-specific message */
-};
-
-struct snd_firewire_event_motu_notification {
- unsigned int type;
- __u32 message; /* MOTU-specific bits. */
-};
-
-struct snd_firewire_tascam_change {
- unsigned int index;
- __be32 before;
- __be32 after;
-};
-
-struct snd_firewire_event_tascam_control {
- unsigned int type;
- struct snd_firewire_tascam_change changes[0];
-};
-
-struct snd_firewire_event_motu_register_dsp_change {
- unsigned int type;
- __u32 count; /* The number of changes. */
- __u32 changes[]; /* Encoded event for change of register DSP. */
-};
-
-union snd_firewire_event {
- struct snd_firewire_event_common common;
- struct snd_firewire_event_lock_status lock_status;
- struct snd_firewire_event_dice_notification dice_notification;
- struct snd_firewire_event_efw_response efw_response;
- struct snd_firewire_event_digi00x_message digi00x_message;
- struct snd_firewire_event_tascam_control tascam_control;
- struct snd_firewire_event_motu_notification motu_notification;
- struct snd_firewire_event_motu_register_dsp_change motu_register_dsp_change;
-};
-
-
-#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
-#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
-#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
-#define SNDRV_FIREWIRE_IOCTL_TASCAM_STATE _IOR('H', 0xfb, struct snd_firewire_tascam_state)
-#define SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_METER _IOR('H', 0xfc, struct snd_firewire_motu_register_dsp_meter)
-#define SNDRV_FIREWIRE_IOCTL_MOTU_COMMAND_DSP_METER _IOR('H', 0xfd, struct snd_firewire_motu_command_dsp_meter)
-#define SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_PARAMETER _IOR('H', 0xfe, struct snd_firewire_motu_register_dsp_parameter)
-
-#define SNDRV_FIREWIRE_TYPE_DICE 1
-#define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
-#define SNDRV_FIREWIRE_TYPE_BEBOB 3
-#define SNDRV_FIREWIRE_TYPE_OXFW 4
-#define SNDRV_FIREWIRE_TYPE_DIGI00X 5
-#define SNDRV_FIREWIRE_TYPE_TASCAM 6
-#define SNDRV_FIREWIRE_TYPE_MOTU 7
-#define SNDRV_FIREWIRE_TYPE_FIREFACE 8
-
-struct snd_firewire_get_info {
- unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
- unsigned int card; /* same as fw_cdev_get_info.card */
- unsigned char guid[8];
- char device_name[16]; /* device node in /dev */
-};
-
-/*
- * SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
- * Returns -EBUSY if the driver is already streaming.
- */
-
-#define SNDRV_FIREWIRE_TASCAM_STATE_COUNT 64
-
-struct snd_firewire_tascam_state {
- __be32 data[SNDRV_FIREWIRE_TASCAM_STATE_COUNT];
-};
-
-/*
- * In below MOTU models, software is allowed to control their DSP by accessing to registers.
- * - 828mk2
- * - 896hd
- * - Traveler
- * - 8 pre
- * - Ultralite
- * - 4 pre
- * - Audio Express
- *
- * On the other hand, the status of DSP is split into specific messages included in the sequence of
- * isochronous packet. ALSA firewire-motu driver gathers the messages and allow userspace applications
- * to read it via ioctl. In 828mk2, 896hd, and Traveler, hardware meter for all of physical inputs
- * are put into the message, while one pair of physical outputs is selected. The selection is done by
- * LSB one byte in asynchronous write quadlet transaction to 0x'ffff'f000'0b2c.
- *
- * I note that V3HD/V4HD uses asynchronous transaction for the purpose. The destination address is
- * registered to 0x'ffff'f000'0b38 and '0b3c by asynchronous write quadlet request. The size of
- * message differs between 23 and 51 quadlets. For the case, the number of mixer bus can be extended
- * up to 12.
- */
-
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_INPUT_COUNT 24
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_OUTPUT_COUNT 24
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_COUNT \
- (SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_INPUT_COUNT + SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_OUTPUT_COUNT)
-
-/**
- * struct snd_firewire_motu_register_dsp_meter - the container for meter information in DSP
- * controlled by register access
- * @data: Signal level meters. The mapping between position and input/output channel is
- * model-dependent.
- *
- * The structure expresses the part of DSP status for hardware meter. The u8 storage includes linear
- * value for audio signal level between 0x00 and 0x7f.
- */
-struct snd_firewire_motu_register_dsp_meter {
- __u8 data[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_METER_COUNT];
-};
-
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT 4
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT 20
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_INPUT_COUNT 10
-#define SNDRV_FIREWIRE_MOTU_REGISTER_DSP_ALIGNED_INPUT_COUNT (SNDRV_FIREWIRE_MOTU_REGISTER_DSP_INPUT_COUNT + 2)
-
-/**
- * snd_firewire_motu_register_dsp_parameter - the container for parameters of DSP controlled
- * by register access.
- * @mixer.source.gain: The gain of source to mixer.
- * @mixer.source.pan: The L/R balance of source to mixer.
- * @mixer.source.flag: The flag of source to mixer, including mute, solo.
- * @mixer.source.paired_balance: The L/R balance of paired source to mixer, only for 4 pre and
- * Audio Express.
- * @mixer.source.paired_width: The width of paired source to mixer, only for 4 pre and
- * Audio Express.
- * @mixer.output.paired_volume: The volume of paired output from mixer.
- * @mixer.output.paired_flag: The flag of paired output from mixer.
- * @output.main_paired_volume: The volume of paired main output.
- * @output.hp_paired_volume: The volume of paired hp output.
- * @output.hp_paired_assignment: The source assigned to paired hp output.
- * @output.reserved: Padding for 32 bit alignment for future extension.
- * @line_input.boost_flag: The flags of boost for line inputs, only for 828mk2 and Traveler.
- * @line_input.nominal_level_flag: The flags of nominal level for line inputs, only for 828mk2 and
- * Traveler.
- * @line_input.reserved: Padding for 32 bit alignment for future extension.
- * @input.gain_and_invert: The value including gain and invert for input, only for Ultralite, 4 pre
- * and Audio Express.
- * @input.flag: The flag of input; e.g. jack detection, phantom power, and pad, only for Ultralite,
- * 4 pre and Audio express.
- * @reserved: Padding so that the size of structure is kept to 512 byte, but for future extension.
- *
- * The structure expresses the set of parameters for DSP controlled by register access.
- */
-struct snd_firewire_motu_register_dsp_parameter {
- struct {
- struct {
- __u8 gain[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
- __u8 pan[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
- __u8 flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
- __u8 paired_balance[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
- __u8 paired_width[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_SRC_COUNT];
- } source[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
- struct {
- __u8 paired_volume[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
- __u8 paired_flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
- } output;
- } mixer;
- struct {
- __u8 main_paired_volume;
- __u8 hp_paired_volume;
- __u8 hp_paired_assignment;
- __u8 reserved[5];
- } output;
- struct {
- __u8 boost_flag;
- __u8 nominal_level_flag;
- __u8 reserved[6];
- } line_input;
- struct {
- __u8 gain_and_invert[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_ALIGNED_INPUT_COUNT];
- __u8 flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_ALIGNED_INPUT_COUNT];
- } input;
- __u8 reserved[64];
-};
-
-/*
- * In below MOTU models, software is allowed to control their DSP by command in frame of
- * asynchronous transaction to 0x'ffff'0001'0000:
- *
- * - 828 mk3 (FireWire only and Hybrid)
- * - 896 mk3 (FireWire only and Hybrid)
- * - Ultralite mk3 (FireWire only and Hybrid)
- * - Traveler mk3
- * - Track 16
- *
- * On the other hand, the states of hardware meter is split into specific messages included in the
- * sequence of isochronous packet. ALSA firewire-motu driver gathers the message and allow userspace
- * application to read it via ioctl.
- */
-
-#define SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT 400
-
-/**
- * struct snd_firewire_motu_command_dsp_meter - the container for meter information in DSP
- * controlled by command
- * @data: Signal level meters. The mapping between position and signal channel is model-dependent.
- *
- * The structure expresses the part of DSP status for hardware meter. The 32 bit storage is
- * estimated to include IEEE 764 32 bit single precision floating point (binary32) value. It is
- * expected to be linear value (not logarithm) for audio signal level between 0.0 and +1.0.
- */
-struct snd_firewire_motu_command_dsp_meter {
- float data[SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT];
-};
-
-#endif /* _SOUND_FIREWIRE_H_INCLUDED */
diff --git a/src/hinawa.h b/src/hinawa.h
index bf52629..c6dd46a 100644
--- a/src/hinawa.h
+++ b/src/hinawa.h
@@ -21,6 +21,4 @@
#include <fw_req.h>
#include <fw_fcp.h>
-#include <snd_unit.h>
-
#endif
diff --git a/src/hinawa.map b/src/hinawa.map
index 55cbb5b..4e439e0 100644
--- a/src/hinawa.map
+++ b/src/hinawa.map
@@ -5,11 +5,6 @@ HINAWA_0_6_0 {
"hinawa_fw_resp_get_type";
"hinawa_fw_fcp_get_type";
-
- "hinawa_snd_unit_get_type";
- "hinawa_snd_unit_open";
- "hinawa_snd_unit_lock";
- "hinawa_snd_unit_unlock";
local:
*;
};
@@ -24,7 +19,6 @@ HINAWA_1_0_0 {
global:
"hinawa_fw_tcode_get_type";
"hinawa_fw_rcode_get_type";
- "hinawa_snd_unit_type_get_type";
"hinawa_sigs_marshal_ENUM__ENUM";
} HINAWA_0_8_0;
@@ -36,7 +30,6 @@ HINAWA_1_3_0 {
"hinawa_fw_req_new";
"hinawa_fw_resp_new";
"hinawa_fw_fcp_new";
- "hinawa_snd_unit_new";
} HINAWA_1_1_0;
HINAWA_1_4_0 {
@@ -45,8 +38,6 @@ HINAWA_1_4_0 {
"hinawa_fw_node_open";
"hinawa_fw_node_create_source";
- "hinawa_snd_unit_create_source";
-
"hinawa_fw_resp_reserve";
"hinawa_fw_resp_release";
@@ -63,8 +54,6 @@ HINAWA_2_0_0 {
"hinawa_fw_resp_set_resp_frame";
"hinawa_fw_req_transaction";
-
- "hinawa_snd_unit_get_node";
} HINAWA_1_4_0;
HINAWA_2_1_0 {
@@ -76,9 +65,6 @@ HINAWA_2_1_0 {
"hinawa_fw_fcp_error_get_type";
"hinawa_fw_fcp_error_quark";
- "hinawa_snd_unit_error_get_type";
- "hinawa_snd_unit_error_quark";
-
"hinawa_fw_req_transaction_async";
"hinawa_fw_req_transaction_sync";
diff --git a/src/hinawa_enum_types.h b/src/hinawa_enum_types.h
index 0ae2b25..273840b 100644
--- a/src/hinawa_enum_types.h
+++ b/src/hinawa_enum_types.h
@@ -114,33 +114,6 @@ typedef enum {
} HinawaFwReqError;
/**
- * HinawaSndUnitType:
- * @HINAWA_SND_UNIT_TYPE_DICE: The type of DICE ASIC.
- * @HINAWA_SND_UNIT_TYPE_FIREWORKS: The type of Fireworks board module.
- * @HINAWA_SND_UNIT_TYPE_BEBOB: The type of BeBoB ASIC.
- * @HINAWA_SND_UNIT_TYPE_OXFW: The type of OXFW ASIC
- * @HINAWA_SND_UNIT_TYPE_DIGI00X: The type of Digi00x series.
- * @HINAWA_SND_UNIT_TYPE_TASCAM: The type of Tascam FireWire series.
- * @HINAWA_SND_UNIT_TYPE_MOTU: The type of MOTU FireWire series.
- * @HINAWA_SND_UNIT_TYPE_FIREFACE: The type of RME Fireface series.
- *
- * A representation of type for sound unit defined by Linux sound subsystem.
- *
- * Since: 1.0
- * Deprecated: 2.5. Use [enum@Hitaki.AlsaFirewireType] in libhitaki library instead.
- */
-typedef enum {
- HINAWA_SND_UNIT_TYPE_DICE = 1,
- HINAWA_SND_UNIT_TYPE_FIREWORKS,
- HINAWA_SND_UNIT_TYPE_BEBOB,
- HINAWA_SND_UNIT_TYPE_OXFW,
- HINAWA_SND_UNIT_TYPE_DIGI00X,
- HINAWA_SND_UNIT_TYPE_TASCAM,
- HINAWA_SND_UNIT_TYPE_MOTU,
- HINAWA_SND_UNIT_TYPE_FIREFACE,
-} HinawaSndUnitType;
-
-/**
* HinawaFwNodeError:
* @HINAWA_FW_NODE_ERROR_DISCONNECTED: The node associated to the instance is disconnected.
* @HINAWA_FW_NODE_ERROR_OPENED: The instance is already associated to node by opening
@@ -190,35 +163,6 @@ typedef enum {
HINAWA_FW_FCP_ERROR_LARGE_RESP,
} HinawaFwFcpError;
-/**
- * HinawaSndUnitError:
- * @HINAWA_SND_UNIT_ERROR_DISCONNECTED: The hwdep device associated to the instance is disconnected.
- * @HINAWA_SND_UNIT_ERROR_USED: The hedep device is already in use.
- * @HINAWA_SND_UNIT_ERROR_OPENED: The instance is already associated to unit by opening hwdep
- * character device.
- * @HINAWA_SND_UNIT_ERROR_NOT_OPENED: The instance is not associated to unit yet by opening hwdep
- * character device.
- * @HINAWA_SND_UNIT_ERROR_LOCKED: The hwdep device is already locked for kernel packet streaming.
- * @HINAWA_SND_UNIT_ERROR_UNLOCKED: The hwdep device is not locked for kernel packet streaming yet.
- * @HINAWA_SND_UNIT_ERROR_WRONG_CLASS: The hwdep device is not for the unit expected by the class.
- * @HINAWA_SND_UNIT_ERROR_FAILED: The system call fails.
- *
- * A set of error code for [struct@GLib.Error] with domain which equals to Hinawa.SndUnitError.
- *
- * Since: 2.1
- * Deprecated: 2.5. Use Hitaki.AlsaFirewireError in libhitaki library instead.
- */
-typedef enum {
- HINAWA_SND_UNIT_ERROR_DISCONNECTED,
- HINAWA_SND_UNIT_ERROR_USED,
- HINAWA_SND_UNIT_ERROR_OPENED,
- HINAWA_SND_UNIT_ERROR_NOT_OPENED,
- HINAWA_SND_UNIT_ERROR_LOCKED,
- HINAWA_SND_UNIT_ERROR_UNLOCKED,
- HINAWA_SND_UNIT_ERROR_WRONG_CLASS,
- HINAWA_SND_UNIT_ERROR_FAILED,
-} HinawaSndUnitError;
-
G_END_DECLS
#endif
diff --git a/src/internal.h b/src/internal.h
index ecc5a6b..fbf5c32 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -13,10 +13,4 @@ void hinawa_fw_resp_handle_request3(HinawaFwResp *self, const struct fw_cdev_eve
void hinawa_fw_req_handle_response(HinawaFwReq *self, const struct fw_cdev_event_response *event);
void hinawa_fw_req_handle_response2(HinawaFwReq *self, const struct fw_cdev_event_response2 *event);
-void hinawa_snd_unit_write(HinawaSndUnit *self, const void *buf, size_t length,
- GError **exception);
-
-void hinawa_snd_unit_ioctl(HinawaSndUnit *self, unsigned long request,
- void *arg, GError **exception);
-
#endif
diff --git a/src/meson.build b/src/meson.build
index 88c394d..e2bf5c6 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -12,7 +12,6 @@ sources = [
'fw_req.c',
'fw_fcp.c',
'cycle_time.c',
- 'snd_unit.c',
]
headers = [
@@ -22,7 +21,6 @@ headers = [
'fw_req.h',
'fw_fcp.h',
'cycle_time.h',
- 'snd_unit.h',
'hinawa_enum_types.h',
]
diff --git a/src/snd_unit.c b/src/snd_unit.c
deleted file mode 100644
index 119a164..0000000
--- a/src/snd_unit.c
+++ /dev/null
@@ -1,624 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-#include "internal.h"
-
-#include <stdio.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-/**
- * HinawaSndUnit:
- * An event listener for ALSA FireWire sound devices.
- *
- * This class is an application of ALSA FireWire stack. Any functionality which ALSA drivers in the
- * stack can be available.
- *
- * Deprecated: 2.5. libhitaki library provides [class@Hitaki.SndUnit] as the alternative.
- */
-
-/**
- * hinawa_snd_unit_error_quark:
- *
- * Return the [alias@GLib.Quark] for [struct@GLib.Error] which has code in Hinawa.SndUnitError.
- *
- * Since: 2.1
- * Deprecated: 2.5. Use Hitaki.AlsaFirewireError instead.
- *
- * Returns: A [alias@GLib.Quark].
- */
-G_DEFINE_QUARK(hinawa-snd-unit-error-quark, hinawa_snd_unit_error)
-
-static const char *const err_msgs[] = {
- [HINAWA_SND_UNIT_ERROR_DISCONNECTED] = "The associated hwdep device is not available",
- [HINAWA_SND_UNIT_ERROR_USED] = "The hedep device is already in use",
- [HINAWA_SND_UNIT_ERROR_OPENED] = "The instance is already associated to unit",
- [HINAWA_SND_UNIT_ERROR_NOT_OPENED] = "The instance is not associated to unit yet",
- [HINAWA_SND_UNIT_ERROR_LOCKED] = "The associated hwdep device is already locked or kernel packet streaming runs",
- [HINAWA_SND_UNIT_ERROR_UNLOCKED] = "The associated hwdep device is not locked against kernel packet streaming",
- [HINAWA_SND_UNIT_ERROR_WRONG_CLASS] = "The hwdep device is not for the unit expected by the class",
-};
-
-#define generate_local_error(error, code) \
- g_set_error_literal(error, HINAWA_FW_NODE_ERROR, code, err_msgs[code])
-
-#define generate_file_error(error, code, format, arg) \
- g_set_error(error, G_FILE_ERROR, code, format, arg)
-
-#define generate_syscall_error(error, errno, format, arg) \
- g_set_error(error, HINAWA_SND_UNIT_ERROR, HINAWA_SND_UNIT_ERROR_FAILED, \
- format " %d(%s)", arg, errno, strerror(errno))
-
-typedef struct {
- int fd;
- struct snd_firewire_get_info info;
- HinawaFwNode *node;
-
- gboolean streaming;
-} HinawaSndUnitPrivate;
-G_DEFINE_TYPE_WITH_PRIVATE(HinawaSndUnit, hinawa_snd_unit, G_TYPE_OBJECT)
-
-typedef struct {
- GSource src;
- HinawaSndUnit *unit;
- gpointer tag;
- void *buf;
- size_t len;
-} SndUnitSource;
-
-enum snd_unit_prop_type {
- SND_UNIT_PROP_TYPE_FW_TYPE = 1,
- SND_UNIT_PROP_TYPE_CARD_ID,
- SND_UNIT_PROP_TYPE_DEVICE,
- SND_UNIT_PROP_TYPE_GUID,
- SND_UNIT_PROP_TYPE_STREAMING,
- SND_UNIT_PROP_TYPE_COUNT,
-};
-static GParamSpec *snd_unit_props[SND_UNIT_PROP_TYPE_COUNT] = { NULL, };
-
-// This object has two signals.
-enum snd_unit_sig_type {
- SND_UNIT_SIG_TYPE_LOCK_STATUS = 0,
- SND_UNIT_SIG_TYPE_DISCONNECTED,
- SND_UNIT_SIG_TYPE_COUNT,
-};
-static guint snd_unit_sigs[SND_UNIT_SIG_TYPE_COUNT] = { 0 };
-
-static void snd_unit_get_property(GObject *obj, guint id,
- GValue *val, GParamSpec *spec)
-{
- HinawaSndUnit *self = HINAWA_SND_UNIT(obj);
- HinawaSndUnitPrivate *priv = hinawa_snd_unit_get_instance_private(self);
-
- switch (id) {
- case SND_UNIT_PROP_TYPE_FW_TYPE:
- g_value_set_enum(val, (HinawaSndUnitType)priv->info.type);
- break;
- case SND_UNIT_PROP_TYPE_CARD_ID:
- g_value_set_uint(val, priv->info.card);
- break;
- case SND_UNIT_PROP_TYPE_DEVICE:
- g_value_set_static_string(val,
- (const gchar *)priv->info.device_name);
- break;
- case SND_UNIT_PROP_TYPE_GUID:
- g_value_set_uint64(val,
- GUINT64_FROM_BE(*((guint64 *)priv->info.guid)));
- break;
- case SND_UNIT_PROP_TYPE_STREAMING:
- g_value_set_boolean(val, priv->streaming);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
- break;
- }
-}
-
-static void snd_unit_finalize(GObject *obj)
-{
- HinawaSndUnit *self = HINAWA_SND_UNIT(obj);
- HinawaSndUnitPrivate *priv = hinawa_snd_unit_get_instance_private(self);
-
- close(priv->fd);
- priv->fd = -1;
- g_object_unref(priv->node);
-
- G_OBJECT_CLASS(hinawa_snd_unit_parent_class)->finalize(obj);
-}
-
-static void hinawa_snd_unit_class_init(HinawaSndUnitClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
- gobject_class->get_property = snd_unit_get_property;
- gobject_class->finalize = snd_unit_finalize;
-
- /**
- * HinawaSndUnit:type:
- *
- * Since: 1.0
- * Deprecated: 2.5. Use [property@Hitaki.AlsaFirewire:unit-type] instead.
- */
- snd_unit_props[SND_UNIT_PROP_TYPE_FW_TYPE] =
- g_param_spec_enum("type", "type",
- "The value of HinawaSndUnitType enumerators",
- HINAWA_TYPE_SND_UNIT_TYPE,
- HINAWA_SND_UNIT_TYPE_DICE,
- G_PARAM_READABLE | G_PARAM_DEPRECATED);
-
- /**
- * HinawaSndUnit:card:
- *
- * Since: 2.0
- * Deprecated: 2.5. Use [property@Hitaki.AlsaFirewire:card_id] instead.
- */
- snd_unit_props[SND_UNIT_PROP_TYPE_CARD_ID] =
- g_param_spec_uint("card", "card",
- "The numeric ID for ALSA sound card",
- 0, G_MAXUINT,
- 0,
- G_PARAM_READABLE | G_PARAM_DEPRECATED);
-
- /**
- * HinawaSndUnit:device:
- *
- *
- * Since: 0.3
- * Deprecated: 2.5. Use [property@Hitaki.AlsaFirewire:node-device] instead.
- */
- snd_unit_props[SND_UNIT_PROP_TYPE_DEVICE] =
- g_param_spec_string("device", "device",
- "A name of special file as FireWire unit.",
- NULL,
- G_PARAM_READABLE | G_PARAM_DEPRECATED);
-
- /**
- * HinawaSndUnit:streaming:
- *
- * Since: 0.4
- * Deprecated: 2.5. Use [property@Hitaki.AlsaFirewire:is-locked] instead.
- */
- snd_unit_props[SND_UNIT_PROP_TYPE_STREAMING] =
- g_param_spec_boolean("streaming", "streaming",
- "Whether this device is streaming or not",
- FALSE,
- G_PARAM_READABLE | G_PARAM_DEPRECATED);
-
- /**
- * HinawaSndUnit:guid:
- *
- * Since: 0.4
- * Deprecated: 2.5. Use [property@Hitaki.AlsaFirewire:guid] instead.
- */
- snd_unit_props[SND_UNIT_PROP_TYPE_GUID] =
- g_param_spec_uint64("guid", "guid",
- "Global unique ID for this firewire unit.",
- 0, G_MAXUINT64, 0,
- G_PARAM_READABLE | G_PARAM_DEPRECATED);
-
- g_object_class_install_properties(gobject_class,
- SND_UNIT_PROP_TYPE_COUNT,
- snd_unit_props);
-
- /**
- * HinawaSndUnit::lock-status:
- * @self: A [class@SndUnit]
- * @state: %TRUE when locked, %FALSE when unlocked.
- *
- * Emitted when corresponding ALSA driver changes status of lock by starting/stopping
- * packet streaming requested by ALSA PCM/Rawmidi applications.
- *
- * Since: 0.3
- * Deprecated: 2.5. Use change notify signal of [property@Hitaki.AlsaFirewire:is-locked]
- * instead.
- */
- snd_unit_sigs[SND_UNIT_SIG_TYPE_LOCK_STATUS] =
- g_signal_new("lock-status",
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
- G_STRUCT_OFFSET(HinawaSndUnitClass, lock_status),
- NULL, NULL,
- g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
-
- /**
- * HinawaSndUnit::disconnected:
- * @self: A [class@SndUnit]
- *
- * Emitted when the sound card is not available anymore due to unbinding driver or hot
- * unplugging. The owner of this object should call [method@GObject.Object.unref] as
- * quickly as possible to release ALSA hwdep character device.
- *
- * Since: 2.0
- * Deprecated: 2.5. Use change notify signal of
- * [property@Hitaki.AlsaFirewire:is-disconnected] instead.
- */
- snd_unit_sigs[SND_UNIT_SIG_TYPE_DISCONNECTED] =
- g_signal_new("disconnected",
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
- G_STRUCT_OFFSET(HinawaSndUnitClass, disconnected),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0, G_TYPE_NONE, 0);
-}
-
-static void hinawa_snd_unit_init(HinawaSndUnit *self)
-{
- HinawaSndUnitPrivate *priv = hinawa_snd_unit_get_instance_private(self);
-
- priv->fd = -1;
- priv->node = g_object_new(HINAWA_TYPE_FW_NODE, NULL);
-}
-
-/**
- * hinawa_snd_unit_new:
- *
- * Instantiate [class@SndUnit] object and return the instance.
- *
- * Returns: an instance of [class@SndUnit].
- *
- * Since: 1.3.
- * Deprecated: 2.5. Use [method@Hitaki.SndUnit.new] instead.
- */
-HinawaSndUnit *hinawa_snd_unit_new(void)
-{
- return g_object_new(HINAWA_TYPE_SND_UNIT, NULL);
-}
-
-/**
- * hinawa_snd_unit_open:
- * @self: A [class@SndUnit]
- * @path: A full path of a special file for ALSA hwdep character device
- * @error: A [struct@GLib.Error]. Error can be generated with three domains; GLib.FileError,
- * Hinawa.FwNodeError, and Hinawa.SndUnitError.
- *
- * Open ALSA hwdep character device and check it for FireWire sound devices.
- *
- * Since: 0.4
- * Deprecated: 2.5. Use implementation of [method@Hitaki.AlsaFirewire.open] in
- * [class@Hitaki.SndUnit] instead.
- */
-void hinawa_snd_unit_open(HinawaSndUnit *self, gchar *path, GError **error)
-{
- HinawaSndUnitPrivate *priv;
- char fw_cdev[32];
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(path != NULL && strlen(path) > 0);
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- if (priv->fd >= 0) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_OPENED);
- return;
- }
-
- priv->fd = open(path, O_RDWR);
- if (priv->fd < 0) {
- if (errno == ENODEV) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_DISCONNECTED);
- } else if (errno == EBUSY) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_USED);
- } else {
- GFileError code = g_file_error_from_errno(errno);
-
- if (code != G_FILE_ERROR_FAILED)
- generate_file_error(error, code, "open(%s)", path);
- else
- generate_syscall_error(error, errno, "open(%s)", path);
- }
- return;
- }
-
- /* Get FireWire sound device information. */
- if (ioctl(priv->fd, SNDRV_FIREWIRE_IOCTL_GET_INFO, &priv->info) < 0) {
- if (errno == ENODEV)
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_DISCONNECTED);
- else
- generate_syscall_error(error, errno, "ioctl(%s)", "SNDRV_FIREWIRE_IOCTL_GET_INFO");
- goto end;
- }
-
- snprintf(fw_cdev, sizeof(fw_cdev), "/dev/%s", priv->info.device_name);
- hinawa_fw_node_open(priv->node, fw_cdev, error);
-end:
- if (*error != NULL) {
- close(priv->fd);
- priv->fd = -1;
- }
-}
-
-/**
- * hinawa_snd_unit_get_node:
- * @self: A [class@SndUnit].
- * @node: (out)(transfer none): A [class@FwNode].
- *
- * Retrieve an instance of [class@FwNode] associated to the given unit.
- *
- * Since: 2.0.
- * Deprecated: 2.5. Instantiate [class@FwNode] according to
- * [property@Hitaki.AlsaFirewire:node-device] instead.
- */
-void hinawa_snd_unit_get_node(HinawaSndUnit *self, HinawaFwNode **node)
-{
- HinawaSndUnitPrivate *priv;
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(node != NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- g_return_if_fail(priv->fd >= 0);
-
- *node = priv->node;
-}
-/**
- * hinawa_snd_unit_lock:
- * @self: A [class@SndUnit]
- * @error: A [struct@GLib.Error]. Error can be generated with domain of Hinawa.SndUnitError.
- *
- * Disallow corresponding ALSA driver to start packet streaming.
- *
- * Since: 0.3
- * Deprecated: 2.5. Use implementation of [method@Hitaki.AlsaFirewire.lock] in
- * [class@Hitaki.SndUnit] instead.
- */
-void hinawa_snd_unit_lock(HinawaSndUnit *self, GError **error)
-{
- HinawaSndUnitPrivate *priv;
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- if (priv->fd < 0) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_NOT_OPENED);
- return;
- }
-
- if (ioctl(priv->fd, SNDRV_FIREWIRE_IOCTL_LOCK, NULL) < 0) {
- if (errno == ENODEV)
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_DISCONNECTED);
- else if (errno == EBUSY)
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_LOCKED);
- else
- generate_syscall_error(error, errno, "ioctl(%s)", "SNDRV_FIREWIRE_IOCTL_LOCK");
- }
-}
-
-/**
- * hinawa_snd_unit_unlock:
- * @self: A [class@SndUnit]
- * @error: A [struct@GLib.Error]. Error can be generated with domain of Hinawa.SndUnitError.
- *
- * Allow corresponding ALSA driver to start packet streaming.
- *
- * Since: 0.3
- * Deprecated: 2.5. Use implementation of [method@Hitaki.AlsaFirewire.unlock] in
- * [class@Hitaki.SndUnit] instead.
- */
-void hinawa_snd_unit_unlock(HinawaSndUnit *self, GError **error)
-{
- HinawaSndUnitPrivate *priv;
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- if (priv->fd < 0) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_NOT_OPENED);
- return;
- }
-
- if (ioctl(priv->fd, SNDRV_FIREWIRE_IOCTL_UNLOCK, NULL) < 0) {
- if (errno == ENODEV)
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_DISCONNECTED);
- else if (errno == EBADFD)
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_UNLOCKED);
- else
- generate_syscall_error(error, errno, "ioctl(%s)", "SNDRV_FIREWIRE_IOCTL_UNLOCK");
- }
-}
-
-/* For internal use. */
-void hinawa_snd_unit_write(HinawaSndUnit *self, const void *buf, size_t length,
- GError **error)
-{
- HinawaSndUnitPrivate *priv;
- ssize_t len;
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- if (priv->fd < 0) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_NOT_OPENED);
- return;
- }
-
- len = write(priv->fd, buf, length);
- if (len < 0) {
- if (errno == ENODEV)
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_DISCONNECTED);
- else
- generate_syscall_error(error, errno, "write: %zu", length);
- } else if (len != length){
- generate_syscall_error(error, EIO, "write: %zu", length);
- }
-}
-
-void hinawa_snd_unit_ioctl(HinawaSndUnit *self, unsigned long request,
- void *arg, GError **error)
-{
- HinawaSndUnitPrivate *priv;
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- if (priv->fd < 0) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_NOT_OPENED);
- return;
- }
-
- if (ioctl(priv->fd, request, arg) < 0) {
- if (errno == ENODEV) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_DISCONNECTED);
- } else {
- const char *arg;
-
- switch (request) {
- case SNDRV_FIREWIRE_IOCTL_TASCAM_STATE:
- arg = "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE";
- break;
- case SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_METER:
- arg = "SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_METER";
- break;
- case SNDRV_FIREWIRE_IOCTL_MOTU_COMMAND_DSP_METER:
- arg = "SNDRV_FIREWIRE_IOCTL_MOTU_COMMAND_DSP_METER";
- break;
- case SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_PARAMETER:
- arg = "SNDRV_FIREWIRE_IOCTL_MOTU_REGISTER_DSP_PARAMETER";
- break;
- default:
- arg = "Unknown";
- break;
- }
-
- generate_syscall_error(error, errno, "ioctl(%s)", arg);
- }
- }
-}
-
-static void handle_lock_event(HinawaSndUnit *self,
- const void *buf, ssize_t length)
-{
- HinawaSndUnitPrivate *priv = hinawa_snd_unit_get_instance_private(self);
- const struct snd_firewire_event_lock_status *event = buf;
-
- priv->streaming = event->status;
-
- g_signal_emit(self, snd_unit_sigs[SND_UNIT_SIG_TYPE_LOCK_STATUS], 0,
- event->status);
-}
-
-static gboolean check_src(GSource *gsrc)
-{
- SndUnitSource *src = (SndUnitSource *)gsrc;
- GIOCondition condition;
-
- // Don't go to dispatch if nothing available. As an error, return
- // TRUE for POLLERR to call .dispatch for internal destruction.
- condition = g_source_query_unix_fd(gsrc, src->tag);
- return !!(condition & (G_IO_IN | G_IO_ERR));
-}
-
-static gboolean dispatch_src(GSource *gsrc, GSourceFunc cb, gpointer user_data)
-{
- SndUnitSource *src = (SndUnitSource *)gsrc;
- HinawaSndUnit *unit = src->unit;
- HinawaSndUnitPrivate *priv;
- GIOCondition condition;
- struct snd_firewire_event_common *common;
- ssize_t len;
-
- priv = hinawa_snd_unit_get_instance_private(unit);
- if (priv->fd < 0)
- return G_SOURCE_REMOVE;
-
- condition = g_source_query_unix_fd(gsrc, src->tag);
- if (condition & G_IO_ERR) {
- g_signal_emit(unit,
- snd_unit_sigs[SND_UNIT_SIG_TYPE_DISCONNECTED], 0,
- NULL);
-
- return G_SOURCE_REMOVE;
- }
-
- len = read(priv->fd, src->buf, src->len);
- if (len <= 0)
- goto end;
-
- common = (struct snd_firewire_event_common *)src->buf;
-
- if (common->type == SNDRV_FIREWIRE_EVENT_LOCK_STATUS)
- handle_lock_event(unit, src->buf, len);
-end:
- /* Just be sure to continue to process this source. */
- return G_SOURCE_CONTINUE;
-}
-
-static void finalize_src(GSource *gsrc)
-{
- SndUnitSource *src = (SndUnitSource *)gsrc;
- HinawaSndUnitPrivate *priv =
- hinawa_snd_unit_get_instance_private(src->unit);
-
- if (priv->streaming)
- ioctl(priv->fd, SNDRV_FIREWIRE_IOCTL_UNLOCK, NULL);
-
- g_free(src->buf);
-}
-
-/**
- * hinawa_snd_unit_create_source:
- * @self: A [class@SndUnit].
- * @gsrc: (out): A [struct@GLib.Source].
- * @error: A [struct@GLib.Error]. Error can be generated with domain with Hinawa.SndUnitError.
- *
- * Create [struct@GLib.Source] for [struct@GLib.MainContext] to dispatch events for the sound
- * device.
- *
- * Since: 1.4.
- * Deprecated: 2.5. Use implementation of [method@Hitaki.AlsaFirewire.create_source] in
- * [class@Hitaki.SndUnit] instead.
- */
-void hinawa_snd_unit_create_source(HinawaSndUnit *self, GSource **gsrc,
- GError **error)
-{
- static GSourceFuncs funcs = {
- .check = check_src,
- .dispatch = dispatch_src,
- .finalize = finalize_src,
- };
- HinawaSndUnitPrivate *priv;
- SndUnitSource *src;
-
- g_return_if_fail(HINAWA_IS_SND_UNIT(self));
- g_return_if_fail(gsrc != NULL);
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinawa_snd_unit_get_instance_private(self);
- if (priv->fd < 0) {
- generate_local_error(error, HINAWA_SND_UNIT_ERROR_NOT_OPENED);
- return;
- }
-
- *gsrc = g_source_new(&funcs, sizeof(SndUnitSource));
-
- g_source_set_name(*gsrc, "HinawaSndUnit");
- g_source_set_priority(*gsrc, G_PRIORITY_HIGH_IDLE);
- g_source_set_can_recurse(*gsrc, TRUE);
-
- // MEMO: allocate one page because we cannot assume the size of
- // transaction frame.
- src = (SndUnitSource *)(*gsrc);
- src->len = sysconf(_SC_PAGESIZE);
- src->buf = g_malloc(src->len);
-
- src->unit = self;
- src->tag = g_source_add_unix_fd(*gsrc, priv->fd, G_IO_IN);
-
- // Check locked or not.
- if (ioctl(priv->fd, SNDRV_FIREWIRE_IOCTL_LOCK, NULL) < 0) {
- if (errno == EBUSY)
- priv->streaming = true;
- return;
- }
- ioctl(priv->fd, SNDRV_FIREWIRE_IOCTL_UNLOCK, NULL);
-}
diff --git a/src/snd_unit.h b/src/snd_unit.h
deleted file mode 100644
index 7bf4b4d..0000000
--- a/src/snd_unit.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-#ifndef __ALSA_HINAWA_SND_UNIT_H__
-#define __ALSA_HINAWA_SND_UNIT_H__
-
-#include <hinawa.h>
-
-G_BEGIN_DECLS
-
-#define HINAWA_TYPE_SND_UNIT (hinawa_snd_unit_get_type())
-
-G_DECLARE_DERIVABLE_TYPE(HinawaSndUnit, hinawa_snd_unit, HINAWA, SND_UNIT, GObject)
-
-#define HINAWA_SND_UNIT_ERROR hinawa_snd_unit_error_quark()
-
-GQuark hinawa_snd_unit_error_quark();
-
-struct _HinawaSndUnitClass {
- GObjectClass parent_class;
-
- /**
- * HinawaSndUnitClass::lock_status:
- * @self: A [class@SndUnit]
- * @state: %TRUE when locked, %FALSE when unlocked.
- *
- * Class closure for the [signal@SndUnit::lock-status],
- *
- * Since: 1.2
- * Deprecated: 2.5. Use change notify signal of [property@Hitaki.AlsaFirewire:is-locked]
- * instead.
- */
- void (*lock_status)(HinawaSndUnit *self, gboolean state);
-
- /**
- * HinawaSndUnitClass::disconnected:
- * @self: A [class@SndUnit]
- *
- * Class closure for the [signal@SndUnit::disconnected].
- *
- * Since: 2.0
- * Deprecated: 2.5. Use change notify signal of
- * [property@Hitaki.AlsaFirewire:is-disconnected] instead.
- */
- void (*disconnected)(HinawaSndUnit *self);
-};
-
-HinawaSndUnit *hinawa_snd_unit_new(void);
-
-void hinawa_snd_unit_open(HinawaSndUnit *self, gchar *path, GError **error);
-
-void hinawa_snd_unit_get_node(HinawaSndUnit *self, HinawaFwNode **node);
-
-void hinawa_snd_unit_lock(HinawaSndUnit *self, GError **error);
-void hinawa_snd_unit_unlock(HinawaSndUnit *self, GError **error);
-
-void hinawa_snd_unit_create_source(HinawaSndUnit *self, GSource **gsrc, GError **error);
-
-G_END_DECLS
-
-#endif
diff --git a/tests/hinawa-enum b/tests/hinawa-enum
index fa49a28..86137e0 100644
--- a/tests/hinawa-enum
+++ b/tests/hinawa-enum
@@ -56,17 +56,6 @@ fw_req_error_enumerations = (
'INVALID',
)
-snd_unit_type_enumerators = (
- 'DICE',
- 'FIREWORKS',
- 'BEBOB',
- 'OXFW',
- 'DIGI00X',
- 'TASCAM',
- 'MOTU',
- 'FIREFACE',
-)
-
fw_node_error_enumerators = (
'DISCONNECTED',
'OPENED',
@@ -85,25 +74,13 @@ fw_fcp_error_enumerators = (
'LARGE_RESP',
)
-snd_unit_error_enumerators = (
- 'DISCONNECTED',
- 'USED',
- 'OPENED',
- 'NOT_OPENED',
- 'LOCKED',
- 'UNLOCKED',
- 'FAILED',
-)
-
types = {
Hinawa.FwTcode: fw_tcode_enumerators,
Hinawa.FwRcode: fw_rcode_enumerators,
Hinawa.FwReqError: fw_req_error_enumerations,
- Hinawa.SndUnitType: snd_unit_type_enumerators,
Hinawa.FwNodeError: fw_node_error_enumerators,
Hinawa.FwRespError: fw_resp_error_enumerations,
Hinawa.FwFcpError: fw_fcp_error_enumerators,
- Hinawa.SndUnitError: snd_unit_error_enumerators,
}
for target_type, enumerations in types.items():
diff --git a/tests/hinawa-functions b/tests/hinawa-functions
index f668ffd..a4fe07b 100644
--- a/tests/hinawa-functions
+++ b/tests/hinawa-functions
@@ -22,9 +22,6 @@ types = {
Hinawa.FwFcpError: (
'quark',
),
- Hinawa.SndUnitError: (
- 'quark',
- ),
}
for target_type, functions in types.items():
diff --git a/tests/meson.build b/tests/meson.build
index 9a93dbc..9de4f4c 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -4,7 +4,6 @@ tests = [
'fw-resp',
'fw-fcp',
'cycle-time',
- 'snd-unit',
'hinawa-enum',
'hinawa-functions',
]
diff --git a/tests/snd-unit b/tests/snd-unit
deleted file mode 100755
index 43386ca..0000000
--- a/tests/snd-unit
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python3
-
-from sys import exit
-from errno import ENXIO
-
-from helper import test_object
-
-import gi
-gi.require_version('Hinawa', '3.0')
-from gi.repository import Hinawa
-
-target_type = Hinawa.SndUnit
-props = (
- 'type',
- 'card',
- 'device',
- 'streaming',
- 'guid',
-)
-methods = (
- 'new',
- 'open',
- 'get_node',
- 'lock',
- 'unlock',
-)
-vmethods = (
- 'do_lock_status',
- 'do_disconnected',
-)
-signals = (
- 'lock-status',
- 'disconnected',
-)
-
-if not test_object(target_type, props, methods, vmethods, signals):
- exit(ENXIO)