History

ALSA: seq: Add port direction to snd_seq_port_info

Add a new field "direction" to snd_seq_port_info for allowing a client to tell the expected direction of the port access. A port might still allow subscriptions for read/write (e.g. for MIDI-CI) even if the primary usage of the port is a single direction (either input or output only). This new "direction" field can help to indicate such cases. When the direction is unspecified at creating a port and the port has either read or write capability, the corresponding direction bits are set automatically as default.

Takashi Iwai committed 3 years ago

Commit ff166a91 parent 177ccf87 files · +43 −3Browse files

Showing the changes to include/uapi (1 of 7 files). Show all

Unified · Split

include/uapi/sound/asequencer.h+8−1
@@ -455,6 +455,12 @@ struct snd_seq_remove_events { · 454 unmodified lines
455455 #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
456456 #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
457457
458+/* port direction */
459+#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
460+#define SNDRV_SEQ_PORT_DIR_INPUT 1
461+#define SNDRV_SEQ_PORT_DIR_OUTPUT 2
462+#define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3
463+
458464 struct snd_seq_port_info {
459465 struct snd_seq_addr addr; /* client/port numbers */
460466 char name[64]; /* port name */
@@ -471,7 +477,8 @@ struct snd_seq_port_info { · 10 unmodified lines
471477 void *kernel; /* reserved for kernel use (must be NULL) */
472478 unsigned int flags; /* misc. conditioning */
473479 unsigned char time_queue; /* queue # for timestamping */
474− char reserved[59]; /* for future use */
480+ unsigned char direction; /* port usage direction (r/w/bidir) */
481+ char reserved[58]; /* for future use */
475482 };
476483
477484

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t