]> git.alsa-project.org Git - alsa-lib.git/commitdiff
seq: Add UMP 1.1 features
authorTakashi Iwai <tiwai@suse.de>
Mon, 27 Mar 2023 08:43:50 +0000 (10:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 12 Jun 2023 08:14:23 +0000 (10:14 +0200)
Add APIs for groupless message filtering.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/seq.h
include/sound/uapi/asequencer.h
src/Versions.in
src/seq/seq.c

index 7faf4367df3d2ff4e07e3bba5455ad1737a525f0..68934037cb8890ce97212349810c13df35d47d44 100644 (file)
@@ -159,6 +159,7 @@ int snd_seq_client_info_get_event_lost(const snd_seq_client_info_t *info);
 int snd_seq_client_info_get_midi_version(const snd_seq_client_info_t *info);
 int snd_seq_client_info_get_ump_group_enabled(const snd_seq_client_info_t *info,
                                              int group);
+int snd_seq_client_info_get_ump_groupless_enabled(const snd_seq_client_info_t *info);
 int snd_seq_client_info_get_ump_conversion(const snd_seq_client_info_t *info);
 void snd_seq_client_info_set_client(snd_seq_client_info_t *info, int client);
 void snd_seq_client_info_set_name(snd_seq_client_info_t *info, const char *name);
@@ -168,6 +169,8 @@ void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned
 void snd_seq_client_info_set_midi_version(snd_seq_client_info_t *info, int midi_version);
 void snd_seq_client_info_set_ump_group_enabled(snd_seq_client_info_t *info,
                                               int group, int enable);
+void snd_seq_client_info_set_ump_groupless_enabled(snd_seq_client_info_t *info,
+                                                  int enable);
 void snd_seq_client_info_set_ump_conversion(snd_seq_client_info_t *info, int enable);
 
 void snd_seq_client_info_event_filter_clear(snd_seq_client_info_t *info);
index 3653a3f33778cf4ef57876ff7d691bb99a931327..b913f31daa2dd0ae039a0668c92c8c9740153bbf 100644 (file)
@@ -378,7 +378,10 @@ struct snd_seq_client_info {
        int card;                       /* RO: card number[kernel] */
        int pid;                        /* RO: pid[user] */
        unsigned int midi_version;      /* MIDI version */
-       unsigned int group_filter;      /* UMP group filter bitmap */
+       unsigned int group_filter;      /* UMP group filter bitmap
+                                        * (bit 0 = groupless messages,
+                                        *  bit 1-16 = messages for groups 1-16)
+                                        */
        char reserved[48];              /* for future use */
 };
 
index 0c2837305039a151b087372f05a76847a802e668..c8ac1c8277a35c5c84ec4a942379d5d4e06fed5e 100644 (file)
@@ -159,9 +159,11 @@ ALSA_1.2.10 {
     @SYMBOL_PREFIX@snd_seq_ump_*;
     @SYMBOL_PREFIX@snd_seq_client_info_get_midi_version;
     @SYMBOL_PREFIX@snd_seq_seq_client_info_get_ump_group_enabled;
+    @SYMBOL_PREFIX@snd_seq_client_info_get_ump_groupless_enabled;
     @SYMBOL_PREFIX@snd_seq_seq_client_get_ump_conversion;
     @SYMBOL_PREFIX@snd_seq_client_info_set_midi_version;
     @SYMBOL_PREFIX@snd_seq_seq_client_info_set_ump_group_enabled;
+    @SYMBOL_PREFIX@snd_seq_client_info_set_ump_groupless_enabled;
     @SYMBOL_PREFIX@snd_seq_seq_client_set_ump_conversion;
     @SYMBOL_PREFIX@snd_seq_get_ump_endpoint_info;
     @SYMBOL_PREFIX@snd_seq_get_ump_block_info;
index 65ccaaed5896323a15a2b0e0e403c875506f385b..9d3a18d3ea995e67328d404cbc1f4d3fc4f2f4f4 100644 (file)
@@ -1763,6 +1763,21 @@ int snd_seq_client_info_get_ump_group_enabled(const snd_seq_client_info_t *info,
        return !(info->group_filter & (1U << group));
 }
 
+#define UMP_GROUPLESS_FILTER   (1U << 0)
+
+/**
+ * \brief Get the UMP groupless message handling status
+ * \param info client_info container
+ * \return 1 if UMP groupless messages is processed, 0 if filtered/disabled
+ *
+ * \sa snd_seq_get_client_info()
+ */
+int snd_seq_client_info_get_ump_groupless_enabled(const snd_seq_client_info_t *info)
+{
+       assert(info);
+       return !(info->group_filter & UMP_GROUPLESS_FILTER);
+}
+
 /**
  * \brief Get the automatic conversion mode for UMP
  * \param info client_info container
@@ -1850,6 +1865,23 @@ void snd_seq_client_info_set_ump_group_enabled(snd_seq_client_info_t *info,
                info->group_filter |= (1U << group);
 }
 
+/**
+ * \brief Enable/disable the UMP groupless message handling
+ * \param info client_info container
+ * \param enable enable the UMP groupless messages
+ *
+ * \sa snd_seq_set_client_info(), snd_seq_client_info_get_ump_groupless_enabled()
+ */
+void snd_seq_client_info_set_ump_groupless_enabled(snd_seq_client_info_t *info,
+                                                  int enable)
+{
+       assert(info);
+       if (enable)
+               info->group_filter &= ~UMP_GROUPLESS_FILTER;
+       else
+               info->group_filter |= UMP_GROUPLESS_FILTER;
+}
+
 /**
  * \brief Set the automatic conversion mode for UMP
  * \param info client_info container