From: Takashi Sakamoto Date: Sun, 9 Feb 2020 03:20:53 +0000 (+0900) Subject: timer: device_info: add object to represent information of timer X-Git-Tag: v0.1.0~359 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=c1364cde7c6286153752a40b8b080556e98dff16;p=alsa-gobject.git timer: device_info: add object to represent information of timer Signed-off-by: Takashi Sakamoto --- diff --git a/src/timer/alsatimer.map b/src/timer/alsatimer.map index 9ae39db..088b9b5 100644 --- a/src/timer/alsatimer.map +++ b/src/timer/alsatimer.map @@ -17,6 +17,8 @@ ALSA_GOBJECT_0_0_0 { "alsatimer_device_id_get_card_id"; "alsatimer_device_id_get_device_id"; "alsatimer_device_id_get_subdevice_id"; + + "alsatimer_device_info_get_type"; local: *; }; diff --git a/src/timer/device-info.c b/src/timer/device-info.c new file mode 100644 index 0000000..0f98404 --- /dev/null +++ b/src/timer/device-info.c @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +#include "device-info.h" + +#include + +G_DEFINE_TYPE(ALSATimerDeviceInfo, alsatimer_device_info, G_TYPE_OBJECT) + +static void alsatimer_device_info_class_init(ALSATimerDeviceInfoClass *klass) +{ +} + +static void alsatimer_device_info_init(ALSATimerDeviceInfo *self) +{ + return; +} diff --git a/src/timer/device-info.h b/src/timer/device-info.h new file mode 100644 index 0000000..f3de19c --- /dev/null +++ b/src/timer/device-info.h @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +#ifndef __ALSA_GOBJECT_ALSATIMER_DEVICE_INFO__H__ +#define __ALSA_GOBJECT_ALSATIMER_DEVICE_INFO__H__ + +#include +#include + +G_BEGIN_DECLS + +#define ALSATIMER_TYPE_DEVICE_INFO (alsatimer_device_info_get_type()) + +#define ALSATIMER_DEVICE_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + ALSATIMER_TYPE_DEVICE_INFO, \ + ALSATimerDeviceInfo)) +#define ALSATIMER_IS_DEVICE_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ + ALSATIMER_TYPE_DEVICE_INFO)) + +#define ALSATIMER_DEVICE_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), \ + ALSATIMER_TYPE_DEVICE_INFO, \ + ALSATimerDeviceInfoClass)) +#define ALSATIMER_IS_DEVICE_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), \ + ALSATIMER_TYPE_DEVICE_INFO)) +#define ALSATIMER_DEVICE_INFO_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), \ + ALSATIMER_TYPE_DEVICE_INFO, \ + ALSATimerDeviceInfoClass)) + +typedef struct _ALSATimerDeviceInfo ALSATimerDeviceInfo; +typedef struct _ALSATimerDeviceInfoClass ALSATimerDeviceInfoClass; + +struct _ALSATimerDeviceInfo { + GObject parent_instance; +}; + +struct _ALSATimerDeviceInfoClass { + GObjectClass parent_class; +}; + +GType alsatimer_device_info_get_type() G_GNUC_CONST; + +G_END_DECLS + +#endif diff --git a/src/timer/meson.build b/src/timer/meson.build index 96ae71a..077eef2 100644 --- a/src/timer/meson.build +++ b/src/timer/meson.build @@ -11,11 +11,13 @@ has_marshaller = false sources = files( 'query.c', 'device-id.c', + 'device-info.c', ) headers = files( 'query.h', 'device-id.h', + 'device-info.h', ) privates = files( diff --git a/tests/alsatimer-device-info b/tests/alsatimer-device-info new file mode 100644 index 0000000..d76fae1 --- /dev/null +++ b/tests/alsatimer-device-info @@ -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.DeviceInfo() +props = () +methods = () +signals = () + +if not test(target, props, methods, signals): + exit(ENXIO) diff --git a/tests/meson.build b/tests/meson.build index fb1e8b1..d9fe90d 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -17,6 +17,7 @@ tests = { ], 'timer': [ 'alsatimer-enums', + 'alsatimer-device-info', ], }