]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: instance_info: add object to represent information of instance
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/instance-info.c [new file with mode: 0644]
src/timer/instance-info.h [new file with mode: 0644]
src/timer/meson.build
tests/alsatimer-instance-info [new file with mode: 0644]
tests/meson.build

index b00c7d1d07b96d2f0e6f8f5cf7323ecb135da13a..9b0234a94677a5f5e478b1927c8ded46658a24fe 100644 (file)
@@ -32,6 +32,8 @@ ALSA_GOBJECT_0_0_0 {
     "alsatimer_user_instance_open";
     "alsatimer_user_instance_attach";
     "alsatimer_user_instance_attach_as_slave";
+
+    "alsatimer_instance_info_get_type";
   local:
     *;
 };
diff --git a/src/timer/instance-info.c b/src/timer/instance-info.c
new file mode 100644 (file)
index 0000000..47c0bbe
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "instance-info.h"
+
+G_DEFINE_TYPE(ALSATimerInstanceInfo, alsatimer_instance_info, G_TYPE_OBJECT)
+
+static void alsatimer_instance_info_class_init(ALSATimerInstanceInfoClass *klass)
+{
+    return;
+}
+
+static void alsatimer_instance_info_init(ALSATimerInstanceInfo *self)
+{
+    return;
+}
diff --git a/src/timer/instance-info.h b/src/timer/instance-info.h
new file mode 100644 (file)
index 0000000..52c4b1d
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSATIMER_INSTANCE_INFO__H__
+#define __ALSA_GOBJECT_ALSATIMER_INSTANCE_INFO__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <device-id.h>
+
+G_BEGIN_DECLS
+
+#define ALSATIMER_TYPE_INSTANCE_INFO    (alsatimer_instance_info_get_type())
+
+#define ALSATIMER_INSTANCE_INFO(obj)                            \
+    (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
+                                ALSATIMER_TYPE_INSTANCE_INFO,   \
+                                ALSATimerInstanceInfo))
+#define ALSATIMER_IS_INSTANCE_INFO(obj)                         \
+    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                          \
+                                ALSATIMER_TYPE_INSTANCE_INFO))
+
+#define ALSATIMER_INSTANCE_INFO_CLASS(klass)                    \
+    (G_TYPE_CHECK_CLASS_CAST((klass),                           \
+                             ALSATIMER_TYPE_INSTANCE_INFO,      \
+                             ALSATimerInstanceInfoClass))
+#define ALSATIMER_IS_INSTANCE_INFO_CLASS(klass)                 \
+    (G_TYPE_CHECK_CLASS_TYPE((klass),                           \
+                             ALSATIMER_TYPE_INSTANCE_INFO))
+#define ALSATIMER_INSTANCE_INFO_GET_CLASS(obj)                  \
+    (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
+                               ALSATIMER_TYPE_INSTANCE_INFO,    \
+                               ALSATimerInstanceInfoClass))
+
+typedef struct _ALSATimerInstanceInfo           ALSATimerInstanceInfo;
+typedef struct _ALSATimerInstanceInfoClass      ALSATimerInstanceInfoClass;
+
+struct _ALSATimerInstanceInfo {
+    GObject parent_instance;
+};
+
+struct _ALSATimerInstanceInfoClass {
+    GObjectClass parent_class;
+};
+
+GType alsatimer_instance_info_get_type() G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
index 849c5abc2879090630070efd6311c12effe3aa3a..6cd10c19532d7023a7be101e51ca83f9423f5c59 100644 (file)
@@ -15,6 +15,7 @@ sources = files(
   'device-status.c',
   'device-params.c',
   'user-instance.c',
+  'instance-info.c',
 )
 
 headers = files(
@@ -24,6 +25,7 @@ headers = files(
   'device-status.h',
   'device-params.h',
   'user-instance.h',
+  'instance-info.h',
 )
 
 privates = files(
diff --git a/tests/alsatimer-instance-info b/tests/alsatimer-instance-info
new file mode 100644 (file)
index 0000000..7af17db
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+from sys import exit
+from errno import ENXIO
+
+from helper import test
+
+import gi
+gi.require_version('ALSATimer', '0.0')
+from gi.repository import ALSATimer
+
+target = ALSATimer.InstanceInfo()
+props = ()
+methods = ()
+signals = ()
+
+if not test(target, props, methods, signals):
+    exit(ENXIO)
index e77e47fd14ef57effe30281d2bbc7d453e129023..dd4e7769cfe1b7293f1ae6d739c1b09f708a2b58 100644 (file)
@@ -21,6 +21,7 @@ tests = {
     'alsatimer-device-status',
     'alsatimer-device-params',
     'alsatimer-user-instance',
+    'alsatimer-instance-info',
   ],
 }