]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
ctl: elem_info_int: add object to represent information for integer type element
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 18 Nov 2019 04:22:44 +0000 (13:22 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 12 Dec 2019 05:29:12 +0000 (14:29 +0900)
src/ctl/alsactl.map
src/ctl/elem-info-int.c [new file with mode: 0644]
src/ctl/elem-info-int.h [new file with mode: 0644]
src/ctl/meson.build
tests/alsactl-elem-info-int [new file with mode: 0644]
tests/meson.build

index ae2a381483efb069abcbb4e3643fba5ee90cb45f..f828f0970c573efe53676a64078144f91ed21245 100644 (file)
@@ -34,6 +34,8 @@ ALSA_GOBJECT_0_0_0 {
 
     "alsactl_elem_info_bool_get_type";
     "alsactl_elem_info_bool_new";
+
+    "alsactl_elem_info_int_get_type";
   local:
     *;
 };
diff --git a/src/ctl/elem-info-int.c b/src/ctl/elem-info-int.c
new file mode 100644 (file)
index 0000000..64ac570
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "elem-info-int.h"
+
+G_DEFINE_TYPE(ALSACtlElemInfoInt, alsactl_elem_info_int, ALSACTL_TYPE_ELEM_INFO)
+
+static void alsactl_elem_info_int_class_init(ALSACtlElemInfoIntClass *klass)
+{
+    return;
+}
+
+static void alsactl_elem_info_int_init(ALSACtlElemInfoInt *self)
+{
+    return;
+}
diff --git a/src/ctl/elem-info-int.h b/src/ctl/elem-info-int.h
new file mode 100644 (file)
index 0000000..433fabd
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSACTL_ELEM_INFO_INT__H__
+#define __ALSA_GOBJECT_ALSACTL_ELEM_INFO_INT__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <ctl/elem-info.h>
+
+#define ALSACTL_TYPE_ELEM_INFO_INT  (alsactl_elem_info_int_get_type())
+
+#define ALSACTL_ELEM_INFO_INT(obj)                              \
+    (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
+                                ALSACTL_TYPE_ELEM_INFO_INT,     \
+                                ALSACtlElemInfoInt))
+#define ALSACTL_IS_ELEM_INFO_INT(obj)                           \
+    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                          \
+                                ALSACTL_TYPE_ELEM_INFO_INT))
+
+#define ALSACTL_ELEM_INFO_INT_CLASS(klass)                      \
+    (G_TYPE_CHECK_CLASS_CAST((klass),                           \
+                             ALSACTL_TYPE_ELEM_INFO_INT,        \
+                             ALSACtlElemInfoIntClass))
+#define ALSACTL_IS_ELEM_INFO_INT_CLASS(klass)                   \
+    (G_TYPE_CHECK_CLASS_TYPE((klass),                           \
+                             ALSACTL_TYPE_ELEM_INFO_INT))
+#define ALSACTL_ELEM_INFO_INT_GET_CLASS(obj)                    \
+    (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
+                               ALSACTL_TYPE_ELEM_INFO_INT,      \
+                               ALSACtlElemInfoIntClass))
+
+typedef struct _ALSACtlElemInfoInt      ALSACtlElemInfoInt;
+typedef struct _ALSACtlElemInfoIntClass ALSACtlElemInfoIntClass;
+
+struct _ALSACtlElemInfoInt {
+    ALSACtlElemInfo parent_instance;
+};
+
+struct _ALSACtlElemInfoIntClass {
+    ALSACtlElemInfoClass parent_class;
+};
+
+GType alsactl_elem_info_int_get_type(void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
index fe2f6304093af7c3d327171468bb019fbe842bf1..f4f6b015c38ccef044d99daa43a35a93d6a1faca 100644 (file)
@@ -15,6 +15,7 @@ sources = files(
   'elem-id.c',
   'elem-info.c',
   'elem-info-bool.c',
+  'elem-info-int.c',
 )
 
 headers = files(
@@ -24,6 +25,7 @@ headers = files(
   'elem-id.h',
   'elem-info.h',
   'elem-info-bool.h',
+  'elem-info-int.h',
 )
 
 privates = files(
diff --git a/tests/alsactl-elem-info-int b/tests/alsactl-elem-info-int
new file mode 100644 (file)
index 0000000..168e2e9
--- /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('ALSACtl', '0.0')
+from gi.repository import ALSACtl
+
+target = ALSACtl.ElemInfoInt()
+props = ()
+methods = ()
+signals = ()
+
+if not test(target, props, methods, signals):
+    exit(ENXIO)
index 5a3e07cef89a7c3d9518488190add4a7ab389586..157164cdddaa4e5626ae660386a8885a4acceac6 100644 (file)
@@ -8,6 +8,7 @@ tests = {
     'alsactl-card-info',
     'alsactl-elem-info',
     'alsactl-elem-info-bool',
+    'alsactl-elem-info-int',
   ],
 }