"alsatimer_user_instance_open";
"alsatimer_user_instance_attach";
"alsatimer_user_instance_attach_as_slave";
+ "alsatimer_user_instance_get_info";
"alsatimer_instance_info_get_type";
local:
// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "instance-info.h"
-
-#include <sound/asound.h>
+#include "privates.h"
struct _ALSATimerInstanceInfoPrivate {
struct snd_timer_info info;
{
return;
}
+
+void timer_instance_info_refer_private(ALSATimerInstanceInfo *self,
+ struct snd_timer_info **info)
+{
+ ALSATimerInstanceInfoPrivate *priv =
+ alsatimer_instance_info_get_instance_private(self);
+
+ *info = &priv->info;
+}
#include "device-info.h"
#include "device-status.h"
#include "device-params.h"
+#include "instance-info.h"
#include <sound/asound.h>
void timer_device_params_refer_private(ALSATimerDeviceParams *self,
struct snd_timer_gparams **params);
+void timer_instance_info_refer_private(ALSATimerInstanceInfo *self,
+ struct snd_timer_info **info);
+
G_END_DECLS
#endif
if (ioctl(priv->fd, SNDRV_TIMER_IOCTL_SELECT, &sel) < 0)
generate_error(error, errno);
}
+
+/**
+ * alsatimer_user_instance_get_info:
+ * @self: A #ALSATimerUserInstance.
+ * @instance_info: (out): A #ALSATimerInstanceInfo.
+ * @error: A #GError.
+ *
+ * Return the information of device if attached to the instance.
+ */
+void alsatimer_user_instance_get_info(ALSATimerUserInstance *self,
+ ALSATimerInstanceInfo **instance_info,
+ GError **error)
+{
+ ALSATimerUserInstancePrivate *priv;
+ struct snd_timer_info *info;
+
+ g_return_if_fail(ALSATIMER_IS_USER_INSTANCE(self));
+ priv = alsatimer_user_instance_get_instance_private(self);
+
+ *instance_info = g_object_new(ALSATIMER_TYPE_INSTANCE_INFO, NULL);
+ timer_instance_info_refer_private(*instance_info, &info);
+
+ if (ioctl(priv->fd, SNDRV_TIMER_IOCTL_INFO, info) < 0) {
+ generate_error(error, errno);
+ g_object_unref(*instance_info);
+ }
+}
#include <glib-object.h>
#include <timer/device-id.h>
+#include <timer/instance-info.h>
G_BEGIN_DECLS
int slave_id,
GError **error);
+void alsatimer_user_instance_get_info(ALSATimerUserInstance *self,
+ ALSATimerInstanceInfo **instance_info,
+ GError **error);
+
G_END_DECLS
#endif
'open',
'attach',
'attach_as_slave',
+ 'get_info',
)
signals = ()