From: Takashi Sakamoto Date: Sun, 9 Feb 2020 03:20:53 +0000 (+0900) Subject: timer: device_params: add object to represent parameters of timer device X-Git-Tag: v0.1.0~353 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=e239969a63896f6b3b398632cecf5bd6d44d7c01;p=alsa-gobject.git timer: device_params: add object to represent parameters of timer device Signed-off-by: Takashi Sakamoto --- diff --git a/src/timer/alsatimer.map b/src/timer/alsatimer.map index 825418f..4935ff7 100644 --- a/src/timer/alsatimer.map +++ b/src/timer/alsatimer.map @@ -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 index 0000000..73e05af --- /dev/null +++ b/src/timer/device-params.c @@ -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 index 0000000..09be883 --- /dev/null +++ b/src/timer/device-params.h @@ -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 +#include + +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 diff --git a/src/timer/meson.build b/src/timer/meson.build index 131b7bc..e2bebc9 100644 --- a/src/timer/meson.build +++ b/src/timer/meson.build @@ -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 index 0000000..2370959 --- /dev/null +++ b/tests/alsatimer-device-params @@ -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) diff --git a/tests/meson.build b/tests/meson.build index 86ded7e..603a9dc 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -19,6 +19,7 @@ tests = { 'alsatimer-enums', 'alsatimer-device-info', 'alsatimer-device-status', + 'alsatimer-device-params', ], }