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

index 825418f3e082d4189fef81b460671274c65f6f71..4935ff7502c6e980ca41c444045e4297bd7aa04c 100644 (file)
@@ -23,6 +23,8 @@ ALSA_GOBJECT_0_0_0 {
     "alsatimer_device_info_get_type";
 
     "alsatimer_device_status_get_type";
+
+    "alsatimer_device_params_get_type";
   local:
     *;
 };
diff --git a/src/timer/device-params.c b/src/timer/device-params.c
new file mode 100644 (file)
index 0000000..73e05af
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "device-params.h"
+
+G_DEFINE_TYPE(ALSATimerDeviceParams, alsatimer_device_params, G_TYPE_OBJECT)
+
+static void alsatimer_device_params_class_init(ALSATimerDeviceParamsClass *klass)
+{
+    return;
+}
+
+static void alsatimer_device_params_init(ALSATimerDeviceParams *self)
+{
+    return;
+}
diff --git a/src/timer/device-params.h b/src/timer/device-params.h
new file mode 100644 (file)
index 0000000..09be883
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSATIMER_DEVICE_PARAMS__H__
+#define __ALSA_GOBJECT_ALSATIMER_DEVICE_PARAMS__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define ALSATIMER_TYPE_DEVICE_PARAMS    (alsatimer_device_params_get_type())
+
+#define ALSATIMER_DEVICE_PARAMS(obj)                            \
+    (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
+                                ALSATIMER_TYPE_DEVICE_PARAMS,   \
+                                ALSATimerDeviceParams))
+#define ALSATIMER_IS_DEVICE_PARAMS(obj)                         \
+    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                          \
+                                ALSATIMER_TYPE_DEVICE_PARAMS))
+
+#define ALSATIMER_DEVICE_PARAMS_CLASS(klass)                    \
+    (G_TYPE_CHECK_CLASS_CAST((klass),                           \
+                             ALSATIMER_TYPE_DEVICE_PARAMS,      \
+                             ALSATimerDeviceParamsClass))
+#define ALSATIMER_IS_DEVICE_PARAMS_CLASS(klass)                 \
+    (G_TYPE_CHECK_CLASS_TYPE((klass),                           \
+                             ALSATIMER_TYPE_DEVICE_PARAMS))
+#define ALSATIMER_DEVICE_PARAMS_GET_CLASS(obj)                  \
+    (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
+                               ALSATIMER_TYPE_DEVICE_PARAMS,    \
+                               ALSATimerDeviceParamsClass))
+
+typedef struct _ALSATimerDeviceParams           ALSATimerDeviceParams;
+typedef struct _ALSATimerDeviceParamsClass      ALSATimerDeviceParamsClass;
+
+struct _ALSATimerDeviceParams {
+    GObject parent_instance;
+};
+
+struct _ALSATimerDeviceParamsClass {
+    GObjectClass parent_class;
+};
+
+GType alsatimer_device_params_get_type() G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
index 131b7bce74b7e8ea9428da121dfe26babe71d07a..e2bebc94dc218bc92078b6e378ae8b6fa71e4413 100644 (file)
@@ -13,6 +13,7 @@ sources = files(
   'device-id.c',
   'device-info.c',
   'device-status.c',
+  'device-params.c',
 )
 
 headers = files(
@@ -20,6 +21,7 @@ headers = files(
   'device-id.h',
   'device-info.h',
   'device-status.h',
+  'device-params.h',
 )
 
 privates = files(
diff --git a/tests/alsatimer-device-params b/tests/alsatimer-device-params
new file mode 100644 (file)
index 0000000..2370959
--- /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.DeviceParams()
+props = ()
+methods = ()
+signals = ()
+
+if not test(target, props, methods, signals):
+    exit(ENXIO)
index 86ded7ee6712f187f5172aaf600d4f1e91f51f3a..603a9dc8fbc7a796dcd4edc4aa67148589324a6e 100644 (file)
@@ -19,6 +19,7 @@ tests = {
     'alsatimer-enums',
     'alsatimer-device-info',
     'alsatimer-device-status',
+    'alsatimer-device-params',
   ],
 }