snd_seq_subscribe_port

Name

snd_seq_subscribe_port -- subscribe a port connection

Synopsis

int snd_seq_subscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *info);

Description

Subscribes a connection between two ports. The subscription information is stored in info argument, which takes the following argument:

typedef struct {
	snd_seq_addr_t sender;		/* sender address */
	snd_seq_addr_t dest;		/* destination address */
	unsigned char queue;		/* input time-stamp queue (optional) */
	int exclusive: 1,		/* exclusive mode */
	    realtime: 1,		/* realtime timestamp */
	    convert_time: 1;		/* convert timestamp */
	int midi_channels;		/* midi channels setup */
	int midi_voices;		/* midi voices setup */
	int synth_voices;		/* synth voices setup */
	char reserved[32];		/* for future use */
} snd_seq_port_subscribe_t;
The sender and dest fields are source and destination port addresses for connection, respectively.

The exclusive field indicates that the connection is exclusive and no other ports can subscribe connection to the destination port. The succeeding subscriptions will be refused.

If convert_time is true, the timestamp through subscribed connections will be automatically converted to the current time on the specified queue. The queue must be specified in queue field. If realtime is true, the timestamp is converted to realt-ime structure (sec/nsec pair). Otherwise, the timestamp is stored in tick unit. This feature is useful when receiving events from MIDI input device. The event time is automatically set in the event record.

midi_channels, midi_voices and synth_voices are used for describing used MIDI channels, voices and synth voices, respectively. Since they are not referred on the current implementation, they should be filled with zero.

See Also

snd_seq_unsubscribe_port, snd_seq_get_port_subscription