@@ -318,6 +318,7 @@ int snd_seq_port_info_get_timestamp_real(const snd_seq_port_info_t *info);
int snd_seq_port_info_get_timestamp_queue(const snd_seq_port_info_t *info);
int snd_seq_port_info_get_direction(const snd_seq_port_info_t *info);
int snd_seq_port_info_get_ump_group(const snd_seq_port_info_t *info);
+int snd_seq_port_info_get_ump_is_midi1(const snd_seq_port_info_t *info);
void snd_seq_port_info_set_client(snd_seq_port_info_t *info, int client);
void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port);
@@ -334,6 +335,7 @@ void snd_seq_port_info_set_timestamp_real(snd_seq_port_info_t *info, int realtim
void snd_seq_port_info_set_timestamp_queue(snd_seq_port_info_t *info, int queue);
void snd_seq_port_info_set_direction(snd_seq_port_info_t *info, int direction);
void snd_seq_port_info_set_ump_group(snd_seq_port_info_t *info, int ump_group);
+void snd_seq_port_info_set_ump_is_midi1(snd_seq_port_info_t *info, int is_midi1);
int snd_seq_create_port(snd_seq_t *handle, snd_seq_port_info_t *info);
int snd_seq_delete_port(snd_seq_t *handle, int port);
@@ -477,6 +477,8 @@ struct snd_seq_remove_events {
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
+#define SNDRV_SEQ_PORT_FLG_IS_MIDI1 (1<<3) /* Keep MIDI 1.0 protocol */
+
/* port direction */
#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
#define SNDRV_SEQ_PORT_DIR_INPUT 1
@@ -209,6 +209,8 @@ ALSA_1.2.13 {
@SYMBOL_PREFIX@snd_seq_queue_tempo_get_tempo_base;
@SYMBOL_PREFIX@snd_seq_queue_tempo_set_tempo_base;
@SYMBOL_PREFIX@snd_seq_has_tempo_base;
+ @SYMBOL_PREFIX@snd_seq_port_info_get_ump_is_midi1;
+ @SYMBOL_PREFIX@snd_seq_port_info_set_ump_is_midi1;
#endif
#ifdef HAVE_RAWMIDI_SYMS
@SYMBOL_PREFIX@snd_ump_endpoint_info_clear;
@@ -2431,6 +2431,19 @@ int snd_seq_port_info_get_ump_group(const snd_seq_port_info_t *info)
return info->ump_group;
}
+/**
+ * \brief Get the status of the optional MIDI 1.0 port in MIDI 2.0 UMP Endpoint
+ * \param info port_info container
+ * \return 1 if it's an optional MIDI 1.0 port in MIDI 2.0 UMP Endpoint
+ *
+ * \sa snd_seq_get_port_info(), snd_seq_port_info_set_ump_is_midi1()
+ */
+int snd_seq_port_info_get_ump_is_midi1(const snd_seq_port_info_t *info)
+{
+ assert(info);
+ return !!(info->flags & SNDRV_SEQ_PORT_FLG_IS_MIDI1);
+}
+
/**
* \brief Set the client id of a port_info container
* \param info port_info container
@@ -2635,6 +2648,22 @@ void snd_seq_port_info_set_ump_group(snd_seq_port_info_t *info, int ump_group)
info->ump_group = ump_group;
}
+/**
+ * \brief Set the optional MIDI 1.0 port in MIDI 2.0 UMP Endpoint
+ * \param info port_info container
+ * \param is_midi1 non-zero for MIDI 1.0 port in MIDI 2.0 EP
+ *
+ * \sa snd_seq_get_port_info(), snd_seq_port_info_get_ump_is_midi1()
+ */
+void snd_seq_port_info_set_ump_is_midi1(snd_seq_port_info_t *info, int is_midi1)
+{
+ assert(info);
+ if (is_midi1)
+ info->flags |= SNDRV_SEQ_PORT_FLG_IS_MIDI1;
+ else
+ info->flags &= ~SNDRV_SEQ_PORT_FLG_IS_MIDI1;
+}
+
/**
* \brief create a sequencer port on the current client
* \param seq sequencer handle
Implement the API function calls corresponding to the new sequencer port flag bit that has been added recently to the kernel. A UMP MIDI 2.0 device allow to have an optional MIDI 1.0 port while speaking in MIDI 2.0 protocol for other UMP Groups. The new seq port flag indicates that. This is rather a minor difference, and since ALSA sequencer core covers the all conversions, usually you don't have to worry about it at all. Signed-off-by: Takashi Iwai <tiwai@suse.de> --- include/seq.h | 2 ++ include/sound/uapi/asequencer.h | 2 ++ src/Versions.in.in | 2 ++ src/seq/seq.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+)