]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: device_id: add object to represent identifier of timer
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.map
src/timer/device-id.c [new file with mode: 0644]
src/timer/device-id.h [new file with mode: 0644]
src/timer/meson.build

index 45b0436aee79951b4eed01b13e79dc92a661702d..5ecf1fb2a076ac7d8930ca569d68519e5b1e0a73 100644 (file)
@@ -9,6 +9,8 @@ ALSA_GOBJECT_0_0_0 {
 
     "alsatimer_get_sysname";
     "alsatimer_get_devnode";
+
+    "alsatimer_device_id_get_type";
   local:
     *;
 };
diff --git a/src/timer/device-id.c b/src/timer/device-id.c
new file mode 100644 (file)
index 0000000..e9238a0
--- /dev/null
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "device-id.h"
+
+ALSATimerDeviceId *timer_device_id_copy(const ALSATimerDeviceId *self)
+{
+    return g_memdup(self, sizeof(*self));
+}
+
+G_DEFINE_BOXED_TYPE(ALSATimerDeviceId, alsatimer_device_id, timer_device_id_copy, g_free)
diff --git a/src/timer/device-id.h b/src/timer/device-id.h
new file mode 100644 (file)
index 0000000..069d620
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSATIMER_DEVICE_ID__H__
+#define __ALSA_GOBJECT_ALSATIMER_DEVICE_ID__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <sound/asound.h>
+
+G_BEGIN_DECLS
+
+#define ALSATIMER_TYPE_DEVICE_ID    (alsatimer_device_id_get_type())
+
+typedef struct snd_timer_id ALSATimerDeviceId;
+
+GType alsatimer_device_id_get_type() G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
index e46f0b63655c2593516279a1a069b52916e57f50..96ae71af61a13cd65a75becea6489586b241bfd7 100644 (file)
@@ -10,10 +10,12 @@ has_marshaller = false
 
 sources = files(
   'query.c',
+  'device-id.c',
 )
 
 headers = files(
   'query.h',
+  'device-id.h',
 )
 
 privates = files(