]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: generate enumerations
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 9 Feb 2020 03:20:53 +0000 (12:20 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 11 Feb 2020 04:28:18 +0000 (13:28 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/timer/alsatimer-enum-types.h [new file with mode: 0644]
src/timer/alsatimer.map
src/timer/meson.build

diff --git a/src/timer/alsatimer-enum-types.h b/src/timer/alsatimer-enum-types.h
new file mode 100644 (file)
index 0000000..c1292d0
--- /dev/null
@@ -0,0 +1,113 @@
+#ifndef __ALSA_GOBJECT_ALSATIMER_ENUM_TYPES__H__
+#define __ALSA_GOBJECT_ALSATIMER_ENUM_TYPES__H__
+
+#include <sound/asound.h>
+
+/**
+ * ALSATimerClass:
+ * @ALSATIMER_CLASS_NONE:   Invalid.
+ * @ALSATIMER_CLASS_GLOBAL: The timer device is relevant to system.
+ * @ALSATIMER_CLASS_CARD:   The timer device is relevant to sound card.
+ * @ALSATIMER_CLASS_PCM:    The timer device is relevant to PCM device.
+ *
+ * A set of enumerations for the class of timer device.
+ */
+typedef enum {
+    ALSATIMER_CLASS_NONE     = SNDRV_TIMER_CLASS_NONE,
+    ALSATIMER_CLASS_GLOBAL   = SNDRV_TIMER_CLASS_GLOBAL,
+    ALSATIMER_CLASS_CARD     = SNDRV_TIMER_CLASS_CARD,
+    ALSATIMER_CLASS_PCM      = SNDRV_TIMER_CLASS_PCM,
+} ALSATimerClass;
+
+/**
+ * ALSATimerSlaveClass:
+ * @ALSATIMER_SLAVE_CLASS_NONE:             The timer instance is not slave.
+ * @ALSATIMER_SLAVE_CLASS_APPLICATION:      The timer instance is slave to any application.
+ * @ALSATIMER_SLAVE_CLASS_SEQUENCER:        The timer instance is slave to ALSA sequencer.
+ *
+ * A set of enumerations for the slave class of timer instance (not timer device).
+ */
+typedef enum {
+    ALSATIMER_SLAVE_CLASS_NONE          = SNDRV_TIMER_SCLASS_NONE,
+    ALSATIMER_SLAVE_CLASS_APPLICATION   = SNDRV_TIMER_SCLASS_APPLICATION,
+    ALSATIMER_SLAVE_CLASS_SEQUENCER     = SNDRV_TIMER_SCLASS_SEQUENCER,
+} ALSATimerSlaveClass;
+
+/**
+ * ALSATimerSpecificGlobalDevice:
+ * @ALSATIMER_SPECIFIC_GLOBAL_DEVICE_SYSTEM:    The timer device is system timer wheel.
+ * @ALSATIMER_SPECIFIC_GLOBAL_DEVICE_HRTIMER:   The timer device is system hrtimer.
+ *
+ * A set of enumerations for the kind of global timer device.
+ */
+typedef enum {
+    ALSATIMER_SPECIFIC_GLOBAL_DEVICE_SYSTEM    = SNDRV_TIMER_GLOBAL_SYSTEM,
+    ALSATIMER_SPECIFIC_GLOBAL_DEVICE_HRTIMER   = SNDRV_TIMER_GLOBAL_HRTIMER,
+} ALSATimerSpecificGlobalDevice;
+
+/**
+ * ALSATimerDeviceInfoFlag:
+ * @ALSATIMER_DEVICE_INFO_FLAG_SLAVE:       The timer device is slave to any timer device.
+ *
+ * A set of flags for the information of timer device.
+ */
+typedef enum /*< flags >*/
+{
+    ALSATIMER_DEVICE_INFO_FLAG_SLAVE =  SNDRV_TIMER_FLG_SLAVE,
+} ALSATimerDeviceInfoFlag;
+
+/**
+ * ALSATimerInstanceParamFlag:
+ * @ALSATIMER_INSTANCE_PARAM_FLAG_AUTO:         The instance receives any events after configured.
+ * @ALSATIMER_INSTANCE_PARAM_FLAG_EXCLUSIVE:    The instance occupies the attached timer device.
+ * @ALSATIMER_INSTANCE_PARAM_FLAG_EARLY_EVENT:  The instance receives early event after configured even if not started.
+ *
+ * A set of flags for the parameters of user client.
+ */
+typedef enum /*< flags >*/
+{
+    ALSATIMER_INSTANCE_PARAM_FLAG_AUTO          = SNDRV_TIMER_PSFLG_AUTO,
+    ALSATIMER_INSTANCE_PARAM_FLAG_EXCLUSIVE     = SNDRV_TIMER_PSFLG_EXCLUSIVE,
+    ALSATIMER_INSTANCE_PARAM_FLAG_EARLY_EVENT   = SNDRV_TIMER_PSFLG_EARLY_EVENT,
+} ALSATimerInstanceParamFlag;
+
+/**
+ * ALSATimerEventType:
+ * @ALSATIMER_EVENT_TYPE_RESOLUTION:    The event for timer resolution.
+ * @ALSATIMER_EVENT_TYPE_TICK:          The event for timer tick.
+ * @ALSATIMER_EVENT_TYPE_START:         The event for timer start.
+ * @ALSATIMER_EVENT_TYPE_STOP:          The event for timer stop.
+ * @ALSATIMER_EVENT_TYPE_CONTINUE:      The event for timer continue.
+ * @ALSATIMER_EVENT_TYPE_PAUSE:         The event for timer pause.
+ * @ALSATIMER_EVENT_TYPE_EARLY:         The event before timer start.
+ * @ALSATIMER_EVENT_TYPE_SUSPEND:       The event for timer suspend.
+ * @ALSATIMER_EVENT_TYPE_RESUME:        The event for timer resume.
+ * @ALSATIMER_EVENT_TYPE_MSTART:        The event for master timer start.
+ * @ALSATIMER_EVENT_TYPE_MSTOP:         The event for master timer stop.
+ * @ALSATIMER_EVENT_TYPE_MCONTINUE:     The event for master timer continue.
+ * @ALSATIMER_EVENT_TYPE_MPAUSE:        The event for master timer pause.
+ * @ALSATIMER_EVENT_TYPE_MSUSPEND:      The event for master timer suspend.
+ * @ALSATIMER_EVENT_TYPE_MRESUME:       The event for master timer resume.
+ *
+ * A set of enumerations for timer event.
+ */
+typedef enum
+{
+    ALSATIMER_EVENT_TYPE_RESOLUTION = SNDRV_TIMER_EVENT_RESOLUTION,
+    ALSATIMER_EVENT_TYPE_TICK       = SNDRV_TIMER_EVENT_TICK,
+    ALSATIMER_EVENT_TYPE_START      = SNDRV_TIMER_EVENT_START,
+    ALSATIMER_EVENT_TYPE_STOP       = SNDRV_TIMER_EVENT_STOP,
+    ALSATIMER_EVENT_TYPE_CONTINUE   = SNDRV_TIMER_EVENT_CONTINUE,
+    ALSATIMER_EVENT_TYPE_PAUSE      = SNDRV_TIMER_EVENT_PAUSE,
+    ALSATIMER_EVENT_TYPE_EARLY      = SNDRV_TIMER_EVENT_EARLY,
+    ALSATIMER_EVENT_TYPE_SUSPEND    = SNDRV_TIMER_EVENT_SUSPEND,
+    ALSATIMER_EVENT_TYPE_RESUME     = SNDRV_TIMER_EVENT_RESUME,
+    ALSATIMER_EVENT_TYPE_MSTART     = SNDRV_TIMER_EVENT_MSTART,
+    ALSATIMER_EVENT_TYPE_MSTOP      = SNDRV_TIMER_EVENT_MSTOP,
+    ALSATIMER_EVENT_TYPE_MCONTINUE  = SNDRV_TIMER_EVENT_MCONTINUE,
+    ALSATIMER_EVENT_TYPE_MPAUSE     = SNDRV_TIMER_EVENT_MPAUSE,
+    ALSATIMER_EVENT_TYPE_MSUSPEND   = SNDRV_TIMER_EVENT_MSUSPEND,
+    ALSATIMER_EVENT_TYPE_MRESUME    = SNDRV_TIMER_EVENT_MRESUME,
+} ALSATimerEventType;
+
+#endif
index 72ece8a8a00a98d42a9c832b49050551b43a8d95..9fd44200c19fe5fe6d1088dae420e7e1621d6aa5 100644 (file)
@@ -1,4 +1,11 @@
 ALSA_GOBJECT_0_0_0 {
+  global:
+    "alsatimer_class_get_type";
+    "alsatimer_slave_class_get_type";
+    "alsatimer_specific_global_device_get_type";
+    "alsatimer_device_info_flag_get_type";
+    "alsatimer_instance_param_flag_get_type";
+    "alsatimer_event_type_get_type";
   local:
     *;
 };
index 30612016ce7f43d00d76035fa6bcdca000629eb0..51a17110e72a006f167e60b784508fd132988ace 100644 (file)
@@ -5,7 +5,7 @@
 path = 'timer'
 name = 'alsatimer'
 namespace = 'ALSATimer'
-has_enumerations = false
+has_enumerations = true
 has_marshaller = false
 
 sources = files()